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

# getWithdrawalFeeQuote

> Get fee quote for on-chain withdrawal at fast, medium, or slow speeds.

Gets a fee quote for a cooperative exit (on-chain withdrawal) for the `SparkWallet`. The quote includes options for different speeds and an expiry time.

## Method Signature

```typescript theme={null}
async getWithdrawalFeeQuote({
  amountSats,
  withdrawalAddress,
}: {
  amountSats: number;
  withdrawalAddress: string;
}): Promise<CoopExitFeeQuote | null>
```

## Parameters

<ResponseField name="amountSats" type="number" required>
  The amount in satoshis to withdraw
</ResponseField>

<ResponseField name="withdrawalAddress" type="string" required>
  The Bitcoin address where the funds should be sent
</ResponseField>

## Returns

<ResponseField name="feeQuote" type="CoopExitFeeQuote | null" required>
  A fee quote for the withdrawal, or null if not available
</ResponseField>

### CoopExitFeeQuote Fields

| Field                  | Type             | Description                                    |
| ---------------------- | ---------------- | ---------------------------------------------- |
| `id`                   | `string`         | Quote ID (use as `feeQuoteId` in `withdraw()`) |
| `expiresAt`            | `string`         | When this quote expires                        |
| `userFeeFast`          | `CurrencyAmount` | Service fee for fast exit                      |
| `userFeeMedium`        | `CurrencyAmount` | Service fee for medium exit                    |
| `userFeeSlow`          | `CurrencyAmount` | Service fee for slow exit                      |
| `l1BroadcastFeeFast`   | `CurrencyAmount` | L1 tx fee for fast exit                        |
| `l1BroadcastFeeMedium` | `CurrencyAmount` | L1 tx fee for medium exit                      |
| `l1BroadcastFeeSlow`   | `CurrencyAmount` | L1 tx fee for slow exit                        |

`CurrencyAmount` has `originalValue` (number in satoshis) and `originalUnit` fields.

## Example

```typescript theme={null}
const feeQuote = await wallet.getWithdrawalFeeQuote({
  amountSats: 17000,
  withdrawalAddress: "bcrt1p..."
});

if (feeQuote) {
  console.log("Quote expires:", feeQuote.expiresAt);
  console.log("Fast fee:", feeQuote.userFeeFast.originalValue + feeQuote.l1BroadcastFeeFast.originalValue, "sats");
  console.log("Medium fee:", feeQuote.userFeeMedium.originalValue + feeQuote.l1BroadcastFeeMedium.originalValue, "sats");
  console.log("Slow fee:", feeQuote.userFeeSlow.originalValue + feeQuote.l1BroadcastFeeSlow.originalValue, "sats");
}
```
