from __future__ import annotations

from dataclasses import asdict, dataclass


@dataclass(frozen=True)
class ReadOnlyGuard:
    read_only: bool = True
    live_orders: bool = False
    vault_deposits: bool = False
    wallet_execution: bool = False
    signing_enabled: bool = False

    def as_dict(self) -> dict[str, bool]:
        return asdict(self)

    def assert_safe(self) -> None:
        if not self.read_only or self.live_orders or self.vault_deposits or self.wallet_execution or self.signing_enabled:
            raise RuntimeError("copy research track is not read-only safe")


DEFAULT_READ_ONLY_GUARD = ReadOnlyGuard()
