eth_getFilterChanges - Mantle
Example code for the eth_getFilterChanges JSON-RPC method. Complete guide on how to use eth_getFilterChanges JSON-RPC in GetBlock Web3 documentation.
This method polls for filter changes. Returns an array of logs that occurred since last poll for log filters, or an array of block hashes for block filters.
Parameters
filterId
string
The filter ID returned by eth_newFilter or eth_newBlockFilter
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": ["0x1a2b3c4d5e6f"],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": ["0x1a2b3c4d5e6f"],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": []
}Response Parameters
result
array
Array of log objects or block hashes since last poll
Use Case
The eth_getFilterChanges method is essential for:
Polling for new events
Block monitoring via HTTP
Event-driven applications
Backend services without WebSocket
Incremental log retrieval
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN
-32000
Filter not found
Invalid or expired filter ID
Web3 Integration
Last updated
Was this helpful?