Skip to main content
Plasma API method that creates a filter object based on filter options to notify when the state changes (logs).

Parameters

  • object — the filter options with fields like fromBlock, toBlock, address, topics

Response

  • quantity — a filter ID

eth_newFilter code examples

const { JsonRpcProvider } = require("ethers");

const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");

async function call() {
  const result = await provider.send("eth_newFilter", [
    {
      fromBlock: "latest",
      toBlock: "latest"
    }
  ]);
  console.log(result);
}

call();