feat: HodlInvoices (Rebase) (#2869)

Co-authored-by: pseudozach <git@pseudozach.com>
Co-authored-by: dni  <office@dnilabs.com>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
ziggieXXX
2025-07-15 11:15:14 +02:00
committed by dni ⚡
co-authored by pseudozach dni ⚡ Vlad Stan
parent 6e9f451419
commit f91c933919
23 changed files with 4192 additions and 6027 deletions
+14 -2
View File
@@ -21,7 +21,8 @@ window.LNbits = {
unit = 'sat',
lnurlCallback = null,
fiatProvider = null,
internalMemo = null
internalMemo = null,
payment_hash = null
) {
const data = {
out: false,
@@ -29,7 +30,8 @@ window.LNbits = {
memo: memo,
unit: unit,
lnurl_callback: lnurlCallback,
fiat_provider: fiatProvider
fiat_provider: fiatProvider,
payment_hash: payment_hash
}
if (internalMemo) {
data.extra = {
@@ -80,6 +82,16 @@ window.LNbits = {
data
)
},
cancelInvoice(wallet, paymentHash) {
return this.request('post', '/api/v1/payments/cancel', wallet.adminkey, {
payment_hash: paymentHash
})
},
settleInvoice(wallet, preimage) {
return this.request('post', `/api/v1/payments/settle`, wallet.adminkey, {
preimage: preimage
})
},
authLnurl(wallet, callback) {
return this.request('post', '/api/v1/lnurlauth', wallet.adminkey, {
callback