Skip to main content
POST
/
v1
/
quote
/
contractCalls
Perform multiple contract calls across blockchains (BETA)
curl --request POST \
  --url https://li.quest/v1/quote/contractCalls \
  --header 'Content-Type: application/json' \
  --data '
{
  "fromChain": 10,
  "fromToken": "0x4200000000000000000000000000000000000042",
  "fromAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
  "toChain": 1,
  "toToken": "ETH",
  "toAmount": "100000000000001",
  "contractCalls": [
    {
      "fromAmount": "100000000000001",
      "fromTokenAddress": "0x0000000000000000000000000000000000000000",
      "toTokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
      "toContractAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
      "toContractCallData": "0x",
      "toContractGasLimit": "110000"
    },
    {
      "fromAmount": "100000000000000",
      "fromTokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
      "toTokenAddress": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
      "toContractAddress": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
      "toFallbackAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
      "toContractCallData": "0xea598cb000000000000000000000000000000000000000000000000000005af3107a4000",
      "toContractGasLimit": "100000"
    }
  ],
  "integrator": "muc-hackaton-postman"
}
'
{
  "exchanges": [
    {
      "key": "<string>",
      "name": "0x",
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/zerox.svg",
      "supportedChains": [
        "1",
        "137",
        "56"
      ]
    }
  ],
  "bridges": [
    {
      "key": "<string>",
      "name": "Connext",
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/relay.svg",
      "supportedChains": [
        {
          "fromChainId": 137,
          "toChainId": 1
        }
      ]
    }
  ]
}

Headers

x-lifi-api-key
string

The apiKey allows you to authenticate on the API.

Body

application/json

Object describing what tokens to transfer and how to interact with the destination contracts.

Object defining instructions on how to perform multiple cross-chain/same-chain calls

fromChain
number
required

The sending chain. Can be the chain id or chain key

fromToken
string
required

The token that should be transferred. Can be the address or the symbol

fromAddress
string
required

The wallet that will send the transaction and contains the starting token

toChain
number
required

The receiving chain. Can be the chain id or chain key

toToken
string
required

The token required to perform the contract interation (can be something to stake, donate or to be used as payment)

toAmount
string
required

The amount of token required by the contract interaction. The LI.FI API will try and generate a quote that guarantees at least that amount on the destination chain.

contractCalls
Root Type for ContractCall · object[]
required
toFallbackAddress
string

If the call fails, use this address to send the bridged tokens to. If none is specified, the sending address will be used.

contractOutputsToken
string

Some contract interactions will output a token. This is the case in things like staking. Omit this parameter if no token should be returned to the user.

slippage
number<double>

The maximum allowed slippage for the transaction as a decimal value. 0.005 represents 0.5%.

Required range: 0 <= x <= 1
integrator
string

A string containing tracking information about the integrator of the API

referrer
string

A string containing tracking information about the referrer of the integrator

allowBridges
string[]

List of bridges that are allowed for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

denyBridges
string[]

List of bridges that are not allowed for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

preferBridges
string[]

List of bridges that should be preferred for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

allowExchanges
string[]

List of exchanges that are allowed for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

denyExchanges
string[]

List of exchanges that are not allowed for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

preferExchanges
string[]

List of exchanges that should be preferred for this transaction. Retrieve the current catalog from the /v1/tools endpoint.

allowDestinationCall
boolean

Whether swaps or other contract calls should be allowed as part of the destination transaction of a bridge transfer. Separate swap transactions on the destination chain are not affected by this flag. By default, parameter is true.

fee
number<double>

The percent of the integrator's fee that is taken from every transaction. The maximum fee amount should be less than 100%.

Required range: 0 <= x < 1

Response

200 - application/json

Object listing all the currently enabled bridges and exchanges.

exchanges
object[]
bridges
object[]