from __future__ import annotations

"""Ledger resource — hash chain verification."""

from nexure.models import LedgerVerification
from nexure.resources._base import BaseResource


class LedgerResource(BaseResource):
    """nx.ledger — verify hash chain integrity."""

    def verify(self) -> LedgerVerification:
        """Verify the hash chain integrity for the authenticated tenant."""
        data = self._get("/ledger/verify")
        return LedgerVerification(**data)
