Compare commits
4 Commits
41b699f9ee
...
fix/issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04e4c1a487 | ||
| feb65131fa | |||
|
|
50af4e0722 | ||
|
|
786e964e32 |
@@ -1,13 +1,19 @@
|
|||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
|
||||||
|
from ..core.config import get_settings
|
||||||
|
from ..services.ave import AveCloudClient
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
@router.get("/chains")
|
@router.get("/chains")
|
||||||
def get_chains():
|
def get_chains():
|
||||||
return {"chains": []}
|
return {"chains": ["bsc"]}
|
||||||
|
|
||||||
|
|
||||||
@router.get("/tokens")
|
@router.get("/tokens")
|
||||||
def get_tokens():
|
async def get_tokens():
|
||||||
return {"tokens": []}
|
settings = get_settings()
|
||||||
|
client = AveCloudClient(api_key=settings.AVE_API_KEY, plan=settings.AVE_API_PLAN)
|
||||||
|
tokens = await client.get_tokens(chain="bsc", limit=20)
|
||||||
|
return {"tokens": tokens}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from pydantic import BaseModel, EmailStr
|
from pydantic import BaseModel, EmailStr, field_validator
|
||||||
from typing import Optional, List, Any
|
from typing import Optional, List, Any, Dict
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
@@ -69,6 +69,13 @@ class BacktestCreate(BaseModel):
|
|||||||
start_date: str
|
start_date: str
|
||||||
end_date: str
|
end_date: str
|
||||||
|
|
||||||
|
@field_validator("chain")
|
||||||
|
@classmethod
|
||||||
|
def chain_must_be_bsc(cls, v: str) -> str:
|
||||||
|
if v != "bsc":
|
||||||
|
raise ValueError("Phase 1 only supports BSC (bnb chain)")
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
class BacktestResponse(BaseModel):
|
class BacktestResponse(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
@@ -90,6 +97,13 @@ class SimulationCreate(BaseModel):
|
|||||||
check_interval: int = 60
|
check_interval: int = 60
|
||||||
auto_execute: bool = False
|
auto_execute: bool = False
|
||||||
|
|
||||||
|
@field_validator("chain")
|
||||||
|
@classmethod
|
||||||
|
def chain_must_be_bsc(cls, v: str) -> str:
|
||||||
|
if v != "bsc":
|
||||||
|
raise ValueError("Phase 1 only supports BSC (bnb chain)")
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
class SimulationResponse(BaseModel):
|
class SimulationResponse(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
|
|||||||
Reference in New Issue
Block a user