Overview
LI.FI Widget v4 introduces a modular provider architecture, internal routing improvements with TanStack Router, and enhanced multi-ecosystem support for Ethereum, Solana, Bitcoin, Sui, and Tron chains. This guide covers all breaking changes and migration steps.What’s new in v4
Beyond the breaking changes below, v4 adds:- Modular providers — Install only
@lifi/widget-provider-*packages for the ecosystems you need; the core widget no longer bundles wallet stacks. - TanStack Router — In-widget navigation uses TanStack Router instead of react-router compatibility layers.
- wagmi v3 — Ethereum flows align with wagmi and
@wagmi/corev3 when using@lifi/widget-provider-ethereum. - Tron (TVM) — Full Tron support via
@lifi/widget-provider-tronand matching Widget Light handlers. - Widget Light — Continued improvements to the iframe integration surface (configuration, events, multi-chain handlers).
Provider Architecture (biggest change)
New Provider Packages
Widget v4 introduces a modular provider system. Instead of the widget internally creating all wallet providers, you now explicitly install and configure only the provider packages you need:| Package | Ecosystem | Peer Dependencies |
|---|---|---|
@lifi/widget-provider-ethereum | EVM | wagmi ^3, @wagmi/core ^3 |
@lifi/widget-provider-solana | SVM | bs58 >=4.0.1 |
@lifi/widget-provider-bitcoin | UTXO | @bigmi/react ^0.8.0 |
@lifi/widget-provider-sui | MVM | @mysten/dapp-kit-react ^2.0.0 |
@lifi/widget-provider-tron | TVM | @tronweb3/tronwallet-adapter-react-hooks ^1.1.11 |
| Package | Description |
|---|---|
@lifi/widget-provider | Base provider abstraction with hooks (useBitcoinContext, useEthereumContext, useSolanaContext, useSuiContext, useTronContext) and isWalletInstalled |
Core Widget Peer Dependencies Changed
Widget v3 core had blockchain-specific peer dependencies:wagmi ^2, @bigmi/react, @mysten/dapp-kit, @solana/wallet-adapter-react.
Widget v4 core only requires: react >=18, react-dom >=18, @tanstack/react-query >=5.90.0.
Blockchain-specific peer dependencies are now on the individual provider packages.
Configuring Providers
Widget v3 - Dependencies installed separately, providers detected automatically:providers config option:
@lifi/widget-provider-ethereum:
EthereumProvider Configuration
Wallet connector options have moved fromwalletConfig to EthereumProvider:
Widget v3:
Wagmi v2 to v3
Widget v4 requires Wagmi v3 (was v2 in Widget v3). If you use an external Wagmi setup, you must upgrade Wagmi to v3. See the Wagmi v3 migration guide for details.Sui Package Change
The Sui peer dependency changed from@mysten/dapp-kit to @mysten/dapp-kit-react ^2.0.0:
Import Changes
Moved Exports
Several exports have moved to new packages:| Export | v3 Package | v4 Package |
|---|---|---|
createDefaultWagmiConfig | @lifi/wallet-management | @lifi/widget-provider-ethereum |
createDefaultBigmiConfig | @lifi/wallet-management | @lifi/widget-provider-bitcoin |
useSyncWagmiConfig | @lifi/wallet-management | @lifi/widget-provider-ethereum |
isWalletInstalled | @lifi/wallet-management | @lifi/widget-provider |
Renamed Hooks
useWidgetChains takes a WidgetConfig parameter (used to create an SDK client for fetching chains).
Wallet Configuration
Updated WidgetWalletConfig
The wallet configuration interface has been simplified. Connector-specific options (walletConnect, coinbase, metaMask, baseAccount, porto) have moved to EthereumProvider:
Widget v3:
disableMessageSigning Moved
disableMessageSigning has moved from sdkConfig.executionOptions to the EthereumProvider configuration:
SDK Execution Options
sdkConfig.executionOptions has been reduced. disableMessageSigning and getContractCalls were removed. Only updateTransactionRequestHook remains:
Routing Changes
Internal Router Migration
Widget v4 uses TanStack Router internally instead of React Router v6. This is an internal change that should not affect most integrations. If you’re using React Router in your app: No special configuration is needed. The widget’s internal router is completely isolated. Widget v3 - Required catch-all route:Navigation Route Changes
Navigation route names have been updated:transactionHistory was removed entirely and merged into activities.
WidgetConfig Changes
Subvariant Renamed to Mode
subvariant is now mode, and subvariantOptions is now modeOptions. All related types have been renamed:
| v3 | v4 |
|---|---|
subvariant | mode |
subvariantOptions | modeOptions |
WidgetSubvariant | WidgetMode |
SplitSubvariant | SplitMode |
SplitSubvariantOptions | SplitModeOptions |
SubvariantOptions | ModeOptions |
CustomSubvariant | CustomMode |
Custom Mode Options Restructured
Thecustom mode option is now an object with a type field. The 'fund' value has been removed:
Wide Variant Chain Sidebar Moved to HiddenUI
The chain sidebar option has moved frommodeOptions to hiddenUI:
UI Controls Changed from Arrays to Objects
disabledUI, hiddenUI, and requiredUI now use object configs instead of enum arrays:
DisabledUI, HiddenUI, and RequiredUI enums have been replaced by DisabledUIConfig, HiddenUIConfig, and RequiredUIConfig interfaces.
useRecommendedRoute Renamed to showSingleRoute
Top-level fee Removed
The top-levelfee shorthand has been removed. Use feeConfig.fee instead:
SDK Route Options Restricted
fee, referrer, order, and slippage can no longer be passed through sdkConfig.routeOptions. Use the top-level config fields (feeConfig, referrer, routePriority, slippage) instead.
Split Mode Options Enhanced
Thesplit mode now supports an object form with defaultTab:
Event Changes
Event Bus Migrated to eventemitter3
The internal event bus has migrated frommitt to eventemitter3. Event type signatures now use callback functions:
on/off subscription API remains the same — this change only affects custom type declarations.
WalletConnected Event Moved
ThewalletConnected event has moved from WidgetEvents to WalletManagementEvents in the @lifi/wallet-management package. The event type also changed — all fields are now required and two new fields were added:
TokensReversed Event Removed
WidgetEvent.TokensReversed has been removed entirely.
RouteExecutionUpdate Type Changed
TheRouteExecutionUpdate type now uses action (type ExecutionAction) instead of process (type Process):
process property:
ReviewTransactionPageEntered Deprecated
WidgetEvent.ReviewTransactionPageEntered is deprecated. Use WidgetEvent.PageEntered instead, which fires for all page navigation with a NavigationRouteType payload.
SDK v4 Dependency
Widget v4 depends on LI.FI SDK v4, which has its own breaking changes:createConfigis nowcreateClientProcesstype is nowExecutionAction
Quick Migration Checklist
- Update packages: Install
@lifi/widgetv4 and the provider packages you need - Add
providersto config: PassEthereumProvider(),SolanaProvider(), etc. viaconfig.providers - Move wallet connector config: Move
walletConnect,coinbase, etc. fromwalletConfigtoEthereumProvider({...}) - Move
disableMessageSigning: FromsdkConfig.executionOptionstoEthereumProvider({ disableMessageSigning: true }) - Update Wagmi to v3 if using an external Wagmi setup
- Update Sui package: Replace
@mysten/dapp-kitwith@mysten/dapp-kit-react - Update
useAvailableChains: Replace withuseWidgetChains(widgetConfig) - Update
useSyncWagmiConfigimport: From@lifi/wallet-managementto@lifi/widget-provider-ethereum - Update
createDefaultWagmiConfigimport: From@lifi/wallet-managementto@lifi/widget-provider-ethereum - Rename
subvariant→modeandsubvariantOptions→modeOptions - Update custom mode options: Change
custom: 'checkout'tocustom: { type: 'checkout' } - Move chain sidebar config: From
subvariantOptions.wide.disableChainSidebartohiddenUI: { chainSidebar: true } - Update UI controls to object configs: Replace
disabledUI: [DisabledUI.X]withdisabledUI: { x: true }, same forhiddenUIandrequiredUI - Rename
useRecommendedRoute→showSingleRoute - Replace top-level
feewithfeeConfig: { fee: 0.03 } - Remove
fee/referrer/order/slippagefromsdkConfig.routeOptions: Use top-level config fields instead - Fix event handlers: Replace
update.processwithupdate.actionin route execution event handlers - Remove
TokensReversedevent: If subscribed, remove the handler - Update
walletConnectedevent: Now inWalletManagementEvents, notWidgetEvents - Update navigation routes: Replace
activeTransactions/transactionHistorywithactivities - Remove
'fund'custom mode: If used, replace with'checkout'or'deposit' - Remove React Router catch-all: No longer needed for widget routes

