Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getUncleCountByBlockHash returns the number of uncle blocks referenced by the block identified by a given hash, as a hex string. On Polygon — the MATIC-powered PoS chain reachable at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) — that count is always "0x0", because the Bor/Heimdall Proof-of-Stake consensus and its L1 checkpoints never produce uncles. The method is retained for Ethereum JSON-RPC compatibility so that wallets, indexers, and libraries expecting the full standard interface continue to function against Polygon.
eth_getUncleByBlockHashAndIndex; on Polygon the count is always "0x0", so that follow-up is never needed.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of the block to count uncles in. |
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded uncle count (always "0x0", "0x1", or "0x2" on PoW chains; "0x0" on PoS). |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block hash is malformed. |
"0x0"; the method only carries non-zero values on historical Proof-of-Work data from other chains, so do not build Polygon logic that expects a positive count.null rather than "0x0" — distinguish "block not found" (null) from "block has zero uncles" ("0x0") when handling the response.参数
0x-prefixed 32-byte block hash