MCPcopy Create free account
hub / github.com/TurtleTrace2026/TurtleTrace / convertToNormalMode

Function convertToNormalMode

src/services/batchService.ts:253–266  ·  view source on GitHub ↗
(position: Position)

Source from the content-addressed store, hash-verified

251 * 将批次模式转换为普通模式
252 */
253export function convertToNormalMode(position: Position): Position {
254 if (!position.batches || position.batches.length === 0) {
255 return position // 已经是普通模式
256 }
257
258 // 合并所有批次的交易记录
259 const allTransactions = position.batches.flatMap(b => b.transactions)
260
261 return {
262 ...position,
263 batches: undefined,
264 transactions: allTransactions,
265 }
266}
267
268/**
269 * 拆分普通持仓为多个批次

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected