lnbits-legend/lnbits/wallets/void.py

40 lines
1.1 KiB
Python
Raw Normal View History

2022-01-17 16:38:03 +01:00
from typing import AsyncGenerator, Optional
from .base import (
InvoiceResponse,
PaymentResponse,
PaymentStatus,
2022-01-17 16:38:03 +01:00
StatusResponse,
Unsupported,
2022-01-17 16:38:03 +01:00
Wallet,
)
class VoidWallet(Wallet):
async def create_invoice(
self,
amount: int,
memo: Optional[str] = None,
description_hash: Optional[bytes] = None,
) -> InvoiceResponse:
raise Unsupported("")
async def status(self) -> StatusResponse:
2022-01-17 16:38:03 +01:00
print("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(
2022-01-17 16:38:03 +01:00
None,
0,
)
async def pay_invoice(self, bolt11: str) -> PaymentResponse:
raise Unsupported("")
async def get_invoice_status(self, checking_id: str) -> PaymentStatus:
raise Unsupported("")
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
raise Unsupported("")
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
yield ""