Actions22
- Call Contract
- Estimate Gas
- Get Balance
- Get Block
- Get Block By Hash
- Get Block Number
- Get Block Transaction Count By Hash
- Get Block Transaction Count By Number
- Get Code
- Get Gas Price
- Get Logs
- Get Storage At
- Get Transaction
- Get Transaction By Block Hash And Index
- Get Transaction By Block Number And Index
- Get Transaction Count
- Get Transaction Receipt
- Get Uncle By Block Hash And Index
- Get Uncle By Block Number And Index
- Get Uncle Count By Block Hash
- Get Uncle Count By Block Number
- Send Raw Transaction
Get Transaction By Block Hash And Index
AI-generatedOverview
This node operation retrieves a specific transaction from the Ethereum blockchain by using the block's hash and the transaction's index within that block. It is useful for scenarios where you need detailed information about a particular transaction included in a known block, such as auditing, transaction tracking, or blockchain analysis.
Use Case Examples
- Retrieve a transaction from a block when you have the block hash and want to inspect the transaction details at a specific index.
- Use case in blockchain analytics to fetch transaction data for verification or reporting.
Properties
| Name | Meaning |
|---|---|
| Block Hash | The hash of the block from which to retrieve the transaction. |
| Transaction Index | The index of the transaction within the block, specified in hexadecimal format. |
Output
JSON
result- The raw transaction data retrieved from the blockchain.valueEth- The transaction value converted from Wei to Ether.gasPriceGwei- The gas price of the transaction converted from Wei to Gwei.blockNumberDecimal- The block number containing the transaction, converted from hexadecimal to decimal.transactionIndexDecimal- The transaction index within the block, converted from hexadecimal to decimal.nonceDecimal- The nonce of the transaction, converted from hexadecimal to decimal.metadatanetwork- The blockchain network used (e.g., mainnet, rinkeby).operation- The operation performed, here 'getTransactionByBlockHashAndIndex'.timestamp- The 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 key credential with project ID and optional project secret for authentication.
Troubleshooting
- Ensure the block hash and transaction index are correctly formatted in hexadecimal and correspond to an existing block and transaction.
- Common errors include invalid parameters or network issues connecting to the Infura endpoint.
- If the transaction is not found, verify the block hash and index are correct and that the transaction exists in that block.
Links
- Infura API Documentation - eth_getTransactionByBlockHashAndIndex - Official documentation for the JSON-RPC method used to get a transaction by block hash and index.