From 78b557c713eff6109798ca3d618d337efa09dd37 Mon Sep 17 00:00:00 2001 From: "gervickas.js" Date: Sun, 23 Jun 2024 20:24:02 -0300 Subject: [PATCH] chore: update adapter page docs (#468) * chore: update adapter page docs Signed-off-by: gervickas.js * Update page.mdx Signed-off-by: samina <57885104+saminacodes@users.noreply.github.com> --------- Signed-off-by: gervickas.js Signed-off-by: samina <57885104+saminacodes@users.noreply.github.com> Co-authored-by: samina <57885104+saminacodes@users.noreply.github.com> --- src/app/typescript/v5/adapters/page.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/typescript/v5/adapters/page.mdx b/src/app/typescript/v5/adapters/page.mdx index c150856c..a18d6e2d 100644 --- a/src/app/typescript/v5/adapters/page.mdx +++ b/src/app/typescript/v5/adapters/page.mdx @@ -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 `` + +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 @@ -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).