eth_getTransactionByBlockNumberAndIndex - Ethereum

eth_getTransactionByBlockNumberAndIndex. Returns information about a transaction by block number and transaction index position

eth_getTransactionByBlockNumberAndIndex - ethereum [Value: 13CU]
Returns information about a transaction by block number and transaction index position.
Use cases

Use cases

  • Retrieve transaction details by block number and index
  • Verify transaction order within a specific block
  • Audit transactions for a given block and index
Constraints

Constraints

  • Requires valid block number and index
  • Node must be synchronized with the blockchain
  • Accurate input parameters are necessary for results
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://eth.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionByBlockNumberAndIndex","params":["0xc5043f", "0x0"],"id":1,"jsonrpc":"2.0"}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xb1770efb14906e509893b6190359658208ae64d0c56e22f748a1b0869885559e"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray of strings
array of strings
blockNumberarray_of_strings
The block number as a string in hexadecimal format or tags:
  • latest [default] - the blockchain's most recent block
  • safe - a block validated by the beacon chain
  • finalized - a block confirmed by over two-thirds of validators
  • earliest - the first or genesis block
  • pending - transactions broadcasted but not yet included in a block.
indexstring
An integer of the transaction index position encoded as a hexadecimal.

Response

200
A block object with the following fields, or null when no block was found.

Response params

object
idinteger
jsonrpcstring
resultarray_of_objects
Array of log objects, or an empty array if nothing has changed since last poll.
object
blockHashstring
The number of the block where the given transaction was included.
blockNumberstring
The block number where this log was in. null when its pending. null when its pending log.
transactionIndexstring
Integer of the transactions index position log was created from. null when its pending log.
noncestring
The number of transactions made by the sender prior to this one.
hashstring
32 Bytes - hash of the transaction.
fromstring
20 Bytes - address of the sender.
gasstring
Gas provided by the sender.
gasPricestring
Gas price provided by the sender in Wei.
maxFeePerGasstring
The maximum fee per gas set in the transaction.
maxPriorityFeePerGasstring
The maximum priority gas fee set in the transaction.
inputstring
The data send along with the transaction.
chainIDstring
The chain id of the transaction, if any.
vstring
ECDSA recovery id.
rstring
ECDSA signature r.
sstring
ECDSA signature r.
tostring
20 Bytes - address of the receiver. null when it's a contract creation transaction.
valuestring
Value transferred in Wei.
typestring
The transaction type.