Docs

useWallet

Signature #1

Hook to get the instance of the currently connected wallet.

Example

import { useWallet } from "@thirdweb-dev/react";

function App() {
  const walletInstance = useWallet();
}

Returns

Currently connected WalletInstance , or undefined if no wallet is connected.

Signature #2

Hook to get the instance of the currently connected wallet if it matches the given walletId .

Example

import { useWallet } from "@thirdweb-dev/react";

function App() {
  const metamaskWalletInstance = useWallet("metamask");
}

Parameters

Returns

Currently connected WalletInstance with given walletId , or undefined if no wallet is connected or if the connected wallet does not match the given walletId .