from abc import ABC, abstractmethod from typing import TYPE_CHECKING, AsyncIterator, List from node.api.serializers.block import BlockSerializer from node.api.serializers.health import HealthSerializer if TYPE_CHECKING: from core.app import NBESettings class NodeApi(ABC): @abstractmethod def __init__(self, _settings: "NBESettings"): pass @abstractmethod async def get_health(self) -> HealthSerializer: pass @abstractmethod async def get_blocks(self, **kwargs) -> List[BlockSerializer]: pass @abstractmethod async def get_blocks_stream(self) -> AsyncIterator[List[BlockSerializer]]: pass