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_getUncleByBlockNumberAndIndex returns the header of an uncle (ommer) block at a given index inside the block at a specified height or block tag. It is the height-based twin of eth_getUncleByBlockHashAndIndex and exists on Polygon — the MATIC-fueled PoS chain at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) — purely for Ethereum JSON-RPC compatibility. Polygon's Bor/Heimdall Proof-of-Stake consensus with L1 checkpoints does not create uncle blocks, so on this network the call returns null at every height. It stays in the interface so standard Ethereum tooling keeps working unmodified.
null, so this loop reports no uncles by design."earliest" let you reach genesis-era data without first resolving a hash — handy in generic tooling, though on Polygon the result here is still null and you would read the canonical block with eth_getBlockByNumber instead.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockTag | string | Ja | The block that references the uncle. |
| 2 | uncleIndex | string (hex) | Ja | Zero-based index of the uncle within the block's uncles array. |
| Typ | Beschreibung |
|---|---|
| object | null | Same uncle header object as eth_getUncleByBlockHashAndIndex. Returns null if not found. |
Try it live in the Polygon playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block tag or uncle index is malformed. |
null for recent blocks — and in fact for every height. A null here is the expected result on Polygon, not a sign of a missing block or a bad request.Parameter
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0")