fix: correct klines status check (1 not 200) and data.points format

This commit is contained in:
shokollm
2026-04-11 04:56:50 +00:00
parent caef4b36ed
commit 7afcb983e8

View File

@@ -99,8 +99,9 @@ class AveCloudClient:
) )
response.raise_for_status() response.raise_for_status()
data = response.json() data = response.json()
if data.get("status") == 200: # AVE API returns status: 1 for success, not 200
return data.get("data", []) if data.get("status") == 1:
return data.get("data", {}).get("points", [])
raise Exception(f"Failed to fetch klines: {data}") raise Exception(f"Failed to fetch klines: {data}")
async def get_token_price(self, token_id: str) -> Optional[Dict[str, Any]]: async def get_token_price(self, token_id: str) -> Optional[Dict[str, Any]]: