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

Function encodeContractLegacy

packages/ibkr/src/client/encode.ts:52–74  ·  view source on GitHub ↗
(client: EClient, contract: Contract)

Source from the content-addressed store, hash-verified

50 * no version gate). Used by some older-style methods.
51 */
52export function encodeContractLegacy(client: EClient, contract: Contract): string[] {
53 const flds: string[] = []
54
55 flds.push(
56 makeField(contract.conId),
57 makeField(contract.symbol),
58 makeField(contract.secType),
59 makeField(contract.lastTradeDateOrContractMonth),
60 makeFieldHandleEmpty(contract.strike),
61 makeField(contract.right),
62 makeField(contract.multiplier),
63 makeField(contract.exchange),
64 makeField(contract.primaryExchange),
65 makeField(contract.currency),
66 makeField(contract.localSymbol),
67 )
68
69 if (client.serverVersion() >= SV.MIN_SERVER_VER_TRADING_CLASS) {
70 flds.push(makeField(contract.tradingClass))
71 }
72
73 return flds
74}

Callers 1

applyMarketDataFunction · 0.85

Calls 4

makeFieldHandleEmptyFunction · 0.85
pushMethod · 0.65
makeFieldFunction · 0.50
serverVersionMethod · 0.45

Tested by

no test coverage detected