Skip to main content
Portal’s React Native SDK provides comprehensive cross-chain bridging and swapping capabilities through the portal.trading.lifi API. This guide covers getting quotes, finding routes, executing swaps and bridges, and tracking transaction status.

Overview

The Li.Fi functionality allows you to:
  • Get quotes for bridging or swapping tokens across chains
  • Find routes to discover the best paths for your cross-chain transfers
  • Execute swaps and bridges by signing and submitting transactions
  • Track transaction status for cross-chain transfers
Supported Chains: Li.Fi integration currently supports EVM-compatible chains (Ethereum, Base, Arbitrum, Polygon, etc.) and Solana. Other non-EVM chains may not be supported for Li.Fi operations.

Prerequisites

Before using Li.Fi operations, ensure you have:
  • A properly initialized Portal client
  • An active wallet with the required token(s) on the source network (see Create a wallet)
  • Li.Fi integration enabled in your Portal Dashboard (see Li.Fi Integration)

High-Level Methods

tradeAsset

Runs the end-to-end Li.Fi flow in one call:
  1. Discover routes (getRoutes)
  2. Select a route (routeIndex, default 0)
  3. Build each step (getRouteStep)
  4. Sign and broadcast each step transaction
  5. Wait for on-chain confirmation for that step
  6. Poll Li.Fi status until terminal for that step
  7. Continue to the next step
Steps are executed sequentially (in order), not in parallel. Confirmation behavior: tradeAsset uses strict confirmation semantics. Each step MUST be confirmed on-chain before proceeding to the next step. If waitForConfirmation returns false, times out, or throws, the entire flow fails and an error is thrown. There is no optimistic fallback.

Signature

Essential parameters Second argument LifiTradeAssetOptions: Return value Example (progress + per-call confirmation options)
Example (default confirmation behavior)
Wrap tradeAsset in try/catch; failures (no route, step error, receipt timeout, Li.Fi terminal FAILED, …) throw after onProgress may report 'failed'.

Progress lifecycle

onProgress can emit statuses such as:
  • fetching_routes
  • route_selected
  • preparing_step
  • signing
  • submitted
  • confirming
  • lifi_pending
  • step_done
  • complete
  • failed

pollStatus

Built-in Li.Fi status polling with retries and backoff. Use when you already have a tx hash (for example from a manual flow) and want the same polling behavior as inside tradeAsset, without implementing the loop yourself.

pollStatus options

Return false from the update callback to stop early; return true (or nothing) to continue.

Route Options

The routeOptions parameter on tradeAsset (and the options field on LifiRoutesRequest) accepts a LifiRoutesRequestOptions object:

Getting a Quote


Finding Routes


Getting Route Step Details


Executing Transactions

Note LifiTransactionRequest may include gasLimit and gasPrice. You can omit these fields to let Portal estimate gas automatically, or include them if you prefer to use Li.Fi’s suggested values.

Processing Multi-Step Routes


Tracking Transaction Status


Polling Until Completion


Supported Networks

Portal’s Li.Fi integration supports the following mainnet networks:
  • Monad (eip155:143)
  • Ethereum (eip155:1)
  • Optimism (eip155:10)
  • BSC (eip155:56)
  • Gnosis (eip155:100)
  • Unichain (eip155:130)
  • Polygon (eip155:137)
  • Sonic (eip155:146)
  • Mantle (eip155:5000)
  • Base (eip155:8453)
  • Arbitrum (eip155:42161)
  • Celo (eip155:42220)
  • Avalanche (eip155:43114)
  • Linea (eip155:59144)
  • Berachain (eip155:80094)
  • Katana (eip155:747474)
  • Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)
  • Bitcoin (bip122:000000000019d6689c085ae165831e93-p2wpkh)
For the complete list of networks Li.Fi supports across its ecosystem, refer to the Li.Fi documentation. If you need a chain that isn’t listed above, contact Portal support.
Testnets are not supported.

Next Steps