Polygon
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getUncleByBlockHashAndIndex returns the header of an uncle (ommer) block at a given index inside the block identified by a hash. The method is kept for Ethereum JSON-RPC compatibility on Polygon — the PoS chain whose native token is MATIC and whose endpoint is https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89). It is important to understand that Polygon's Bor/Heimdall Proof-of-Stake design never forks into uncle blocks the way Ethereum's old Proof-of-Work chain did, so on Polygon this call effectively always returns null. It remains available so tooling written against the standard Ethereum interface does not break.
null.eth_getBlockByHash instead.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of the block that references the uncle. |
| 2 | uncleIndex | string (hex) | 是 | Zero-based index of the uncle within the block's uncles array. |
| 类型 | 描述 |
|---|---|
| object | null | Block header object (no transactions array): number, hash, parentHash, sha3Uncles, miner, stateRoot, transactionsRoot, receiptsRoot, logsBloom, difficulty, gasLimit, gasUsed, timestamp, extraData, mixHash, nonce. Returns null if not found. |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block hash or uncle index is malformed. |
null, for both recent and historical blocks. Treat a null as normal, not an error."0x2" and above always return null; on Polygon even index "0x0" returns null.参数
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0")