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 Number And Index
AI-generatedOverview
This node interacts with the Infura blockchain API to retrieve details of a specific transaction by its block number and transaction index within that block. It is useful for blockchain developers or analysts who need to fetch transaction data from Ethereum blocks, for example, to verify transaction details or analyze blockchain activity.
Use Case Examples
- Retrieve the transaction at index 0 in the latest block to monitor recent blockchain activity.
- Fetch a transaction by specifying a particular block number and transaction index to audit or debug blockchain transactions.
Properties
| Name | Meaning |
|---|---|
| Block Number | The block number (in hex) or tag (latest, earliest, pending) from which to retrieve the transaction. |
| Transaction Index | The index (in hex) of the transaction within the specified block. |
Output
JSON
result- The raw transaction data returned by the Infura API.valueEth- Transaction value converted from Wei to Ether.gasPriceGwei- Gas price of the transaction converted from Wei to Gwei.blockNumberDecimal- Block number converted from hex to decimal.transactionIndexDecimal- Transaction index converted from hex to decimal.nonceDecimal- Nonce of the transaction converted from hex to decimal.metadatanetwork- The blockchain network used (e.g., mainnet, rinkeby).operation- The operation performed, here 'getTransactionByBlockNumberAndIndex'.timestamp- Timestamp when the data was fetched.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
Troubleshooting
- Common issues include invalid block number or transaction index formats, which must be in hex or valid tags like 'latest'.
- Errors may occur if the Infura API credentials are incorrect or missing.
- If the transaction does not exist at the specified block number and index, the response will be empty or null.
- Ensure the network specified in credentials matches the blockchain network of the block number.
Links
- Infura API Documentation for eth_getTransactionByBlockNumberAndIndex - Official documentation for the JSON-RPC method used to get a transaction by block number and index.