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

# `l1.finalizeWithdrawal`

Finalizes an OP Stack withdrawal on L1.

## Usage

Submit a proven withdrawal to the Optimism Portal after its finalization delay has elapsed.

:::code-group
```ts twoslash [example.ts]
import { optimism } from 'viem/chains'
import type { Withdrawal } from 'viem/op-stack'
import { client } from './viem.config'

declare const withdrawal: Withdrawal.Withdrawal

const hash = await client.withdrawal.finalizeWithdrawal({ // [!code focus]
  account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', // [!code focus]
  targetChain: optimism, // [!code focus]
  withdrawal, // [!code focus]
}) // [!code focus]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l1.config.ts:setup]
```
:::

### Standalone Action

Call `Actions.l1.finalizeWithdrawal` directly by passing the [Client](/docs/clients) as the first argument.

:::code-group
```ts twoslash [example.ts]
import { optimism } from 'viem/chains'
import { Actions, type Withdrawal } from 'viem/op-stack'
import { client } from './viem.config'

declare const withdrawal: Withdrawal.Withdrawal

const hash = await Actions.l1.finalizeWithdrawal(client, { // [!code focus]
  account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', // [!code focus]
  targetChain: optimism, // [!code focus]
  withdrawal, // [!code focus]
}) // [!code focus]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l1.config.ts:setup]
```
:::

## Return Value

`Hex`

The L1 transaction hash.

## Parameters

### account

* **Type:** `Account | Address`

The [Account](/docs/accounts) that sends the finalization transaction. Required when the Client has no Account.

### chain

* **Type:** `Chain | null`
* **Default:** `client.chain`

The L1 chain on which the finalization transaction is sent.

### gas

* **Type:** `bigint | null`

The gas limit for the L1 transaction.

### maxFeePerGas

* **Type:** `bigint`

The maximum total fee per gas, in wei.

### maxPriorityFeePerGas

* **Type:** `bigint`

The maximum priority fee per gas, in wei.

### nonce

* **Type:** `number`

The L1 transaction nonce.

### portalAddress

* **Type:** `Address`

An explicit Optimism Portal address. When supplied, `targetChain` is optional.

### proofSubmitter

* **Type:** `Address | null`

The proof submitter used by portals that support external-proof finalization.

### targetChain

* **Type:** `Chain`

The OP Stack L2 [Chain](/docs/chains) whose portal contract is used.

### withdrawal

* **Type:** `Withdrawal.Withdrawal`

The proven withdrawal to finalize.
