diff --git a/lnbits/core/templates/core/wallet.html b/lnbits/core/templates/core/wallet.html index db859df97..c6151600a 100644 --- a/lnbits/core/templates/core/wallet.html +++ b/lnbits/core/templates/core/wallet.html @@ -662,6 +662,7 @@ > {% endif %} Jinja2Templa if settings.lnbits_denomination == "FakeWallet" else "sats" ), + "has_holdinvoice": settings.has_holdinvoice, } t.env.globals["WINDOW_SETTINGS"] = window_settings diff --git a/lnbits/settings.py b/lnbits/settings.py index fbf02329c..366ecb61f 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -987,6 +987,7 @@ class TransientSettings(InstalledExtensionsSettings, ExchangeHistorySettings): server_startup_time: int = Field(default=time()) + has_holdinvoice: bool = Field(default=False) has_nodemanager: bool = Field(default=False) @property diff --git a/lnbits/wallets/__init__.py b/lnbits/wallets/__init__.py index 291a999b2..4833345f9 100644 --- a/lnbits/wallets/__init__.py +++ b/lnbits/wallets/__init__.py @@ -40,6 +40,7 @@ def set_funding_source(class_name: str | None = None) -> None: global funding_source funding_source = funding_source_constructor() settings.has_nodemanager = funding_source.has_feature(Feature.nodemanager) + settings.has_holdinvoice = funding_source.has_feature(Feature.holdinvoice) def get_funding_source() -> Wallet: diff --git a/lnbits/wallets/base.py b/lnbits/wallets/base.py index 5fa404292..90517948d 100644 --- a/lnbits/wallets/base.py +++ b/lnbits/wallets/base.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: class Feature(Enum): nodemanager = "nodemanager" - # hold = "hold" + holdinvoice = "holdinvoice" # bolt12 = "bolt12" diff --git a/lnbits/wallets/lndgrpc.py b/lnbits/wallets/lndgrpc.py index dc9c3b622..8900009bf 100644 --- a/lnbits/wallets/lndgrpc.py +++ b/lnbits/wallets/lndgrpc.py @@ -19,6 +19,7 @@ from lnbits.utils.crypto import random_secret_and_hash from lnbits.wallets.lnd_grpc_files.router_pb2_grpc import RouterStub from .base import ( + Feature, InvoiceResponse, PaymentFailedStatus, PaymentPendingStatus, @@ -64,6 +65,8 @@ environ["GRPC_SSL_CIPHER_SUITES"] = "HIGH+ECDSA" class LndWallet(Wallet): + features = [Feature.holdinvoice] + def __init__(self): if not settings.lnd_grpc_endpoint: raise ValueError("cannot initialize LndWallet: missing lnd_grpc_endpoint") diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index 9bbe5d210..95d0b596e 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -31,7 +31,7 @@ class LndRestWallet(Wallet): """https://api.lightning.community/#lnd-rest-api-reference""" __node_cls__ = LndRestNode - features = [Feature.nodemanager] + features = [Feature.nodemanager, Feature.holdinvoice] def __init__(self): if not settings.lnd_rest_endpoint: