add VoidWallet and make it the default.

This commit is contained in:
fiatjaf 2020-09-03 21:43:32 -03:00
parent 23cfe0d417
commit 8b7028d728
3 changed files with 21 additions and 1 deletions

View File

@ -3,7 +3,7 @@ import os
wallets_module = importlib.import_module("lnbits.wallets")
wallet_class = getattr(wallets_module, os.getenv("LNBITS_BACKEND_WALLET_CLASS", "LntxbotWallet"))
wallet_class = getattr(wallets_module, os.getenv("LNBITS_BACKEND_WALLET_CLASS", "VoidWallet"))
LNBITS_PATH = os.path.dirname(os.path.realpath(__file__))
LNBITS_DATA_FOLDER = os.getenv("LNBITS_DATA_FOLDER", os.path.join(LNBITS_PATH, "data"))

View File

@ -1,5 +1,6 @@
# flake8: noqa
from .void import VoidWallet
from .clightning import CLightningWallet
from .lndgrpc import LndWallet
from .lntxbot import LntxbotWallet

19
lnbits/wallets/void.py Normal file
View File

@ -0,0 +1,19 @@
from typing import Optional
from .base import InvoiceResponse, PaymentResponse, PaymentStatus, Wallet, Unsupported
class VoidWallet(Wallet):
def create_invoice(
self, amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None
) -> InvoiceResponse:
raise Unsupported("")
def pay_invoice(self, bolt11: str) -> PaymentResponse:
raise Unsupported("")
def get_invoice_status(self, checking_id: str) -> PaymentStatus:
raise Unsupported("")
def get_payment_status(self, checking_id: str) -> PaymentStatus:
raise Unsupported("")