eth_getBlockReceipts
Get all transaction receipts for a given block on Ethereum.
Params
- a string array containing (required):QUANTITY|TAG(hex string|string, required)
- integer block number in hex string format, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter.
Array
- Array of objects, or null
when no block was found:blockHash(hex string)
.DATA
, 32 Bytes - hash of the block where this transaction was in.null
when its pending.blockNumber(hex string)
.QUANTITY
- block number where this transaction was in.null
when its pending.from(hex string)
.DATA
, 20 Bytes - address of the sender.to(hex string)
.DATA
, 20 Bytes - address of the receiver.null
when its a contract creation transaction.transactionHash(hex string)
.DATA
, 32 Bytes - hash of the transaction.transactionIndex(hex string)
.QUANTITY
- integer of the transactions index position in the block.null
when its pending.cumulativeGasUsed(hex string)
.QUANTITY
- the total amount of gas used when this transaction was executed in the block.gasUsed(hex string)
.QUANTITY
- the amount of gas used by this specific transaction alone.contractAddress(hex string)
.DATA
, 20 Bytes - the contract address created, if the transaction was a contract creation, otherwisenull
.logs(array of logs objects)
.Array
- array of log objects, which this transaction generated.logsBloom(hex string)
.DATA
, 256 Bytes - bloom filter for light clients to quickly retrieve related logs.status(integer number)
.QUANTITY
- either1
(success) or0
(failure).
curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"params": [
"0xece64e"
],
"id": 1
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access BlockVision Enhanced API requests
bv.getBlockReceipts('latest').then(console.log)
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"blockHash": "0xedbcdd4542699555641e78f00ceddf7622ed9e37cbad09f4021b9c889e989f98",
"blockNumber": "0xec83e1",
"contractAddress": null,
"cumulativeGasUsed": "0x1db2a",
"effectiveGasPrice": "0x2af5ede9f",
"from": "0x7777777743f67f50e0227e5d1467cbfee088e82c",
"gasUsed": "0x1db2a",
"logs": [
{
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000007933790a4f00000099e9001629d9fe7775b800",
"0x0000000000000000000000003aba2f680fb3c2b64e7edb8baaef68a9cf3655e2"
],
"data": "0x00000000000000000000000000000000000000000000000000c5d9c28b8aa000",
"blockNumber": "0xec83e1",
"transactionHash": "0xb40a84a83f0fbc9cd3f0eb3bfbb5f13fdda175522e0c4d52eb8fdd9b1a2e844c",
"transactionIndex": "0x0",
"blockHash": "0xedbcdd4542699555641e78f00ceddf7622ed9e37cbad09f4021b9c889e989f98",
"logIndex": "0x0",
"removed": false
}
],
"logsBloom": "0x00200000010000000000000080000000000000400000000000000200000000000000000000000000000000000000000002000000080000008200000000000000000000000000001000000008000000200000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000200000000000000000080000004000000000000000000000000000200000000000000000000000000000000000000000000000000002000100000000000014000000000000000000001000040000100000000000200000000000000000000000000000000000000200000000000000000000",
"status": "0x1",
"to": "0x007933790a4f00000099e9001629d9fe7775b800",
"transactionHash": "0xb40a84a83f0fbc9cd3f0eb3bfbb5f13fdda175522e0c4d52eb8fdd9b1a2e844c",
"transactionIndex": "0x0",
"type": "0x2"
},
{
...
}
]
}
Last modified 1mo ago