Optimism
Optimism
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getBlockReceipts returns every transaction receipt in a single OP Mainnet block in one call — status, gas used, effective gas price, and the full log set for each transaction. On this OP Stack rollup, where gas is paid in ETH and blocks arrive about every 2 seconds, it is the most efficient way to ingest a block's events without firing off one request per transaction. Send the block tag to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
gasUsed and effectiveGasPrice across a block's transactions to compute total L2 fees paid in ETH.Transfer logs in a block — e.g. Velodrome or Synthetix token movements — to keep balances in sync.status of "0x0") in a block for error analysis and alerting.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | blockTag | string | Sim | The block whose receipts to fetch. |
| Tipo | Descrição |
|---|---|
| array of object | Array of receipt objects. Each receipt contains: transactionHash, transactionIndex, blockHash, blockNumber, from, to, contractAddress, gasUsed, cumulativeGasUsed, effectiveGasPrice, status ("0x1" success / "0x0" failure), logs, logsBloom, type. |
Try it live in the Optimism playground.
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | Block tag is unrecognised or malformed. |
-32000 | Block not found | The requested block does not exist or has been pruned. |
eth_getTransactionReceipt calls — always prefer this for block-level receipt ingestion on OP Mainnet.Parâmetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"