Returns information about a transaction by block hash and transaction index position.
Request
curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
-X POST \
-H 'x-amberdata-blockchain-id: ethereum-mainnet' \
-d {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByBlockHashAndIndex","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35","0x0"]}'
index | Description |
---|---|
0 - blockHash | The hash of a block. |
1 - index | The integer of the transaction index position. |
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"from": "0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98",
"gas": "0x249f0",
"gasPrice": "0x174876e800",
"hash": "0x8784d99762bccd03b2086eabccee0d77f14d05463281e121a62abfebcf0d2d5f",
"input": "0x6ea056a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bd8d7fa6f8cc00",
"nonce": "0x5e4724",
"to": "0x4b9c25ca0224aef6a7522cabdbc3b2e125b7ca50",
"transactionIndex": "0x0",
"value": "0x0",
"v": "0x25",
"r": "0xd1556332df97e3bd911068651cfad6f975a30381f4ff3a55df7ab3512c78b9ec",
"s": "0x66b51cbb10cd1b2a09aaff137d9f6d4255bf73cb7702b666ebd5af502ffa4410"
}
}
Field | Description |
---|---|
result | The transaction object, or null when no transaction was found. |
blockHash | The hash of the block where this transaction was in. null when its pending. |
blockNumber | The block number where this transaction was in. null when its pending. |
from | The address of the sender. |
gas | The gas provided by the sender. |
gasPrice | The gas price provided by the sender in Wei. |
hash | The 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 | The address of the receiver. null when its a contract creation transaction. |
transactionIndex | The integer of the transaction's index position in the block. null when its pending. |
value | The value transferred in Wei. |
v | The ECDSA recovery id. |
r | The ECDSA signature r. |
s | The ECDSA signature s. |