From d19e619e3eb16c69e3acc425c664e048090e9510 Mon Sep 17 00:00:00 2001 From: arcbtc Date: Fri, 16 Aug 2024 05:25:01 +0100 Subject: [PATCH] some tweaks --- helpers.py | 3 ++- templates/lnurldevice/atm.html | 16 +++++++++------- templates/lnurldevice/index.html | 2 +- views.py | 16 ++++++++-------- views_api.py | 27 +++++++++++++-------------- views_lnurl.py | 10 +++++----- 6 files changed, 38 insertions(+), 36 deletions(-) diff --git a/helpers.py b/helpers.py index 548fa2a..1f7f183 100644 --- a/helpers.py +++ b/helpers.py @@ -21,8 +21,9 @@ async def register_atm_payment(device, p): data = base64.urlsafe_b64decode(p) decrypted = xor_decrypt(device.key.encode(), data) price_msat = await fiat_amount_as_satoshis(float(decrypted[1]) / 100, device.currency) * 1000 if device.currency != "sat" else decrypted[1] * 1000 + price_msat = int(price_msat * ((device.profit / 100) + 1)) lnurldevicepayment = await create_lnurldevicepayment(deviceid=device.id, payload=p, sats=price_msat / 1000, pin=decrypted[0], payhash="payment_hash") - return lnurldevicepayment + return lnurldevicepayment, price_msat def xor_decrypt(key, blob): s = BytesIO(blob) diff --git a/templates/lnurldevice/atm.html b/templates/lnurldevice/atm.html index ca50498..a603be0 100644 --- a/templates/lnurldevice/atm.html +++ b/templates/lnurldevice/atm.html @@ -22,14 +22,16 @@ - - Amount is too small to send over onchain + Amount is too small to send over onchain, needs to be 10000+ sats + Onchain not available - - Amount is too small to send over onchain + Amount is too small to send over liquid, needs to be 2000+ sats + Onchain not available @@ -55,7 +57,7 @@
Lightning / LNaddress / LNURL-pay
@@ -65,7 +67,7 @@ - +
Onchain
- +
Liquid