Arbitrum One
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Arbitrum One
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_newFilter creates a server-side log filter on Arbitrum One and returns a hex filter ID. You define which logs you care about — a block range, one or more contract addresses, and topic patterns — and then poll the ID with eth_getFilterChanges to fetch only the matching logs emitted since your last poll, without re-sending the filter each time. On Arbitrum One, the ETH-fee Optimistic Rollup running Nitro/ArbOS, this is the standard way to watch contract events such as ERC-20 transfers or DEX swaps over plain HTTP. The endpoint is https://arbitrum.therpc.io/YOUR_API_KEY (chain ID 42161, 0xa4b1).
Transfer events on a regular interval without re-specifying the full filter each time; on Arbitrum One's sub-second blocks you can poll more frequently than the ~12-second cadence typical of Ethereum L1.Swap events in a long-running indexer process by keeping one filter alive and reading incremental changes.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 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 Arbitrum One 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.eth_subscribe over WebSocket is more efficient than repeatedly polling a filter, especially given the chain's fast sequencer blocks.参数
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).