Docs

createWalletConnectClient

Creates a new WalletConnect client for interacting with another application.

Example

import { createWalletConnectClient } from "thirdweb/wallets";
const client = await createWalletConnectClient({
wallet: wallet,
client: client,
});

Pass custom handlers:

import { createWalletConnectClient } from "thirdweb/wallets";
const client = await createWalletConnectClient({
wallet: wallet,
client: client,
requestHandlers: {
eth_signTransaction: ({ account, chainId, params }) => {
// handle transaction signing
},
},
});

Pass connect and disconnect callbacks:

import { createWalletConnectClient } from "thirdweb/wallets";
const client = await createWalletConnectClient({
wallet: wallet,
client: client,
onConnect: (session) => {
console.log("Connected to WalletConnect", session);
},
onDisconnect: (session) => {
console.log("Disconnected from WalletConnect", session);
},
});

Parameters

Returns

The WalletConnect client. Use this client to connect to a WalletConnect URI with createWalletConnectSession.