feat: 实现仓位出售功能并修复价格接口
- 新增仓位出售功能,支持市价和限价卖出 - 添加卖出模态框,包含订单类型选择、数量快捷按钮、限价输入 - 实现实时平仓收益计算和显示 - 修复价格接口:改用Gamma API获取价格(支持condition_ids参数) - 优化价格选择逻辑:卖出使用bestBid,买入使用bestAsk - 添加提交订单的加载状态和错误处理 - 优化UI提示,明确标注价格用途(买入/卖出参考)
This commit is contained in:
@@ -97,7 +97,19 @@ export const apiService = {
|
||||
* 查询所有账户的仓位列表
|
||||
*/
|
||||
positionsList: () =>
|
||||
apiClient.post<ApiResponse<any>>('/copy-trading/accounts/positions/list', {})
|
||||
apiClient.post<ApiResponse<any>>('/copy-trading/accounts/positions/list', {}),
|
||||
|
||||
/**
|
||||
* 卖出仓位
|
||||
*/
|
||||
sellPosition: (data: any) =>
|
||||
apiClient.post<ApiResponse<any>>('/copy-trading/accounts/positions/sell', data),
|
||||
|
||||
/**
|
||||
* 获取市场价格
|
||||
*/
|
||||
getMarketPrice: (data: any) =>
|
||||
apiClient.post<ApiResponse<any>>('/copy-trading/accounts/markets/price', data)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user