Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 78b557c

Browse files
chore: update adapter page docs (#468)
* chore: update adapter page docs Signed-off-by: gervickas.js <[email protected]> * Update page.mdx Signed-off-by: samina <[email protected]> --------- Signed-off-by: gervickas.js <[email protected]> Signed-off-by: samina <[email protected]> Co-authored-by: samina <[email protected]>
1 parent bcd70b1 commit 78b557c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/typescript/v5/adapters/page.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ You can use the thirdweb SDK within a wagmi application by setting the wagmi con
1616

1717
```ts
1818
// 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+
1929
const { data: walletClient } = useWalletClient(); // from wagmi
2030
const { disconnectAsync } = useDisconnect(); // from wagmi
2131
const { switchChainAsync } = useSwitchChain(); // from wagmi
@@ -44,6 +54,7 @@ useEffect(() => {
4454
};
4555
setActive();
4656
}, [walletClient]);
57+
4758
```
4859

4960
You can view a fully functioning wagmi + thirdweb app in this [github repository](https://github.com/thirdweb-example/wagmi-thirdweb-pay).

0 commit comments

Comments
 (0)