eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the given block number.
Parameters
Section titled “Parameters”| Position | Name | Type | Description |
|---|---|---|---|
| 1 | block | string | Block number in hex, or "latest", "pending", "safe", "finalized", "earliest". Required. |
Returns
Section titled “Returns”| Field | Type | Description |
|---|---|---|
result | string | The number of transactions in the block as a hexadecimal integer. |
Example
Section titled “Example”Request
Section titled “Request”{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1}Response
Section titled “Response”{ "jsonrpc": "2.0", "id": 1, "result": "0x1f"}