feat: HodlInvoices (Rebase) (#2869)

Co-authored-by: pseudozach <git@pseudozach.com>
Co-authored-by: dni  <office@dnilabs.com>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
ziggieXXX
2025-07-15 11:15:14 +02:00
committed by dni ⚡
co-authored by pseudozach dni ⚡ Vlad Stan
parent 6e9f451419
commit f91c933919
23 changed files with 4192 additions and 6027 deletions
+24
View File
@@ -8,6 +8,7 @@ from typing import TYPE_CHECKING, NamedTuple
from loguru import logger
from lnbits.exceptions import InvoiceError
from lnbits.settings import settings
if TYPE_CHECKING:
@@ -152,6 +153,29 @@ class Wallet(ABC):
) -> Coroutine[None, None, PaymentStatus]:
pass
async def create_hold_invoice(
self,
amount: int,
payment_hash: str,
memo: str | None = None,
description_hash: bytes | None = None,
unhashed_description: bytes | None = None,
**kwargs,
) -> InvoiceResponse:
raise InvoiceError(
message="Hold invoices are not supported by this wallet.", status="failed"
)
async def settle_hold_invoice(self, preimage: str) -> InvoiceResponse:
raise InvoiceError(
message="Hold invoices are not supported by this wallet.", status="failed"
)
async def cancel_hold_invoice(self, payment_hash: str) -> InvoiceResponse:
raise InvoiceError(
message="Hold invoices are not supported by this wallet.", status="failed"
)
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
while settings.lnbits_running:
for invoice in self.pending_invoices: