Skip to main content
POST
/
be84184cd12967be5a65d06651c60085
eth_newFilter
curl --request POST \
  --url https://plasma-mainnet.core.chainstack.com/be84184cd12967be5a65d06651c60085 \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_newFilter",
  "params": [
    {
      "fromBlock": "latest",
      "toBlock": "latest"
    }
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
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();

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:eth_newFilter
params
Filter options · object[]

The filter options object.

Response

200 - application/json

Creates a filter object based on filter options to notify when the state changes (logs).

jsonrpc
string
id
integer
result
object | null