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

Commit

Permalink
chore: update adapter page docs (#468)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
wellitongervickas and saminacodes authored Jun 23, 2024
1 parent bcd70b1 commit 78b557c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/typescript/v5/adapters/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ You can use the thirdweb SDK within a wagmi application by setting the wagmi con

```ts
// Assumes you've wrapped your application in a `<ThirdwebProvider>`

import { useEffect } from 'react'
import { defineChain } from 'thirdweb'
import { useSetActiveWallet } from 'thirdweb/react'
import { createWalletAdapter } from 'thirdweb/wallets'
import { useDisconnect, useSwitchChain, useWalletClient } from 'wagmi'
import { viemAdapter } from "thirdweb/adapters/viem";
import { client } from './client'


const { data: walletClient } = useWalletClient(); // from wagmi
const { disconnectAsync } = useDisconnect(); // from wagmi
const { switchChainAsync } = useSwitchChain(); // from wagmi
Expand Down Expand Up @@ -44,6 +54,7 @@ useEffect(() => {
};
setActive();
}, [walletClient]);

```

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

0 comments on commit 78b557c

Please sign in to comment.