TriportRPC

eth_getBlockReceipts

POSThttps://api.triport.io

Returns every transaction receipt for a single Polygon block in one call — the fast path for block-level indexing.

Polygonpolygon_read_rpcfree 15 rps · basic 20 rps · pro 100 rps · business 250 rps (per-tier RPS with burst; no daily cap)

eth_getBlockReceipts returns the receipts for all transactions in a given block as a single array. It is the bulk equivalent of calling eth_getTransactionReceipt once per transaction — but in a single round trip, which is dramatically faster when you need to index or analyze a whole block (gas usage, event logs, contract creations, status flags).

Use it when you are building an indexer, analytics pipeline, or block explorer that processes every transaction in a block. For pulling only events that match a filter (by address/topic), prefer eth_getLogs instead; for a single transaction's outcome, use eth_getTransactionReceipt.

Gotchas to plan for:

  • Payload-heavy. A typical Polygon block carries 50–150 transactions, so a single response is commonly 50–300 KB. Make sure your HTTP client and any intermediate proxy allow response bodies of that size and set generous read timeouts.
  • Block cadence. Polygon block time is ~2.1 s, so latest advances roughly every two seconds. When polling the chain tip, align your interval to that cadence rather than hammering the endpoint.
  • Still cheaper than N calls. Even though the response is large, one eth_getBlockReceipts call avoids the per-transaction network round-trips of N×eth_getTransactionReceipt, which is the main reason to use it for indexing.

Parameters

A single positional parameter — a block number, block hash, or a named block tag.

blockstringrequired
Block to fetch receipts for. One of: a hex-encoded block number (e.g. "0x3a1f2c0"), a 32-byte block hash, or a tag — "latest", "earliest", "pending", "safe", or "finalized".

Response

The result is an array of receipt objects — one per transaction, in the order they appear in the block. (Trimmed to two receipts below; a real block returns 50–150.)

blockHashstring
Hash of the block containing the transaction.
blockNumberstring
Hex block number.
transactionHashstring
Hash of the transaction.
transactionIndexstring
Hex index of the transaction within the block.
fromstring
Sender address.
tostring | null
Recipient address; null for contract-creation transactions.
contractAddressstring | null
Address of the contract created, or null if the transaction was not a contract creation.
cumulativeGasUsedstring
Total gas used in the block up to and including this transaction (hex).
gasUsedstring
Gas used by this transaction alone (hex).
effectiveGasPricestring
Actual gas price paid per unit, in wei (hex).
logsarray
Event logs emitted by the transaction.
logsBloomstring
Bloom filter over the logs for quick membership tests.
statusstring
"0x1" on success, "0x0" on revert.
typestring
Transaction type ("0x0" legacy, "0x2" EIP-1559, etc.).

Errors

Errors are returned in the standard JSON-RPC envelope (error.code, error.message, optional error.data). See errors.md for the full envelope and the data fields attached to tier/rate-limit errors.

CodeMeaningWhen it happens
-32001trial_expiredThe account's trial period has ended.
-32002tier_insufficientThe key's tier does not include the polygon_read_rpc capability.
-32003rate_limitedPer-tier RPS exceeded; retry after data.retry_after_sec.
-32004subscription_expiredThe paid subscription lapsed.
-32005unauthorizedMissing or invalid API key.
-32601method_unknownMethod not available on this network/key.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "eth_getBlockReceipts",
    params: ["latest"],
  }),
});


const { result: receipts } = await res.json();
const totalGas = receipts.reduce((sum, r) => sum + BigInt(r.gasUsed), 0n);
console.log(`${receipts.length} receipts, ${totalGas} gas used`);

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const receipts = await client.polygon.rpc<unknown[]>("eth_getBlockReceipts", [
  "latest",
]);


console.log(`fetched ${receipts.length} receipts in one call`);

Python (triport-sdk)

import os
from triport import Triport


client = Triport(api_key=os.environ["TRIPORT_API_KEY"])


receipts = client.polygon.rpc("eth_getBlockReceipts", ["latest"])
total_gas = sum(int(r["gasUsed"], 16) for r in receipts)
print(f"{len(receipts)} receipts, {total_gas} gas used")

Notes

  • Indexing pattern. To backfill a range of blocks, iterate block numbers and call eth_getBlockReceipts once per block rather than fanning out eth_getTransactionReceipt per transaction — fewer round trips, far less overhead. Pace your loop against your tier's RPS limit and handle -32003 with the retry_after_sec hint.
  • Related methods: eth_getTransactionReceipt (single receipt), eth_getLogs (filtered events across a block range), eth_getBlockByNumber (block header and transaction list).
  • No pagination. The full block's receipts are returned in one response; size scales with the number of transactions in the block.