|
|
@@ -49,7 +49,11 @@ export async function copyPosition(positionDetails: OpenPositionEvent['positionD
|
|
|
positionAddress,
|
|
|
maxUsdValue,
|
|
|
}),
|
|
|
- }).then(res => res.json()).then(() => {
|
|
|
+ }).then(res => res.json()).then((response: unknown) => {
|
|
|
+ const data = response as { ok?: boolean, error?: string }
|
|
|
+ if (!data.ok) {
|
|
|
+ throw new Error(data.error ?? 'Failed to copy position')
|
|
|
+ }
|
|
|
console.log(`[${Date.now()}] 复制仓位成功`)
|
|
|
// 发送Discord通知,使用embeds
|
|
|
const solscanBaseUrl = 'https://solscan.io'
|