fix: nostr zaps (#63)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

This commit is contained in:
Vlad Stan 2024-08-07 17:26:20 +03:00 committed by GitHub
commit efb2eef323
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -125,8 +125,15 @@ async def send_zap(payment: Payment):
tags.append([t, tag[0]])
tags.append(["bolt11", payment.bolt11])
tags.append(["description", nostr])
pubkey = next((pk[1] for pk in tags if pk[0] == "p"), None)
assert pubkey, "Cannot create zap receipt. Recepient pubkey is missing."
zap_receipt = EncryptedDirectMessage(
kind=9735, tags=tags, content=payment.extra.get("comment") or ""
kind=9735,
recipient_pubkey=pubkey,
tags=tags,
content=payment.extra.get("comment") or "",
cleartext_content=payment.extra.get("comment") or "",
)
settings = await get_or_create_lnurlp_settings()