Ethereum
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Ethereum
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getUncleByBlockNumberAndIndex is the by-height twin of the hash-based uncle lookup: you give it a block number (or a tag like earliest) and the uncle's index, and it returns that ommer's header. Because you address the block by its position in the chain rather than by a 32-byte hash, this is the variant you reach for when walking a contiguous range of Ethereum history to harvest uncles. The data only exists for the Proof-of-Work era. After The Merge at block 15537393, every slot yields a single PoS block with no ommers, so a query against a recent height resolves to null. Call it on https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1); the payload is the uncle's header, no transactions attached.
earliest tag instead of hardcoding genesis-adjacent heights, which keeps a backfill script readable when crawling the oldest uncles.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockTag | string | 是 | The block that references the uncle. |
| 2 | uncleIndex | string (hex) | 是 | Zero-based index of the uncle within the block's uncles array. |
| 类型 | 描述 |
|---|---|
| object | null | Same uncle header object as eth_getUncleByBlockHashAndIndex. Returns null if not found. |
Try it live in the Ethereum playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block tag or uncle index is malformed. |
latest or any post-Merge height returns null every time, because PoS Ethereum simply does not produce ommers. Keep your scan bounded below block 15537393 to avoid wasting calls.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0")