|
@@ -50,8 +50,8 @@ export async function copyPosition(positionDetails: OpenPositionEvent['positionD
|
|
|
maxUsdValue,
|
|
maxUsdValue,
|
|
|
}),
|
|
}),
|
|
|
}).then(res => res.json()).then((response: unknown) => {
|
|
}).then(res => res.json()).then((response: unknown) => {
|
|
|
- const data = response as { ok?: boolean, error?: string }
|
|
|
|
|
- if (!data.ok) {
|
|
|
|
|
|
|
+ const data = response as { success?: boolean, error?: string }
|
|
|
|
|
+ if (!data.success) {
|
|
|
throw new Error(data.error ?? 'Failed to copy position')
|
|
throw new Error(data.error ?? 'Failed to copy position')
|
|
|
}
|
|
}
|
|
|
console.log(`[${Date.now()}] 复制仓位成功`)
|
|
console.log(`[${Date.now()}] 复制仓位成功`)
|