查询指定区块中包含的所有交易回执。
查询指定区块中包含的所有交易回执。
参数
- 区块标识符,可以是非负十进制或
0x前缀的十六进制区块高度、32 字节区块哈希(带或不带0x),或区块标签latest、earliest、finalized。不支持pending和safe。
示例
请求
# 按区块号查询
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["0x377a8a2"],
"id":1,
"jsonrpc":"2.0"
}'
# 按区块哈希查询
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["00000000049e470616a96ca7af19fc46a473e9733796960d840697dd70ac14ad"],
"id":1,
"jsonrpc":"2.0"
}'
# 按标签查询
curl --location 'https://api.shasta.trongrid.io/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{ "method":"eth_getBlockReceipts",
"params":["latest"],
"id":1,
"jsonrpc":"2.0"
}'
响应
{
"jsonrpc": "2.0",
"id": 1,
"result": [{
"blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b",
"blockNumber": "0x20ef11c",
"contractAddress": null,
"cumulativeGasUsed": "0x646e2",
"effectiveGasPrice": "0x8c",
"from": "0x6eced5214d62c3bc9eaa742e2f86d5c516785e14",
"gasUsed": "0x0",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x0697250b9d73b460a9d2bbfd8c4cacebb05dd1f1",
"transactionHash": "0xc9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0",
"transactionIndex": "0x6",
"type": "0x0"
}]
}