Crypto APIs icon

Crypto APIs

Interact with Crypto APIs REST API

Actions113

Overview

This node operation estimates the gas limit required for transferring tokens on an Ethereum Virtual Machine (EVM) compatible blockchain. It is useful when you want to predict the amount of gas (transaction fee units) needed before actually sending a token transfer transaction, helping to avoid failed transactions due to insufficient gas.

Common scenarios include:

  • Wallet applications estimating fees before token transfers.
  • DApps preparing transactions with accurate gas limits.
  • Automated scripts that need to calculate gas costs dynamically.

For example, before sending an ERC-20 token from one address to another, this node can estimate how much gas will be consumed, allowing the user to set an appropriate gas limit.

Properties

Name Meaning
blockchain The blockchain network to use (e.g., Ethereum, Binance Smart Chain).
network The specific network environment (e.g., mainnet, testnet) within the chosen blockchain.
context Optional context string to correlate or identify the request.
JSON Body A collection of optional parameters describing the token transfer details:
- amount The amount of tokens to transfer.
- contract The smart contract address of the token.
- contractType The type of the contract (e.g., ERC-20, ERC-721).
- recipient The address receiving the tokens.
- sender The address sending the tokens.

Output

The output is a JSON array where each item contains the response from the API estimating the gas limit. The exact structure depends on the external API but typically includes fields such as estimated gas limit and possibly additional metadata about the transaction estimation.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for accessing the Crypto APIs REST API service.
  • The node reads a local OpenAPI specification file (2024-12-12-final.json) bundled with the node to map operations.
  • Network connectivity to the Crypto APIs service endpoint is necessary.

Troubleshooting

  • Operation not found error: If the specified operation cannot be found in the internal API spec, ensure the correct operation name is selected and the node version is up to date.
  • Invalid or missing parameters: Make sure all required properties like blockchain and network are provided and valid.
  • API authentication errors: Verify that the API key credential is correctly configured and has sufficient permissions.
  • Network issues: Check internet connectivity and firewall settings if requests fail to reach the API.
  • Unexpected API responses: Inspect the input parameters for correctness; malformed addresses or amounts may cause errors.

Links and References

Discussion