Skip to main content
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.

Using Widget Providers

The simplest way to set up wallet management is using the built-in provider packages:

EVM Wallet Connection

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:

Automatic Detection

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.

Basic Wagmi Setup

Keep Chains in Sync

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:
  1. Manual: Update both Widget and Wagmi chains configuration to specify all supported chains.
  2. Dynamic: Get available chains from LI.FI API and dynamically update Wagmi configuration.

Dynamic Chain Sync

Use the useSyncWagmiConfig hook from @lifi/widget-provider-ethereum and useWidgetChains from @lifi/widget:
Please check out our complete examples in the widget repository:

SVM (Solana) Wallet Connection

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:
The @lifi/widget-provider-solana package requires bs58 (>=4.0.1) as a peer dependency.

MVM (Sui) Wallet Connection

To manage wallet connections to Sui, the widget uses @mysten/dapp-kit-react (^2.0.0).
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:
If you already have a Sui wallet context in your app using @mysten/dapp-kit-react, the widget will detect it and reuse your existing connection:

UTXO (Bitcoin) Wallet Connection

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:

TVM (Tron) Wallet Connection

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.

Configuration

WidgetWalletConfig Interface

Connect Wallet Button

When using external wallet management, use the onConnect callback to open your wallet modal:

Ethereum Provider Configuration

When using the built-in wallet management via EthereumProvider, you can configure wallet connectors:
Each connector option can also be set to true to use default settings, or omitted to disable that connector:

EthereumProviderConfig Interface

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.

Partial Wallet Management

If your external wallet management doesn’t support all ecosystems, enable partial wallet management to use a hybrid approach:
In partial mode:
  • External wallet management handles “opt-out” ecosystems
  • Internal wallet management handles remaining ecosystems
  • Both wallet menus can operate together
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).

Force Internal Wallet Management

The widget automatically detects existing wallet contexts (e.g., WagmiContext for EVM). To override this and force internal management for all ecosystems:

Ecosystem Order for Wallets

Define the preferred ecosystem order for multichain wallets:
The keys must match wallet names as labeled in the Widget UI. This only affects display order, not actual ecosystem support.

Custom SDK Providers

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:
Example using a factory function with the Ethereum provider:
When omitted, each provider uses its built-in SDK provider implementation.

Smart Accounts Compatibility

When using the Widget with smart accounts (Privy, Dynamic, ZeroDev, etc.), you may encounter signature compatibility issues.

The Problem

  • 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.

EIP-5792 Transaction Batching Support

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.

Disabling Message Signing

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.

updateTransactionRequestHook

For advanced use cases, you can modify transaction requests before they’re sent:

Wallet Management Events

The @lifi/wallet-management package provides its own event emitter for wallet connection and disconnection events. These are separate from the Widget Events.

WalletConnected

Fires when a wallet is connected via the widget’s internal wallet management UI.

WalletDisconnected

Fires when a wallet is disconnected.