tx_getBlockTransactionCountByNumber

根据区块号查询区块交易数量。

Parameters

  1. <blcokNumber> - 区块号,可以是十进制整数、进制字符串或“latest”字符串来表示最新区块。

Returns

  1. <string> - 十六进制字符串,交易数量。

Example1:正常的请求

  1. # Request
  2. curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method":" tx_getBlockTransactionCountByNumber", "params": ["0x2"], "id": 71}'
  3.  
  4. # Response
  5. {
  6. "id":71,
  7. "jsonrpc": "2.0",
  8. "namespace":"global",
  9. "code": 0,
  10. "message": "SUCCESS",
  11. "result": "0xaf5"
  12. }

Example2:查询的区块不存在

  1. # Request
  2. curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method":" tx_getBlockTransactionCountByNumber", "params": ["0x2"], "id": 71}'
  3.  
  4. # Response
  5. {
  6. "jsonrpc": "2.0",
  7. "namespace": "global",
  8. "id": 71,
  9. "code": -32602,
  10. "message": "block number 0x2 is out of range, and now latest block number is 0"
  11. }