Skip to main content

getBlockReceipts

The eth_getBlockReceipts method fetches transaction receipts from within a block. It seamlessly accepts either the block height or block hash as a parameter, providing flexibility in accessing the desired data.

How to use getBlockReceipts method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getBlockReceipts Builder API method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

Field

Type

Description
blockNumberOrHashString

This parameter is essential and must be provided. Depending on the value you specify, whether it's the block height or block hash, it will initiate the retrieval of the receipt objects, ordered by transactionIndex.

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.

FieldTypeDescription
blockHashstringThe hash of the block
blockNumberintegerThe height of the block
blockTimestampstringThe timestamp of the block
transactionCountintegerThe number of transactions for which receipts were returned
receiptsarrayThe array of Receipts objects
transactionHashstringThe hash of the transaction
transactionIndexintegerThe index of the transaction
fromstringThe address of the sender
tostringThe address of the receiver. Null when it's a contract creation transaction
contractAddressstringThe contract address created, if the transaction was a contract creation, otherwise null
cumulativeGasUsedstringThe sum of gas used by this transaction and all preceding transactions in the same block
effectiveGasPricestringPrice paid for each unit of gas used in this transaction, denoted in wei
gasUsedstringThe amount of gas used in this transaction
gasUsedForL1stringArbitrum The amount of gas used on L1 in units of L2 gas
l1BlockNumberstringArbitrum The L1 block number that would be used for block.number calls
l1FeestringArbitrum, Base, Optimism Fee paid on L1 to post the transaction, denoted in wei
l1FeeScalarstringBase, Optimism L1 fee scalar
l1GasPricestringBase, Optimism Price paid for each unit of L1 gas, denoted in wei
l1GasUsedstringBase, Optimism The amount of gas used on L1
cumulativeGasUsedstringThe total amount of gas used when this transaction was executed in the block
effectiveGasPricestringThe amount of gas used by this specific transaction alone
gasUsedstringThe amount of gas used by this specific transaction alone
logsBloomstringBloom filter for light clients to quickly retrieve related logs
logsarrayArray of Log objects
addressstringContract address from which logs should originate
topicsarrayTopic to describe the log event
datastringAdditional data of the log event
blockNumberintegerThe block height where the log event occurred
transactionHashstringThe hash of the transaction
transactionIndexintegerThe index of the transaction
blockHashstringThe hash of the block where the log event occurred
logIndexintegerThe index of the log
removedbooleantrue when the log was removed, due to a chain reorganization. false if it's a valid log
statusstringThe status of the transaction
typestringThe type of the transaction

Example Request and Result for getBlockReceipts

In this section, we provide an illustrative example of a request made to retrieve the receipts for all transactions in a block contents using the getBlockReceipts Builder API method. Additionally, we present the resulting response containing information about the specified receipts. Developers can use this as a reference for crafting their own requests and parsing the returned data when working with the getBlockReceipts method.

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!