2023-07-25 15:13:34 +02:00
|
|
|
from typing import AsyncGenerator
|
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,
|
|
|
|
Wallet,
|
2021-03-24 00:40:32 -03:00
|
|
|
)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
|
|
|
|
|
|
|
class VoidWallet(Wallet):
|
2023-07-25 15:13:34 +02:00
|
|
|
async def create_invoice(self, *_, **__) -> InvoiceResponse:
|
|
|
|
return InvoiceResponse(
|
|
|
|
ok=False, error_message="VoidWallet cannot create invoices."
|
|
|
|
)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
2021-03-24 01:01:09 -03:00
|
|
|
async def status(self) -> StatusResponse:
|
2023-04-17 08:38:12 +02:00
|
|
|
logger.warning(
|
2023-08-24 11:26:09 +02:00
|
|
|
"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."
|
2023-04-17 08:38:12 +02:00
|
|
|
)
|
2022-01-30 19:43:30 +00:00
|
|
|
return StatusResponse(None, 0)
|
2020-10-12 22:25:55 -03:00
|
|
|
|
2023-07-25 15:13:34 +02:00
|
|
|
async def pay_invoice(self, *_, **__) -> PaymentResponse:
|
|
|
|
return PaymentResponse(
|
|
|
|
ok=False, error_message="VoidWallet cannot pay invoices."
|
|
|
|
)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
2023-07-25 15:13:34 +02:00
|
|
|
async def get_invoice_status(self, *_, **__) -> PaymentStatus:
|
2022-08-04 18:40:46 +02:00
|
|
|
return PaymentStatus(None)
|
2020-09-03 21:43:32 -03:00
|
|
|
|
2023-07-25 15:13:34 +02:00
|
|
|
async def get_payment_status(self, *_, **__) -> 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 ""
|