ccxt 4.3.34 → 4.3.35

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.
@@ -969,7 +969,9 @@ export default class bitget extends bitgetRest {
969
969
  * @param {int} [limit] the maximum number of order structures to retrieve
970
970
  * @param {object} [params] extra parameters specific to the exchange API endpoint
971
971
  * @param {boolean} [params.stop] *contract only* set to true for watching trigger orders
972
- * @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders
972
+ * @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
973
+ * @param {string} [params.type] 'spot', 'swap'
974
+ * @param {string} [params.subType] 'linear', 'inverse'
973
975
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
974
976
  */
975
977
  await this.loadMarkets();
@@ -985,11 +987,26 @@ export default class bitget extends bitgetRest {
985
987
  marketId = market['id'];
986
988
  messageHash = messageHash + ':' + symbol;
987
989
  }
990
+ const productType = this.safeString(params, 'productType');
988
991
  let type = undefined;
989
992
  [type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
993
+ let subType = undefined;
994
+ [subType, params] = this.handleSubTypeAndParams('watchOrders', market, params, 'linear');
990
995
  if ((type === 'spot') && (symbol === undefined)) {
991
996
  throw new ArgumentsRequired(this.id + ' watchOrders requires a symbol argument for ' + type + ' markets.');
992
997
  }
998
+ if ((productType === undefined) && (type !== 'spot') && (symbol === undefined)) {
999
+ messageHash = messageHash + ':' + subType;
1000
+ }
1001
+ else if (productType === 'USDT-FUTURES') {
1002
+ messageHash = messageHash + ':linear';
1003
+ }
1004
+ else if (productType === 'COIN-FUTURES') {
1005
+ messageHash = messageHash + ':inverse';
1006
+ }
1007
+ else if (productType === 'USDC-FUTURES') {
1008
+ messageHash = messageHash + ':usdcfutures'; // non unified channel
1009
+ }
993
1010
  let instType = undefined;
994
1011
  [instType, params] = this.getInstType(market, params);
995
1012
  if (type === 'spot') {
@@ -1011,6 +1028,7 @@ export default class bitget extends bitgetRest {
1011
1028
  channel = 'orders-crossed';
1012
1029
  }
1013
1030
  }
1031
+ subscriptionHash = subscriptionHash + ':' + instType;
1014
1032
  const args = {
1015
1033
  'instType': instType,
1016
1034
  'channel': channel,
@@ -1070,6 +1088,9 @@ export default class bitget extends bitgetRest {
1070
1088
  else {
1071
1089
  marketType = 'contract';
1072
1090
  }
1091
+ const isLinearSwap = (instType === 'USDT-FUTURES');
1092
+ const isInverseSwap = (instType === 'COIN-FUTURES');
1093
+ const isUSDCFutures = (instType === 'USDC-FUTURES');
1073
1094
  const data = this.safeValue(message, 'data', []);
1074
1095
  if (this.orders === undefined) {
1075
1096
  const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
@@ -1096,6 +1117,15 @@ export default class bitget extends bitgetRest {
1096
1117
  client.resolve(stored, innerMessageHash);
1097
1118
  }
1098
1119
  client.resolve(stored, messageHash);
1120
+ if (isLinearSwap) {
1121
+ client.resolve(stored, 'order:linear');
1122
+ }
1123
+ if (isInverseSwap) {
1124
+ client.resolve(stored, 'order:inverse');
1125
+ }
1126
+ if (isUSDCFutures) {
1127
+ client.resolve(stored, 'order:usdcfutures');
1128
+ }
1099
1129
  }
1100
1130
  parseWsOrder(order, market = undefined) {
1101
1131
  //
package/js/src/pro/okx.js CHANGED
@@ -162,7 +162,7 @@ export default class okx extends okxRest {
162
162
  this.deepExtend(firstArgument, params),
163
163
  ],
164
164
  };
165
- return this.watch(url, messageHash, request, messageHash);
165
+ return await this.watch(url, messageHash, request, messageHash);
166
166
  }
167
167
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
168
168
  /**
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 1 | 0 | -1;
18
+ protected signum(): 0 | 1 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.34",
3
+ "version": "4.3.35",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",