eth_uninstallFilter - Blast
Example code for the eth_uninstallFilter JSON-RPC method. Complete guide on how to use eth_uninstallFilter JSON-RPC in GetBlock Web3 documentation.
This method removes a filter by ID and stops the node from tracking it. Filters also expire automatically after a period of inactivity.
Parameters
filterId
string
Yes
Filter ID returned by a create-filter method
Request
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_uninstallFilter",
"params": ["0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2"],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_uninstallFilter',
params: ['0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2'],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data.result);import requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'eth_uninstallFilter',
'params': ['0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2'],
'id': 'getblock.io'
}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": true
}Response Parameters
jsonrpc
string
JSON-RPC protocol version ("2.0")
id
string
Request identifier matching the request
result
boolean
true if the filter existed and was removed
Use Cases
Resource Cleanup: Release a filter once polling is complete
Filter Rotation: Remove stale filters before creating new ones
Leak Prevention: Avoid accumulating unused filters on the node
Graceful Shutdown: Tear down filters when a watcher stops
Error Handling
-32602
Invalid params
Malformed or unknown filter ID
-32603
Internal error
The node failed to remove the filter
Web3 Integration
Last updated
Was this helpful?