Compare commits

...
8 changed files with 43 additions and 15 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+5
View File
@@ -98,6 +98,10 @@ window.localisation.en = {
view_swagger_docs: 'View LNbits Swagger API docs',
api_docs: 'API docs',
api_keys_api_docs: 'Node URL, API keys and API docs',
api_keys_warning:
'These keys should be kept safe, sharing them could risk losing funds.',
admin_key_warning:
'Your admin key grants full access to your wallet, including the ability to send payments. Never share it unless you fully trust the recipient.',
lnbits_version: 'LNbits version',
runs_on: 'Runs on',
paste: 'Paste',
@@ -116,6 +120,7 @@ window.localisation.en = {
read: 'Read',
write: 'Write',
pay: 'Pay',
sending: 'Sending',
memo: 'Memo',
date: 'Date',
path: 'Path',
@@ -1,6 +1,11 @@
window.app.component('lnbits-wallet-api-docs', {
template: '#lnbits-wallet-api-docs',
methods: {
copyAdminKey() {
LNbits.utils
.confirmDialog(this.$t('admin_key_warning'))
.onOk(() => LNbits.utils.copyText(this.g.wallet.adminkey))
},
resetKeys() {
LNbits.utils
.confirmDialog('Are you sure you want to reset your API keys?')
+15 -2
View File
@@ -7,6 +7,7 @@ window.PageWallet = {
invoice: null,
lnurlpay: null,
lnurlauth: null,
sending: false,
data: {
request: '',
amount: 0,
@@ -131,6 +132,7 @@ window.PageWallet = {
this.parse.data.request = ''
this.parse.data.comment = ''
this.parse.data.internalMemo = null
this.parse.sending = false
this.parse.data.paymentChecker = null
this.parse.camera.show = false
},
@@ -362,6 +364,9 @@ window.PageWallet = {
this.parse.invoice = Object.freeze(cleanInvoice)
},
payInvoice() {
if (this.parse.sending) return
this.parse.sending = true
const dismissPaymentMsg = Quasar.Notify.create({
timeout: 0,
message: this.$t('payment_processing')
@@ -374,6 +379,7 @@ window.PageWallet = {
this.parse.data.internalMemo
)
.then(response => {
this.parse.sending = false
dismissPaymentMsg()
this.g.updatePayments = !this.g.updatePayments
this.parse.show = false
@@ -391,13 +397,16 @@ window.PageWallet = {
}
})
.catch(err => {
this.parse.sending = false
dismissPaymentMsg()
LNbits.utils.notifyApiError(err)
this.g.updatePayments = !this.g.updatePayments
this.parse.show = false
})
},
payLnurl() {
if (this.parse.sending) return
this.parse.sending = true
LNbits.api
.request('post', '/api/v1/payments/lnurl', this.g.wallet.adminkey, {
res: this.parse.lnurlpay,
@@ -408,6 +417,7 @@ window.PageWallet = {
internalMemo: this.parse.data.internalMemo
})
.then(response => {
this.parse.sending = false
this.parse.show = false
if (response.data.extra.success_action) {
const action = JSON.parse(response.data.extra.success_action)
@@ -464,7 +474,10 @@ window.PageWallet = {
}
}
})
.catch(LNbits.utils.notifyApiError)
.catch(err => {
this.parse.sending = false
LNbits.utils.notifyApiError(err)
})
},
authLnurl() {
const dismissAuthMsg = Quasar.Notify.create({
@@ -6,9 +6,12 @@
:content-inset-level="0.5"
>
<q-card-section>
<q-banner dense rounded class="bg-warning text-black q-mb-md">
These keys should be kept safe, sharing them could risk losing funds.
</q-banner>
<q-banner
dense
rounded
class="bg-warning text-black q-mb-md"
v-text="$t('api_keys_warning')"
></q-banner>
<q-list>
<q-item dense class="q-pa-none">
<q-item-section>
@@ -69,7 +72,7 @@
<q-icon
name="content_copy"
class="cursor-pointer q-ml-sm"
@click="utils.copyText(g.wallet.adminkey)"
@click="copyAdminKey()"
></q-icon>
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
<q-popup-proxy>
+9 -2
View File
@@ -664,7 +664,8 @@
unelevated
color="primary"
@click="payInvoice"
:label="$t('pay')"
:disable="parse.sending"
:label="parse.sending ? $t('sending') + '...' : $t('pay')"
></q-btn>
<q-btn
v-close-popup
@@ -836,7 +837,13 @@
</div>
</div>
<div class="row q-mt-lg">
<q-btn unelevated color="primary" type="submit">Send</q-btn>
<q-btn
unelevated
color="primary"
type="submit"
:disable="parse.sending"
:label="parse.sending ? $t('sending') + '...' : $t('send')"
></q-btn>
<q-btn
:label="$t('cancel')"
v-close-popup
-5
View File
@@ -1,5 +1,3 @@
from collections.abc import AsyncGenerator
from loguru import logger
from .base import (
@@ -40,6 +38,3 @@ class VoidWallet(Wallet):
async def get_payment_status(self, *_, **__) -> PaymentStatus:
return PaymentPendingStatus()
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
yield ""