eth_uninstallFilter
https://api.triport.io/v1/polygonRemoves a previously created server-side filter on Polygon, freeing the resource it held on the node.
eth_uninstallFilter deletes a server-side filter that was previously created
with eth_newBlockFilter, eth_newFilter, or eth_newPendingTransactionFilter.
You pass the filter id returned at creation time and the node drops the filter
along with any state it was buffering for you.
Server-side filters are a stateful resource. The node keeps a per-filter
buffer of changes between your eth_getFilterChanges polls, and a filter that is
never uninstalled lingers until the node times it out on its own. Always call
eth_uninstallFilter as soon as you are done polling so you don't leave orphaned
filters accumulating on the upstream node.
The call returns a boolean: true when the filter existed and was removed,
false when the id was unknown (already uninstalled, expired, or never valid).
Because an unknown id is reported as false rather than as an error, this method
is safe to call defensively in cleanup paths.
Parameters
Positional params array with a single element.
filterIdstring (hex quantity)requiredeth_newBlockFilter / eth_newFilter / eth_newPendingTransactionFilter, e.g. "0x1".Response
When the filter id is unknown:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}resultbooleantrue if the filter existed and was uninstalled; false if the id was not found (already removed, expired, or never valid).Errors
Transport- and tier-level failures are returned as JSON-RPC error objects. A
valid request with an unknown filter id is not an error — it returns
result: false.
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The trial period for the API key has ended. |
-32002 | tier_insufficient | The key's tier is below what this method requires. |
-32003 | rate_limited | Per-tier RPS limit exceeded; back off and retry. |
-32004 | subscription_expired | The key's subscription has lapsed. |
-32005 | unauthorized | Missing or invalid API key. |
-32601 | method_unknown | Method not enabled for this key or unrecognized. |
See the shared error envelope reference for the full error object shape and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/polygon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_uninstallFilter",
params: [filterId],
}),
});
const { result } = await res.json();
console.log(result ? "filter removed" : "filter id not found");TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const removed: boolean = await client.polygon.rpc("eth_uninstallFilter", [filterId]);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
removed = client.polygon.rpc("eth_uninstallFilter", [filter_id])
print("filter removed" if removed else "filter id not found")Notes
- Pair every filter you create with an
eth_uninstallFiltercall. The recommended lifecycle is: create witheth_newBlockFilter→ poll witheth_getFilterChanges→ uninstall here. - Calling
eth_uninstallFilteron an id that has already been removed (or that the node has timed out on its own) returnsfalse, not an error — it is safe to run infinally/cleanup blocks. - Polygon's ~2.1s block time means short-lived filters expire on the node quickly if left unpolled; do not assume a filter id stays valid across long idle periods.
- For push-style streaming instead of HTTP polling, prefer a WebSocket subscription where your client supports it; server-side filters are the polling alternative for WebSocket-incompatible clients.