curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"id": 1,
"params": [
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": [
{
"transactionHash": "<string>",
"transactionIndex": 123,
"blockHash": "<string>",
"blockNumber": 123,
"from": "<string>",
"to": "<string>",
"cumulativeGasUsed": 123,
"gasUsed": 123,
"contractAddress": "<string>",
"logs": [
{
"removed": true,
"logIndex": 123,
"transactionIndex": 123,
"transactionHash": "<string>",
"blockHash": "<string>",
"blockNumber": 123,
"address": "<string>",
"data": "<string>",
"topics": [
"<string>"
]
}
],
"status": "<string>"
}
]
}
curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"id": 1,
"params": [
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": [
{
"transactionHash": "<string>",
"transactionIndex": 123,
"blockHash": "<string>",
"blockNumber": 123,
"from": "<string>",
"to": "<string>",
"cumulativeGasUsed": 123,
"gasUsed": 123,
"contractAddress": "<string>",
"logs": [
{
"removed": true,
"logIndex": 123,
"transactionIndex": 123,
"transactionHash": "<string>",
"blockHash": "<string>",
"blockNumber": 123,
"address": "<string>",
"data": "<string>",
"topics": [
"<string>"
]
}
],
"status": "<string>"
}
]
}
eth_getBlockReceipts
retrieves all transaction receipts for a specified block. This method enables applications to access detailed information about every transaction within a block, including outcomes, gas used, and event logs.
blockIdentifier
— a string that specifies the block number in hexadecimal format or one of the strings "earliest"
, "latest"
, or "pending"
, indicating which block’s receipts to retrieve. For instance, using "latest"
fetches the receipts for the most recent block.result
— an array of objects, each representing a transaction receipt within the specified block. Key fields in each receipt include:
transactionHash
— the hash of the transaction.transactionIndex
— the transaction’s index position within the block.blockHash
— the hash of the block containing the transaction.blockNumber
— the number of the block containing the transaction.from
— the address of the sender.to
— the address of the receiver (null
for contract creation transactions).cumulativeGasUsed
— the total amount of gas used in the block up until this transaction.gasUsed
— the amount of gas used by this transaction.contractAddress
— the contract address created by the transaction, if any.logs
— an array of log objects generated by the transaction.status
— the status of the transaction (0x1
for success, 0x0
for failure).eth_getBlockReceipts
method is crucial for applications requiring comprehensive transactional data from a block, such as:
The transaction receipts of the block
The response is of type object
.
Was this page helpful?