Connect
The provider comes with a connect action that establishes a new connection to WalletConnect.
// Some where within your codebase...
const { actions, session, accounts } = useProvider();
const response = await actions.connect()Inputs (Optional)
You can optionally pass in the chain , pairing.topic , or openModal directives.
{
chain: string;
pairing?: { topic: string };
openModal?: boolean;
}Return Type
The method will resolve with the active session if a connection is established by the user.
Promise<{
data: SessionTypes.Struct || null
error: Error || null
}>Example usage:
Last updated