2022-01-17 15:38:03 +00:00
from typing import AsyncGenerator , Optional
2020-09-03 21:43:32 -03:00
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 ,
2020-09-03 21:43:32 -03:00
) - > InvoiceResponse :
raise Unsupported ( " " )
2021-03-24 01:01:09 -03:00
async def status ( self ) - > StatusResponse :
2022-01-30 19:43:30 +00: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-12 22:25:55 -03:00
)
2022-01-30 19:43:30 +00:00
return StatusResponse ( None , 0 )
2020-10-12 22:25:55 -03:00
2021-03-24 01:01:09 -03:00
async def pay_invoice ( self , bolt11 : str ) - > 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 :
2020-09-03 21:43:32 -03:00
raise Unsupported ( " " )
2021-03-24 01:01:09 -03:00
async def get_payment_status ( self , checking_id : str ) - > PaymentStatus :
2020-09-03 21:43:32 -03:00
raise Unsupported ( " " )
2020-10-02 17:13:33 -03:00
async def paid_invoices_stream ( self ) - > AsyncGenerator [ str , None ] :
yield " "