Perform multiple contract calls across blockchains (BETA)

This endpoint can be used to bridge tokens, swap them and perform a number or arbitrary contract calls on the destination chain. You can find an example of it here. This functionality is currently in beta. While we've worked hard to ensure its stability and functionality, there might still be some rough edges.

post/v1/quote/contractCalls

Request

Headers

x-lifi-api-keystring

The apiKey allows you to authenticate on the API.

Request body

fromChainnumber required

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

fromTokenstring required

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

fromAddressstring required

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

toChainnumber required

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

toTokenstring required

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

toAmountstring 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.

toFallbackAddressstring

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

contractOutputsTokenstring

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.

slippagenumber double

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

integratorstring

A string containing tracking information about the integrator of the API

referrerstring

A string containing tracking information about the referrer of the integrator

allowBridgesstring[]

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

denyBridgesstring[]

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

preferBridgesstring[]

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

allowExchangesstring[]

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

denyExchangesstring[]

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

preferExchangesstring[]

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

allowDestinationCallboolean

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.

feenumber double

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

Response

Object listing all the currently enabled bridges and exchanges.

Example response

{
  "exchanges": [
    {
      "name": "0x",
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/zerox.svg"
    }
  ],
  "bridges": [
    {
      "name": "Connext",
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/relay.svg"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.