eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number 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_getTransactionByBlockNumberAndIndex\",\"params\": [\"0x6F3620\", \"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_getTransactionByBlockNumberAndIndex","params": ["0x6F3620", "0x0"],"id":1}'
Copied!
Request Parameters
Response
  1. 1.
    BLOCK PARAMETER - An int block number in the form of hex, appended with 0x such as 0x6D7FE0, or pre-defined strings latest, earliest, pending.
  2. 2.
    TRANSACTION INDEX POSITION - a hex of the integer representing the position in the block, appended with 0x such as 0x0 .
Web3API's Composer accepts int block numbers, which will be auto-converted to a hex representation before being sent to a node.
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":"0xe84fe3e06769f2bc5bae419de2c68a6f58917feb1c9fe7fa22abe9685b09412d",
6
"blockNumber":"0x6f3620",
7
"from":"0x4cf8800ccc0a56396f77b1e7c46160f5df0e09a5",
8
"gas":"0x186a0",
9
"gasPrice":"0x5d21dba00",
10
"hash":"0x6c46e09a9a0d563ceb540ff32204e43f63090f8a28f1240ebde6f3aef6481a28",
11
"input":"0xa9059cbb000000000000000000000000e926e07abd2aa8170cef9ecfad6e2e65af7cceaa000000000000000000000000000000000000000000000000a4c81fda4bf52000",
12
"nonce":"0x406c",
13
"to":"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
14
"transactionIndex":"0x0",
15
"value":"0x0",
16
"v":"0x93",
17
"r":"0xbe9f336c68ef336fcf03fed1d4c8fa6f51beb092056f2201a28e1f59d465ef7e",
18
"s":"0x5f28510ad969b4faf8ca648900d8e5ab961761b940b5908a6e85db69db383c96"
19
}
20
}
Copied!
Last modified 5mo ago
Copy link