Safe (Gnosis)
Prompt users to connect to your app with their Safe wallet.
To connect to a safe wallet, a personal wallet must first be connected.
Usage
import { CoinbaseWallet, SafeWallet } from "@thirdweb-dev/wallets";
import { Ethereum } from "@thirdweb-dev/chains";
// First, connect the personal wallet
const personalWallet = new CoinbaseWallet();
await personalWallet.connect();
// Then, connect the Safe wallet
const wallet = new SafeWallet();
await wallet.connect({
personalWallet: personalWallet,
chain: Ethereum,
safeAddress: "{{contract_address}}",
});
Configuration
Optionally, provide a configuration object when instantiating the SafeWallet
class.
clientId (recommended)
chains
dappMetadata
walletStorage
walletId
Methods
Inherits all the public methods from the AbstractClientWallet
class.
connect
Prompt the user to connect their wallet to your app.
Note: A personal wallet must be connected before connecting to a Safe wallet.
import { CoinbaseWallet, SafeWallet } from "@thirdweb-dev/wallets";
import { Ethereum } from "@thirdweb-dev/chains";
// First, connect the personal wallet
const personalWallet = new CoinbaseWallet();
await personalWallet.connect();
// Then, connect the Safe wallet
const wallet = new SafeWallet();
await wallet.connect({
personalWallet: personalWallet, // Wallet that can sign transactions on the Safe
chain: Ethereum, // Chain that the Safe is on
safeAddress: "{{contract_address}}", // Smart contract address of the Safe
});