feat: preimages for incoming payments, fundingsource saves preimage on create_invoice (#3085)

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2025-04-30 11:03:19 +02:00
committed by GitHub
co-authored by Vlad Stan
parent f8b3644029
commit c4d0540e76
20 changed files with 183 additions and 106 deletions
+5
View File
@@ -10,6 +10,7 @@ from loguru import logger
from websockets.client import connect
from lnbits.settings import settings
from lnbits.utils.crypto import random_secret_and_hash
from .base import (
InvoiceResponse,
@@ -99,6 +100,9 @@ class EclairWallet(Wallet):
else:
data["description"] = memo
preimage, _ = random_secret_and_hash()
data["paymentPreimage"] = preimage
try:
r = await self.client.post("/createinvoice", data=data, timeout=40)
r.raise_for_status()
@@ -120,6 +124,7 @@ class EclairWallet(Wallet):
ok=True,
checking_id=data["paymentHash"],
payment_request=data["serialized"],
preimage=preimage,
)
except json.JSONDecodeError:
return InvoiceResponse(