YAD
SiteDocs
SiteDocs
    • Introduction
    • Blockchains
      GET
    • List tokens
      POST
    • Liquidity sources
      GET
    • Gas prices
      GET
    • Get price for pair
      GET
    • Transaction allowance
      GET
    • Transaction approve
      GET
    • Get quote for pair
      GET
    • Get Bridge Price
      GET
    • Get Bridge Quote
      GET
    • Get Bridge Tokens
      POST

      Transaction approve

      GET
      https://api.entrswap.io/v1/{chainID}/transaction/approve
      Generates transaction input parameters to provide access to the user's tokens for the exchange smart contract.

      Request

      Authorization
      Add parameter in header
      X-API-Key
      Example:
      X-API-Key: ********************
      Path Params
      chainID
      enum<integer> 
      required
      The blockchain ID.
      (Supported list: v1/platforms)
      Allowed values:
      110561372504216143114
      Default:
      1
      Example:
      1
      Query Params
      tokenAddress
      string 
      required
      Address of the smart contract of the token for which the access request is generated.
      Default:
      0xdAC17F958D2ee523a2206206994597C13D831ec7
      Example:
      0xdAC17F958D2ee523a2206206994597C13D831ec7
      takerAddress
      string 
      optional
      Address of user’s wallet which will provide approve. When provided the gas will be estimated exactly.
      Default:
      0x06723241Ed93A57a0227207c5ACd8EcAafc6735c
      amount
      integer 
      optional
      The amount of user tokens to which access is granted. By default - infinite number.
      Default:
      100000000000
      gasPrice
      integer 
      optional
      Cost of gas for an approve transaction. By default: medium.
      Default:
      100000000000
      contractAddress
      string 
      optional
      Contract that we want to give an approval. If not passed, then the default for chain is used.

      Request samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request GET 'https://api.entrswap.io/v1/1/transaction/approve?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7' \
      --header 'X-API-Key;'

      Responses

      🟢200OK
      application/json
      Body
      calldata
      string 
      optional
      One of the input parameters for processing a transaction providing access to tokens.
      Example:
      0x095ea7b30000000000000000000000001aaad07998466cd3eb8140827dddb37570be1e63000000000000000000000000000000000000000000000000000000174876e800
      gas_price
      string 
      optional
      Gas price value for a transaction in WEI (nAVAX for Avalanche).
      Example:
      123
      to
      string 
      optional
      Address of the smart contract the transaction should be sent to.
      Example:
      0x1aaad07998466cd3eb8140827dddb37570be1e63
      estimate_gas
      string 
      optional
      The estimated amount of gas that will be used during the transaction.
      Example:
      123
      Example
      {
          "calldata": "0x095ea7b30000000000000000000000001aaad07998466cd3eb8140827dddb37570be1e63000000000000000000000000000000000000000000000000000000174876e800",
          "gas_price": "123",
          "to": "0x1aaad07998466cd3eb8140827dddb37570be1e63",
          "estimate_gas": "123"
      }
      🟠400Bad Request
      🔴500Internal Server Error
      Modified at 2024-05-21 13:57:12
      Previous
      Transaction allowance
      Next
      Get quote for pair