LogoLogo
  • Introduction
  • Radius testnet access
  • Quickstart
    • Command line
    • Go
    • JavaScript
    • Postman
    • Python
    • Rust
    • TypeScript
  • How to
    • Create a Private Key
    • Get testnet ETH tokens
    • Deploy a smart contract
  • Concepts
    • Ethereum transaction types
  • Tutorials
  • Radius SDKs
  • API Reference
    • eth_blockNumber
    • eth_call
    • eth_chainId
    • eth_createAccessList
    • eth_estimateGas
    • eth_feeHistory
    • eth_gasPrice
    • eth_getBalance
    • eth_getBlock
    • eth_getBlockByHash
    • eth_getBlockByNumber
    • eth_getBlockTransactionCountByHash
    • eth_getBlockTransactionCountByNumber
    • eth_getCode
    • eth_getLogs
    • eth_getStorageAt
    • eth_getTransactionByBlockHashAndIndex
    • eth_getTransactionByBlockNumberAndIndex
    • eth_getTransactionByHash
    • eth_getTransactionCount
    • eth_getTransactionReceipt
    • eth_sendRawTransaction
    • eth_sendTransaction
    • net_version
    • web3_clientVersion
    • web3_sha3
    • web3_getTransactionCount
  • Release Notes
  • Whitepaper
  • Radius Discord
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example

Was this helpful?

Edit on GitHub
  1. API Reference

eth_getBlockTransactionCountByNumber

Returns the number of transactions in the block with the given block number.

Parameters

  • block number: (string) [Required] A string representing the number of a block.

Returns

An integer representing the number of transactions in the block.

Example

Request

curl https://rpc.testnet.tryradi.us/<YOUR-RPC-ENDPOINT> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '
{
  "jsonrpc": "2.0",     
  "method": "eth_getBlockTransactionCountByNumber",
  "params": [
    "1738267480915"
  ],
  "id": 1
}
'

Response

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

This method does not work as expected using cast, but we are looking into it.

Request

cast rpc eth_getBlockTransactionCountByNumber \
  1738267480915 \
  --rpc-url https://rpc.testnet.tryradi.us/<YOUR-RPC-ENDPOINT>

Response

Error: server returned an error response: error code -32602: Invalid params, data: "invalid type: integer `1738267480915`, expected a string at line 1 column 13"
Previouseth_getBlockTransactionCountByHashNexteth_getCode

Last updated 4 months ago

Was this helpful?

Workaround: Use curl or instead.

eth_getBlockTransactionCountByHash