Infura icon

Infura

Interact with blockchain APIs via Infura

Get Transaction

AI-generated

Overview

This node interacts with the Infura blockchain API to retrieve details of a specific Ethereum transaction by its hash. It is useful for scenarios where you need to fetch transaction information such as sender, recipient, value, gas price, block number, and other transaction metadata from the Ethereum blockchain. For example, it can be used in blockchain analytics, monitoring transaction status, or integrating Ethereum transaction data into workflows.

Use Case Examples

  1. Retrieve transaction details by providing the transaction hash to monitor the status and details of a specific Ethereum transaction.
  2. Use the node to fetch transaction data for auditing or reporting purposes in a blockchain application.

Properties

Name Meaning
Transaction Hash The hash of the Ethereum transaction to retrieve details for.

Output

JSON

  • blockNumberDecimal - The block number containing the transaction, converted to decimal.
  • transactionIndexDecimal - The index of the transaction within the block, converted to decimal.
  • nonceDecimal - The nonce of the transaction, converted to decimal.
  • valueEth - The value transferred in the transaction, converted from Wei to Ether.
  • gasPriceGwei - The gas price used for the transaction, converted from Wei to Gwei.
  • result - Raw result data from the Infura API response (if applicable).
  • metadata
    • network - The blockchain network used (e.g., mainnet, rinkeby).
    • operation - The operation performed, here 'getTransaction'.
    • timestamp - Timestamp when the data was retrieved.
    • infura_endpoint - The Infura API endpoint used for the request.
    • raw_response - The full raw response from the Infura API.

Dependencies

  • Infura API credentials including network, project ID, and optionally project secret for authentication.

Troubleshooting

  • Ensure the transaction hash is valid and correctly formatted as a hexadecimal string starting with '0x'.
  • Check that the Infura API credentials are correctly configured and have access to the specified network.
  • If the node throws an error about unknown operation, verify that the operation parameter is set to 'getTransaction'.
  • If the response is empty or null, the transaction hash might not exist on the specified network or the transaction is pending and not yet indexed.

Links

Discussion