Skip to main content
Returns the number of transactions in a block identified by block number.

Parameters

blockParameter
string
required
Block number in hexadecimal, or a block tag: latest, earliest, pending, safe, or finalized.

Returns

result
string | null
The number of transactions in the block as a hexadecimal integer, or null if no block was found.

Example

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