Avalanche
Avalanche
Avalanche
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_getUncleCountByBlockNumber returns the number of uncle blocks referenced by the block at a given height or block tag (such as latest). On the Avalanche C-Chain (chain ID 43114, gas paid in AVAX), this is always 0x0: under Snowman/Avalanche BFT consensus there is no competitive mining and therefore no uncle (ommer) blocks at any height. Available at https://avalanche.therpc.io/YOUR_API_KEY, the method is kept for EVM tooling compatibility, but on this chain you can treat its result as a constant 0x0.
0x0, so the rate is uniformly zero and the scan is unnecessary.0x0 here, so there is never a follow-up eth_getUncleByBlockNumberAndIndex call to make.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | blockTag | string | Oui | The block to count uncles in. |
| Type | Description |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Avalanche playground.
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
0x0 regardless of the height or block tag you pass, because Snowman consensus produces no uncles — there is no block where the count is non-zero."0x0"), not a number — parse it (for example with parseInt(value, 16)) before any numeric comparison.Paramètres
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"