TriportRPC

eth_uninstallFilter

POSThttps://api.triport.io/v1/polygon

Removes a previously created server-side filter on Polygon, freeing the resource it held on the node.

Polygonpolygon_read_rpcFree — 15 rps · Basic — 20 rps · Pro — 100 rps · Business — 250 rps

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)required
The id returned by eth_newBlockFilter / eth_newFilter / eth_newPendingTransactionFilter, e.g. "0x1".

Response

When the filter id is unknown:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": false
}
resultboolean
true 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.

CodeMeaningWhen it happens
-32001trial_expiredThe trial period for the API key has ended.
-32002tier_insufficientThe key's tier is below what this method requires.
-32003rate_limitedPer-tier RPS limit exceeded; back off and retry.
-32004subscription_expiredThe key's subscription has lapsed.
-32005unauthorizedMissing or invalid API key.
-32601method_unknownMethod 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_uninstallFilter call. The recommended lifecycle is: create with eth_newBlockFilter → poll with eth_getFilterChanges → uninstall here.
  • Calling eth_uninstallFilter on an id that has already been removed (or that the node has timed out on its own) returns false, not an error — it is safe to run in finally/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.