feat: saxo history
This commit is contained in:
@@ -74,9 +74,12 @@ def get_default_account_key() -> str:
|
|||||||
if _account_key_cache:
|
if _account_key_cache:
|
||||||
return _account_key_cache
|
return _account_key_cache
|
||||||
data = _get("/port/v1/accounts/me")
|
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:
|
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
|
_account_key_cache = account_key
|
||||||
return account_key
|
return account_key
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user