eth_getBlockTransactionCountByNumber
The eth_getBlockTransactionCountByNumber method returns the number of transactions in a block matching the given block number on the Optimism network. This lightweight method provides a quick way to check how many transactions are included in a specific block without fetching the entire block data, useful for statistics gathering, block analysis, and determining if a block is worth processing further.
Parameters
parameter | type | description |
|---|---|---|
blockParameter | string (required) | Block number in hex or tag (latest, earliest, pending) |
Return Object
The method returns the transaction count as a hexadecimal number.
Request Example
Request
Response Example
Response