SparkWallet.
Method Signature
Parameters
string
required
The BOLT11-encoded Lightning invoice to pay
number
required
Maximum fee in satoshis to pay for the invoice
boolean
When
true, initiate a Spark transfer if a valid Spark address is found in the invoice (default: false)number
Amount in satoshis to send for zero-amount invoices. Rejected if the invoice already specifies an amount.
UUID
Optional transfer UUID for retrying the same logical payment. Generate it with
generateTransferId() from the SDK and persist it before the first attempt. Reuse the same ID and payment parameters when retrying; do not generate a new ID for each attempt. This is a UUID object, not an arbitrary string. Reconcile a failed attempt before retrying.Returns
LightningSendRequest | WalletTransfer
required
The Lightning payment request details, or a
WalletTransfer if preferSpark is true and a valid Spark address was found in the invoiceThe payment preimage is not returned immediately. To retrieve the preimage after payment completes, call
getLightningSendRequest(id) with the returned request ID.When
preferSpark: true and the invoice contains a valid Spark fallback address, the method returns a WalletTransfer instead of LightningSendRequest. If no valid Spark address is found, it falls back to Lightning.