fix: correct klines status check (1 not 200) and data.points format
This commit is contained in:
@@ -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]]:
|
||||||
|
|||||||
Reference in New Issue
Block a user