> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zyf.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# waitForWithdrawSettlement

> Short poll until sync withdraw settles or async enters cooldown or claiming.

Polls [`getWithdrawStatus`](/docs/sdk/api/get-withdraw-status) until the withdrawal reaches a **settlement terminal** state: sync work finished, or async legs are in cooldown or already claiming. Use this right after [`withdrawFunds`](/docs/sdk/api/withdraw-funds) when you need to know whether the call can return without waiting through a multi-day async cooldown.

If the terminal status is `async_cooldown` or `async_claiming`, follow with [`waitForWithdrawComplete`](/docs/sdk/api/wait-for-withdraw-complete) to wait until funds land on the EOA. If the terminal status is `completed`, the withdrawal is already done.

Requires `connectAccount()` on the **same** `ZyfaiSDK` instance.

## Signature

```typescript theme={null}
waitForWithdrawSettlement(
  withdrawalId: string,
  chainId: SupportedChainId,
  options?: WaitForWithdrawSettlementOptions,
): Promise<WithdrawLifecycleResponse>
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | :-: | - |
| `withdrawalId` | `string` | ✅ | Lifecycle UUID from `withdrawFunds().lifecycle.id` |
| `chainId` | `SupportedChainId` | ✅ | Chain withdrawn on (`1`, `8453`, or `42161`) |
| `options` | `WaitForWithdrawSettlementOptions` | ❌ | Poll interval and timeout overrides |

```typescript theme={null}
interface WaitForWithdrawSettlementOptions {
  intervalMs?: number;
  timeoutMs?: number;
}
```

Default polling matches [`waitForDepositPosition`](/docs/sdk/api/wait-for-deposit-position): Ethereum 4s / 180s, Base and Arbitrum 1s / 90s.

## Terminal statuses

This helper returns when `status` is one of:

| Status | Meaning |
| - | - |
| `completed` | Entire withdrawal finished (including async claim when applicable) |
| `async_cooldown` | Async redemption requested; protocol cooldown in progress |
| `async_claiming` | Claim in flight (for example resume after cooldown) |

Statuses such as `accepted`, `redeeming`, `transferring`, and `async_requesting` keep polling until one of the terminal states above or `failed`.

<Info title="Resume and retry">
  Treat `async_claiming` as terminal for this **short** poll so integrations that poll again after cooldown do not hit a spurious timeout while claim is already running.
</Info>

## Errors

| Condition | Error |
| - | - |
| `status === "failed"` | `Withdraw {id} failed: {lastError}` |
| Timeout | `Timed out waiting for withdraw lifecycle {id} to settle` (`WithdrawSettlementTimeoutError`) |

## Example

```typescript theme={null}
const withdrawn = await sdk.withdrawFunds(userAddress, 8453);
const withdrawalId = withdrawn.lifecycle!.id;

const settled = await sdk.waitForWithdrawSettlement(withdrawalId, 8453);

if (settled.status === "completed") {
  console.log("Withdrawal complete");
} else {
  const completed = await sdk.waitForWithdrawComplete(withdrawalId, 8453);
  console.log(completed.status);
}
```

## Related methods

* [`waitForWithdrawComplete`](/docs/sdk/api/wait-for-withdraw-complete) — long poll through async cooldown
* [`getWithdrawStatus`](/docs/sdk/api/get-withdraw-status) — single fetch


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.