Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_getUncleCountByBlockNumber RPC method

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

Parameters:

  1. Number - Integer of a block number in hexadecimal format starting with 0x.

Returns:

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

Code Examples:

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

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  const uncleCount = await provider.send("eth_getUncleCountByBlockNumber", [
    "0xc5043f",
  ]);
  console.log(uncleCount);
})();
Ready to get started? Create a free account