Overview
TheILiFi interface is the foundational contract interface for the LiFi protocol. It defines the core data structures and events used throughout the protocol for cross-chain bridging and transfer operations.
BridgeData Struct
TheBridgeDataStruct contains all necessary information for executing a cross-chain bridge transaction.
Type Signature
Fields
Unique identifier for the transaction across the LiFi protocol
Name of the bridge protocol being used (e.g., “stargate”, “hop”, “across”)
Address or identifier of the integrator using the LiFi protocol
Address of the referrer for fee sharing purposes
Contract address of the token being sent (use zero address for native tokens)
Destination address that will receive the bridged assets
Minimum amount of tokens expected on the destination chain (for slippage protection)
Chain ID of the destination blockchain
Whether the transaction includes token swaps on the source chain before bridging
Whether the transaction includes additional calls on the destination chain after bridging
Usage Example
Events
LiFiTransferStarted
Emitted when a cross-chain transfer is initiated.Complete bridge data for the initiated transfer
LiFiTransferCompleted
Emitted when a cross-chain transfer completes successfully on the destination chain.The unique transaction identifier
Address of the token received on the destination chain
Address that received the tokens
Amount of tokens received
Block timestamp when the transfer completed
LiFiTransferRecovered
Emitted when assets are recovered from a failed transfer.The unique transaction identifier
Address of the token being recovered
Address receiving the recovered tokens
Amount of tokens recovered
Block timestamp when the recovery occurred
LiFiSwappedGeneric
Emitted when a token swap occurs as part of a LiFi transaction.The unique transaction identifier
Integrator identifier
Referrer identifier
Address of the token being swapped from
Address of the token being swapped to
Amount of tokens sent to the swap
Amount of tokens received from the swap
LiFiGenericSwapCompleted
Emitted when a generic swap completes, including receiver information.The unique transaction identifier
Integrator identifier
Referrer identifier
Address that received the swapped tokens
Address of the token being swapped from
Address of the token being swapped to
Amount of tokens sent to the swap
Amount of tokens received from the swap
BridgeToNonEVMChain
Emitted when bridging to a non-EVM chain with a bytes receiver address.The unique transaction identifier
Chain ID of the destination blockchain
Receiver address in bytes format (for non-EVM addresses)
BridgeToNonEVMChainBytes32
Emitted when bridging to a non-EVM chain with a bytes32 receiver address.The unique transaction identifier
Chain ID of the destination blockchain
Receiver address in bytes32 format (for chains like Solana)
Interface
TheILiFi interface extends BaseContract from ethers and provides methods for querying events and managing listeners.