This repository was archived by the owner on Aug 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/app/typescript/v5/adapters Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ You can use the thirdweb SDK within a wagmi application by setting the wagmi con
16
16
17
17
``` ts
18
18
// Assumes you've wrapped your application in a `<ThirdwebProvider>`
19
+
20
+ import { useEffect } from ' react'
21
+ import { defineChain } from ' thirdweb'
22
+ import { useSetActiveWallet } from ' thirdweb/react'
23
+ import { createWalletAdapter } from ' thirdweb/wallets'
24
+ import { useDisconnect , useSwitchChain , useWalletClient } from ' wagmi'
25
+ import { viemAdapter } from " thirdweb/adapters/viem" ;
26
+ import { client } from ' ./client'
27
+
28
+
19
29
const { data : walletClient } = useWalletClient (); // from wagmi
20
30
const { disconnectAsync } = useDisconnect (); // from wagmi
21
31
const { switchChainAsync } = useSwitchChain (); // from wagmi
@@ -44,6 +54,7 @@ useEffect(() => {
44
54
};
45
55
setActive ();
46
56
}, [walletClient ]);
57
+
47
58
```
48
59
49
60
You can view a fully functioning wagmi + thirdweb app in this [ github repository] ( https://github.com/thirdweb-example/wagmi-thirdweb-pay ) .
You can’t perform that action at this time.
0 commit comments