{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b"
  ]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0xa"
}

Defined in the Ethereum JSON-RPC Specification

Returns the number of transactions in a block by block hash.

Parameters

blockHash
string
required

Hash of a block (32 bytes).

Returns

result
string

The number of transactions in this block as a hexadecimal string.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b"
  ]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0xa"
}

Error Handling

CodeMessageDescription
-32602Invalid block hashThe provided block hash is invalid
4100Requested method not supportedThe method is not supported by the wallet

This method returns the count of transactions in a specific block identified by its hash.