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

Returns the current lifecycle status of an OP Stack withdrawal.

## Usage

Derive the withdrawal and its current status from an L2 transaction receipt.

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

declare const receipt: TransactionReceipt.TransactionReceipt

const status = await client.withdrawal.getWithdrawalStatus({ // [!code focus]
  receipt, // [!code focus]
  targetChain: optimism, // [!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.getWithdrawalStatus` 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 TransactionReceipt } from 'viem/op-stack'
import { client } from './viem.config'

declare const receipt: TransactionReceipt.TransactionReceipt

const status = await Actions.l1.getWithdrawalStatus(client, { // [!code focus]
  receipt, // [!code focus]
  targetChain: optimism, // [!code focus]
}) // [!code focus]
```

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

## Return Value

```ts
'finalized'
  | 'ready-to-finalize'
  | 'ready-to-prove'
  | 'waiting-to-finalize'
  | 'waiting-to-prove'
```

The current withdrawal lifecycle status.

## Parameters

### chain

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

The L1 chain used to read the contracts.

### disputeGameFactoryAddress

* **Type:** `Address`

An explicit Dispute Game Factory address. Supply all three explicit addresses when omitting `targetChain`.

### gameLimit

* **Type:** `number`
* **Default:** `100`

The maximum number of recent dispute games to inspect.

### l2BlockNumber

* **Type:** `bigint`

The withdrawal's L2 block number. Required with `sender` and `withdrawalHash` when `receipt` is omitted.

### l2OutputOracleAddress

* **Type:** `Address`

An explicit L2 Output Oracle address. Supply all three explicit addresses when omitting `targetChain`.

### l2Timestamp

* **Type:** `bigint`

The L2 timestamp used as the position for super-root games.

### logIndex

* **Type:** `number`
* **Default:** `0`

The relative withdrawal log index within `receipt`.

### portalAddress

* **Type:** `Address`

An explicit Optimism Portal address. Supply all three explicit addresses when omitting `targetChain`.

### receipt

* **Type:** `TransactionReceipt`

The L2 withdrawal transaction receipt. Use this form instead of the direct withdrawal fields.

### sender

* **Type:** `Address`

The withdrawal sender. Required with `l2BlockNumber` and `withdrawalHash` when `receipt` is omitted.

### targetChain

* **Type:** `Chain`

The OP Stack L2 [Chain](/docs/chains) whose L1 contracts are used.

### withdrawalHash

* **Type:** `Hex`

The withdrawal hash. Required with `l2BlockNumber` and `sender` when `receipt` is omitted.
