hedgequantx 2.9.178 → 2.9.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -178,7 +178,14 @@ const fetchAllFrontMonths = (service) => {
|
|
|
178
178
|
if (msg.templateId !== 114) return;
|
|
179
179
|
template114Count++;
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
// Use official protobuf decoder
|
|
182
|
+
let decoded;
|
|
183
|
+
try {
|
|
184
|
+
decoded = proto.decode('ResponseFrontMonthContract', msg.data);
|
|
185
|
+
} catch (e) {
|
|
186
|
+
brokerLog('FrontMonth decode error', { error: e.message });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
182
189
|
|
|
183
190
|
// Log first few responses to diagnose
|
|
184
191
|
if (template114Count <= 5) {
|
|
@@ -191,10 +198,11 @@ const fetchAllFrontMonths = (service) => {
|
|
|
191
198
|
});
|
|
192
199
|
}
|
|
193
200
|
|
|
194
|
-
if (decoded.rpCode[0] === '0' && decoded.tradingSymbol) {
|
|
195
|
-
|
|
201
|
+
if (decoded.rpCode && decoded.rpCode[0] === '0' && decoded.tradingSymbol) {
|
|
202
|
+
const baseSymbol = decoded.userMsg?.[0] || decoded.symbol;
|
|
203
|
+
contracts.set(baseSymbol, {
|
|
196
204
|
symbol: decoded.tradingSymbol,
|
|
197
|
-
baseSymbol:
|
|
205
|
+
baseSymbol: baseSymbol,
|
|
198
206
|
exchange: decoded.exchange,
|
|
199
207
|
});
|
|
200
208
|
}
|