Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 1.07 KB

hmy_getblocktransactioncountbynumber.md

File metadata and controls

69 lines (49 loc) · 1.07 KB
description
GetBlockTransactionCount

hmy_getBlockTransactionCountByNumber

Get the number of transactions in a block by the block's index in the chain.

API v1

Parameters

  1. Number - The block number.

Returns

  • Number - The number of transactions in the given block.

Sample Curl Request

curl -d '{
    "jsonrpc":"2.0",
    "method":"hmy_getBlockTransactionCountByNumber",
    "params":["0x66"],
    "id":1
}' -H "Content-Type:application/json" -X POST "https://api.s0.b.hmny.io"

Sample Curl Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0"
}

API v2

Parameters

  1. Number - The block number.

Returns

  • Number - The number of transactions in the given block.

Sample Curl Request

curl -d '{
    "jsonrpc":"2.0",
    "method":"hmyv2_getBlockTransactionCountByNumber",
    "params":[1],
    "id":1
}' -H "Content-Type:application/json" -X POST "https://api.s0.b.hmny.io"

Sample Curl Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": 1
}