eth_getFilterChanges - BSC

Example code for the eth_getFilterChanges JSON RPC method. Сomplete guide on how to use eth_getFilterChanges JSON RPC in GetBlock Web3 documentation.

The eth_getFilterChanges method returns an array of logs or block hashes that have occurred since the last poll for the given filter on the BNB Smart Chain.

Parameters

Parameter
Type
Required
Description

filterId

string

Yes

Filter ID from eth_newFilter or eth_newBlockFilter

Request Example

cURL
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": ["0x1"],
    "id": "getblock.io"
}'

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": []
}

Response Parameters

Parameter
Type
Description

result

array

Array of log objects or block hashes

Use Cases

  • Poll for new events on BSC

  • Monitor BEP-20 token transfers

  • Track PancakeSwap swaps

  • Build event-driven applications

circle-info

When possible, prefer provider-native event listening (SDK event listeners or websocket subscriptions) instead of manual polling for better efficiency and lower latency.

Error Handling

Error Code
Description

-32602

Invalid filter ID

-32603

Internal error

SDK Integration

Last updated

Was this helpful?