feat: introduce self.features to wallets, refactor feature nodemanager (#3260)

This commit is contained in:
dni ⚡
2025-07-15 11:15:13 +02:00
parent 256a8098c6
commit 6e9f451419
9 changed files with 36 additions and 29 deletions
+11
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
import asyncio
from abc import ABC, abstractmethod
from collections.abc import AsyncGenerator, Coroutine
from enum import Enum
from typing import TYPE_CHECKING, NamedTuple
from loguru import logger
@@ -13,6 +14,12 @@ if TYPE_CHECKING:
from lnbits.nodes.base import Node
class Feature(Enum):
nodemanager = "nodemanager"
# hold = "hold"
# bolt12 = "bolt12"
class StatusResponse(NamedTuple):
error_message: str | None
balance_msat: int
@@ -100,6 +107,10 @@ class PaymentPendingStatus(PaymentStatus):
class Wallet(ABC):
__node_cls__: type[Node] | None = None
features: list[Feature] | None = None
def has_feature(self, feature: Feature) -> bool:
return self.features is not None and feature in self.features
def __init__(self) -> None:
self.pending_invoices: list[str] = []