Avalanche
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Avalanche
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_newFilter creates a server-side log filter on the Avalanche C-Chain (chain ID 43114, gas paid in AVAX) and returns a hex filter ID. You define which logs you care about — by block range, contract address, and indexed topics — once, then poll the ID with eth_getFilterChanges to receive only the new matching logs since your last poll, without re-sending the full filter each time. This is the efficient way to watch contract events such as ERC-20 transfers or DEX swaps over a long-running connection. Create the filter at https://avalanche.therpc.io/YOUR_API_KEY.
Transfer events on a short interval — the C-Chain's ~1–2s block time means a few-second poll keeps up — without re-specifying the full filter on every call.Swap events from a long-running indexer or bot.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Avalanche 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 filter not found, recreate the filter and continue from where you left off.eth_subscribe over a WebSocket connection is more efficient than repeatedly polling a filter; reserve polling for HTTP-only setups.المعاملات
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).