Optimism
Optimism
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getFilterLogs returns the full set of logs on OP Mainnet that match a log filter you created with eth_newFilter, ignoring how much you have already polled — every matching entry comes back, not just the new ones. OP Mainnet is an OP Stack optimistic rollup (Bedrock) settling to Ethereum L1, with gas paid in ETH and blocks roughly every two seconds, so a filter spanning even a modest time window can cover many blocks. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
fromBlock–toBlock range) before switching to incremental eth_getFilterChanges polling.eth_getFilterLogs once to catch up, then resume eth_getFilterChanges for new deltas.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | filterId | string | Sim | The log filter ID. Only log filters (eth_newFilter) are valid — block and pending-tx filters are not supported. |
| Tipo | Descrição |
|---|---|
| array | Array of all log objects matching the filter's criteria. |
Try it live in the Optimism playground.
| Código | Mensagem | Causa |
|---|---|---|
-32000 | filter not found | Filter ID is invalid, expired, or the filter was already uninstalled. |
-32005 | query returned more than 10000 results | The filter matches too many logs; narrow the block range or add topic filters. |
eth_getFilterChanges, this returns every matching log, not just new ones — for a wide filter over many OP Mainnet blocks it can be heavy and may hit the result cap.eth_newFilter; passing a block-filter or pending-tx-filter ID returns an error.eth_getFilterLogs promptly after creating the filter rather than letting it sit idle.Parâmetros
Hex filter ID from eth_newFilter