feat: saxo history

This commit is contained in:
OpenSquared
2026-07-18 18:46:52 +02:00
parent ca57f7d8d6
commit e1e21bf912

View File

@@ -74,9 +74,12 @@ def get_default_account_key() -> str:
if _account_key_cache:
return _account_key_cache
data = _get("/port/v1/accounts/me")
account_key = _first(data, "AccountKey", "accountKey")
items = data.get("Data") or data.get("data") or []
if not items:
raise ValueError(f"Aucun compte trouvé dans /port/v1/accounts/me: {data}")
account_key = _first(items[0], "AccountKey", "accountKey")
if not account_key:
raise ValueError(f"Champ AccountKey introuvable dans /port/v1/accounts/me: {data}")
raise ValueError(f"Champ AccountKey introuvable pour le compte: {items[0]}")
_account_key_cache = account_key
return account_key