Compute statistics about the total number and rate of transactions in the chain.
Arguments:
- nblocks (numeric, optional) Size of the window in number of blocks (default: one month).
- "blockhash" (string, optional) The hash of the block that ends the window.
Request
curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
-X POST \
-H 'x-amberdata-blockchain-id: bitcoin-mainnet' \
-d '{"jsonrpc":"2.0","id":1,"method":"getchaintxstats","params":[]}'
Response
{
"result": {
"time": 1570128841,
"txcount": 461368169,
"window_final_block_hash": "000000000000000000056cfe0e84953b4e077b5b791386aad89a7400039abf5f",
"window_block_count": 4320,
"window_tx_count": 9133578,
"window_interval": 2421330,
"txrate": 3.772132670887487
},
"error": null,
"id": 1
}