@stoqey/ib 1.3.27 → 1.3.29

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.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/api/api.d.ts +5 -5
  3. package/dist/api/api.js +4 -4
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/contract/contractDetails.d.ts +2 -0
  6. package/dist/api/contract/ineligibilityReason.d.ts +7 -0
  7. package/dist/api/contract/ineligibilityReason.js +3 -0
  8. package/dist/api/contract/ineligibilityReason.js.map +1 -0
  9. package/dist/api/data/enum/min-server-version.d.ts +11 -1
  10. package/dist/api/data/enum/min-server-version.js +10 -0
  11. package/dist/api/data/enum/min-server-version.js.map +1 -1
  12. package/dist/api/order/execution.d.ts +1 -7
  13. package/dist/api/order/liquidities.d.ts +9 -0
  14. package/dist/api/order/liquidities.js +14 -0
  15. package/dist/api/order/liquidities.js.map +1 -0
  16. package/dist/api/order/order.d.ts +3 -0
  17. package/dist/api/order/order.js.map +1 -1
  18. package/dist/api/order/orderCancel.d.ts +8 -0
  19. package/dist/api/order/orderCancel.js +3 -0
  20. package/dist/api/order/orderCancel.js.map +1 -0
  21. package/dist/api-next/api-next.d.ts +3 -3
  22. package/dist/api-next/api-next.js +8 -3
  23. package/dist/api-next/api-next.js.map +1 -1
  24. package/dist/common/errorCode.d.ts +4 -0
  25. package/dist/common/errorCode.js +4 -0
  26. package/dist/common/errorCode.js.map +1 -1
  27. package/dist/core/io/decoder.d.ts +6 -0
  28. package/dist/core/io/decoder.js +58 -18
  29. package/dist/core/io/decoder.js.map +1 -1
  30. package/dist/core/io/encoder.d.ts +3 -3
  31. package/dist/core/io/encoder.js +83 -22
  32. package/dist/core/io/encoder.js.map +1 -1
  33. package/dist/index.d.ts +4 -1
  34. package/dist/index.js +3 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/tests/unit/api/historical-data.test.js +6 -6
  37. package/dist/tests/unit/api/historical-data.test.js.map +1 -1
  38. package/dist/tests/unit/api/order/issue203.test.d.ts +1 -0
  39. package/dist/tests/unit/api/order/issue203.test.js +137 -0
  40. package/dist/tests/unit/api/order/issue203.test.js.map +1 -0
  41. package/dist/tests/unit/api/order/placeConditionalOrder.test.js +10 -3
  42. package/dist/tests/unit/api/order/placeConditionalOrder.test.js.map +1 -1
  43. package/dist/tests/unit/api/order/placeOrder.test.js +0 -49
  44. package/dist/tests/unit/api/order/placeOrder.test.js.map +1 -1
  45. package/dist/tests/unit/api/positions.test.js +3 -3
  46. package/dist/tests/unit/api/positions.test.js.map +1 -1
  47. package/dist/tests/unit/api-next/get-executed-trades.test.js +1 -3
  48. package/dist/tests/unit/api-next/get-executed-trades.test.js.map +1 -1
  49. package/dist/tests/unit/api-next-live/subscription-registry.test.js +1 -1
  50. package/dist/tests/unit/api-next-live/subscription-registry.test.js.map +1 -1
  51. package/package.json +10 -10
@@ -2,6 +2,8 @@
2
2
  * [[IBApi]] error event codes.
3
3
  */
4
4
  export declare enum ErrorCode {
5
+ /** No request id associated to this error */
6
+ NO_VALID_ID = -1,
5
7
  /** Order Canceled - reason: */
6
8
  ORDER_CANCELLED = 202,
7
9
  /** ou must subscribe for additional permissions to obtain precise results for scanner.Parameter:Most Active,Filter:Price;Real-Time Market Data:Pink Sheets */
@@ -191,6 +193,8 @@ export declare enum ErrorCode {
191
193
  FAIL_SEND_REQ_USER_INFO = 584,
192
194
  /** FA Profile is not supported anymore, use FA Group instead */
193
195
  FA_PROFILE_NOT_SUPPORTED = 585,
196
+ /** Failed to read message because not connected */
197
+ FAIL_READ_MESSAGE = 586,
194
198
  /** Invalid position trade derived value */
195
199
  INVALID_POSITION_TRADE_DERIVATED_VALUE = 2150,
196
200
  /** Part of requested market data is not subscribed. */
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ErrorCode = void 0;
8
8
  var ErrorCode;
9
9
  (function (ErrorCode) {
10
+ /** No request id associated to this error */
11
+ ErrorCode[ErrorCode["NO_VALID_ID"] = -1] = "NO_VALID_ID";
10
12
  /** Order Canceled - reason: */
11
13
  ErrorCode[ErrorCode["ORDER_CANCELLED"] = 202] = "ORDER_CANCELLED";
12
14
  /** ou must subscribe for additional permissions to obtain precise results for scanner.Parameter:Most Active,Filter:Price;Real-Time Market Data:Pink Sheets */
@@ -196,6 +198,8 @@ var ErrorCode;
196
198
  ErrorCode[ErrorCode["FAIL_SEND_REQ_USER_INFO"] = 584] = "FAIL_SEND_REQ_USER_INFO";
197
199
  /** FA Profile is not supported anymore, use FA Group instead */
198
200
  ErrorCode[ErrorCode["FA_PROFILE_NOT_SUPPORTED"] = 585] = "FA_PROFILE_NOT_SUPPORTED";
201
+ /** Failed to read message because not connected */
202
+ ErrorCode[ErrorCode["FAIL_READ_MESSAGE"] = 586] = "FAIL_READ_MESSAGE";
199
203
  /** Invalid position trade derived value */
200
204
  ErrorCode[ErrorCode["INVALID_POSITION_TRADE_DERIVATED_VALUE"] = 2150] = "INVALID_POSITION_TRADE_DERIVATED_VALUE";
201
205
  /** Part of requested market data is not subscribed. */
@@ -1 +1 @@
1
- {"version":3,"file":"errorCode.js","sourceRoot":"","sources":["../../src/common/errorCode.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,gEAAgE;;;AAEhE,IAAY,SAmSX;AAnSD,WAAY,SAAS;IACnB,+BAA+B;IAC/B,iEAAqB,CAAA;IAErB,8JAA8J;IAC9J,6EAA2B,CAAA;IAE3B,yBAAyB;IACzB,qEAAuB,CAAA;IAEvB,qFAAqF;IACrF,+EAA4B,CAAA;IAE5B,8BAA8B;IAC9B,+EAA4B,CAAA;IAE5B;;;;;;;;;OASG;IACH,2DAAkB,CAAA;IAElB,mDAAmD;IACnD,uDAAgB,CAAA;IAEhB,qBAAqB;IACrB,6DAAmB,CAAA;IAEnB,uCAAuC;IACvC,uDAAgB,CAAA;IAEhB,2BAA2B;IAC3B,yEAAyB,CAAA;IAEzB,0BAA0B;IAC1B,uDAAgB,CAAA;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/B,sCAAsC;IACtC,2FAAkC,CAAA;IAElC,8CAA8C;IAC9C,yFAAiC,CAAA;IAEjC,6CAA6C;IAC7C,+FAAoC,CAAA;IAEpC,8CAA8C;IAC9C,2FAAkC,CAAA;IAElC,+BAA+B;IAC/B,+DAAoB,CAAA;IAEpB,2CAA2C;IAC3C,yFAAiC,CAAA;IAEjC,yCAAyC;IACzC,yFAAiC,CAAA;IAEjC,2CAA2C;IAC3C,2FAAkC,CAAA;IAElC,0CAA0C;IAC1C,2FAAkC,CAAA;IAElC,sCAAsC;IACtC,iFAA6B,CAAA;IAE7B,gEAAgE;IAChE,mFAA8B,CAAA;IAE9B,mDAAmD;IACnD,qEAAuB,CAAA;IAEvB,2CAA2C;IAC3C,gHAA6C,CAAA;IAE7C,uDAAuD;IACvD,+GAA6C,CAAA;IAE7C,+EAA+E;IAC/E,mFAA+B,CAAA;IAE/B,+BAA+B;IAC/B,+EAA6B,CAAA;AAC/B,CAAC,EAzSW,SAAS,yBAAT,SAAS,QAySpB"}
@@ -99,6 +99,12 @@ export declare class Decoder {
99
99
  * Read a token from queue and return it as boolean value.
100
100
  */
101
101
  readBool(): boolean;
102
+ /**
103
+ * Read a token from queue and return it as boolean value.
104
+ *
105
+ * @deprecated readBool is probably what you are looking for
106
+ */
107
+ readBoolFromInt: () => boolean;
102
108
  /**
103
109
  * Read a token from queue and return it as floating point value.
104
110
  *
@@ -65,6 +65,12 @@ class Decoder {
65
65
  this.dataQueue = [];
66
66
  /** Data emit queue (data to be emitted to controller). */
67
67
  this.emitQueue = [];
68
+ /**
69
+ * Read a token from queue and return it as boolean value.
70
+ *
71
+ * @deprecated readBool is probably what you are looking for
72
+ */
73
+ this.readBoolFromInt = this.readBool;
68
74
  /**
69
75
  * Read a token from queue and return it as integer value.
70
76
  *
@@ -358,7 +364,7 @@ class Decoder {
358
364
  */
359
365
  readDouble() {
360
366
  const token = this.readStr();
361
- if (!token || token === "") {
367
+ if (token === "") {
362
368
  return 0;
363
369
  }
364
370
  const val = parseFloat(token);
@@ -371,7 +377,7 @@ class Decoder {
371
377
  */
372
378
  readDecimal() {
373
379
  const token = this.readStr();
374
- if (!token || token === "") {
380
+ if (token === "") {
375
381
  return undefined;
376
382
  }
377
383
  const val = parseFloat(token.replaceAll(",", ""));
@@ -384,7 +390,7 @@ class Decoder {
384
390
  */
385
391
  readDoubleOrUndefined() {
386
392
  const token = this.readStr();
387
- if (!token) {
393
+ if (token === "") {
388
394
  return undefined;
389
395
  }
390
396
  const val = parseFloat(token);
@@ -397,7 +403,7 @@ class Decoder {
397
403
  */
398
404
  readInt() {
399
405
  const token = this.readStr();
400
- if (!token || token === "") {
406
+ if (token === "") {
401
407
  return 0;
402
408
  }
403
409
  const val = parseInt(token, 10);
@@ -410,7 +416,7 @@ class Decoder {
410
416
  */
411
417
  readIntOrUndefined() {
412
418
  const token = this.readStr();
413
- if (!token || token === "") {
419
+ if (token === "") {
414
420
  return undefined;
415
421
  }
416
422
  const val = parseInt(token, 10);
@@ -647,6 +653,9 @@ class Decoder {
647
653
  orderDecoder.readPegBestPegMidOrderAttributes();
648
654
  orderDecoder.readCustomerAccount();
649
655
  orderDecoder.readProfessionalCustomer();
656
+ orderDecoder.readBondAccruedInterest();
657
+ orderDecoder.readIncludeOvernight();
658
+ orderDecoder.readCMETaggingFields();
650
659
  this.emit(event_name_1.EventName.openOrder, order.orderId, contract, order, orderState);
651
660
  }
652
661
  /**
@@ -843,6 +852,16 @@ class Decoder {
843
852
  this.readStr();
844
853
  contract.fundAssetType = this.readStr();
845
854
  }
855
+ if (this.serverVersion >= min_server_version_1.default.INELIGIBILITY_REASONS) {
856
+ const ineligibilityReasonCount = this.readInt();
857
+ const ineligibilityReasonList = new Array();
858
+ for (let i = 0; i < ineligibilityReasonCount; i++) {
859
+ const id = this.readStr();
860
+ const description = this.readStr();
861
+ ineligibilityReasonList.push({ id, description });
862
+ }
863
+ contract.ineligibilityReasonList = ineligibilityReasonList;
864
+ }
846
865
  this.emit(event_name_1.EventName.contractDetails, reqId, contract);
847
866
  }
848
867
  /**
@@ -910,7 +929,7 @@ class Decoder {
910
929
  exec.modelCode = this.readStr();
911
930
  }
912
931
  if (this.serverVersion >= min_server_version_1.default.LAST_LIQUIDITY) {
913
- exec.lastLiquidity = { value: this.readInt() };
932
+ exec.lastLiquidity = this.readInt();
914
933
  }
915
934
  if (this.serverVersion >= min_server_version_1.default.PENDING_PRICE_REVISION) {
916
935
  exec.pendingPriceRevision = this.readBool();
@@ -1113,6 +1132,11 @@ class Decoder {
1113
1132
  if (version >= 4) {
1114
1133
  contract.longName = this.readStr();
1115
1134
  }
1135
+ if (this.serverVersion >= min_server_version_1.default.BOND_TRADING_HOURS) {
1136
+ contract.timeZoneId = this.readStr();
1137
+ contract.tradingHours = this.readStr();
1138
+ contract.liquidHours = this.readStr();
1139
+ }
1116
1140
  if (version >= 6) {
1117
1141
  contract.evRule = this.readStr();
1118
1142
  contract.evMultiplier = this.readDouble();
@@ -1907,10 +1931,10 @@ class Decoder {
1907
1931
  * Decode a ORDER_BOUND message from data queue and a emit orderBound event.
1908
1932
  */
1909
1933
  decodeMsg_ORDER_BOUND() {
1934
+ const permId = this.readInt();
1935
+ const clientId = this.readDouble();
1910
1936
  const orderId = this.readInt();
1911
- const apiClientId = this.readDouble();
1912
- const apiOrderId = this.readInt();
1913
- this.emit(event_name_1.EventName.orderBound, orderId, apiClientId, apiOrderId);
1937
+ this.emit(event_name_1.EventName.orderBound, permId, clientId, orderId);
1914
1938
  }
1915
1939
  /**
1916
1940
  * Decode a COMPLETED_ORDER message from data queue and a emit completedOrder event.
@@ -2053,23 +2077,23 @@ class Decoder {
2053
2077
  */
2054
2078
  readLastTradeDate(contract, isBond) {
2055
2079
  const lastTradeDateOrContractMonth = this.readStr();
2056
- if (lastTradeDateOrContractMonth?.length) {
2057
- const tokens = lastTradeDateOrContractMonth.indexOf("-") > 0
2080
+ if (lastTradeDateOrContractMonth.length) {
2081
+ const split = lastTradeDateOrContractMonth.indexOf("-") > 0
2058
2082
  ? lastTradeDateOrContractMonth.split("-")
2059
2083
  : lastTradeDateOrContractMonth.split("\\s+");
2060
- if (tokens.length > 0) {
2084
+ if (split.length > 0) {
2061
2085
  if (isBond) {
2062
- contract.maturity = tokens[0];
2086
+ contract.maturity = split[0];
2063
2087
  }
2064
2088
  else {
2065
- contract.contract.lastTradeDateOrContractMonth = tokens[0];
2089
+ contract.contract.lastTradeDateOrContractMonth = split[0];
2066
2090
  }
2067
2091
  }
2068
- if (tokens.length > 1) {
2069
- contract.lastTradeTime = tokens[1];
2092
+ if (split.length > 1) {
2093
+ contract.lastTradeTime = split[1];
2070
2094
  }
2071
- if (isBond && tokens.length > 2) {
2072
- contract.timeZoneId = tokens[2];
2095
+ if (isBond && split.length > 2) {
2096
+ contract.timeZoneId = split[2];
2073
2097
  }
2074
2098
  }
2075
2099
  }
@@ -2757,5 +2781,21 @@ class OrderDecoder {
2757
2781
  this.order.professionalCustomer = this.decoder.readBool();
2758
2782
  }
2759
2783
  }
2784
+ readBondAccruedInterest() {
2785
+ if (this.serverVersion >= min_server_version_1.default.BOND_ACCRUED_INTEREST) {
2786
+ this.order.bondAccruedInterest = this.decoder.readStr();
2787
+ }
2788
+ }
2789
+ readIncludeOvernight() {
2790
+ if (this.serverVersion >= min_server_version_1.default.INCLUDE_OVERNIGHT) {
2791
+ this.order.includeOvernight = this.decoder.readBool();
2792
+ }
2793
+ }
2794
+ readCMETaggingFields() {
2795
+ if (this.serverVersion >= min_server_version_1.default.CME_TAGGING_FIELDS_IN_OPEN_ORDER) {
2796
+ this.order.extOperator = this.decoder.readStr();
2797
+ this.order.manualOrderIndicator = this.decoder.readIntOrUndefined();
2798
+ }
2799
+ }
2760
2800
  }
2761
2801
  //# sourceMappingURL=decoder.js.map