mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-25 07:07:48 +01:00
* remove unused and update black + precommit * makefile add ruff remove unused * F541 fix * complete ruff ignore * remove unused workflow and combine linters into one add lnbits/static to ruff ignore save preview and linelength for later define target version for black * ignore upgrades for mypy * remove flake8 * ignore F401 for __init__ files * unused pylint comment * unused noqa * ignore upgrades for black * run linting on py3.9 and py3.10 * dont assume python
39 lines
1 KiB
Python
39 lines
1 KiB
Python
from __future__ import annotations
|
|
|
|
import importlib
|
|
from typing import Optional
|
|
|
|
from lnbits.settings import settings
|
|
from lnbits.wallets.base import Wallet
|
|
|
|
from .cliche import ClicheWallet
|
|
from .cln import CoreLightningWallet
|
|
from .cln import CoreLightningWallet as CLightningWallet
|
|
from .eclair import EclairWallet
|
|
from .fake import FakeWallet
|
|
from .lnbits import LNbitsWallet
|
|
from .lndgrpc import LndWallet
|
|
from .lndrest import LndRestWallet
|
|
from .lnpay import LNPayWallet
|
|
from .lntips import LnTipsWallet
|
|
from .opennode import OpenNodeWallet
|
|
from .spark import SparkWallet
|
|
from .void import VoidWallet
|
|
|
|
|
|
def set_wallet_class(class_name: Optional[str] = None):
|
|
backend_wallet_class = class_name or settings.lnbits_backend_wallet_class
|
|
wallet_class = getattr(wallets_module, backend_wallet_class)
|
|
global WALLET
|
|
WALLET = wallet_class()
|
|
|
|
|
|
def get_wallet_class() -> Wallet:
|
|
return WALLET
|
|
|
|
|
|
wallets_module = importlib.import_module("lnbits.wallets")
|
|
FAKE_WALLET: Wallet = FakeWallet()
|
|
|
|
# initialize as fake wallet
|
|
WALLET: Wallet = FAKE_WALLET
|