payLightningInvoice(params: PayLightningInvoiceParams)
Pays a Lightning invoice.
params: Object containing:invoice: The BOLT11-encoded Lightning invoice to pay.maxFeeSats: Maximum fee in satoshis to pay for the invoice.preferSpark: (Optional) Boolean that defaults tofalse. WhenpreferSparkis set totrue, Spark wallets will initiate a Spark transfer instead of a Lightning transfer if a valid Spark address is found in the invoice. If not, a regular Lightning payment will occur.amountSatsToSend: (Optional) Amount in satoshis to send. This parameter is only used for zero-amount invoices. For regular invoices with a fixed amount, this parameter is ignored.
Promise<LightningSendRequest>: The Lightning payment request details
createLightningInvoice(params)
Creates a Lightning invoice for receiving payments.
params: Object containing:amountSats: Amount in satoshismemo: (Optional) Description for the invoiceexpirySeconds: (Optional) Expiry time in seconds, defaults to 30 daysincludeSparkAddress: (Optional) By passing intrue, a 36-byte string consisting of a recognizable header and a receiver’s compressed identity public keySPK:identitypubkeywill get embedded in the fallback address (f) field of a BOLT11 invoicereceiverIdentityPubkey: (Optional) To generate an invoice for another Spark user, pass in the 33-byte compressed identity pubkey as a string
Promise<LightningReceiveRequest>: The Lightning receive request details
getLightningReceiveRequest(id: string)
Gets the status of a Lightning receive request (invoice).
id: The ID of the invoice to check.
Promise<LightningReceiveRequest | null>: The Lightning receive request details or null if not found.
getLightningSendRequest(id: string)
Gets the status of a Lightning send request.
id: The ID of the Lightning send request to check.
Promise<LightningSendRequest | null>: The Lightning send request details or null if not found.
getLightningSendFeeEstimate(params)
Estimates the fee for sending a Lightning payment.
params: Object containing:encodedInvoice: The BOLT11-encoded Lightning invoice.
Promise<number>: The estimated fee in satoshis.