feat: render embedded invoices (#392)

This commit is contained in:
Daniel Vergara
2025-06-19 08:12:06 -06:00
committed by GitHub
parent d7dc098995
commit f25b742877
7 changed files with 126 additions and 0 deletions

View File

@@ -154,6 +154,27 @@ class LightningService {
})
}
async payInvoice(invoice: string, closeOuterModel?: () => void): Promise<{ preimage: string; invoice: string } | null> {
if (this.provider) {
const { preimage } = await this.provider.sendPayment(invoice)
closeOuterModel?.()
return { preimage, invoice: invoice }
}
return new Promise((resolve) => {
closeOuterModel?.()
launchPaymentModal({
invoice: invoice,
onPaid: (response) => {
resolve({ preimage: response.preimage, invoice: invoice })
},
onCancelled: () => {
resolve(null)
}
})
})
}
async fetchRecentSupporters() {
if (this.recentSupportersCache) {
return this.recentSupportersCache