Overview
If your application has already connected to a user’s wallet (e.g., via MetaMask for EVM networks, Phantom for Solana, or Keplr for Cosmos), you can provide this information directly to the Widget. By doing so, the Widget will:- Display and query balances for the user’s already-connected wallet addresses for supported chains.
- Use the signer functions you provide to facilitate transactions, token swaps, or any operation that requires the user’s signature.
See a full code example here.
Key Props and Concepts
connectedAddresses
The connectedAddresses prop is a map from chain IDs to addresses. This map tells the widget which addresses are currently connected and should be used for transactions.
- Type:
Record<ChainId, Address> - Example:
Signer Functions
In addition to passing inconnectedAddresses, you must also provide the widget with signer functions so it can sign and send transactions on behalf of the user. These functions vary by chain type and are provided as separate props:
getCosmosSigner() => Promise<OfflineSigner>getEvmSigner() => Promise<WalletClient>getSvmSigner() => Promise<PhantomWalletAdapter>