WCConnectOptions
type WCConnectOptions = { walletConnect?: Prettify< WalletConnectConfig & { onDisplayUri?: (uri: string) => void; pairingTopic?: string; qrModalOptions?: WalletConnectQRCodeModalOptions; showQrModal?: boolean; } >;};
The Chain
object of the blockchain you want the wallet to connect to
If a chain
is not specified, Wallet will be connected to whatever is the default set in the wallet.
If a chain
is specified, Wallet will be prompted to switch to given chain after connection if it is not already connected to it.
This ensures that the wallet is connected to the correct blockchain before interacting with your app.
You can create a Chain
object using the defineChain
function.
At minimum, you need to pass the id
of the blockchain to defineChain
function to create a Chain
object.
import { defineChain } from "thirdweb/react"; const polygon = defineChain({ id: 137,}); await wallet.connect({ chain: polygon });
A client is the entry point to the thirdweb SDK.
It is required for all other actions.
You can create a client using the createThirdwebClient
function. Refer to the Creating a Client documentation for more information.
You must provide a clientId
or secretKey
in order to initialize a client. Pass clientId
if you want for client-side usage and secretKey
for server-side usage.
import { createThirdwebClient } from "thirdweb"; const client = createThirdwebClient({ clientId: "<your_client_id>",});
type walletConnect = Prettify< WalletConnectConfig & { onDisplayUri?: (uri: string) => void; pairingTopic?: string; qrModalOptions?: WalletConnectQRCodeModalOptions; showQrModal?: boolean; }>;