Configure your widget for seamless wallet management
The widget has a built-in wallet management UI, so you can connect wallets and use the widget as a standalone dApp out of the box. However, when embedding the widget into an existing dApp, reusing the existing wallet management UI of that dApp often makes the most sense.
See wallet management modes in the Widget Playground — open Wallet management in the sidebar.
There are several ecosystems and types of chains supported by the widget:
EVM (Ethereum Virtual Machine) - Ethereum, Polygon, Arbitrum, etc.
SVM (Solana Virtual Machine) - Solana
UTXO - Bitcoin
MVM (Move Virtual Machine) - Sui
TVM (Tron Virtual Machine) - Tron
Each ecosystem uses different libraries to manage wallet connections.
To manage wallet connections to EVM chains, the widget uses the Wagmi library internally and provides first-class support for Wagmi-based libraries such as:
If you already manage wallets using Wagmi or a Wagmi-based library in your dApp and the Widget detects that it is wrapped in WagmiProvider, it will automatically reuse your wallet management without any additional configuration.
It’s important to keep the Wagmi chains configuration in sync with the Widget chain list so all functionality, like switching chains, works correctly. There are two approaches:
Manual: Update both Widget and Wagmi chains configuration to specify all supported chains.
Dynamic: Get available chains from LI.FI API and dynamically update Wagmi configuration.
To manage wallet connections to Solana, the widget uses the Solana Wallet Standard via the @lifi/widget-provider-solana package.The Solana provider automatically discovers wallets that implement the Wallet Standard. To use it, simply include SolanaProvider() in your widget’s providers array:
In Widget v4, the Sui peer dependency changed from @mysten/dapp-kit to @mysten/dapp-kit-react.
If the Widget detects it’s wrapped in a Sui DAppKitContext, it will reuse your wallet management automatically.To use the built-in Sui wallet management, include SuiProvider() in the providers array:
To manage wallet connections to Bitcoin, the widget uses Bigmi.To use the built-in Bitcoin wallet management, include BitcoinProvider() in the providers array:
The @lifi/widget-provider-bitcoin package requires @bigmi/react (^0.8.0) as a peer dependency.If the Widget detects it’s wrapped in BigmiProvider, it will reuse your wallet management automatically:
To manage wallet connections to Tron, the widget uses @tronweb3/tronwallet-adapter-react-hooks (^1.1.11).To use the built-in Tron wallet management, include TronProvider() in the providers array:
The @lifi/widget-provider-tron package requires @tronweb3/tronwallet-adapter-react-hooks (^1.1.11) as a peer dependency.The TronProvider accepts an optional configuration object with a walletConnect option to enable WalletConnect support for Tron wallets:
The walletConnect option accepts a WalletConnectAdapterConfig from @tronweb3/tronwallet-adapters with required network ('Mainnet', 'Shasta', 'Nile', or a chain ID) and options (WalletConnect SignClientTypes.Options including your projectId) fields. Set walletConnect to true to use default settings.
Each connector option can also be set to true to use default settings, or omitted to disable that connector:
EthereumProvider({ walletConnect: true, // Use defaults (no projectId required for basic discovery) coinbase: true, // Use defaults metaMask: false, // Explicitly disabled (same as omitting)})
The disableMessageSigning option disables permit-based (EIP-2612) gasless approvals, falling back to standard token approval transactions. This is useful for smart account compatibility. See Smart Accounts Compatibility below.The sdkProvider option lets you supply a custom SDK provider. See Custom SDK Providers for details.
This is useful when migrating to a new setup or when your wallet library only supports certain chains (e.g., RainbowKit for EVM, while internal handles Solana and Bitcoin).
The widget automatically detects existing wallet contexts (e.g., WagmiContext for EVM). To override this and force internal management for all ecosystems:
Every provider config accepts an sdkProvider option that lets you replace the built-in SDK provider with a custom implementation for signing, chain switching, or other low-level operations.You can pass either an SDKProvider object directly or a factory function that receives ecosystem-specific dependencies and returns an SDKProvider.Each ecosystem exposes different dependencies to the factory:
EOAs use ECDSA signatures for standard transactions
Smart Accounts may use ERC-1271 or other signature validation methods
This can cause incompatibility with native permit functionality (EIP-2612) used for gasless token approvals.
EIP-7702 delegated smart wallets, such as delegated MetaMask accounts,
currently require source-chain native gas because gasless or relayer routes
are not offered for this wallet type. See EIP-7702 delegated wallet troubleshooting.
If your smart account provider supports EIP-5792 (Wallet Function Call API), there should be no compatibility issues. The widget will automatically use batch transactions instead of individual permit signatures.
For smart accounts without EIP-5792 support, disable message signing to use standard approval transactions. In v4, this option is configured on the EthereumProvider:
Disabling message signing will fallback to standard token approval
transactions, which may require additional gas fees but ensures compatibility
with all smart account implementations.
The @lifi/wallet-management package provides its own event emitter for wallet connection and disconnection events. These are separate from the Widget Events.