Skip to main content
Estimates the fee for sending a Lightning payment via the SparkWallet.

Method Signature

interface LightningSendFeeEstimateInput {
  encodedInvoice: string;
}

async getLightningSendFeeEstimate(params: LightningSendFeeEstimateInput): Promise<number>

Parameters

encodedInvoice
string
required
The BOLT11-encoded Lightning invoice

Returns

fee
number
required
The estimated fee in satoshis

Example

const feeEstimate = await wallet.getLightningSendFeeEstimate({
  encodedInvoice: "lnbc..."
});
console.log("Estimated fee:", feeEstimate, "sats");