Ethereum
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Ethereum
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_newBlockFilter registers a server-side filter that watches for new blocks on Ethereum and hands you back a hex filter ID. There are no parameters: the filter simply accumulates the hash of every block the node sees, and you drain that buffer by polling eth_getFilterChanges with the ID. Each poll returns the block hashes that arrived since your last call, so on mainnet you can expect roughly one new hash per 12-second slot under PoS. Create the filter against https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1. This is the lightest of the filter family, since it tracks block arrivals rather than logs or mempool entries, and it pairs with eth_uninstallFilter for cleanup.
Este método no acepta parámetros. Pasa un array vacío [].
| Tipo | Descripción |
|---|---|
| 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 Ethereum playground.
| Código | Mensaje | Causa |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
eth_getBlockByHash with each hash.eth_getFilterChanges comes back with a filter-not-found error, recreate the filter and resume.safe or finalized tag (about 12.8 minutes for full finality) before treating a block as settled.