Synchronous Python SDK modeled on prime-sdk-go. Provides DC1-HMAC-SHA256 auth, dataclass models, and resource clients for system, transaction, transaction-type, smart-contract, and block endpoints, plus a YAML credentials loader.
18 lines
484 B
Python
18 lines
484 B
Python
"""System endpoints (health, status)."""
|
|
|
|
from .client import Client
|
|
from .models import SystemStatus
|
|
|
|
|
|
class SystemClient:
|
|
def __init__(self, client: Client):
|
|
self._client = client
|
|
|
|
def health(self) -> None:
|
|
"""Check system health. Raises ``DragonchainAPIError`` if unhealthy."""
|
|
self._client.get("/api/v1/health")
|
|
|
|
def status(self) -> SystemStatus:
|
|
"""Get system status."""
|
|
return self._client.get("/api/v1/status", SystemStatus)
|