Optimism
Optimism
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_newBlockFilter registers a server-side filter that tracks new block arrivals on OP Mainnet and returns a hex filter ID. You then poll that ID with eth_getFilterChanges to receive the hashes of blocks that have been produced since your last poll. OP Mainnet is the ETH-gas OP Stack rollup at chain ID 10 (0xa), and because its single sequencer mints a block roughly every 2 seconds, each poll typically returns a small, steady stream of new block hashes. Create the filter against https://optimism.therpc.io/YOUR_API_KEY.
Este método não aceita parâmetros. Passe um array vazio [].
| Tipo | Descrição |
|---|---|
| string | Hex filter ID. When polled with eth_getFilterChanges, yields an array of new block hashes since the last poll. |
Try it live in the Optimism playground.
| Código | Mensagem | Causa |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
eth_getBlockByHash for each hash when you need the header or transaction list.eth_getFilterChanges reports filter not found, recreate the filter and resume.safe or finalized tag rather than acting on a freshly seen block hash.