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 --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": ["0x1"],
"id": "getblock.io"
}'const axios = require('axios');
const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
method: 'eth_getFilterChanges',
params: ['0x1'],
id: 'getblock.io'
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));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
Error Handling
Error Code
Description
-32602
Invalid filter ID
-32603
Internal error
SDK Integration
Last updated
Was this helpful?