from typing import Dict, Mapping, Protocol

from ..core.base import Method, MintKeyset, Unit
from ..core.db import Database
from ..lightning.base import LightningBackend
from ..mint.crud import LedgerCrud


class SupportsKeysets(Protocol):
    keyset: MintKeyset
    keysets: Dict[str, MintKeyset]


class SupportsBackends(Protocol):
    backends: Mapping[Method, Mapping[Unit, LightningBackend]] = {}


class SupportsDb(Protocol):
    db: Database
    crud: LedgerCrud
