> For the complete documentation index, see [llms.txt](https://docs.constellationnetwork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.constellationnetwork.io/stargazer-wallet/ethereum-rpc-api/eth_newfilter.md).

# eth\_newFilter

Creates a new filter in the node, based on filter options. Used to notify state changes (logs). To check for state changes call [`eth_getFilterChanges`](https://docs.constellationnetwork.io/stargazer/APIReference/ethereumRPCAPI/eth_getFilterChanges).

**Parameters**[**​**](https://docs.constellationnetwork.io/stargazer/APIReference/ethereumRPCAPI/eth_newFilter#parameters)

| Name   | Type     | Description                       |
| ------ | -------- | --------------------------------- |
| Filter | `Filter` | Filter logs based on this filter. |

Filter

```typescript
type Filter = {
  address?: Address; // Address from which logs generated.
  fromBlock?: HexString<Number> | "latest" | "earliest" | "pending"; // Block number or string the string "latest", "earliest" or "pending" to search from.
  toBlock?: HexString<Number> | "latest" | "earliest" | "pending"; // Block number or string the string "latest", "earliest" or "pending" to search to.
  topics?: HexString<Topic>[]; // Array of 0 - 4 topics.
  blockHash?: HexString<Hash>; // Block from which logs generated.
};
```

**Return Type**[**​**](https://docs.constellationnetwork.io/stargazer/APIReference/ethereumRPCAPI/eth_newFilter#return-type)

`HexString<FilterId>` - The new associated filter id.

**Example**[**​**](https://docs.constellationnetwork.io/stargazer/APIReference/ethereumRPCAPI/eth_newFilter#example)

```typescript
await provider.request({
  method: "eth_newFilter",
  params: [
    {
      topics: [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
      ],
    },
  ],
});
// "0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.constellationnetwork.io/stargazer-wallet/ethereum-rpc-api/eth_newfilter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
