Skip to main content
In Widget Light, the host application owns all wallet connections. The widget running inside the iframe never touches browser extensions or private keys directly. Instead, ecosystem handlers bridge RPC requests from the iframe to your wallet provider.

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 an RPC_REQUEST message via postMessage. The host-side handler processes the request using your wallet provider and sends the result back as an RPC_RESPONSE.
Wallet state changes (account switches, chain changes, connect/disconnect) are also pushed from the host to the iframe automatically via EVENT messages.

IframeEcosystemHandler Interface

Every ecosystem handler implements the IframeEcosystemHandler interface:

Ecosystem Handlers

EVM — useEthereumIframeHandler()

The EVM handler reads wallet state from your wagmi context automatically. No parameters are required.
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)

The Solana handler is library-agnostic. You pass wallet state explicitly, so it works with any Solana wallet library that provides a wallet-standard Wallet instance.
Parameters: Supported RPC methods: Wallet events emitted: accountsChanged, connect, disconnect

Bitcoin — useBitcoinIframeHandler()

The Bitcoin handler reads wallet state from the @bigmi/react context automatically. No parameters are required.
Supported RPC methods: Wallet events emitted: accountsChanged, connect, disconnect

Sui — useSuiIframeHandler()

The Sui handler reads wallet state from @mysten/dapp-kit-react hooks automatically. No parameters are required.
Supported RPC methods: Wallet events emitted: accountsChanged, connect, disconnect

Tron — useTronIframeHandler(params)

The Tron handler is library-agnostic. You pass wallet state explicitly, so it works with any Tron wallet library that provides a compatible adapter.
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’s chainType:

External Wallet Management

If your app has its own wallet connection UI (a connect button, a modal, etc.), use the onConnect 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.
The 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.