eth_getBlockReceipts

Ethereum RPC

Overview

eth_getBlockReceipts RPC method is a powerful tool for retrieving the receipts of all transactions included in a block, along with the block header. This method is particularly useful for applications that require detailed information about transactions, such as event logs, gas usage, and the status of transactions. It is supported on nodes running the Erigon client.

Parameters

eth_getBlockReceipts method takes a single parameter: the block identifier. This can be a block number (in hex format), a block hash, or one of the special strings "latest" or "earliest". The block identifier specifies which block's transaction receipts you want to retrieve. For example, to get the receipts for the latest block, you would use "latest" as the parameter.

Returns

The response from eth_getBlockReceipts includes an array of transaction receipt objects, each containing detailed information about a transaction. Key fields in the response include:

NameDescription
blockHashThe hash of the block containing the transaction.
blockNumberThe number of the block containing the transaction.
contractAddressThe address of the contract created by the transaction, if applicable.
cumulativeGasUsedThe total amount of gas used in the block up to this transaction.
effectiveGasPriceThe actual gas price paid for the transaction.
fromThe address of the sender of the transaction.
gasUsedThe amount of gas used by the transaction.
logsAn array of log objects generated by the transaction, including the address, topics, and data of each log.
logsBloomA bloom filter used by light clients to quickly retrieve logs related to the transaction.
statusThe success status of the transaction, represented as 1 for success or 0 for failure.
toThe address of the recipient of the transaction, if applicable.
transactionHashThe hash of the transaction.
transactionIndexThe index of the transaction within the block.
typeThe type of the transaction, with 0 indicating a regular transfer and 2 indicating a contract creation or smart contract function call

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/ethereum-mainnet/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
    "jsonrpc":"2.0",
    "method":"eth_getBlockReceipts",
    "params":["0x10f5d58"],
    "id":1
}'
// yarn add @tatumio/tatum

import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'

const tatum = (await TatumSDK.init) < Ethereum > { network: Network.ETHEREUM }

const result = await tatum.rpc.getBlockReceipts(10123321)

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs