> **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.

# Create Pending Filter \[transaction.createPendingFilter]

Creates a filter to listen for new pending transaction hashes.

Poll the filter with [`Actions.filter.getChanges`](/docs/actions/public/filter/getChanges) and tear it down with [`Actions.filter.uninstall`](/docs/actions/public/filter/uninstall).

## Usage

This example creates a filter to listen for new pending transaction hashes.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const filter = await client.transaction.createPendingFilter()
// @log: { id: '0x345a6572337856574a76364e457a4366', request: ƒ, type: 'transaction' }
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(publicActions())
```
:::

### Standalone Action

Call `Actions.transaction.createPendingFilter` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem'
import { client } from './viem.config'

const filter = await Actions.transaction.createPendingFilter(client)
// @log: { id: '0x345a6572337856574a76364e457a4366', request: ƒ, type: 'transaction' }
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```
:::

## Return Value

`Actions.filter.Filter<'transaction'>`

A pending transaction filter. Its `request` function uses the transport that created the filter ID.
