> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://github.com/lifinance/sdk/tree/main/examples).
This functionality is currently in beta. While we've worked hard to ensure its stability and functionality, there might still be some rough edges.



## OpenAPI

````yaml post /v1/quote/contractCalls
openapi: 3.0.2
info:
  title: LI.FI API
  version: 1.0.0
  description: >-
    LI.FI provides the best cross-chain swap across all liquidity pools and
    bridges.
servers:
  - url: https://li.quest
    description: LI.FI Production Environment
  - url: https://staging.li.quest
    description: LI.FI Staging Environment
security: []
paths:
  /v1/quote/contractCalls:
    post:
      summary: Perform multiple contract calls across blockchains (BETA)
      description: >-
        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](https://github.com/lifinance/sdk/tree/main/examples).

        This functionality is currently in beta. While we've worked hard to
        ensure its stability and functionality, there might still be some rough
        edges.
      parameters:
        - name: x-lifi-api-key
          description: The apiKey allows you to authenticate on the API.
          schema:
            type: string
          in: header
      requestBody:
        description: >-
          Object describing what tokens to transfer and how to interact with the
          destination contracts.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractCallsRequest'
            example:
              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
      responses:
        '200':
          $ref: '#/components/responses/ToolsResponse'
components:
  schemas:
    ContractCallsRequest:
      title: Root type for ContractCallsRequest
      description: >-
        Object defining instructions on how to perform multiple
        cross-chain/same-chain calls
      required:
        - fromChain
        - fromToken
        - fromAddress
        - toChain
        - toToken
        - toAmount
        - contractCalls
      type: object
      properties:
        fromChain:
          description: The sending chain. Can be the chain id or chain key
          type: number
        fromToken:
          description: >-
            The token that should be transferred. Can be the address or the
            symbol
          type: string
        fromAddress:
          description: >-
            The wallet that will send the transaction and contains the starting
            token
          type: string
        toChain:
          description: The receiving chain. Can be the chain id or chain key
          type: number
        toToken:
          description: >-
            The token required to perform the contract interaction (can be
            something to stake, donate or to be used as payment)
          type: string
        toAmount:
          description: >-
            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.
          type: string
        contractCalls:
          type: array
          items:
            $ref: '#/components/schemas/ContractCall'
        toFallbackAddress:
          description: >-
            If the call fails, use this address to send the bridged tokens to.
            If none is specified, the sending address will be used.
          type: string
        contractOutputsToken:
          description: >-
            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.
          type: string
        slippage:
          format: double
          description: >-
            The maximum allowed slippage for the transaction as a decimal value.
            0.005 represents 0.5%.
          maximum: 1
          minimum: 0
          type: number
        integrator:
          description: >-
            A string containing tracking information about the integrator of the
            API
          type: string
        referrer:
          description: >-
            A string containing tracking information about the referrer of the
            integrator
          type: string
        allowBridges:
          description: >-
            List of bridges that are allowed for this transaction. Retrieve the
            current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        denyBridges:
          description: >-
            List of bridges that are not allowed for this transaction. Retrieve
            the current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        preferBridges:
          description: >-
            List of bridges that should be preferred for this transaction.
            Retrieve the current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        allowExchanges:
          description: >-
            List of exchanges that are allowed for this transaction. Retrieve
            the current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        denyExchanges:
          description: >-
            List of exchanges that are not allowed for this transaction.
            Retrieve the current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        preferExchanges:
          description: >-
            List of exchanges that should be preferred for this transaction.
            Retrieve the current catalog from the `/v1/tools` endpoint.
          type: array
          items:
            type: string
        allowDestinationCall:
          description: >-
            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`.
          type: boolean
        fee:
          format: double
          description: >-
            The percent of the integrator's fee that is taken from every
            transaction. The maximum fee amount should be less than 100%.
          maximum: 1
          exclusiveMaximum: true
          minimum: 0
          type: number
    ContractCall:
      title: Root Type for ContractCall
      description: Object defining a single arbitrary contract call
      required:
        - fromAmount
        - fromTokenAddress
        - toContractAddress
        - toContractCallData
        - toContractGasLimit
      type: object
      properties:
        fromAmount:
          description: >-
            The amount that will feed into this contract call. This is not
            dependent on how much was bridged or deposited before - it's the
            *expected* amount of token available on order to execute the call.
          type: string
        fromTokenAddress:
          description: >-
            The token that will feed into this contract call. E.g. a ETH staking
            transaction would expect to have ETH available.
          type: string
        toContractAddress:
          description: The address of the contract to interact with.
          type: string
        toContractCallData:
          description: >-
            The calldata to be sent to the contract for the interaction on the
            destination chain.
          type: string
        toContractGasLimit:
          description: >-
            The estimated gas used by the destination call. If this value is
            incorrect, the interaction may fail -- choose this carefully!
          type: string
        toApprovalAddress:
          description: >-
            If the approval address is different thant the contract to call,
            specify that address here
          type: string
        toTokenAddress:
          description: >-
            If the contract outputs a token, specify its address here. (E.g.
            staking ETH produces stETH)
          type: string
    Tools:
      type: object
      properties:
        exchanges:
          type: array
          items:
            $ref: '#/components/schemas/Exchange'
        bridges:
          type: array
          items:
            $ref: '#/components/schemas/Bridge'
    Exchange:
      type: object
      properties:
        key:
          $ref: '#/components/schemas/ExchangesEnum'
        name:
          description: The common name of the tool
          type: string
          example: 0x
        logoURI:
          description: The logo of the tool
          type: string
          example: >-
            https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/zerox.svg
        supportedChains:
          description: The chains which are supported on this exchange
          type: string
          example:
            - '1'
            - '137'
            - '56'
    Bridge:
      type: object
      properties:
        key:
          $ref: '#/components/schemas/BridgesEnum'
        name:
          description: The common name of the tool
          type: string
          example: Connext
        logoURI:
          description: The logo of the tool
          type: string
          example: >-
            https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/relay.svg
        supportedChains:
          type: array
          items:
            $ref: '#/components/schemas/SupportedChains'
    ExchangesEnum:
      type: string
      description: >-
        Identifier for an exchange tool. Retrieve the latest exchange keys from
        the `/v1/tools` endpoint. Keywords such as `all`, `none`, `default`, and
        `[]` are also supported where applicable.
    BridgesEnum:
      type: string
      description: >-
        Identifier for a bridge tool. Retrieve the latest bridge keys from the
        `/v1/tools` endpoint. Keywords such as `all`, `none`, `default`, and
        `[]` are also supported where applicable.
    SupportedChains:
      type: object
      properties:
        fromChainId:
          description: Supported `from` chain
          type: string
          example: 137
        toChainId:
          description: Supported `to` chain
          type: string
          example: 1
  responses:
    ToolsResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Tools'
      description: Object listing all the currently enabled bridges and exchanges.

````