eth_getTransactionByBlockHashAndIndex
Returns information about a transaction by block hash and transaction index position.
Example
curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY
-X POST
-H "Content-Type: application/json"
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\": [\"0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6\", \"0x0\"],\"id\":1}"
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params": ["0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6", "0x0"],"id":1}'
BLOCK HASH
- a string representing the hash (32 bytes) of a block.TRANSACTION INDEX POSITION
- a hex of the integer representing the position in the block, appended with 0x such as0x0
.
Result Fields
TRANSACTION
- A transaction object, or null when no transaction was found
Within the transaction object, the following information are available.
blockHash
: 32 Bytes - hash of the block where this transaction was in, null when its pending.blockNumber
: block number where this transaction was in, null when its pending.from
: 20 Bytes - address of the sender.gas
: gas provided by the sender.gasPrice
: gas price provided by the sender in Wei.hash
: 32 Bytes - hash of the transaction.input
: the data send along with the transaction.nonce
: the number of transactions made by the sender prior to this one.to
: 20 Bytes - address of the receiver. null when its a contract creation transaction.transactionIndex
: integer of the transactions index position in the block. null when its pending.value
: value transferred in Wei.
Body
{
"jsonrpc":"2.0",
"id":1,
"result":{
"blockHash":"0x4afd743f186bc6028c44e2916a62405b9b46200e4dabebe59b79b24a40c792b6",
"blockNumber":"0x6f3424",
"from":"0x2aab3ddd93ededc4d4275bef3e4f4d2ca95e0008",
"gas":"0x186a00",
"gasPrice":"0x52e340e800",
"hash":"0xbbbbfa9c5e1be53cc70c8f8d360925ce5957a4710605111c1064949f780f1188",
"input":"0xdbcfef0d0000000000000000000000004f2604aac91114ae3b3d0be485d407d02b24480b00000000000000000000000000000000000000000000000191116ce198ca0000000000000000000000000000000000000000000000000000013c310749028000000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000005e90253fbae4dab78aa351f4e6fed08a64ab559000000000000000000000000005ff2b0db69458a0750badebc4f9e13add608c7f00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e",
"nonce":"0x356a",
"to":"0x3096acb2de5b2f8590c5e0e9a60553c161f03fc6",
"transactionIndex":"0x0",
"value":"0x0",
"v":"0x94",
"r":"0x82ec6779064eef30862c2dc6141081788fc92b862cf4c6c98d09437a9de9eab2",
"s":"0x22a8b1b5f38ca97ab2a0dadae06a317e6eeac744a2de29f09ed72295d1068e3c"
}
}
Last updated