diff --git a/lnbits/extensions/lndhub/config.json b/lnbits/extensions/lndhub/config.json index 584acf0..2b536d7 100644 --- a/lnbits/extensions/lndhub/config.json +++ b/lnbits/extensions/lndhub/config.json @@ -1,5 +1,5 @@ { - "name": "lndhub", + "name": "LndHub", "short_description": "Access lnbits from BlueWallet or Zeus.", "icon": "navigation", "contributors": ["fiatjaf"] diff --git a/lnbits/extensions/lndhub/templates/lndhub/_instructions.html b/lnbits/extensions/lndhub/templates/lndhub/_instructions.html new file mode 100644 index 0000000..4db79ab --- /dev/null +++ b/lnbits/extensions/lndhub/templates/lndhub/_instructions.html @@ -0,0 +1,35 @@ + + + + To access an LNbits wallet from a mobile phone, +
    +
  1. + Install either Zeus or + BlueWallet; +
  2. +
  3. + Go to Add a wallet / Import wallet on BlueWallet or + Settings / Add a new node on Zeus. +
  4. +
  5. Select the desired wallet on this page;
  6. +
  7. Scan one of the two QR codes from the mobile wallet.
  8. +
+
    +
  • + Invoice URLs mean the mobile wallet will only have the + authorization to read your payments and invoices and generate new + invoices. +
  • +
  • + Admin URLs mean the mobile wallet will be able to pay + invoices.. +
  • +
+
+
+
diff --git a/lnbits/extensions/lndhub/templates/lndhub/_lndhub.html b/lnbits/extensions/lndhub/templates/lndhub/_lndhub.html new file mode 100644 index 0000000..a15cab8 --- /dev/null +++ b/lnbits/extensions/lndhub/templates/lndhub/_lndhub.html @@ -0,0 +1,19 @@ + + + +

+ LndHub is a protocol invented by + BlueWallet that allows mobile + wallets to query payments and balances, generate invoices and make + payments from accounts that exist on a server. The protocol is a + collection of HTTP endpoints exposed through the internet. +

+

+ For a wallet that supports it, reading a QR code that contains the URL + along with secret access credentials should enable access. Currently it + is supported by Zeus and + BlueWallet. +

+
+
+
diff --git a/lnbits/extensions/lndhub/templates/lndhub/index.html b/lnbits/extensions/lndhub/templates/lndhub/index.html index 36c8b7b..7e95549 100644 --- a/lnbits/extensions/lndhub/templates/lndhub/index.html +++ b/lnbits/extensions/lndhub/templates/lndhub/index.html @@ -1,28 +1,93 @@ {% extends "base.html" %} {% from "macros.jinja" import window_vars with context -%} {% block page %} - - -
- {% for wallet in g.user.wallets %} +%} {% block page %} {% raw %} +
+
+
+ + + +
+ Copy LndHub {{type}} URL +
+
+
+
+ + + + + + + +
+ + {% endraw %} + +
- - lndhub://admin:{{wallet.adminkey}}@{% raw %}{{baseURL}}{% endraw %}/lndhub/ext/ - + +
+ LNbits LndHub extension +
+
+ + + + {% include "lndhub/_instructions.html" %} + + {% include "lndhub/_lndhub.html" %} + +
- {% endfor %} - - - +
+
+ {% endblock %} {% block scripts %} {{ window_vars(user) }} + {% endblock %} diff --git a/lnbits/extensions/lndhub/views.py b/lnbits/extensions/lndhub/views.py index aaf9202..81e4c69 100644 --- a/lnbits/extensions/lndhub/views.py +++ b/lnbits/extensions/lndhub/views.py @@ -1,4 +1,4 @@ -from flask import render_template +from flask import render_template, g from lnbits.decorators import check_user_exists, validate_uuids from lnbits.extensions.lndhub import lndhub_ext @@ -8,4 +8,4 @@ from lnbits.extensions.lndhub import lndhub_ext @validate_uuids(["usr"], required=True) @check_user_exists() def lndhub_index(): - return render_template("lndhub/index.html") + return render_template("lndhub/index.html", user=g.user)