
Lightning Deposit Flow
The complete process for receiving Lightning payments into your Spark wallet:1
Create Invoice
Generate a Lightning invoice with the desired amount and description.
2
Share Invoice
Provide the invoice to the sender (via QR code, link, or text).
3
Monitor Payment
Track the payment status until completion.
Create Lightning Invoice
Generate Lightning invoices to receive Bitcoin payments that will be deposited into your Spark wallet.createLightningInvoice(params)
Creates a Lightning invoice for receiving Bitcoin payments.
Monitor Lightning Payments
Track incoming Lightning payments and their status using receive request monitoring.getLightningReceiveRequest(id)
Gets the status of a Lightning receive request by ID.
Real-time Payment Monitoring
Use event listeners to monitor Lightning payments in real-time.Error Handling
Implement proper error handling for Lightning invoice operations.Best Practices
- Set appropriate expiry times - Balance between urgency and flexibility
- Include clear descriptions - Help senders understand the payment purpose
- Monitor payment status - Use polling or events to track payments
- Handle expired invoices - Implement retry logic for expired invoices
- Validate amounts - Ensure amounts are reasonable and valid
- Use real-time monitoring - Implement event listeners for better UX
