feat: update lnurl lib refactor lnurl endpoints (#3271)

This commit is contained in:
dni ⚡
2025-07-17 17:03:44 +03:00
committed by GitHub
parent 98f732fb6f
commit a36ab2d408
16 changed files with 417 additions and 723 deletions
+2 -37
View File
@@ -19,7 +19,7 @@ window.LNbits = {
amount,
memo,
unit = 'sat',
lnurlCallback = null,
lnurlWithdraw = null,
fiatProvider = null,
internalMemo = null,
payment_hash = null
@@ -29,7 +29,7 @@ window.LNbits = {
amount: amount,
memo: memo,
unit: unit,
lnurl_callback: lnurlCallback,
lnurl_withdraw: lnurlWithdraw,
fiat_provider: fiatProvider,
payment_hash: payment_hash
}
@@ -52,36 +52,6 @@ window.LNbits = {
}
return this.request('post', '/api/v1/payments', wallet.adminkey, data)
},
payLnurl(
wallet,
callback,
description_hash,
amount,
description = '',
comment = '',
unit = '',
internalMemo = null
) {
const data = {
callback,
description_hash,
amount,
comment,
description,
unit
}
if (internalMemo) {
data.internal_memo = String(internalMemo)
}
return this.request(
'post',
'/api/v1/payments/lnurl',
wallet.adminkey,
data
)
},
cancelInvoice(wallet, paymentHash) {
return this.request('post', '/api/v1/payments/cancel', wallet.adminkey, {
payment_hash: paymentHash
@@ -92,11 +62,6 @@ window.LNbits = {
preimage: preimage
})
},
authLnurl(wallet, callback) {
return this.request('post', '/api/v1/lnurlauth', wallet.adminkey, {
callback
})
},
createAccount(name) {
return this.request('post', '/api/v1/account', null, {
name: name