Optimism
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Optimism
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_getFilterChanges returns only what is new on OP Mainnet since you last polled a given filter — log objects for a log filter, block hashes for a block filter, or pending transaction hashes for a pending-tx filter. It pairs with a filter you created earlier (eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter), so you never re-send the criteria. OP Mainnet is an OP Stack optimistic rollup that settles to Ethereum L1 and charges gas in ETH; with ~2s blocks you get fresh deltas quickly. Send polls to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
eth_newBlockFilter once, then poll eth_getFilterChanges repeatedly to receive each new block hash as the sequencer produces it.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | filterId | string | Sí | The filter ID to poll. |
| Tipo | Descripción |
|---|---|
| array | For log filters: array of log objects. For block filters: array of block hash strings. For pending-tx filters: array of transaction hash strings. Empty array if no new events. |
Try it live in the Optimism playground.
| Código | Mensaje | Causa |
|---|---|---|
-32000 | filter not found | Filter ID is invalid, expired (>5 min inactivity), or was already uninstalled. |
removed field on each entry — even on an L2 sequencer, unsafe (pre-finalized) blocks can be reorganized and a log may be revoked.Parámetros
Hex filter ID from eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter