Optimism
Optimism
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockTag | string | 是 | The block to count transactions in. |
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded transaction count. |
Try it live in the Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"