Returns information about a transaction by block hash and transaction index position.


Command Shell
curl https://bsc-<network>
-H "Content-Type: application/json"
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\": [\"0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6\", \"0x0\"],\"id\":1}"
curl -X POST 'https://bsc-<network>' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params": ["0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6", "0x0"],"id":1}'
Request Parameters
  1. 1.
    BLOCK HASH - a string representing the hash (32 bytes) of a block.
  2. 2.
    TRANSACTION INDEX POSITION - a hex of the integer representing the position in the block, appended with 0x such as 0x0 .
Result Fields
TRANSACTION - A transaction object, or null when no transaction was found
Within the transaction object, the following information are available.
  1. 1.
    blockHash: 32 Bytes - hash of the block where this transaction was in, null when its pending.
  2. 2.
    blockNumber: block number where this transaction was in, null when its pending.
  3. 3.
    from: 20 Bytes - address of the sender.
  4. 4.
    gas: gas provided by the sender.
  5. 5.
    gasPrice: gas price provided by the sender in Wei.
  6. 6.
    hash: 32 Bytes - hash of the transaction.
  7. 7.
    input: the data send along with the transaction.
  8. 8.
    nonce: the number of transactions made by the sender prior to this one.
  9. 9.
    to: 20 Bytes - address of the receiver. null when its a contract creation transaction.
  10. 10.
    transactionIndex: integer of the transactions index position in the block. null when its pending.
  11. 11.
    value: value transferred in Wei.