# Filter.toRpc

Converts a [`Filter.Filter`](/api/Filter/types#filter) to a [`Filter.Rpc`](/api/Filter/types#rpc).

## Imports

:::code-group
```ts [Named]
import { Filter } from 'ox'
```

```ts [Entrypoint]
import * as Filter from 'ox/Filter'
```
:::

## Examples

```ts twoslash
import { AbiEvent, Filter } from 'ox'

const transfer = AbiEvent.from(
  'event Transfer(address indexed, address indexed, uint256)'
)
const { topics } = AbiEvent.encode(transfer)

const filter = Filter.toRpc({
  address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
  topics
})
// @log: {
// @log:   address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
// @log:   topics: [
// @log:     '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
// @log:   ],
// @log: }
```

## Definition

```ts
function toRpc(
  filter: toRpc.Input,
): Rpc
```

**Source:** [src/core/Filter.ts](https://github.com/wevm/ox/blob/main/src/core/Filter.ts#L155)

## Parameters

### filter

* **Type:** `toRpc.Input`

The filter to convert.

## Return Type

An RPC filter.

[`Rpc`](/api/Filter/types#filterrpc)
