Marketplace has launched, further enabling blockchain developers! Learn more


eth_getBlockTransactionCountByNumber RPC method

The eth_getBlockTransactionCountByNumber EVM method is only supported on the Avalanche C-Chain.


  1. Integer - Block number in hexadecimal format with 0x prefix.


  1. Result - Integer number of transactions in the block.

Code Examples:

To use the eth_getBlockTransactionCountByNumber EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.

require 'ethereum.rb'
client ='')
block_number = "0x#{12911679.to_s(16)}"
tx_count = client.eth_get_block_transaction_count_by_number(block_number)
puts txCount["result"].to_i(16)
Ready to get started? Create a free account