# human\_protocol\_sdk.filter module

### *class* human\_protocol\_sdk.filter.EscrowFilter(chain\_id, launcher=None, reputation\_oracle=None, recording\_oracle=None, exchange\_oracle=None, job\_requester\_id=None, status=None, date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Bases: `object`

A class used to filter escrow requests.

#### \_\_init\_\_(chain\_id, launcher=None, reputation\_oracle=None, recording\_oracle=None, exchange\_oracle=None, job\_requester\_id=None, status=None, date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Initializes a EscrowFilter instance.

* **Parameters:**
  * **chain\_id** ([`ChainId`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.ChainId)) – Network to request data
  * **launcher** (`Optional`\[`str`]) – Launcher address
  * **reputation\_oracle** (`Optional`\[`str`]) – Reputation oracle address
  * **recording\_oracle** (`Optional`\[`str`]) – Recording oracle address
  * **exchange\_oracle** (`Optional`\[`str`]) – Exchange oracle address
  * **job\_requester\_id** (`Optional`\[`str`]) – Job requester id
  * **status** (`Optional`\[[`Status`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.Status)]) – Escrow status
  * **date\_from** (`Optional`\[`datetime`]) – Created from date
  * **date\_to** (`Optional`\[`datetime`]) – Created to date
  * **first** (`int`) – Number of items per page
  * **skip** (`int`) – Page number to retrieve
  * **order\_direction** ([`OrderDirection`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.OrderDirection)) – Order of results, “asc” or “desc”

### *exception* human\_protocol\_sdk.filter.FilterError

Bases: `Exception`

Raises when some error happens when building filter object.

### *class* human\_protocol\_sdk.filter.PayoutFilter(chain\_id, escrow\_address=None, recipient=None, date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Bases: `object`

A class used to filter payout requests.

#### \_\_init\_\_(chain\_id, escrow\_address=None, recipient=None, date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Initializes a filter for payouts.

* **Parameters:**
  * **chain\_id** ([`ChainId`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.ChainId)) – The chain ID where the payouts are recorded.
  * **escrow\_address** (`Optional`\[`str`]) – Optional escrow address to filter payouts.
  * **recipient** (`Optional`\[`str`]) – Optional recipient address to filter payouts.
  * **date\_from** (`Optional`\[`datetime`]) – Optional start date for filtering.
  * **date\_to** (`Optional`\[`datetime`]) – Optional end date for filtering.
  * **first** (`int`) – Optional number of payouts per page. Default is 10.
  * **skip** (`int`) – Optional number of payouts to skip. Default is 0.
  * **order\_direction** ([`OrderDirection`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.OrderDirection)) – Optional order direction. Default is DESC.

### *class* human\_protocol\_sdk.filter.StatisticsFilter(date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.ASC)

Bases: `object`

A class used to filter statistical data.

* **Parameters:**
  * **date\_from** (`Optional`\[`datetime`]) – Start date for the query range.
  * **date\_to** (`Optional`\[`datetime`]) – End date for the query range.
  * **first** (`int`) – Number of items per page.
  * **skip** (`int`) – Page number to retrieve.
  * **order\_direction** ([`OrderDirection`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.OrderDirection)) – Order of results, “asc” or “desc”.
* **Example:**

  ```python
  from datetime import datetime
  from human_protocol_sdk.filter import StatisticsFilter

  filter = StatisticsFilter(
      date_from=datetime(2023, 1, 1),
      date_to=datetime(2023, 12, 31),
      first=10,
      skip=0,
      order_direction=OrderDirection.ASC
  )
  ```

#### \_\_init\_\_(date\_from=None, date\_to=None, first=10, skip=0, order\_direction=OrderDirection.ASC)

### *class* human\_protocol\_sdk.filter.StatusEventFilter(chain\_id, statuses=None, date\_from=None, date\_to=None, launcher=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Bases: `object`

#### \_\_init\_\_(chain\_id, statuses=None, date\_from=None, date\_to=None, launcher=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Initializes a filter for status events.

* **Parameters:**
  * **chain\_id** ([`ChainId`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.ChainId)) – The chain ID where the events are recorded.
  * **statuses** (`Optional`\[`List`\[[`Status`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.Status)]]) – Optional list of statuses to filter by.
  * **date\_from** (`Optional`\[`datetime`]) – Optional start date for filtering.
  * **date\_to** (`Optional`\[`datetime`]) – Optional end date for filtering.
  * **launcher** (`Optional`\[`str`]) – Optional launcher address to filter by.
  * **first** (`int`) – Optional number of events per page. Default is 10.
  * **skip** (`int`) – Optional number of events to skip. Default is 0.
  * **order\_direction** ([`OrderDirection`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.OrderDirection)) – Optional order direction. Default is DESC.

### *class* human\_protocol\_sdk.filter.TransactionFilter(chain\_id, from\_address=None, to\_address=None, start\_date=None, end\_date=None, start\_block=None, end\_block=None, method=None, escrow=None, token=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Bases: `object`

A class used to filter transactions.

#### \_\_init\_\_(chain\_id, from\_address=None, to\_address=None, start\_date=None, end\_date=None, start\_block=None, end\_block=None, method=None, escrow=None, token=None, first=10, skip=0, order\_direction=OrderDirection.DESC)

Initializes a TransactionsFilter instance.

* **Parameters:**
  * **chain\_id** ([`ChainId`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.ChainId)) – Chain ID to filter transactions from
  * **from\_address** (`Optional`\[`str`]) – Sender address
  * **to\_address** (`Optional`\[`str`]) – Receiver address
  * **start\_date** (`Optional`\[`datetime`]) – Start date for filtering transactions
  * **end\_date** (`Optional`\[`datetime`]) – End date for filtering transactions
  * **start\_block** (`Optional`\[`int`]) – Start block number for filtering transactions
  * **end\_block** (`Optional`\[`int`]) – End block number for filtering transactions
  * **method** (`Optional`\[`str`]) – Method name to filter transactions
  * **escrow** (`Optional`\[`str`]) – Escrow address to filter transactions
  * **token** (`Optional`\[`str`]) – Token address to filter transactions
  * **first** (`int`) – Number of items per page
  * **skip** (`int`) – Page number to retrieve
  * **order** – Order of results, “asc” or “desc”
* **Raises:** **ValueError** – If start\_date is after end\_date

### *class* human\_protocol\_sdk.filter.WorkerFilter(chain\_id, worker\_address=None, order\_by='payoutCount', order\_direction=OrderDirection.DESC, first=10, skip=0)

Bases: `object`

A class used to filter workers.

#### \_\_init\_\_(chain\_id, worker\_address=None, order\_by='payoutCount', order\_direction=OrderDirection.DESC, first=10, skip=0)

Initializes a WorkerFilter instance.

* **Parameters:**
  * **chain\_id** ([`ChainId`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.ChainId)) – Chain ID to request data
  * **worker\_address** (`Optional`\[`str`]) – Address to filter by
  * **order\_by** (`Optional`\[`str`]) – Property to order by, e.g., “payoutCount”
  * **order\_direction** ([`OrderDirection`](https://sdk.humanprotocol.org/human-protocol-sdk/v4.1.5/human_protocol_sdk.constants#human_protocol_sdk.constants.OrderDirection)) – Order direction of results, “asc” or “desc”
  * **first** (`int`) – Number of items per page
  * **skip** (`int`) – Number of items to skip (for pagination)
