Browse Source

add VoidWallet and make it the default.

aiosqlite
fiatjaf 4 years ago
parent
commit
8b7028d728
  1. 2
      lnbits/settings.py
  2. 1
      lnbits/wallets/__init__.py
  3. 19
      lnbits/wallets/void.py

2
lnbits/settings.py

@ -3,7 +3,7 @@ import os
wallets_module = importlib.import_module("lnbits.wallets") 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_PATH = os.path.dirname(os.path.realpath(__file__))
LNBITS_DATA_FOLDER = os.getenv("LNBITS_DATA_FOLDER", os.path.join(LNBITS_PATH, "data")) LNBITS_DATA_FOLDER = os.getenv("LNBITS_DATA_FOLDER", os.path.join(LNBITS_PATH, "data"))

1
lnbits/wallets/__init__.py

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

19
lnbits/wallets/void.py

@ -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("")
Loading…
Cancel
Save