eth_getTransactionByBlockNumberAndIndex

Returns a transaction based on a block number and the transaction’s index position.

web3.eth.getTransactionByBlockNumberAndIndex(BlockNumber, indexNumber [, callback])

Parameters

  1. A block number .

  2. The transaction’s index position.

  3. Optional callback, returns an error object as first parameter and the result as second.

Returns

A transaction object its hash transactionHash:

  • hash : Hash of the transaction.

  • nonce: The number of transactions made by the sender prior to this one.

  • blockHash: Hash of the block where this transaction was in. null if pending.

  • blockNumber: Block number where this transaction was in. null if pending.

  • transactionIndex: Integer of the transactions index position in the block. null if pending.

  • from: Address of the sender.

  • to: Address of the receiver. null if it’s a contract creation transaction.

  • value: Value transferred in wei.

  • gasPrice: Gas price provided by the sender in wei.

  • gas: Gas provided by the sender.

  • input : The data sent along with the transaction.

Example

Last updated