-import type { StrategyOption, StrategyKey } from "../types/Strategy";
-import { apiGet } from "./api/http";
-
-type Risk = "SAFE" | "NORMAL" | "AGGRESSIVE";
-
-function asArray(x: any): any[] {
- if (Array.isArray(x)) return x;
- if (Array.isArray(x?.strategies)) return x.strategies;
- if (Array.isArray(x?.items)) return x.items;
- if (Array.isArray(x?.data)) return x.data;
- return [];
-}
-
-function normalizeRisk(raw: any): Risk {
- const v = String(raw ?? "").toUpperCase();
- if (v === "SAFE") return "SAFE";
- if (v === "AGGRESSIVE") return "AGGRESSIVE";
- if (v === "NORMAL") return "NORMAL";
- return "NORMAL";
-}
-
-function normalizeStrategy(raw: any): StrategyOption | null {
- const key = String(raw?.key ?? raw?.mode ?? raw?.strategy_key ?? raw?.strategyKey ?? "").trim();
- if (!key) return null;
-
- return {
- key: key as StrategyKey,
- label: String(raw?.label ?? raw?.name ?? key),
- description: String(raw?.description ?? "—"),
- risk: normalizeRisk(raw?.risk ?? raw?.level ?? raw?.modeRisk),
- };
-}
-
+import type { StrategyOption } from "../types/Strategy";
+
+/**
+ * strategyService
+ * ---------------
+ * Le serveur ne fournit pas encore /api/strategy/list,
+ * donc on expose une liste locale alignée sur les modes serveur.
+ */