Estimate Token Gas Limit

This endpoint helps customer in estimating the Contract Gas Limit needed for a transaction. It gives information for gas expenses for a specific contract when sending ethers or making a transaction with additional data in it.

Single Result - This endpoint returns only one single result. POST /blockchain-tools/{blockchain}/{network}/gas-limit/contract

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum.

    Example : ethereum
    Possible Values : ethereum ethereum-classic binance-smart-chain
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Example : ropsten
    Possible Values : ropsten mainnet mordor testnet

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Required
        amount string

        Represents transactions' amount.

        Example : 0.12
      • Required
        contract string

        Defines the specific token identifier. For Ethereum-based transactions it is the contract.

        Example : 0x092de782a7e1e0a92991ad829a0a33aef3c7545e
      • Required
        contractType string

        Represents the ERC contract type. It can be ERC20 or ERC721

        Example : ERC-20
      • Required
        recipient string

        The address which receives this transaction. In UTXO-based protocols like Bitcoin there could be several senders while in account-based protocols like Ethereum there is always only one recipient.

        Example : 0xc065b539490f81b6c297c37b1925c3be2f190738
      • Required
        sender string

        Represents the address which sends this transaction. In UTXO-based protocols like Bitcoin there could be several senders while in account-based protocols like Ethereum there is always only one sender.

        Example : 0x6f61e3c2fbb8c8be698bd0907ba6c04b62800fe5

Response schema

200 400 401 402 403 409 415 422 429 500
HTTP Status Code: 200
Content-Type: application/json

The request has been successful.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0.0
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Required
        gasLimit string

        Represents the amount of gas used by this specific transaction alone.

        Example : 550000

Credits Cost : 5 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/v2/blockchain-tools/ethereum/ropsten/gas-limit/contract?context=yourExampleString
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "yourExampleString",
    "data": {
        "item": {
            "amount": "0.12",
            "contract": "0x092de782a7e1e0a92991ad829a0a33aef3c7545e",
            "contractType": "ERC-20",
            "recipient": "0xc065b539490f81b6c297c37b1925c3be2f190738",
            "sender": "0x6f61e3c2fbb8c8be698bd0907ba6c04b62800fe5"
        }
    }
}

Response Example

{
    "apiVersion": "2.0.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "gasLimit": "550000"
        }
    }
}