Avalanche
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Avalanche
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | filter | object | Sí | Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]). |
| Tipo | Descripción |
|---|---|
| string | Hex filter ID. Pass this to eth_getFilterChanges, eth_getFilterLogs, or eth_uninstallFilter. |
Try it live in the Avalanche playground.
| Código | Mensaje | Causa |
|---|---|---|
-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.Parámetros
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).