Crypto APIs icon

Crypto APIs

Interact with Crypto APIs REST API

Actions113

Overview

This node enables users to simulate Ethereum transactions on a specified blockchain network using Crypto APIs. It is useful for developers and blockchain analysts who want to test how a transaction would behave without actually broadcasting it to the Ethereum network. This can help in estimating gas fees, verifying transaction parameters, or debugging smart contract interactions before committing real funds.

Practical examples:

  • Simulating a token transfer to check if the transaction will succeed.
  • Estimating gas usage and fees for a complex contract call.
  • Testing different gas price strategies (e.g., maxFeePerGas, maxPriorityFeePerGas) to optimize transaction cost.

Properties

Name Meaning
network The blockchain network on which to simulate the transaction (e.g., mainnet, testnet).
context Optional context string to associate with the simulation request.
JSON Body Collection of optional parameters describing the transaction details:
- amount Amount of cryptocurrency to send (as a string).
- gasLimit Gas limit for the transaction (number).
- gasPrice Gas price to use for the transaction (string).
- inputData Input data payload for the transaction (string), typically used for contract calls.
- maxFeePerGas Maximum fee per gas unit (string), relevant for EIP-1559 transactions.
- maxPriorityFeePerGas Maximum priority fee per gas unit (string), relevant for EIP-1559 transactions.
- recipient Address of the transaction recipient (string).
- sender Address of the transaction sender (string).

Output

The node outputs an array of JSON objects representing the response from the Crypto APIs simulation endpoint. Each output item contains detailed information about the simulated transaction result, such as success status, gas estimation, and any error messages returned by the simulation.

If the API supports binary data output, it is not explicitly handled here; the output focuses on JSON-formatted simulation results.

Dependencies

  • Requires an active connection to Crypto APIs REST API via an API key credential configured in n8n.
  • The node reads a local OpenAPI specification file (2024-12-12-final.json) bundled with the node to dynamically resolve operation details.
  • No other external dependencies are required.

Troubleshooting

  • Common issues:

    • Missing or invalid network parameter may cause the API request to fail.
    • Incorrect or incomplete transaction parameters (e.g., missing recipient or sender address) might lead to simulation errors.
    • API authentication failure if the API key credential is not set or invalid.
    • File read errors if the bundled OpenAPI spec file is missing or corrupted.
  • Error messages:

    • Operation <operationName> not found: Indicates the requested operation is not defined in the API spec; verify the operation name.
    • API errors returned from Crypto APIs will be included in the output JSON under an error field if "Continue On Fail" is enabled.
    • Network or permission errors should be resolved by checking API credentials and network connectivity.

Links and References

Discussion