BNB Smart Chain
eth_getFilterChanges
BNB Smart Chain settles BNB-denominated transactions into blocks roughly every three seconds, so a stateless application needs an efficient way to ask "what is new?" eth_getFilterChanges does exactly that: hand it a filter ID and it returns only the events that arrived since your previous call, advancing an internal cursor each time. The payload type follows the filter — log objects for a log filter, block-hash strings for a block filter, or transaction-hash strings for a pending filter. Direct the poll at https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 to keep an indexer current without re-sending the filter criteria.
Use cases
- Pull fresh BEP-20 or PancakeSwap log events on a short interval while the heavy filter definition stays server-side.
- Run a block-tick loop on chain 56: register an
eth_newBlockFilteronce, then call this method on repeat to learn of each newly sealed block.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | filterId | string | Yes | The filter ID to poll. |
Response
| Type | Description |
|---|---|
| array | For log filters: array of log objects. For block filters: array of block hash strings. For pending-tx filters: array of transaction hash strings. Empty array if no new events. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Filter ID is invalid, expired (>5 min inactivity), or was already uninstalled. |
Common pitfalls
- A node forgets an idle filter after about five minutes, so catch the filter-not-found error and transparently rebuild the filter before resuming the loop.
- When the filter emits logs, read the
removedflag on each one to catch entries rolled back by a BSC reorg and undo them downstream. - There is a balance to strike: calling too often wastes compute units on empty arrays, while waiting too long lets the filter expire out from under you.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
Hex filter ID from eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter