MetaMask
Prompt users to connect to your app with their MetaMask wallet.
Usage
import { MetaMaskWallet } from "@thirdweb-dev/wallets";
const wallet = new MetaMaskWallet();
wallet.connect();
Configuration
Optionally, provide a configuration object when instantiating the MetaMaskWallet
class.
clientId (recommended)
projectId (recommended)
chains
dappMetadata
qrcode
walletStorage
Methods
Inherits all the public methods from the AbstractClientWallet
class.
connectWithQrCode
Connect to the wallet using a QR code if the user does not have the Metamask extension installed.
await wallet.connectWithQrCode({
onQrCodeUri(qrCodeUri) {
// render the QR code with `qrCodeUri`
},
onConnected(accountAddress) {
// update UI to show connected state
},
chainId: 1, // optional - if provided, It forces the wallet to switch to the given chainId after connecting
});