Skip to content

Commit 89c1ec4

Browse files
Merge pull request #49 from useLiquidOps/feat--Ouro-support
feat: add Ouro
2 parents 1a0790f + 58e0872 commit 89c1ec4

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

public/partners/ouro.png

3.39 KB
Loading

src/components/Connect/Connect.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,33 @@ const Connect: React.FC = () => {
104104
}
105105
};
106106

107+
// Ouro connector
108+
const handleConnectOuro = async () => {
109+
if (typeof window === "undefined" || !window.arweaveWallet) {
110+
alert(
111+
`Please ensure you have the Ouro wallet and it is properly installed on your device.\n\nFor new users, you can download the wallet by going to bit.ly/OuroWallet`,
112+
);
113+
return;
114+
}
115+
116+
try {
117+
await window.arweaveWallet.connect(
118+
["ACCESS_ADDRESS", "SIGN_TRANSACTION"],
119+
walletInfo,
120+
);
121+
const permissions = await window.arweaveWallet.getPermissions();
122+
if (permissions.length > 0) {
123+
const addr = await window.arweaveWallet.getActiveAddress();
124+
setAddress(addr);
125+
setConnected(true);
126+
}
127+
128+
setIsWalletModalOpen(false);
129+
} catch (error) {
130+
console.error("Connection error:", error);
131+
}
132+
};
133+
107134
// Beacon connector
108135
const { isConnected, connect } = useWallet();
109136
const handleConnectBeacon = async () => {
@@ -237,6 +264,7 @@ const Connect: React.FC = () => {
237264
onClose={handleCloseWalletModal}
238265
onConnectWander={handleConnectWander}
239266
onConnectBeacon={connect}
267+
onConnectOuro={handleConnectOuro}
240268
/>
241269
</>
242270
);

src/components/Connect/WalletModal/WalletModal.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ interface WalletModalProps {
1313
onClose: () => void;
1414
onConnectWander: () => void;
1515
onConnectBeacon: () => void;
16+
onConnectOuro: () => void;
1617
}
1718

1819
const WalletModal: React.FC<WalletModalProps> = ({
1920
isOpen,
2021
onClose,
2122
onConnectWander,
2223
onConnectBeacon,
24+
onConnectOuro,
2325
}) => {
2426
return (
2527
<AnimatePresence>
@@ -89,6 +91,30 @@ const WalletModal: React.FC<WalletModalProps> = ({
8991
<p className={styles.walletDescription}>IOS support</p>
9092
</div>
9193
</div>
94+
95+
<div
96+
className={styles.walletOption}
97+
style={{ backgroundColor: "#bbfba9" }}
98+
onClick={onConnectOuro}
99+
>
100+
<Image
101+
src="/partners/ouro.png"
102+
height={40}
103+
width={40}
104+
alt="Ouro"
105+
/>
106+
<div className={styles.walletInfo}>
107+
<p className={styles.walletName} style={{ color: "black" }}>
108+
Ouro
109+
</p>
110+
<p
111+
className={styles.walletDescription}
112+
style={{ color: "black" }}
113+
>
114+
Chrome support
115+
</p>
116+
</div>
117+
</div>
92118
</div>
93119

94120
<div className={styles.noWallet}>

0 commit comments

Comments
 (0)