| 100 | // --------------------------------------------------------------------------- |
| 101 | |
| 102 | function decodeContractFromProto(cp: ContractProto): Contract { |
| 103 | const contract = new Contract() |
| 104 | if (cp.conId !== undefined) contract.conId = cp.conId |
| 105 | if (cp.symbol !== undefined) contract.symbol = cp.symbol |
| 106 | if (cp.secType !== undefined) |
| 107 | if (cp.lastTradeDateOrContractMonth !== undefined) contract.lastTradeDateOrContractMonth = cp.lastTradeDateOrContractMonth |
| 108 | if (cp.strike !== undefined) contract.strike = cp.strike |
| 109 | if (cp.right !== undefined) contract.right = cp.right |
| 110 | if (cp.multiplier !== undefined) contract.multiplier = String(cp.multiplier) |
| 111 | if (cp.exchange !== undefined) contract.exchange = cp.exchange |
| 112 | if (cp.currency !== undefined) contract.currency = cp.currency |
| 113 | if (cp.localSymbol !== undefined) contract.localSymbol = cp.localSymbol |
| 114 | if (cp.tradingClass !== undefined) contract.tradingClass = cp.tradingClass |
| 115 | return contract |
| 116 | } |
| 117 | |
| 118 | function decodeSoftDollarTierFromProto(p: SoftDollarTierProto): SoftDollarTier { |
| 119 | return new SoftDollarTier( |