How Wallet Bridging Works
When the widget inside the iframe needs to perform a wallet operation (send a transaction, sign a message, switch chains), it sends anRPC_REQUEST message via postMessage. The host-side handler processes the request using your wallet provider and sends the result back as an RPC_RESPONSE.
EVENT messages.
IframeEcosystemHandler Interface
Every ecosystem handler implements theIframeEcosystemHandler interface:
Ecosystem Handlers
EVM — useEthereumIframeHandler()
Supported RPC methods:
Any unrecognized methods are forwarded to the public client (e.g.
eth_getBalance, eth_call).
Wallet events emitted: accountsChanged, chainChanged, connect
Solana — useSolanaIframeHandler(params)
Wallet instance.
Parameters:
Supported RPC methods:
Wallet events emitted:
accountsChanged, connect, disconnect
Bitcoin — useBitcoinIframeHandler()
@bigmi/react context automatically. No parameters are required.
Supported RPC methods:
Wallet events emitted:
accountsChanged, connect, disconnect
Sui — useSuiIframeHandler()
@mysten/dapp-kit-react hooks automatically. No parameters are required.
Supported RPC methods:
Wallet events emitted:
accountsChanged, connect, disconnect
Tron — useTronIframeHandler(params)
Parameters:
Supported RPC methods:
Wallet events emitted:
accountsChanged, connect, disconnect
Subpath Imports
Each ecosystem handler is exposed via a subpath import to enable tree-shaking. If you only use EVM, the Solana, Bitcoin, Sui, and Tron handlers (and their peer dependencies) are never included in your bundle:Combining Multiple Handlers
Pass all your handlers as an array. The widget routes each RPC request to the handler matching the request’schainType:
External Wallet Management
If your app has its own wallet connection UI (a connect button, a modal, etc.), use theonConnect prop to intercept wallet connection requests from the widget. When onConnect is provided, the widget sends a CONNECT_WALLET_REQUEST to the host instead of opening its built-in wallet menu.
ConnectWalletArgs type contains:
When
onConnect is provided, the host automatically sets walletConfig.useExternalWalletManagement: true in the config sent to the iframe. You do not need to set this manually.
