Skip to main content
Returns the number of transactions in a block matching the given block number.
Flashblocks: Query https://mainnet-preconf.base.org with "pending" to get the count of pre-confirmed transactions in the current Flashblock.

Parameters

block
string
required
Block number in hex, or "latest", "pending", "safe", "finalized", "earliest".

Returns

result
string
The number of transactions in the block as a hexadecimal integer.

Example

{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByNumber",
  "params": ["latest"],
  "id": 1
}