fix: correct simulation API field names
The backend expects 'check_interval' not 'interval_seconds', and 'chain' is required.
This commit is contained in:
@@ -189,7 +189,7 @@ export const api = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
simulate: {
|
simulate: {
|
||||||
async start(botId: string, config: { token: string; interval_seconds: number; auto_execute: boolean }): Promise<Simulation> {
|
async start(botId: string, config: { token: string; chain?: string; check_interval: number; auto_execute: boolean }): Promise<Simulation> {
|
||||||
const response = await fetch(`${API_URL}/bots/${botId}/simulate`, {
|
const response = await fetch(`${API_URL}/bots/${botId}/simulate`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: getAuthHeaders(),
|
headers: getAuthHeaders(),
|
||||||
|
|||||||
@@ -68,7 +68,8 @@
|
|||||||
try {
|
try {
|
||||||
const simulation = await api.simulate.start(botId, {
|
const simulation = await api.simulate.start(botId, {
|
||||||
token: tokenAddress,
|
token: tokenAddress,
|
||||||
interval_seconds: intervalSeconds,
|
chain: 'bsc',
|
||||||
|
check_interval: intervalSeconds,
|
||||||
auto_execute: autoExecute
|
auto_execute: autoExecute
|
||||||
});
|
});
|
||||||
setCurrentSimulation(simulation);
|
setCurrentSimulation(simulation);
|
||||||
|
|||||||
Reference in New Issue
Block a user