eth_getBlockReceipts - Mantle
Example code for the eth_getBlockReceipts JSON-RPC method. Complete guide on how to use eth_getBlockReceipts JSON-RPC in GetBlock Web3 documentation.
This method returns all transaction receipts for a given block. It provides a more efficient way to retrieve all receipts in a block compared to fetching them individually.
Parameters
blockIdentifier
string
Block number (hex) or tag ("latest", "earliest", "pending")
Request examples
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"params": ["0x3F6777"],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"params": ["0x3F6777"],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": [
{
"blockHash": "0x9b14d73f45c836bfb0e1f59453c39fe8cddab45a0f78670dc6190e5c85b65a8e",
"blockNumber": "0x3f6777",
"contractAddress": null,
"cumulativeGasUsed": "0x5208",
"from": "0x52988d3dd2d1b36e9c48866670b7683c42197139",
"gasUsed": "0x5208",
"logs": [],
"logsBloom": "0x00000...",
"status": "0x1",
"to": "0xd85498dbeaeb1df24be52eed4f52eac2fbd56245",
"transactionHash": "0x6dfef681e0a83a40b05d40877e53a88459e8829240a6d6d5ec6fe816e435f8d8",
"transactionIndex": "0x0",
"type": "0x2"
}
]
}Response Parameters
result
array
Array of transaction receipt objects
blockHash
string
Hash of the block containing the transaction
blockNumber
string
Block number (hex)
contractAddress
string
Contract address if deployment, null otherwise
cumulativeGasUsed
string
Total gas used in block up to this tx
gasUsed
string
Gas used by this transaction
logs
array
Array of log objects emitted
status
string
0x1 for success, 0x0 for failure
Use Case
The eth_getBlockReceipts method is essential for:
Block explorers retrieving all receipts efficiently
Data indexing services
Batch transaction analysis
Event log collection for entire blocks
Transaction verification systems
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN
-32602
Invalid params
Invalid block identifier
Web3 Integration
Last updated
Was this helpful?