Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_getUncleCountByBlockHash RPC method

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

Parameters:

  1. Hash - The Hash of the block to get uncles for.

Returns:

  1. Uncles - Integer value of the number of uncles in the block encoded as a hexadecimal.

Code Examples:

To use the eth_getUncleCountByBlockHash 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/')
uncleCount = client.eth_get_uncle_count_by_block_hash('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b')
puts uncleCount["result"].to_i(16)
Ready to get started? Create a free account