Base
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Base
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_newFilter creates a server-side log filter on Base — Coinbase's ETH-gas OP Stack rollup — from a filter object describing the fromBlock/toBlock range, one or more contract address values, and topics to match. It returns a hex filter ID you then poll incrementally with eth_getFilterChanges, so each poll returns only the logs that have appeared since your previous call instead of re-scanning the whole range. Register the filter against https://base.therpc.io/YOUR_API_KEY (Base mainnet, chain ID 8453 / 0x2105). It pairs naturally with the busy Base log stream from apps like Aerodrome and Uniswap.
Transfer events on a Base token on a fixed interval (a few seconds suits Base's ~2s blocks) without re-specifying the full filter object on every request.Swap events from a long-running indexer or bot process.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | filter | object | 是 | Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]). |
| 类型 | 描述 |
|---|---|
| string | Hex filter ID. Pass this to eth_getFilterChanges, eth_getFilterLogs, or eth_uninstallFilter. |
Try it live in the Base playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation, or filter limit per connection was reached. |
-32602 | invalid argument | Malformed filter object or invalid topic format. |
eth_getFilterChanges returns a filter-not-found error you call eth_newFilter again and continue.eth_subscribe("logs", ...) is more efficient than repeatedly polling a filter on Base; reserve eth_newFilter for HTTP-only or batch-style consumers.参数
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).