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

Example

Command Shell
Bash
1
curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY
2
-X POST
3
-H "Content-Type: application/json"
4
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\": [\"0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6\", \"0x0\"],\"id\":1}"
Copied!
1
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
2
-H 'Content-Type: application/json' \
3
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params": ["0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6", "0x0"],"id":1}'
Copied!
Request Parameters
Response
  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.
Body
1
{
2
"jsonrpc":"2.0",
3
"id":1,
4
"result":{
5
"blockHash":"0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6",
6
"blockNumber":"0x6f3424",
7
"from":"0x2aab3ddd93ededc4d4275bef3e4f4d2ca95e0008",
8
"gas":"0x186a00",
9
"gasPrice":"0x52e340e800",
10
"hash":"0xbbbbfa9c5e1be53cc70c8f8d360925ce5957a4710605111c1064949f780f1188",
11
"input":"0xdbcfef0d0000000000000000000000004f2604aac91114ae3b3d0be485d407d02b24480b00000000000000000000000000000000000000000000000191116ce198ca0000000000000000000000000000000000000000000000000000013c310749028000000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000005e90253fbae4dab78aa351f4e6fed08a64ab559000000000000000000000000005ff2b0db69458a0750badebc4f9e13add608c7f00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e",
12
"nonce":"0x356a",
13
"to":"0x3096acb2de5b2f8590c5e0e9a60553c161f03fc6",
14
"transactionIndex":"0x0",
15
"value":"0x0",
16
"v":"0x94",
17
"r":"0x82ec6779064eef30862c2dc6141081788fc92b862cf4c6c98d09437a9de9eab2",
18
"s":"0x22a8b1b5f38ca97ab2a0dadae06a317e6eeac744a2de29f09ed72295d1068e3c"
19
}
20
}
Copied!
Last modified 6mo ago
Copy link