Ethereum
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Ethereum
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_newFilter is the log-watching member of the filter family. You hand the node a filter object — a contract address (or list of them), a set of indexed topics, and an optional fromBlock/toBlock window — and it returns a hex filter ID that remembers those criteria. From then on you poll eth_getFilterChanges with the ID to pull only the matching event logs that appeared since your last call, without resending the whole query each time. It is the polling cousin of eth_getLogs, trading one big historical scan for a running incremental feed. Register the filter at https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1. Topics encode signatures like an ERC-20 Transfer or a Uniswap Swap, so you can target exactly the events you care about.
Transfer events by registering its address and the Transfer topic once, then polling roughly each 12-second slot for new hits instead of re-sending the full filter every time.Swap topic so your service ingests trades as blocks land.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | filter | object | Sim | Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]). |
| Tipo | Descrição |
|---|---|
| string | Hex filter ID. Pass this to eth_getFilterChanges, eth_getFilterLogs, or eth_uninstallFilter. |
Try it live in the Ethereum playground.
| Código | Mensagem | 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 the last block you processed.eth_subscribe with a logs subscription over WebSocket delivers the same events without the recreation dance.Parâmetros
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).