mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 09:54:21 +01:00
4e6f229db2
* [CHORE] string formatting default length 88 uses blacks default off 88 and enabled autostringformatting * formatting * nitpicks jackstar fix
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from typing import AsyncGenerator
|
|
|
|
from loguru import logger
|
|
|
|
from .base import (
|
|
InvoiceResponse,
|
|
PaymentResponse,
|
|
PaymentStatus,
|
|
StatusResponse,
|
|
Wallet,
|
|
)
|
|
|
|
|
|
class VoidWallet(Wallet):
|
|
async def create_invoice(self, *_, **__) -> InvoiceResponse:
|
|
return InvoiceResponse(
|
|
ok=False, error_message="VoidWallet cannot create invoices."
|
|
)
|
|
|
|
async def status(self) -> StatusResponse:
|
|
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."
|
|
)
|
|
return StatusResponse(None, 0)
|
|
|
|
async def pay_invoice(self, *_, **__) -> PaymentResponse:
|
|
return PaymentResponse(
|
|
ok=False, error_message="VoidWallet cannot pay invoices."
|
|
)
|
|
|
|
async def get_invoice_status(self, *_, **__) -> PaymentStatus:
|
|
return PaymentStatus(None)
|
|
|
|
async def get_payment_status(self, *_, **__) -> PaymentStatus:
|
|
return PaymentStatus(None)
|
|
|
|
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
|
yield ""
|