Ethereum
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Ethereum
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getUncleCountByBlockNumber returns how many uncles a block references, addressed by height or by a tag such as latest, finalized, or earliest. It is the height-keyed counterpart to the hash version, and the one that fits a loop incrementing a block number across Ethereum history. The count reflects the chain's consensus era: pre-Merge PoW blocks (below 15537393) can carry up to two uncles and report 0x1 or 0x2, while every PoS block since The Merge reports 0x0 because the protocol no longer mints ommers. The endpoint is https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1, and the result is a hex-encoded integer.
eth_getUncleByBlockNumberAndIndex: only fetch headers for heights where the count is non-zero.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockTag | string | نعم | The block to count uncles in. |
| النوع | الوصف |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Ethereum playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
0x0 no matter which height you pass, because PoS Ethereum never produces uncles. Restrict meaningful queries to the PoW range below that."0x2" will not compare as the number 2 directly. Parse it (for example parseInt(result, 16)) before doing any arithmetic or threshold check.المعاملات
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"