Optimism
Optimism
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getBlockTransactionCountByNumber reports how many transactions a block on OP Mainnet contains, addressed by its height or by a tag such as latest. OP Mainnet is an OP Stack optimistic rollup (Bedrock) that settles to Ethereum L1, pays gas in ETH, and produces a block roughly every two seconds — so this counter ticks far more often than on a slower L1. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa). The call returns the transaction count for the chosen block as a hex-encoded integer.
latest block on OP Mainnet to gauge real-time congestion as Velodrome swaps and other Superchain activity fill the sequencer's ~2s blocks.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | blockTag | string | Sim | The block to count transactions in. |
| Tipo | Descrição |
|---|---|
| string (hex) | Hex-encoded transaction count. |
Try it live in the Optimism playground.
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
pending tag counts transactions the OP Mainnet sequencer currently holds for the next block, so the value can shift between two calls seconds apart."0x2a"); convert it with parseInt(value, 16) before doing any numeric comparison or arithmetic.Parâmetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"