Skip to main content

klay_getBlockTransactionCountByNumber

POST

Returns the number of transactions in a block by block number.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
param[0]
blockNumberOrTagstringrequired
Use one of block number or block tag to specify the block.
  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
param[1]
includeTransactionsbooleanrequired
Whether to include transactions. Set to true to return results with transactions.
Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://kaia-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "klay_getBlockTransactionCountByNumber",
"params": [
"0x1076B5A",
false
]
}'