Skip to main content
POST
eth_uninstallFilter
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_uninstallFilter",
  "params": [
    "0x..."
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": true
}
Tempo API method that uninstalls a filter created by eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter. Filters should be uninstalled when no longer needed to free server resources.

Parameters

  • filterId — the filter ID to uninstall

Response

  • resulttrue if the filter was successfully uninstalled, false otherwise

eth_uninstallFilter code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const filterLifecycle = async () => {
    // Create a block filter
    const filterId = await provider.send("eth_newBlockFilter", []);
    console.log(`Created block filter: ${filterId}`);

    // Use the filter
    const blocks = await provider.send("eth_getFilterChanges", [filterId]);
    console.log(`Got ${blocks.length} new blocks`);

    // Uninstall when done
    const uninstalled = await provider.send("eth_uninstallFilter", [filterId]);
    console.log(`Filter uninstalled: ${uninstalled}`);

    // Trying to use it again will fail
    try {
      await provider.send("eth_getFilterChanges", [filterId]);
    } catch (e) {
      console.log("Filter no longer exists (expected)");
    }
  };

filterLifecycle();

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_uninstallFilter
params
any[]

Filter ID to uninstall

id
integer
default:1

Response

200 - application/json

Uninstall status

jsonrpc
string
id
integer
result
boolean

true if the filter was successfully uninstalled