fix: nostr zaps (#63)
This commit is contained in:
parent
5fb5aa382d
commit
bc829e5dff
2 changed files with 9 additions and 3 deletions
|
|
@ -91,9 +91,8 @@ class PrivateKey:
|
|||
|
||||
def encrypt_dm(self, dm: EncryptedDirectMessage) -> None:
|
||||
assert dm.recipient_pubkey, "Recipient public key must be set"
|
||||
assert dm.cleartext_content, "Cleartext content must be set"
|
||||
dm.content = self.encrypt_message(
|
||||
message=dm.cleartext_content, public_key_hex=dm.recipient_pubkey
|
||||
message=dm.cleartext_content or "", public_key_hex=dm.recipient_pubkey
|
||||
)
|
||||
|
||||
def decrypt_message(self, encoded_message: str, public_key_hex: str) -> str:
|
||||
|
|
|
|||
9
tasks.py
9
tasks.py
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue