Skip to main content

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.

Gets the estimated fee for a swap of leaves for the SparkWallet.

Method Signature

async getSwapFeeEstimate(amountSats: number): Promise<LeavesSwapFeeEstimateOutput>

Parameters

amountSats
number
required
The amount of sats to swap

Returns

estimate
LeavesSwapFeeEstimateOutput
required
The estimated fee for the swap

Example

const feeEstimate = await wallet.getSwapFeeEstimate(10000);
console.log("Swap fee estimate:", feeEstimate);