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

Function initializeAccountSystem

src/services/accountService.ts:379–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

377
378// 初始化账户系统(首次使用时调用)
379export function initializeAccountSystem(): {
380 storage: AccountsStorage
381 migrated: boolean
382} {
383 let storage = getStorage()
384 let migrated = false
385
386 // 检查是否需要迁移持仓数据
387 const allPositions = getAllPositions()
388 const hasUnassignedPositions = allPositions.some(p => !p.accountId)
389
390 if (hasUnassignedPositions) {
391 migrateLegacyPositions()
392 migrated = true
393 }
394
395 return { storage, migrated }
396}
397
398// ==================== 持仓管理 API ====================
399

Callers 1

AppFunction · 0.90

Calls 3

getStorageFunction · 0.85
getAllPositionsFunction · 0.85
migrateLegacyPositionsFunction · 0.85

Tested by

no test coverage detected