> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getBlockReceipts | BNB Chain

> BNB API method that retrieves all transaction receipts for a given block. Reference for eth_getBlockReceipts on BNB Chain via Chainstack.

BNB API method that retrieves all transaction receipts for a given block. Transaction receipts contain information about a transaction's execution status and can be useful for monitoring the status of transfers or contract execution on the blockchain.

<Note>
  This method is available on both the Geth and Erigon clients.
</Note>

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `quantity or tag` — the integer of a block encoded as hexadecimal or the string with:

  * `latest` — the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.
  * `safe`—the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or severe propagation latency.
  * `finalized`—the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require burning at least 1/3 of the staked BNB.
  * `earliest` — the earliest available or genesis block.
  * `pending`—the pending state and transactions block. This is the current state of transactions that have been broadcast to the network but have not yet been included in a block.

<Note>
  See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block) and [How The Merge Impacts Ethereum’s Application Layer](https://blog.ethereum.org/2021/11/29/how-the-merge-impacts-app-layer).
</Note>

## Response

* `result` — an array of objects with the following fields:
  * `Transaction receipt` — the object with:
    * `blockHash` — the block hash. Identifies the block in which the transaction was included. This field is `null` for transactions that have not yet been included in a block.
    * `blockNumber` — the number of the block in which the transaction was included. This field is `null` for transactions that have not yet been included in a block.
    * `contractAddress` — the address of the contract created by the transaction if it was a contract creation transaction. Otherwise, the value is `null`.
    * `cumulativeGasUsed` — the total amount of gas used in the block until this transaction was executed.
    * `effectiveGasPrice` — the actual value deducted from the sender's account for this transaction.
    * `from` — the address of the sender who initiated the transaction.
    * `gasUsed` — the amount of gas used by this specific transaction alone.
    * `logs` — an array of log objects generated by this transaction, if any. Logs are generated by smart contracts.
    * `logsBloom` — the 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 it was a transaction to an address. For contract creation transactions, this field is `null`.
    * `transactionHash` — the hash that uniquely identifies the transaction.
    * `transactionIndex` — the index of the transaction within the block.
    * `type` — the [type](https://ethereum.org/en/developers/docs/transactions/#types-of-transactions) of the transaction. `0` indicates a regular transfer; `2` indicates a contract creation or smart contract function call.

## `eth_getBlockReceipts` code examples

<CodeGroup>
  ```javascript web3.js theme={"system"}
  /* 
  eth_getBlockReceipts is not available in Web3.js
  Create a custom class using Web3PluginBase to implement it
  */

  const { Web3, Web3PluginBase } = require('web3');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const web3 = new Web3(NODE_URL);

  // Define the ExtraMethods class
  class ExtraMethods extends Web3PluginBase {
      pluginNamespace = 'extra';

      async getBlockReceipts(blockNumber) {
          return this.requestManager.send({
              method: 'eth_getBlockReceipts',
              params: [blockNumber],
          });
      }
  }

  web3.registerPlugin(new ExtraMethods());

  // Function to get block receipts using the custom plugin
  async function getBlockReceipts(blockId) {
      try {
          const receipts = await web3.extra.getBlockReceipts(blockId);
          console.log(receipts);
      } catch (error) {
          console.error("Error fetching block receipts:", error);
      }
  }

  // Call the function with "latest" block
  getBlockReceipts("latest");
  ```

  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const eth_getBlockReceipts = async () => {
      const BlockReceipts = await provider.send("eth_getBlockReceipts", ["latest"]);
       console.log(BlockReceipts);
     };

  eth_getBlockReceipts();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3
  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3.HTTPProvider(node_url)

  block_receipts = web3.make_request('eth_getBlockReceipts', ['latest'])
  print(block_receipts)
  ```
</CodeGroup>

## Use case

The `eth_getBlockReceipts` allows you to retrieve the receipts for all transactions in a specific block. A practical use case can be to retrieve all of the logs emitted from the transactions in a block. The method returns an array of transaction receipts, each containing information about the transaction and any logs generated as a result of the transaction execution so that the logs can be isolated.

<Note>
  Read [Uncovering the power of eth\_getBlockReceipts](/docs/uncovering-the-power-of-ethgetblockreceipts) to learn more about transactions receipts and how to use the `eth_getBlockReceipts` method.
</Note>


## OpenAPI

````yaml /openapi/bnb_node_api/eth_getBlockReceipts.json POST /35848e183f3e3303c8cfeacbea831cab
openapi: 3.0.0
info:
  title: BNB Node API
  version: 1.0.0
  description: This is an API for interacting with an BNB node.
servers:
  - url: https://bsc-mainnet.core.chainstack.com
security: []
paths:
  /35848e183f3e3303c8cfeacbea831cab:
    post:
      tags:
        - upload
      summary: eth_getBlockReceipts
      operationId: getBlockReceipts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockReceipts
                params:
                  type: array
                  items:
                    type: string
                    title: Block identifier
                  default:
                    - latest
      responses:
        '200':
          description: The block receipts information
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: array
                    items:
                      type: object

````