Avalanche
Avalanche
Avalanche
Free tier covers personal projects. Pay-as-you-go scales without a card.
eth_newBlockFilter creates a server-side filter on the Avalanche C-Chain (chain ID 43114, the EVM chain whose gas is paid in AVAX) that tracks new block arrivals. It returns a hex filter ID that you then poll with eth_getFilterChanges; each poll yields the hashes of blocks that have appeared since your last poll. With Snowman/Avalanche consensus finalizing blocks in roughly one to two seconds, new hashes show up quickly, so a tight polling loop keeps your app close to the chain head. Create the filter at https://avalanche.therpc.io/YOUR_API_KEY.
This method takes no parameters. Pass an empty array [].
| 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 Avalanche playground.
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
eth_getBlockByHash.eth_getFilterChanges starts returning filter not found, recreate the filter and resume.