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:
Name | Description |
---|---|
blockHash | The hash of the block containing the transaction. |
blockNumber | The number of the block containing the transaction. |
contractAddress | The address of the contract created by the transaction, if applicable. |
cumulativeGasUsed | The total amount of gas used in the block up to this transaction. |
effectiveGasPrice | The actual gas price paid for the transaction. |
from | The address of the sender of the transaction. |
gasUsed | The amount of gas used by the transaction. |
logs | An array of log objects generated by the transaction, including the address, topics, and data of each log. |
logsBloom | A bloom filter used by light clients to quickly retrieve logs related to the transaction. |
status | The success status of the transaction, represented as 1 for success or 0 for failure. |
to | The address of the recipient of the transaction, if applicable. |
transactionHash | The hash of the transaction. |
transactionIndex | The index of the transaction within the block. |
type | The 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