Ethereum
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Ethereum
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
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.
Cette méthode ne prend aucun paramètre. Passez un tableau vide [].
| Type | Description |
|---|---|
| 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.
| Code | Message | Cause |
|---|---|---|
-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.