From 0d63a10ac803447fa4c94429c357c28d841bbb74 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sat, 11 Apr 2026 17:22:45 +0000 Subject: [PATCH] fix: correct simulation API field names The backend expects 'check_interval' not 'interval_seconds', and 'chain' is required. --- src/frontend/src/lib/api/client.ts | 2 +- src/frontend/src/routes/bot/[id]/simulate/+page.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/lib/api/client.ts b/src/frontend/src/lib/api/client.ts index 3e891e5..c612985 100644 --- a/src/frontend/src/lib/api/client.ts +++ b/src/frontend/src/lib/api/client.ts @@ -189,7 +189,7 @@ export const api = { }, simulate: { - async start(botId: string, config: { token: string; interval_seconds: number; auto_execute: boolean }): Promise { + async start(botId: string, config: { token: string; chain?: string; check_interval: number; auto_execute: boolean }): Promise { const response = await fetch(`${API_URL}/bots/${botId}/simulate`, { method: 'POST', headers: getAuthHeaders(), diff --git a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte index 0ee24a3..a71572c 100644 --- a/src/frontend/src/routes/bot/[id]/simulate/+page.svelte +++ b/src/frontend/src/routes/bot/[id]/simulate/+page.svelte @@ -68,7 +68,8 @@ try { const simulation = await api.simulate.start(botId, { token: tokenAddress, - interval_seconds: intervalSeconds, + chain: 'bsc', + check_interval: intervalSeconds, auto_execute: autoExecute }); setCurrentSimulation(simulation);