Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_getBlockTransactionCountByNumber RPC method

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

Parameters:

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

Returns:

  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 = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')
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