Polygon
Polygon
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Polygon
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getUncleCountByBlockNumber returns, as a hex string, the number of uncle blocks referenced by the block at a given height or block tag (latest, earliest, safe, finalized, and so on). On Polygon — the PoS network whose gas token is MATIC, served at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) — the answer is always "0x0", since its Bor/Heimdall consensus with L1 checkpoints does not fork into uncles. The method is the height-addressed counterpart of eth_getUncleCountByBlockHash and is kept for Ethereum JSON-RPC compatibility.
"0x0", so the computed rate is zero — a direct reflection of its forkless PoS design.eth_getUncleByBlockNumberAndIndex; since Polygon's count is always "0x0", you can skip that follow-up entirely.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockTag | string | Ja | The block to count uncles in. |
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Polygon playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
"0x0" regardless of which block or tag you pass, so do not write branching logic that assumes a height could ever carry uncles here."0x0"), not a number — convert it (e.g. parseInt(result, 16)) before doing any numeric comparison or arithmetic.Parameter
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"