Polygon
Polygon
Polygon
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
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.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockTag | string | نعم | The block to count uncles in. |
| النوع | الوصف |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Polygon playground.
| الكود | الرسالة | السبب |
|---|---|---|
-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.المعاملات
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"