2021-11-08 15:08:57 +00:00
|
|
|
from dataclasses import dataclass
|
|
|
|
from datetime import datetime
|
|
|
|
from enum import Enum
|
2022-02-16 16:12:42 +00:00
|
|
|
from typing import List, Any, Dict
|
2021-11-08 15:08:57 +00:00
|
|
|
|
2022-02-16 16:12:42 +00:00
|
|
|
from pydantic import BaseModel, Field
|
2021-11-13 15:51:32 +00:00
|
|
|
|
2021-11-08 15:08:57 +00:00
|
|
|
|
|
|
|
class AvailableBlockchainType(Enum):
|
|
|
|
ETHEREUM = "ethereum"
|
|
|
|
POLYGON = "polygon"
|
|
|
|
|
|
|
|
|
2021-12-21 15:23:26 +00:00
|
|
|
class StatsUpdateRequest(BaseModel):
|
|
|
|
dashboard_id: str
|
|
|
|
timescales: List[str]
|
|
|
|
token: str
|
|
|
|
|
|
|
|
|
2021-11-08 15:08:57 +00:00
|
|
|
@dataclass
|
|
|
|
class DateRange:
|
|
|
|
start_time: datetime
|
|
|
|
end_time: datetime
|
|
|
|
include_start: bool
|
|
|
|
include_end: bool
|
2021-11-13 15:51:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PingResponse(BaseModel):
|
|
|
|
"""
|
|
|
|
Schema for ping response
|
|
|
|
"""
|
|
|
|
|
|
|
|
status: str
|
|
|
|
|
|
|
|
|
|
|
|
class VersionResponse(BaseModel):
|
|
|
|
"""
|
|
|
|
Schema for responses on /version endpoint
|
|
|
|
"""
|
|
|
|
|
|
|
|
version: str
|
|
|
|
|
|
|
|
|
|
|
|
class NowResponse(BaseModel):
|
|
|
|
"""
|
|
|
|
Schema for responses on /now endpoint
|
|
|
|
"""
|
|
|
|
|
|
|
|
epoch_time: float
|
2022-02-16 16:12:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
class QueryDataUpdate(BaseModel):
|
|
|
|
|
|
|
|
file_type: str
|
|
|
|
query: str
|
|
|
|
params: Dict[str, Any] = Field(default_factory=dict)
|