2022-01-17 15:38:03 +00:00
|
|
|
from typing import AsyncGenerator, Optional
|
2020-09-03 21:43:32 -03:00
|
|
|
|
2022-07-07 14:30:16 +02:00
|
|
|
from loguru import logger
|
|
|
|
|
2021-03-24 00:40:32 -03:00
|
|
|
from .base import (
|
|
|
|
InvoiceResponse,
|
|
|
|
PaymentResponse,
|
|
|
|
PaymentStatus,
|
2022-01-17 15:38:03 +00:00
|
|
|
StatusResponse,
|
2021-03-24 00:40:32 -03:00
|
|
|
Unsupported,
|
2022-01-17 15:38:03 +00:00
|
|
|
Wallet,
|
2021-03-24 00:40:32 -03:00
|
|
|
)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
|
|
|
|
|
|
|
class VoidWallet(Wallet):
|
2021-03-24 01:01:09 -03:00
|
|
|
async def create_invoice(
|
2021-03-24 00:40:32 -03:00
|
|
|
self,
|
|
|
|
amount: int,
|
|
|
|
memo: Optional[str] = None,
|
|
|
|
description_hash: Optional[bytes] = None,
|
2022-08-13 14:29:04 +02:00
|
|
|
**kwargs,
|
2020-09-03 21:43:32 -03:00
|
|
|
) -> InvoiceResponse:
|
|
|
|
raise Unsupported("")
|
|
|
|
|
2021-03-24 01:01:09 -03:00
|
|
|
async def status(self) -> StatusResponse:
|
2023-04-17 08:38:12 +02:00
|
|
|
logger.warning(
|
|
|
|
(
|
|
|
|
"This backend does nothing, it is here just as a placeholder, you must configure an "
|
|
|
|
"actual backend before being able to do anything useful with LNbits."
|
|
|
|
)
|
|
|
|
)
|
2022-01-30 19:43:30 +00:00
|
|
|
return StatusResponse(None, 0)
|
2020-10-12 22:25:55 -03:00
|
|
|
|
2022-03-16 07:20:15 +01:00
|
|
|
async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse:
|
2020-09-03 21:43:32 -03:00
|
|
|
raise Unsupported("")
|
|
|
|
|
2021-03-24 01:01:09 -03:00
|
|
|
async def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
2022-08-04 18:40:46 +02:00
|
|
|
return PaymentStatus(None)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
2021-03-24 01:01:09 -03:00
|
|
|
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
2022-08-04 18:40:46 +02:00
|
|
|
return PaymentStatus(None)
|
2020-10-02 17:13:33 -03:00
|
|
|
|
|
|
|
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
|
|
|
yield ""
|