Optimism
Optimism
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_newBlockFilter registers a server-side filter that tracks new block arrivals on OP Mainnet and returns a hex filter ID. You then poll that ID with eth_getFilterChanges to receive the hashes of blocks that have been produced since your last poll. OP Mainnet is the ETH-gas OP Stack rollup at chain ID 10 (0xa), and because its single sequencer mints a block roughly every 2 seconds, each poll typically returns a small, steady stream of new block hashes. Create the filter against https://optimism.therpc.io/YOUR_API_KEY.
此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| string | Hex filter ID. When polled with eth_getFilterChanges, yields an array of new block hashes since the last poll. |
Try it live in the Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
eth_getBlockByHash for each hash when you need the header or transaction list.eth_getFilterChanges reports filter not found, recreate the filter and resume.safe or finalized tag rather than acting on a freshly seen block hash.