Avalanche
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Avalanche
Free tier covers personal projects. Pay-as-you-go scales without a card.
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.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | filter | object | Yes | Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]). |
| Type | Description |
|---|---|
| string | Hex filter ID. Pass this to eth_getFilterChanges, eth_getFilterLogs, or eth_uninstallFilter. |
Try it live in the Avalanche playground.
| Code | Message | Cause |
|---|---|---|
-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.Parameters
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).