diff --git a/__pycache__/views.cpython-39.pyc b/__pycache__/views.cpython-39.pyc index ca80ade..4af6fe0 100644 Binary files a/__pycache__/views.cpython-39.pyc and b/__pycache__/views.cpython-39.pyc differ diff --git a/templates/myextension/myextension.html b/templates/myextension/myextension.html index 66f6ba5..3c95e20 100644 --- a/templates/myextension/myextension.html +++ b/templates/myextension/myextension.html @@ -7,7 +7,7 @@ @@ -15,25 +15,36 @@
- Copy LNURLCopy LNURL -
+ +
+
+ lnurlpay + +
+
+ lnurlwithdraw + +
+
+
-
LNbits LNURL-pay link
-

Use an LNURL compatible bitcoin wallet to pay.

+
Public page
+

+ Moat extensions have a public page that can be shared + (this page will still be accessible even if you have restricted + access to your LNbits install). +
+ In this example when a user pays the LNURLpay it triggers an event via a websocket waiting for the payment. +

.

@@ -51,35 +62,13 @@ mixins: [windowMixin], data: function () { return { - lnurlpay: "{{ lnurlpay|tojson }}", - lnurlwithdraw: "{{ lnurlwithdraw|tojson }}", + qrValue: '' } }, created: function () { - if (this.g.user.wallets.length) { - this.getTemps() - } + this.qrValue = '{{lnurlpay}}' }, methods: { - copyText: function (text) { - var self = this - navigator.clipboard.writeText(text).then( - function () { - self.$q.notify({ - message: 'LNURL copied to clipboard', - color: 'positive', - icon: 'done', - }) - }, - function (err) { - self.$q.notify({ - message: 'LNURL copy failed', - color: 'negative', - icon: 'error', - }) - } - ) - }, createInvoice(walletId) { console.log(walletId) const wallet = _.findWhere(this.g.user.wallets, { diff --git a/views.py b/views.py index 6dcc99e..aaaf8ff 100644 --- a/views.py +++ b/views.py @@ -33,7 +33,7 @@ async def index(request: Request, user: User = Depends(check_user_exists)): @myextension_ext.get("/{myextension_id}") async def myextension(request: Request, myextension_id): - myextension = await get_myextension(myextension_id) + myextension = await get_myextension(myextension_id, request) if not myextension: raise HTTPException( status_code=HTTPStatus.NOT_FOUND, detail="MyExtension does not exist." @@ -43,8 +43,8 @@ async def myextension(request: Request, myextension_id): { "request": request, "myextension_id": myextension_id, - "lnurlpay": myextension.lnurlpayamount, - "lnurlwithdraw": myextension.lnurlwithdrawamount, + "lnurlpay": myextension.lnurlpay, + "lnurlwithdraw": myextension.lnurlwithdraw, "web_manifest": f"/myextension/manifest/{myextension_id}.webmanifest", }, )