Skip to main content
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

async getWithdrawalFeeQuote({
  amountSats,
  withdrawalAddress,
}: {
  amountSats: number;
  withdrawalAddress: string;
}): Promise<WithdrawalFeeQuote | null>

Parameters

amountSats
number
required
The amount in satoshis to withdraw
withdrawalAddress
string
required
The Bitcoin address where the funds should be sent

Returns

feeQuote
WithdrawalFeeQuote | null
required
A fee quote for the withdrawal, or null if not available

Example

const feeQuote = await wallet.getWithdrawalFeeQuote({
  amountSats: 17000,
  withdrawalAddress: "bcrt1p..."
});
console.log("Fee quote:", feeQuote);