From d5ae1e3d6a32c7f39c6a31d8e6562f02e62d58bd Mon Sep 17 00:00:00 2001 From: Bitkarrot <73979971+bitkarrot@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:28:25 -0800 Subject: [PATCH] feat: add getalby wallet as funding source (#2086) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial scaffolding, methods for getalby wallet * Add getAlby to docs and i18n * update alby wallet methods * change names from GetAlbyWallet to AlbyWallet * remove unused variables in AlbyFundingSource in settings.py * rename getalby.py to alby.py * fix method auth and status * resolve rolznz commented issues * rename ALBY_API_KEY to ALBY_ACCESS_TOKEN * fix desc hash in create_invoice --------- Co-authored-by: Pavol Rusnak Co-authored-by: dni ⚡ --- .env.example | 6 +- README.md | 2 +- docs/guide/faq.md | 2 +- docs/guide/wallets.md | 10 +- lnbits/settings.py | 7 + lnbits/static/bundle.min.js | 2 +- lnbits/static/i18n/br.js | 2 +- lnbits/static/i18n/cn.js | 2 +- lnbits/static/i18n/cs.js | 2 +- lnbits/static/i18n/de.js | 2 +- lnbits/static/i18n/en.js | 2 +- lnbits/static/i18n/es.js | 2 +- lnbits/static/i18n/fr.js | 2 +- lnbits/static/i18n/it.js | 2 +- lnbits/static/i18n/jp.js | 2 +- lnbits/static/i18n/nl.js | 2 +- lnbits/static/i18n/pi.js | 2 +- lnbits/static/i18n/pl.js | 2 +- lnbits/static/i18n/pt.js | 2 +- lnbits/static/i18n/sk.js | 2 +- lnbits/static/i18n/we.js | 2 +- .../js/components/lnbits-funding-sources.js | 8 ++ lnbits/static/js/service-worker.js | 2 +- lnbits/wallets/__init__.py | 1 + lnbits/wallets/alby.py | 129 ++++++++++++++++++ 25 files changed, 178 insertions(+), 21 deletions(-) create mode 100644 lnbits/wallets/alby.py diff --git a/.env.example b/.env.example index 1ede06a9d..3c2fc2c22 100644 --- a/.env.example +++ b/.env.example @@ -96,7 +96,7 @@ LNBITS_THEME_OPTIONS="classic, bitcoin, flamingo, freedom, mint, autumn, monochr # LNBITS_CUSTOM_LOGO="https://lnbits.com/assets/images/logo/logo.svg" # which fundingsources are allowed in the admin ui -LNBITS_ALLOWED_FUNDING_SOURCES="VoidWallet, FakeWallet, CoreLightningWallet, CoreLightningRestWallet, LndRestWallet, EclairWallet, LndWallet, LnTipsWallet, LNPayWallet, LNbitsWallet, OpenNodeWallet" +LNBITS_ALLOWED_FUNDING_SOURCES="VoidWallet, FakeWallet, CoreLightningWallet, CoreLightningRestWallet, LndRestWallet, EclairWallet, LndWallet, LnTipsWallet, LNPayWallet, LNbitsWallet, AlbyWallet, OpenNodeWallet" LNBITS_BACKEND_WALLET_CLASS=VoidWallet # VoidWallet is just a fallback that works without any actual Lightning capabilities, @@ -148,6 +148,10 @@ LNPAY_API_KEY=LNPAY_API_KEY # Wallet Admin in Wallet Access Keys LNPAY_WALLET_KEY=LNPAY_ADMIN_KEY +# AlbyWallet +ALBY_API_ENDPOINT=https://api.getalby.com/ +ALBY_ACCESS_TOKEN=ALBY_ACCESS_TOKEN + # OpenNodeWallet OPENNODE_API_ENDPOINT=https://api.opennode.com/ OPENNODE_KEY=OPENNODE_ADMIN_KEY diff --git a/README.md b/README.md index 5b434c449..75f231f69 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ LNbits is a Python server that sits on top of any funding source. It can be used - Fallback wallet for the LNURL scheme - Instant wallet for LN demonstrations -LNbits can run on top of any Lightning funding source. It supports LND, CLN, Eclair, Spark, LNpay, OpenNode, LightningTipBot, and with more being added regularly. +LNbits can run on top of any Lightning funding source. It supports LND, CLN, Eclair, Spark, LNpay, OpenNode, Alby, LightningTipBot, and with more being added regularly. See [LNbits Wiki](https://github.com/lnbits/lnbits/wiki/) for more detailed documentation. diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 3d72b5f78..b8b24af48 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -34,7 +34,7 @@ allow-self-payment=1
Which funding sources can I use for LNbits?

There are several ways to run a LNbits instance funded from different sources. It is important to choose a source that has a good liquidity and good peers connected. If you use LNbits for public services your users´ payments can then flow happily in both directions. If you would like to fund your LNbits wallet via btc please see section Troubleshooting.

-

The LNbits manual shows you which sources can be used and how to configure each: CLN, LND, LNPay, Cliche, OpenNode as well as bots.

+

The LNbits manual shows you which sources can be used and how to configure each: CLN, LND, LNPay, Cliche, OpenNode, Alby as well as bots.