This commit is contained in:
benarc
2022-01-30 19:43:30 +00:00
parent d6f145eee9
commit 228717195b
31 changed files with 278 additions and 182 deletions
+4 -2
View File
@@ -52,7 +52,7 @@ async def lnurl_callback(address_id, amount: int = Query(...)):
amount_received = amount
domain = await get_domain(address.domain)
base_url = (
address.wallet_endpoint[:-1]
if address.wallet_endpoint.endswith("/")
@@ -71,7 +71,9 @@ async def lnurl_callback(address_id, amount: int = Query(...)):
"out": False,
"amount": int(amount_received / 1000),
"description_hash": hashlib.sha256(
(await address.lnurlpay_metadata(domain=domain.domain)).encode("utf-8")
(await address.lnurlpay_metadata(domain=domain.domain)).encode(
"utf-8"
)
).hexdigest(),
"extra": {"tag": f"Payment to {address.username}@{domain.domain}"},
},
+1 -1
View File
@@ -53,5 +53,5 @@ class Addresses(BaseModel):
text = f"Payment to {self.username}"
identifier = f"{self.username}@{domain}"
metadata = [["text/plain", text], ["text/identifier", identifier]]
return LnurlPayMetadata(json.dumps(metadata))
+2 -2
View File
@@ -36,7 +36,7 @@ async def display(domain_id, request: Request):
wallet = await get_wallet(domain.wallet)
url = urlparse(str(request.url))
return lnaddress_renderer().TemplateResponse(
"lnaddress/display.html",
{
@@ -45,6 +45,6 @@ async def display(domain_id, request: Request):
"domain_domain": domain.domain,
"domain_cost": domain.cost,
"domain_wallet_inkey": wallet.inkey,
"root_url": f"{url.scheme}://{url.netloc}"
"root_url": f"{url.scheme}://{url.netloc}",
},
)