feat(crypto-tail): 尾盘策略完整实现与优化
- 尾盘策略 CRUD、订单簿 WS 订阅、周期内触发下单 - 订单簿订阅日志增加市场 slug,便于排查 - 移除轮询,完全依赖 WebSocket(删除 CryptoTailStrategyScheduler) - FIXED 模式数量改为小数、向上取整,与签名服务一致 - 前端策略列表页、多语言与 API 对接 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -429,6 +429,46 @@ export const apiService = {
|
||||
}) =>
|
||||
apiClient.post<ApiResponse<any>>('/copy-trading/configs/filtered-orders', data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 尾盘策略 API
|
||||
*/
|
||||
cryptoTailStrategy: {
|
||||
list: (data: { accountId?: number; enabled?: boolean } = {}) =>
|
||||
apiClient.post<ApiResponse<{ list: import('../types').CryptoTailStrategyDto[] }>>('/crypto-tail-strategy/list', data),
|
||||
create: (data: {
|
||||
accountId: number
|
||||
name?: string
|
||||
marketSlugPrefix: string
|
||||
intervalSeconds: number
|
||||
windowStartSeconds: number
|
||||
windowEndSeconds: number
|
||||
minPrice: string
|
||||
maxPrice?: string
|
||||
amountMode: string
|
||||
amountValue: string
|
||||
enabled?: boolean
|
||||
}) =>
|
||||
apiClient.post<ApiResponse<import('../types').CryptoTailStrategyDto>>('/crypto-tail-strategy/create', data),
|
||||
update: (data: {
|
||||
strategyId: number
|
||||
name?: string
|
||||
windowStartSeconds?: number
|
||||
windowEndSeconds?: number
|
||||
minPrice?: string
|
||||
maxPrice?: string
|
||||
amountMode?: string
|
||||
amountValue?: string
|
||||
enabled?: boolean
|
||||
}) =>
|
||||
apiClient.post<ApiResponse<import('../types').CryptoTailStrategyDto>>('/crypto-tail-strategy/update', data),
|
||||
delete: (data: { strategyId: number }) =>
|
||||
apiClient.post<ApiResponse<void>>('/crypto-tail-strategy/delete', data),
|
||||
triggers: (data: { strategyId: number; page?: number; pageSize?: number; status?: string }) =>
|
||||
apiClient.post<ApiResponse<{ list: import('../types').CryptoTailStrategyTriggerDto[]; total: number }>>('/crypto-tail-strategy/triggers', data),
|
||||
marketOptions: () =>
|
||||
apiClient.post<ApiResponse<import('../types').CryptoTailMarketOptionDto[]>>('/crypto-tail-strategy/market-options', {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单管理 API
|
||||
|
||||
Reference in New Issue
Block a user