BNB Smart Chain

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

TypeDescription
stringHex filter ID. When polled with eth_getFilterChanges, yields an array of new block hashes since the last poll.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newBlockFilter",
"params": [],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32000filter not foundProvider 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_getBlockByHash when 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 found error 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

See also

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_newBlockFilter","params":[]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.