getBlockReceipts

Get the receipts for all transactions in a block

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.

FieldTypeDescription

blockNumberOrHash

String

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

blockHash

string

The hash of the block

blockNumber

integer

The height of the block

blockTimestamp

string

The timestamp of the block

transactionCount

integer

The number of transactions for which receipts were returned

receipts

array

The array of Receipts objects

transactionHash

string

The hash of the transaction

transactionIndex

integer

The index of the transaction

from

string

The address of the sender

to

string

The address of the receiver. Null when it's a contract creation transaction

contractAddress

string

The contract address created, if the transaction was a contract creation, otherwise null

cumulativeGasUsed

string

The sum of gas used by this transaction and all preceding transactions in the same block

effectiveGasPrice

string

Price paid for each unit of gas used in this transaction, denoted in wei

gasUsed

string

The amount of gas used in this transaction

gasUsedForL1

string

Arbitrum The amount of gas used on L1 in units of L2 gas

l1BlockNumber

string

Arbitrum The L1 block number that would be used for block.number calls

l1Fee

string

Arbitrum, Base, Optimism Fee paid on L1 to post the transaction, denoted in wei

l1FeeScalar

string

Base, Optimism L1 fee scalar

l1GasPrice

string

Base, Optimism Price paid for each unit of L1 gas, denoted in wei

l1GasUsed

string

Base, Optimism The amount of gas used on L1

cumulativeGasUsed

string

The total amount of gas used when this transaction was executed in the block

effectiveGasPrice

string

The amount of gas used by this specific transaction alone

gasUsed

string

The amount of gas used by this specific transaction alone

logsBloom

string

Bloom filter for light clients to quickly retrieve related logs

logs

array

Array of Log objects

address

string

Contract address from which logs should originate

topics

array

Topic to describe the log event

data

string

Additional data of the log event

blockNumber

integer

The block height where the log event occurred

transactionHash

string

The hash of the transaction

transactionIndex

integer

The index of the transaction

blockHash

string

The hash of the block where the log event occurred

logIndex

integer

The index of the log

removed

boolean

true when the log was removed, due to a chain reorganization. false if it's a valid log

status

string

The status of the transaction

type

string

The 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.

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!

Returns the receipt objects, ordered by transactionIndex.

GET https://eth-mainnet.blastapi.io/<project-id>/builder/getBlockReceipts?blockNumberOrHash=4865142

Query Parameters

NameTypeDescription

blockNumberOrHash*

String

4865142

{
    "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
    "blockNumber": "0x4a3c76",
    "blockTimestamp": "2018-01-06T19:41:56.000Z",
    "transactionCount": 102,
    "receipts": [
        {
            "transactionIndex": "0x0",
            "transactionHash": "0x5b61b8373cdeedbe8dd061d1c2fc63aac77bd2402e6ffb8d069c2b0a40d12d1e",
            "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
            "blockNumber": "0x4a3c76",
            "from": "0x3e65303043928403f8a1a2ca4954386e6f39008c",
            "to": "0x431aab554bbe80a1b80e0aa2ea635845bd7ac1cc",
            "contractAddress": null,
            "cumulativeGasUsed": "0x5208",
            "effectiveGasPrice": "0x24729ad3a0",
            "gasUsed": "0x5208",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "logs": [],
            "status": "0x1",
            "type": "0x0"
        },
        {
            "transactionIndex": "0x1",
            "transactionHash": "0x60bcb1b030046fd9518a28dda21f2de58841ae304a0dc9440f23111f49c67a44",
            "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
            "blockNumber": "0x4a3c76",
            "from": "0x0ded5e877ab4f223b8971ffc3c1cc179d976783a",
            "to": "0xcab00a181b91318752f5f1c6198f34d0e881a438",
            "contractAddress": null,
            "cumulativeGasUsed": "0xa410",
            "effectiveGasPrice": "0x1f9cd6d0b0",
            "gasUsed": "0x5208",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "logs": [],
            "status": "0x1",
            "type": "0x0"
        },
        {
            "transactionIndex": "0x2",
            "transactionHash": "0xa09b504fb7388913aad9cdff2e76c9508aa25bd75878473f16c41bc43067e1a6",
            "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
            "blockNumber": "0x4a3c76",
            "from": "0x86ad5fafb823343594b4fb617ec0e1ee5a0a3c38",
            "to": "0xb07ea5e76dde84843e66c11077303996bcd4beb0",
            "contractAddress": null,
            "cumulativeGasUsed": "0xf618",
            "effectiveGasPrice": "0x1f9cd6d0b0",
            "gasUsed": "0x5208",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "logs": [],
            "status": "0x1",
            "type": "0x0"
        },
        {
            "transactionIndex": "0x1b",
            "transactionHash": "0xfcf439ff1bd6aa005d02b2fce047b27763c79cfc4353771da49f94fe61135ea5",
            "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
            "blockNumber": "0x4a3c76",
            "from": "0xa113c179173dffdd74b4102fc5f0a03f541b347c",
            "to": "0xb97048628db6b661d4c2aa833e95dbe1a905b280",
            "contractAddress": null,
            "cumulativeGasUsed": "0xdc1fd",
            "effectiveGasPrice": "0xc1b710800",
            "gasUsed": "0x9109",
            "logsBloom": "0x00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000008000000080000000000000000000000000000000000000000000000000000000004000000100000000000000000000010000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000010000000000000000000000000000000000000000000002000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "logs": [
                {
                    "address": "0xb97048628db6b661d4c2aa833e95dbe1a905b280",
                    "topics": [
                        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                        "0x000000000000000000000000a113c179173dffdd74b4102fc5f0a03f541b347c",
                        "0x00000000000000000000000005ee546c1a62f90d7acbffd6d846c9c54c7cf94c"
                    ],
                    "data": "0x00000000000000000000000000000000000000000000001b62eb6c4c37201800",
                    "blockNumber": "0x4a3c76",
                    "transactionHash": "0xfcf439ff1bd6aa005d02b2fce047b27763c79cfc4353771da49f94fe61135ea5",
                    "transactionIndex": "0x1b",
                    "blockHash": "0x59cd065935ff5bbe05c23a3c0d67edca45c14795c47345a0ee4b5962548bbe50",
                    "logIndex": "0x2",
                    "removed": false
                }
            ],
            "status": "0x1",
            "type": "0x0"
        },
```// Some code

Last updated