跳转到主要内容
POST
Get a set of routes for a request that describes a transfer of tokens

请求头

x-lifi-api-key
string

Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.

请求体

application/json

The request object describes a desired any-to-any transfer and contains all information necessary to calculate the most efficient routes.

A description of a token transfer

fromChainId
number<number>
必填

The sending chain id

fromAmount
string
必填

The amount that should be transferred including all decimals (e.g. 1000000 for 1 USDC (6 decimals))

fromTokenAddress
string
必填

The address of the sending Token

toChainId
number<number>
必填

The id of the receiving chain

toTokenAddress
string
必填

The address of the receiving Token

options
Root Type for RouteOptions · object

Optional configuration for the routes

示例:
fromAddress
string

The sending wallet address

toAddress
string

The receiving wallet address

fromAmountForGas
string

The amount of the token to convert to gas on the destination side.

响应

The resulting routes that can be used to realize the described transfer of tokens

A list of routes that can be used to realize the described transfer of tokens

routes
Root Type for Route · object[]
必填

List of possible Routes for the given transfer

unavailableRoutes
object[]

An object representing the routes that are unavailable for the given transfer