Docs
Centrifuge

eth_uninstallFilter - Uninstall Filter

Remove Centrifuge filter. Clean up event filters.

Remove filter subscription on the Centrifuge network.

Request Parameters

Request

This method accepts no parameters.

Response Body

Response
resultOBJECT

The return value depends on the specific method being called.

Implementation Example

Bash
# Create a short-lived filter so we have an ID to remove (requires jq)
FILTER_ID=$(curl -s -X POST https://api-centrifuge.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_newFilter",
    "params": [{
      "fromBlock": "latest",
      "toBlock": "latest",
      "address": null,
      "topics": []
    }],
    "id": 1
  }' | jq -r '.result')

# Uninstall the filter and confirm the response
curl -s -X POST https://api-centrifuge.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg id \"$FILTER_ID\" '{jsonrpc:\"2.0\", method:\"eth_uninstallFilter\", params:[$id], id:1}')"
JavaScript
const endpoint = 'https://api-centrifuge.n.dwellir.com/YOUR_API_KEY';

const createFilter = async () => {
  const payload = {
    jsonrpc: '2.0',
    method: 'eth_newFilter',
    params: [{ fromBlock: 'latest', toBlock: 'latest', address: null, topics: [] }],
    id: 1
  };

  const response = await fetch(endpoint, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(payload)
  });

  const { result } = await response.json();
  return result;
};

const filterId = await createFilter();
const response = await fetch(endpoint, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_uninstallFilter',
    params: [filterId],
    id: 2
  })
});

const data = await response.json();
console.log(data.result);

On this page