> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_newFilter

Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call [eth\_getFilterChanges](/nodeapi/unichain/execution-api/eth_getfilterchanges).

This method will use `40` [Compute Units](/nodeapi/about/billing).

***

## Reference: [Here](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)

**A note on specifying topic filters:** Topics are order-dependent. A transaction with a log with topics \[A, B] will be matched by the following topic filters:

* `[]` "anything"
* `[A]` "A in first position (and anything after)"
* `[null, B]` "anything in first position AND B in second position (and anything after)"
* `[A, B]` "A in first position AND B in second position (and anything after)"
* `[[A, B], [A, B]]` "(A OR B) in first position AND (A OR B) in second position (and anything after)"

## **Parameters**

`Object` - The filter options:

* `fromBlock`: `QUANTITY|TAG` - (optional, default: `"latest"`) Integer block number, or `"latest"` for the last mined block, `"safe"` for the latest safe block, `"finalized"` for the latest finalized block, `"pending"` for the pending block, or `"earliest"` for the genesis block.
* `toBlock`: `QUANTITY|TAG` - (optional, default: `"latest"`) Integer block number, or `"latest"` for the last mined block, `"safe"` for the latest safe block, `"finalized"` for the latest finalized block, `"pending"` for the pending block, or `"earliest"` for the genesis block.
* `address`: `DATA|Array`, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
* `topics`: `Array of DATA`, - (optional) Array of 32 Bytes `DATA` topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
params: [
  {
    "fromBlock": "latest",
    "address": "0x4200000000000000000000000000000000000006"
  }
]
```

## **Returns**

`QUANTITY`  - A filter id.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 73,
  "result": "0xcab18b86a697e3fee240fa0bf231dcbf"
}
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  curl https://mainnet.unichain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock":"latest","address":"0x4200000000000000000000000000000000000006"}],"id":73}'
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.