> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Filter.fromRpc

:::info
`Filter.fromRpc` is a re-export of ox's [`Filter.fromRpc`](https://oxlib.sh/api/Filter/fromRpc). Refer to the ox documentation for the full reference.
:::

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

## Imports

```ts
import { Filter } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Filter } from 'viem/utils'

const filter = Filter.fromRpc({
  address: '0xd3cda913deb6f67967b99d671a681250403edf27',
  fromBlock: 'latest',
  toBlock: '0x010f2c',
  topics: [
    '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    null,
    '0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1'
  ]
})
// @log: {
// @log:   address: '0xd3cda913deb6f67967b99d671a681250403edf27',
// @log:   fromBlock: 'latest',
// @log:   toBlock: 69420n,
// @log:   topics: [
// @log:     '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
// @log:     null,
// @log:     '0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1',
// @log:   ],
// @log: }
```

## Definition

```ts
function fromRpc(
  filter: Rpc,
): Filter
```

## Parameters

### filter

* **Type:** [`Rpc`](/docs/utilities/filter/types#filterrpc)

The RPC filter to convert.

## Return Type

An instantiated [`Filter.Filter`](/docs/utilities/filter/types#filter).

`Filter`
