POST
/
evm
eth_getBlockReceipts
curl --request POST \
  --url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_getBlockReceipts",
  "params": [
    "0x9d0c37"
  ],
  "id": 1
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
      "transactionIndex": "0x0",
      "blockHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
      "blockNumber": "0x9d0c37",
      "from": "0xFC1286EeddF81d6955eDAd5C8D99B8Aa32F3D2AA",
      "to": "0x5555555555555555555555555555555555555555",
      "gasUsed": "0x5208",
      "cumulativeGasUsed": "0x5208",
      "contractAddress": null,
      "logs": [],
      "status": "0x1",
      "effectiveGasPrice": "0x3b9aca00",
      "type": "0x0"
    }
  ]
}
The eth_getBlockReceipts JSON-RPC method returns all transaction receipts for a given block. This method is highly efficient for retrieving receipt data for all transactions in a block with a single API call, making it ideal for block processing, event extraction, and comprehensive transaction analysis.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

The method takes one parameter:
  1. Block number - The block for which to retrieve all transaction receipts

Parameter details

  • blockNumber (string, required) — Block identifier: "latest", "earliest", "pending", or a specific block number in hexadecimal

Response

The method returns an array of transaction receipt objects for all transactions in the specified block.

Response structure

Receipt array:
  • Array of transaction receipt objects, one for each transaction in the block
  • Empty array if the block contains no transactions
  • null if the block doesn’t exist
Transaction receipt object:
  • transactionHash — Hash of the transaction
  • transactionIndex — Index of the transaction in the block (0-based)
  • blockHash — Hash of the block containing the transaction
  • blockNumber — Number of the block containing the transaction
  • from — Address of the transaction sender
  • to — Address of the transaction receiver (null for contract creation)
  • gasUsed — Amount of gas used by this specific transaction
  • cumulativeGasUsed — Total gas used in the block up to and including this transaction
  • contractAddress — Address of the created contract (null if not a contract creation)
  • logs — Array of log objects generated by the transaction
  • status — Transaction status (0x0 for failure, 0x1 for success)
  • effectiveGasPrice — Actual gas price paid by the transaction
  • type — Transaction type (0x0 for legacy, 0x1 for EIP-2930, 0x2 for EIP-1559)

Usage example

Basic implementation

// Get all transaction receipts for a block on Hyperliquid
const getBlockReceipts = async (blockNumber) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'eth_getBlockReceipts',
      params: [blockNumber],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Analyze block transaction outcomes
const analyzeBlockTransactions = async (blockNumber) => {
  const receipts = await getBlockReceipts(blockNumber);
  
  if (!receipts || receipts.length === 0) {
    return { message: 'No transactions in block' };
  }
  
  const analysis = {
    totalTransactions: receipts.length,
    successfulTransactions: 0,
    failedTransactions: 0,
    totalGasUsed: 0,
    contractCreations: 0,
    totalLogs: 0
  };
  
  receipts.forEach(receipt => {
    // Count successful vs failed transactions
    if (receipt.status === '0x1') {
      analysis.successfulTransactions++;
    } else {
      analysis.failedTransactions++;
    }
    
    // Sum gas usage
    analysis.totalGasUsed += parseInt(receipt.gasUsed, 16);
    
    // Count contract creations
    if (receipt.contractAddress) {
      analysis.contractCreations++;
    }
    
    // Count logs/events
    analysis.totalLogs += receipt.logs.length;
  });
  
  analysis.successRate = (analysis.successfulTransactions / analysis.totalTransactions) * 100;
  
  return analysis;
};

// Extract all events from a block
const extractBlockEvents = async (blockNumber, contractAddress = null) => {
  const receipts = await getBlockReceipts(blockNumber);
  
  if (!receipts) {
    return [];
  }
  
  // Extract all logs from all receipts
  const allLogs = receipts.flatMap(receipt => 
    receipt.logs.map(log => ({
      ...log,
      transactionHash: receipt.transactionHash,
      transactionIndex: receipt.transactionIndex,
      blockNumber: receipt.blockNumber
    }))
  );
  
  // Filter by contract address if specified
  if (contractAddress) {
    return allLogs.filter(log => 
      log.address.toLowerCase() === contractAddress.toLowerCase()
    );
  }
  
  return allLogs;
};

// Usage examples
analyzeBlockTransactions('latest')
  .then(analysis => console.log('Block Analysis:', analysis))
  .catch(error => console.error('Error:', error));

// Extract events from a specific block
extractBlockEvents('0x9d0c37')
  .then(events => console.log(`Found ${events.length} events in block`))
  .catch(error => console.error('Error:', error));

Hyperliquid-specific considerations

System transactions

HyperCore transactions:
  • Block receipts include receipts for both regular and system transactions
  • System transactions originate from HyperCore and may have different patterns
  • All transactions (regular and system) are included in the receipt array
  • System transactions contribute to block gas usage and event generation

Efficiency benefits

Batch processing:
  • Retrieve all receipts for a block in one request
  • More efficient than individual eth_getTransactionReceipt calls
  • Reduces API call overhead and network latency
  • Ideal for processing entire blocks atomically

Receipt data interpretation

Transaction status:
  • 0x1 — Transaction succeeded
  • 0x0 — Transaction failed (reverted)
  • Failed transactions still consume gas
  • Check status before processing transaction effects
Gas analysis:
  • gasUsed — Gas consumed by individual transaction
  • cumulativeGasUsed — Total gas used up to this transaction in the block
  • Use for calculating gas efficiency and block utilization

Example request

Shell
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBlockReceipts","params":["0x9d0c37"],"id":1}' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm

Use cases

The eth_getBlockReceipts method is essential for applications that need to:
  • Block processing: Efficiently process all transactions in a block with a single API call
  • Event indexing: Build comprehensive event indexes from receipt data
  • Analytics platforms: Collect transaction and event data for analysis
  • DeFi monitoring: Track protocol events and state changes
  • Audit systems: Verify transaction outcomes and contract interactions
  • Block explorers: Display comprehensive block transaction information
  • Transaction monitoring: Track transaction success rates and patterns
  • Gas analysis: Analyze gas usage patterns across block transactions
  • Smart contract monitoring: Track contract interactions and events
  • System transaction analysis: Analyze both regular and HyperCore system transaction receipts
  • Data synchronization: Maintain synchronized blockchain data
  • Integration services: Provide receipt data to external systems
This method returns receipts for all transactions in a block, including both regular transactions and system transactions from HyperCore. This can be a large amount of data for blocks with many transactions. Consider filtering strategies for high-volume blocks.

Body

application/json

Response

200 - application/json

Successful response with all transaction receipts for the block

The response is of type object.