BNB Smart Chain
eth_newBlockFilter
A fresh block lands on BNB Smart Chain about every three seconds under PoSA, and eth_newBlockFilter lets you catch each one without holding a socket open. Chain ID 56 pays fees in BNB. Call the method against https://bsc.therpc.io/YOUR_API_KEY and it spins up a server-side filter that tracks new block arrivals, returning a hex filter ID. Poll that ID with eth_getFilterChanges to collect the block hashes seen since your previous poll. Think of it as the request-response counterpart to a streaming newHeads subscription, a good fit for clients that cannot hold a persistent WebSocket to BNB Smart Chain.
Use cases
- Kick off block-level work each time a hash appears — for instance re-checking whether your pending BNB transfers have now been included.
- Keep a cache fresh by invalidating account balances or PancakeSwap pool reserves whenever a new BNB Smart Chain block hash shows up in the poll.
Parameters
This method takes no parameters. Pass an empty array [].
Response
| Type | Description |
|---|---|
| string | Hex filter ID. When polled with eth_getFilterChanges, yields an array of new block hashes since the last poll. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
Common pitfalls
- The poll yields bare block hashes only; pull the header and transactions yourself with
eth_getBlockByHashwhen you need the contents. - A filter the node hasn't seen polled for about five minutes is dropped, so recreate it the moment a
filter not founderror surfaces. - Even with PoSA's fast finality a freshly seen block can still be reorganized at the tip, so confirm finality before treating its data as settled.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97