Queries all transaction receipts contained in a specified block.
Parameters
- A block identifier: a non-negative decimal or
0x-prefixed hexadecimal block height, a 32-byte block hash with or without0x, or the block taglatest,earliest, orfinalized.pendingandsafeare not supported.
Example
Request
# query by blockNumber
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["0xf4240"],
"id":1,
"jsonrpc":"2.0"
}'
# query by blockHash
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["00000000000f424013e51b18e0782a32fa079ddafdb2f4c343468cf8896dc887"],
"id":1,
"jsonrpc":"2.0"
}'
#query by tag
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["latest"],
"id":1,
"jsonrpc":"2.0"
}'
Response (one receipt excerpt)
The first two requests query the same fixed block. The response's result array contains all transaction receipts for that block; only the receipt with transactionIndex equal to 0x5 is shown below. The latest request instead returns receipts for the current head block.
{
"blockHash": "0x00000000000f424013e51b18e0782a32fa079ddafdb2f4c343468cf8896dc887",
"blockNumber": "0xf4240",
"contractAddress": null,
"cumulativeGasUsed": "0x94121",
"effectiveGasPrice": "0xa",
"from": "0x41c910d7942636ae041975616104ef253e5a8371",
"gasUsed": "0x50312",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x174e91a57d68f5ac1bc485d03a038fe745a3b89b",
"transactionHash": "0xba8e727c03d588619310d7a16a95fcfd31a516dbf8893ddd585e0bbd7e0deae4",
"transactionIndex": "0x5",
"type": "0x0"
}