diff --git a/lnurl.py b/lnurl.py index 13ec543..3175a85 100644 --- a/lnurl.py +++ b/lnurl.py @@ -78,16 +78,10 @@ async def api_lnurl_callback( if comment: extra["comment"] = (comment,) + # nip 57 nostr = request.query_params.get("nostr") - nostr_description = "" if nostr: - extra["nostr"] = nostr - # print("HASHING THIS") - nostr_description = nostr # json.dumps(nostr)[1:-1] # json.dumps supposedly makes escaped "-s, remove leading and trailing " - # print(nostr_description) - import hashlib - - print(hashlib.sha256(nostr_description.encode()).hexdigest()) + extra["nostr"] = nostr # put it here for later publishing in tasks.py if lnaddress and link.username and link.domain: extra["lnaddress"] = f"{link.username}@{link.domain}" @@ -96,8 +90,8 @@ async def api_lnurl_callback( wallet_id=link.wallet, amount=int(amount / 1000), memo=link.description, - unhashed_description=nostr_description.encode() - if nostr + unhashed_description=nostr.encode() + if nostr # we take the zap request as the description instead of the LNURL metadata if present else link.lnurlpay_metadata.encode(), extra=extra, ) diff --git a/tasks.py b/tasks.py index 670f38a..0526d62 100644 --- a/tasks.py +++ b/tasks.py @@ -103,11 +103,6 @@ async def on_invoice_paid(payment: Payment): ws.send(zap_receipt.to_message()) ws.close() - from lnbits.core import bolt11 - - print( - f"Invoice description hash: {bolt11.decode(payment.bolt11).description_hash}" - ) ws = WebSocketApp( f"ws://localhost:{settings.port}/nostrclient/api/v1/relay", on_open=send_event,