Avalanche
Avalanche
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_newBlockFilter creates a server-side filter on the Avalanche C-Chain (chain ID 43114, the EVM chain whose gas is paid in AVAX) that tracks new block arrivals. It returns a hex filter ID that you then poll with eth_getFilterChanges; each poll yields the hashes of blocks that have appeared since your last poll. With Snowman/Avalanche consensus finalizing blocks in roughly one to two seconds, new hashes show up quickly, so a tight polling loop keeps your app close to the chain head. Create the filter at https://avalanche.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 Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
eth_getBlockByHash.eth_getFilterChanges starts returning filter not found, recreate the filter and resume.