Infura icon

Infura

Interact with blockchain APIs via Infura

Get Transaction Receipt

AI-generated

Overview

This node interacts with the Infura blockchain API to retrieve the receipt of a specific Ethereum transaction using its transaction hash. It is useful for developers and blockchain analysts who need to verify transaction details such as status, gas used, and block information after a transaction has been processed on the Ethereum network.

Use Case Examples

  1. A developer wants to confirm if a transaction was successful and retrieve its gas usage details.
  2. A blockchain analyst needs to fetch the receipt of a transaction to audit its execution and status.

Properties

Name Meaning
Transaction Hash The unique hash identifier of the Ethereum transaction for which the receipt is requested.

Output

JSON

  • blockNumberDecimal - The block number in decimal format where the transaction was included.
  • transactionIndexDecimal - The index position of the transaction within the block in decimal format.
  • gasUsedDecimal - The amount of gas used by the transaction in decimal format.
  • cumulativeGasUsedDecimal - The total gas used in the block up to and including this transaction in decimal format.
  • statusDecimal - The status of the transaction receipt in decimal format (1 indicates success).
  • success - Boolean indicating if the transaction was successful (true if statusDecimal is 1).
  • transactionHash - The hash of the transaction.
  • blockHash - The hash of the block containing the transaction.
  • from - The address of the sender.
  • to - The address of the receiver.
  • logs - Array of log objects generated by the transaction.
  • logsBloom - Bloom filter for the logs generated by the transaction.
  • contractAddress - The contract address created, if the transaction was a contract creation.
  • gasUsed - Gas used by the transaction in hexadecimal format.
  • cumulativeGasUsed - Cumulative gas used in the block in hexadecimal format.
  • status - Status of the transaction receipt in hexadecimal format.

Dependencies

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

Troubleshooting

  • Ensure the transaction hash is correct and corresponds to a transaction on the specified network.
  • If the node throws an error about invalid JSON or request failure, verify the Infura credentials and network configuration.
  • If the transaction receipt is null, the transaction might not be mined yet or the hash is incorrect.

Links

Discussion