# Using Filters

Filters are a set of conditions and values that allow you to specify the onchain event that should trigger a notification. You can quickly set parameters on any field in the payload. Filters are created using `field_name`, `operator`, `value_type`, and `value`.

<table><thead><tr><th width="177">Name</th><th>Definition</th></tr></thead><tbody><tr><td><code>field_name</code></td><td>The specific attribute within the event data that you want to filter on. See a complete <a href="#list-of-variables">list of filters</a> below.</td></tr><tr><td><code>operator</code></td><td>Specifies the logical or comparison operation to apply between the <code>field_name</code> and <code>value</code>. See complete<a href="#list-of-operators"> list of operators</a> below.</td></tr><tr><td><code>value_type</code></td><td>The data type of the value you are filtering with</td></tr><tr><td><code>value</code></td><td>The actual value or list of values to compare against the specified <code>operator</code></td></tr></tbody></table>

#### Example Request:

```json
 "filters": [
            { "field_name": str, "operator": str, "value": str, "value_type": str },
            # ... more filters if needed
        ],
```

### List of Operators

Operators must be used with a valid value type to successfully create the notification.

<table><thead><tr><th width="186">Operator</th><th width="403">Definition</th><th>Value_Type</th></tr></thead><tbody><tr><td><code>eq</code></td><td>variable is equal to a value [ = ]</td><td>int, float, str, boolean</td></tr><tr><td><code>neq</code></td><td>variable does not equal a value [ != ]</td><td>int, float, str, boolean</td></tr><tr><td><code>gt</code></td><td>variable is greater than a value [ > ]</td><td>int, float</td></tr><tr><td><code>lt</code></td><td>variable is less than a value [ &#x3C; ]</td><td>int, float</td></tr><tr><td><code>in</code></td><td>variable is in a list </td><td>list</td></tr><tr><td><code>nin</code></td><td>variable is <em>not</em> in a list</td><td>list</td></tr><tr><td><code>contains</code></td><td>a list contains the variable</td><td>string</td></tr><tr><td><code>ncontains</code></td><td>a list does <em>not</em> contain the variable</td><td>string</td></tr></tbody></table>

### List of Variables

You can apply filters on any of the data fields in the primary payload. Please reference the tables below for list of `field_names` and corresponding `value_type`.

#### Address\_Activity Filters

<table><thead><tr><th width="228">Field Name</th><th width="405">Definition</th><th>Value Type</th></tr></thead><tbody><tr><td><code>hash</code></td><td>The unique hash identifying the transaction on the blockchain.</td><td><code>str</code></td></tr><tr><td><code>fromAddress</code></td><td>The address sending the asset in a transaction.</td><td><code>str</code></td></tr><tr><td><code>toAddress</code></td><td>The address receiving the asset in a transaction.</td><td><code>str</code></td></tr><tr><td><code>asset</code></td><td>The symbol or address of the asset or token involved in the transaction. (e.g. <code>ETH</code>, <code>USDC</code>)</td><td><code>str</code></td></tr><tr><td><code>value</code></td><td>The amount of the asset or token transferred or exchanged in the transaction.</td><td><code>int</code> </td></tr><tr><td><code>blockNum</code></td><td>The block number in which the transaction was included.</td><td><code>int</code></td></tr><tr><td><code>category</code></td><td>The category of the transaction (e.g., "external", "internal").</td><td><code>str</code></td></tr></tbody></table>

#### GraphQL Filters

<table><thead><tr><th width="292">Field Name</th><th width="332">Definition</th><th>Value Type</th></tr></thead><tbody><tr><td><code>transaction.hash</code></td><td>The hash of the transaction.</td><td><code>str</code></td></tr><tr><td><code>transaction.from.address</code></td><td>The sender address of the transaction.</td><td><code>str</code></td></tr><tr><td><code>transaction.to.address</code></td><td>The recipient address of the transaction</td><td><code>str</code></td></tr><tr><td><code>transaction.value</code></td><td>The value of the transaction</td><td><code>int</code></td></tr></tbody></table>

Note: additional filters on event address and topic-level parameters can be applied in the GRAPHQL object. See [Smart Contracts ](https://docs.nodefy.xyz/our-api-guide/defining-event-types/smart-contracts)for more detail.

#### NFT\_Activity Filters

<table><thead><tr><th width="248">Field Name</th><th width="401">Definition</th><th>Value Type</th></tr></thead><tbody><tr><td><code>hash</code></td><td>The unique hash identifying the transaction on the blockchain.</td><td><code>str</code></td></tr><tr><td><code>fromAddress</code></td><td>The address sending the NFT in a transfer or sale.</td><td><code>str</code></td></tr><tr><td><code>toAddress</code></td><td>The address receiving the NFT in a transfer or sale.</td><td><code>str</code></td></tr><tr><td><code>asset</code></td><td>The address of the NFT contract.</td><td><code>str</code></td></tr><tr><td><code>erc721TokenId</code></td><td>The unique identifier (token ID) of the NFT involved in the event.</td><td><code>int</code></td></tr><tr><td><code>log.logIndex</code></td><td>The index of the log within the block.</td><td><code>int</code></td></tr><tr><td><code>log.blockHash</code></td><td>The hash of the block in which the transaction occurred.</td><td><code>str</code></td></tr><tr><td><code>log.transactionIndex</code></td><td>The index of the transaction within the block.</td><td><code>int</code></td></tr><tr><td><code>log.blockNumber</code></td><td>The block number in which the transaction was included.</td><td><code>int</code></td></tr><tr><td><code>log.data</code></td><td>The raw data associated with the event log.</td><td><code>str</code></td></tr><tr><td><code>log.topics.text</code></td><td>A text representation of the topics (indexed parameters) of the event log.</td><td><code>str</code></td></tr><tr><td><code>log.topics</code></td><td>The topics (indexed parameters) of the event log.</td><td><code>list</code></td></tr><tr><td><code>log.address</code></td><td>The address of the contract that emitted the event.</td><td><code>str</code></td></tr></tbody></table>

#### Farcaster\_Cast Filters:

<table><thead><tr><th width="278">Field Name</th><th width="354">Definition</th><th>Value Type</th></tr></thead><tbody><tr><td><code>hash</code></td><td>The unique hash identifying the cast on Farcaster.</td><td><code>str</code></td></tr><tr><td><code>text</code></td><td>The text content of the cast.</td><td><code>str</code></td></tr><tr><td><code>author.fid</code></td><td>The Farcaster ID (FID) of the author of the cast.</td><td><code>int</code></td></tr><tr><td><code>author.username</code></td><td>The username of the author of the cast.</td><td><code>str</code></td></tr><tr><td><code>author.display.name</code></td><td>The display name of the author of the cast.</td><td><code>str</code></td></tr><tr><td><code>author.pfp.url</code></td><td>The URL of the author's profile picture.</td><td><code>str</code></td></tr><tr><td><code>author.profile.bio.text</code></td><td>The text of the author's profile bio.</td><td><code>str</code></td></tr><tr><td><code>author.follower.count</code></td><td>The number of followers the author has.</td><td><code>int</code></td></tr><tr><td><code>author.following.count</code></td><td>The number of users the author is following.</td><td><code>int</code></td></tr><tr><td><code>power_badge</code></td><td>A boolean of the author's power badge status</td><td><code>boolean</code></td></tr><tr><td><code>timestamp</code></td><td>The timestamp of when the cast was created.</td><td><code>int</code></td></tr><tr><td><code>parent.url</code></td><td>The URL of the farcaster channel</td><td><code>str</code></td></tr><tr><td><code>parent.hash</code></td><td>The hash of the farcaster channel</td><td><code>str</code></td></tr><tr><td><code>thread.hash</code></td><td>The hash of the thread this cast belongs to.</td><td><code>str</code></td></tr><tr><td><code>replies.count</code></td><td>The number of replies to this cast.</td><td><code>int</code></td></tr><tr><td><code>reactions.recasts.text</code></td><td>A text representation of the recast (re-share) reactions to this cast.</td><td><code>str</code></td></tr><tr><td><code>reactions.recasts</code></td><td>An array of recast (re-share) reactions to this cast.</td><td><code>list</code></td></tr><tr><td><code>reactions.likes.text</code></td><td>The like reactions to this cast.</td><td><code>str</code></td></tr><tr><td><code>reactions.likes</code></td><td>An array of like reactions to this cast.</td><td><code>list</code></td></tr></tbody></table>
