MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / getOperationSymbol

Function getOperationSymbol

packages/uta-protocol/src/types/git.ts:299–310  ·  view source on GitHub ↗
(op: Operation | undefined)

Source from the content-addressed store, hash-verified

297
298/** Extract the symbol from any Operation variant. */
299export function getOperationSymbol(op: Operation | undefined): string {
300 if (!op) return 'unknown'
301 switch (op.action) {
302 case 'placeOrder': return op.contract?.symbol || op.contract?.aliceId || 'unknown'
303 case 'modifyOrder': return 'unknown' // modifyOrder doesn't carry contract
304 case 'closePosition': return op.contract?.symbol || op.contract?.aliceId || 'unknown'
305 case 'cancelOrder': return 'unknown'
306 case 'syncOrders': return 'unknown'
307 case 'observeExternalOrder': return op.contract?.symbol || op.contract?.aliceId || 'unknown'
308 case 'reconcileBalance': return op.aliceId
309 }
310}

Callers 5

checkMethod · 0.85
checkMethod · 0.85
logMethod · 0.85
getPendingOrderIdsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected