2022-01-17 16:38:03 +01:00
from typing import AsyncGenerator , Optional
2020-09-04 02:43:32 +02:00
2021-03-24 04:40:32 +01:00
from . base import (
InvoiceResponse ,
PaymentResponse ,
PaymentStatus ,
2022-01-17 16:38:03 +01:00
StatusResponse ,
2021-03-24 04:40:32 +01:00
Unsupported ,
2022-01-17 16:38:03 +01:00
Wallet ,
2021-03-24 04:40:32 +01:00
)
2020-09-04 02:43:32 +02:00
class VoidWallet ( Wallet ) :
2021-03-24 05:01:09 +01:00
async def create_invoice (
2021-03-24 04:40:32 +01:00
self ,
amount : int ,
memo : Optional [ str ] = None ,
description_hash : Optional [ bytes ] = None ,
2020-09-04 02:43:32 +02:00
) - > InvoiceResponse :
raise Unsupported ( " " )
2021-03-24 05:01:09 +01:00
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. " )
2020-10-13 03:25:55 +02:00
return StatusResponse (
2022-01-17 16:38:03 +01:00
None ,
2020-10-13 03:25:55 +02:00
0 ,
)
2021-03-24 05:01:09 +01:00
async def pay_invoice ( self , bolt11 : str ) - > PaymentResponse :
2020-09-04 02:43:32 +02:00
raise Unsupported ( " " )
2021-03-24 05:01:09 +01:00
async def get_invoice_status ( self , checking_id : str ) - > PaymentStatus :
2020-09-04 02:43:32 +02:00
raise Unsupported ( " " )
2021-03-24 05:01:09 +01:00
async def get_payment_status ( self , checking_id : str ) - > PaymentStatus :
2020-09-04 02:43:32 +02:00
raise Unsupported ( " " )
2020-10-02 22:13:33 +02:00
async def paid_invoices_stream ( self ) - > AsyncGenerator [ str , None ] :
yield " "