ccxt 4.1.57 → 4.1.59

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 (68) hide show
  1. package/README.md +5 -5
  2. package/build.sh +2 -2
  3. package/dist/ccxt.browser.js +778 -830
  4. package/dist/ccxt.browser.min.js +2 -2
  5. package/dist/cjs/ccxt.js +1 -19
  6. package/dist/cjs/src/base/Exchange.js +38 -17
  7. package/dist/cjs/src/base/ws/Client.js +1 -1
  8. package/dist/cjs/src/binance.js +70 -22
  9. package/dist/cjs/src/bitget.js +74 -52
  10. package/dist/cjs/src/bitmart.js +14 -22
  11. package/dist/cjs/src/bitrue.js +1 -1
  12. package/dist/cjs/src/bybit.js +36 -33
  13. package/dist/cjs/src/coinex.js +25 -30
  14. package/dist/cjs/src/htx.js +82 -39
  15. package/dist/cjs/src/kucoin.js +83 -35
  16. package/dist/cjs/src/mexc.js +3 -105
  17. package/dist/cjs/src/okx.js +8 -16
  18. package/dist/cjs/src/pro/bitget.js +7 -0
  19. package/dist/cjs/src/pro/bitmart.js +7 -0
  20. package/dist/cjs/src/pro/bittrex.js +9 -0
  21. package/dist/cjs/src/pro/bitvavo.js +9 -0
  22. package/dist/cjs/src/pro/bybit.js +9 -0
  23. package/dist/cjs/src/pro/htx.js +16 -5
  24. package/dist/cjs/src/pro/kucoin.js +7 -0
  25. package/dist/cjs/src/pro/mexc.js +9 -0
  26. package/js/ccxt.d.ts +2 -23
  27. package/js/ccxt.js +2 -16
  28. package/js/src/abstract/mexc.d.ts +0 -4
  29. package/js/src/base/Exchange.d.ts +7 -0
  30. package/js/src/base/Exchange.js +38 -17
  31. package/js/src/base/ws/Client.js +1 -1
  32. package/js/src/binance.d.ts +20 -2
  33. package/js/src/binance.js +70 -22
  34. package/js/src/bitget.d.ts +20 -2
  35. package/js/src/bitget.js +74 -52
  36. package/js/src/bitmart.d.ts +2 -2
  37. package/js/src/bitmart.js +14 -22
  38. package/js/src/bitrue.js +1 -1
  39. package/js/src/bybit.d.ts +2 -2
  40. package/js/src/bybit.js +36 -33
  41. package/js/src/coinex.d.ts +2 -2
  42. package/js/src/coinex.js +25 -30
  43. package/js/src/htx.d.ts +5 -3
  44. package/js/src/htx.js +82 -39
  45. package/js/src/kucoin.d.ts +20 -2
  46. package/js/src/kucoin.js +83 -35
  47. package/js/src/mexc.d.ts +0 -11
  48. package/js/src/mexc.js +3 -105
  49. package/js/src/okx.d.ts +18 -2
  50. package/js/src/okx.js +8 -16
  51. package/js/src/pro/bitget.js +7 -0
  52. package/js/src/pro/bitmart.js +7 -0
  53. package/js/src/pro/bittrex.js +9 -0
  54. package/js/src/pro/bitvavo.js +9 -0
  55. package/js/src/pro/bybit.js +9 -0
  56. package/js/src/pro/htx.js +16 -5
  57. package/js/src/pro/kucoin.js +7 -0
  58. package/js/src/pro/mexc.js +9 -0
  59. package/package.json +1 -1
  60. package/skip-tests.json +5 -0
  61. package/js/src/abstract/huobipro.d.ts +0 -547
  62. package/js/src/abstract/huobipro.js +0 -11
  63. package/js/src/abstract/mexc3.d.ts +0 -180
  64. package/js/src/abstract/mexc3.js +0 -11
  65. package/js/src/abstract/okex.d.ts +0 -280
  66. package/js/src/abstract/okex.js +0 -11
  67. package/js/src/abstract/okex5.d.ts +0 -280
  68. package/js/src/abstract/okex5.js +0 -11
@@ -31,7 +31,8 @@ class kucoin extends kucoin$1 {
31
31
  'swap': false,
32
32
  'future': false,
33
33
  'option': false,
34
- 'borrowMargin': true,
34
+ 'borrowCrossMargin': true,
35
+ 'borrowIsolatedMargin': true,
35
36
  'cancelAllOrders': true,
36
37
  'cancelOrder': true,
37
38
  'createDepositAddress': true,
@@ -92,7 +93,8 @@ class kucoin extends kucoin$1 {
92
93
  'fetchTransactionFee': true,
93
94
  'fetchTransfers': false,
94
95
  'fetchWithdrawals': true,
95
- 'repayMargin': true,
96
+ 'repayCrossMargin': true,
97
+ 'repayIsolatedMargin': true,
96
98
  'setLeverage': false,
97
99
  'setMarginMode': false,
98
100
  'setPositionMode': false,
@@ -4108,41 +4110,64 @@ class kucoin extends kucoin$1 {
4108
4110
  'info': info,
4109
4111
  };
4110
4112
  }
4111
- async borrowMargin(code, amount, symbol = undefined, params = {}) {
4113
+ async borrowCrossMargin(code, amount, params = {}) {
4112
4114
  /**
4113
4115
  * @method
4114
- * @name kucoin#borrowMargin
4116
+ * @name kucoin#borrowCrossMargin
4115
4117
  * @description create a loan to borrow margin
4116
4118
  * @see https://docs.kucoin.com/#1-margin-borrowing
4117
4119
  * @param {string} code unified currency code of the currency to borrow
4118
4120
  * @param {float} amount the amount to borrow
4121
+ * @param {object} [params] extra parameters specific to the kucoin api endpoints
4122
+ * @param {string} [params.timeInForce] either IOC or FOK
4123
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4124
+ */
4125
+ await this.loadMarkets();
4126
+ const currency = this.currency(code);
4127
+ const request = {
4128
+ 'currency': currency['id'],
4129
+ 'size': this.currencyToPrecision(code, amount),
4130
+ 'timeInForce': 'FOK',
4131
+ };
4132
+ const response = await this.privatePostMarginBorrow(this.extend(request, params));
4133
+ //
4134
+ // {
4135
+ // "success": true,
4136
+ // "code": "200",
4137
+ // "msg": "success",
4138
+ // "retry": false,
4139
+ // "data": {
4140
+ // "orderNo": "5da6dba0f943c0c81f5d5db5",
4141
+ // "actualSize": 10
4142
+ // }
4143
+ // }
4144
+ //
4145
+ const data = this.safeValue(response, 'data', {});
4146
+ return this.parseMarginLoan(data, currency);
4147
+ }
4148
+ async borrowIsolatedMargin(symbol, code, amount, params = {}) {
4149
+ /**
4150
+ * @method
4151
+ * @name kucoin#borrowIsolatedMargin
4152
+ * @description create a loan to borrow margin
4153
+ * @see https://docs.kucoin.com/#1-margin-borrowing
4119
4154
  * @param {string} symbol unified market symbol, required for isolated margin
4155
+ * @param {string} code unified currency code of the currency to borrow
4156
+ * @param {float} amount the amount to borrow
4120
4157
  * @param {object} [params] extra parameters specific to the kucoin api endpoints
4121
4158
  * @param {string} [params.timeInForce] either IOC or FOK
4122
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4123
4159
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4124
4160
  */
4125
- const marginMode = this.safeString(params, 'marginMode'); // cross or isolated
4126
- const isIsolated = marginMode === 'isolated';
4127
- params = this.omit(params, 'marginMode');
4128
- this.checkRequiredMarginArgument('borrowMargin', symbol, marginMode);
4129
4161
  await this.loadMarkets();
4162
+ const market = this.market(symbol);
4130
4163
  const currency = this.currency(code);
4131
4164
  const request = {
4132
4165
  'currency': currency['id'],
4133
4166
  'size': this.currencyToPrecision(code, amount),
4167
+ 'symbol': market['id'],
4168
+ 'timeInForce': 'FOK',
4169
+ 'isIsolated': true,
4134
4170
  };
4135
- const timeInForce = this.safeStringN(params, ['timeInForce', 'type', 'borrowStrategy'], 'IOC');
4136
- if (isIsolated) {
4137
- if (symbol === undefined) {
4138
- throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol parameter for isolated margin');
4139
- }
4140
- const market = this.market(symbol);
4141
- request['symbol'] = market['id'];
4142
- request['isIsolated'] = true;
4143
- }
4144
- params = this.omit(params, ['timeInForce', 'type', 'borrowStrategy']);
4145
- request['timeInForce'] = timeInForce;
4146
4171
  const response = await this.privatePostMarginBorrow(this.extend(request, params));
4147
4172
  //
4148
4173
  // {
@@ -4159,37 +4184,60 @@ class kucoin extends kucoin$1 {
4159
4184
  const data = this.safeValue(response, 'data', {});
4160
4185
  return this.parseMarginLoan(data, currency);
4161
4186
  }
4162
- async repayMargin(code, amount, symbol = undefined, params = {}) {
4187
+ async repayCrossMargin(code, amount, params = {}) {
4163
4188
  /**
4164
4189
  * @method
4165
- * @name kucoin#repayMargin
4190
+ * @name kucoin#repayCrossMargin
4166
4191
  * @description repay borrowed margin and interest
4167
4192
  * @see https://docs.kucoin.com/#2-repayment
4168
4193
  * @param {string} code unified currency code of the currency to repay
4169
4194
  * @param {float} amount the amount to repay
4195
+ * @param {object} [params] extra parameters specific to the kucoin api endpoints
4196
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4197
+ */
4198
+ await this.loadMarkets();
4199
+ const currency = this.currency(code);
4200
+ const request = {
4201
+ 'currency': currency['id'],
4202
+ 'size': this.currencyToPrecision(code, amount),
4203
+ };
4204
+ const response = await this.privatePostMarginRepay(this.extend(request, params));
4205
+ //
4206
+ // {
4207
+ // "success": true,
4208
+ // "code": "200",
4209
+ // "msg": "success",
4210
+ // "retry": false,
4211
+ // "data": {
4212
+ // "orderNo": "5da6dba0f943c0c81f5d5db5",
4213
+ // "actualSize": 10
4214
+ // }
4215
+ // }
4216
+ //
4217
+ const data = this.safeValue(response, 'data', {});
4218
+ return this.parseMarginLoan(data, currency);
4219
+ }
4220
+ async repayIsolatedMargin(symbol, code, amount, params = {}) {
4221
+ /**
4222
+ * @method
4223
+ * @name kucoin#repayIsolatedMargin
4224
+ * @description repay borrowed margin and interest
4225
+ * @see https://docs.kucoin.com/#2-repayment
4170
4226
  * @param {string} symbol unified market symbol
4227
+ * @param {string} code unified currency code of the currency to repay
4228
+ * @param {float} amount the amount to repay
4171
4229
  * @param {object} [params] extra parameters specific to the kucoin api endpoints
4172
- * @param {string} [params.marginMode] 'cross' or 'isolated' default is 'cross'
4173
4230
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4174
4231
  */
4175
- const marginMode = this.safeString(params, 'marginMode'); // cross or isolated
4176
- const isIsolated = marginMode === 'isolated';
4177
- params = this.omit(params, 'marginMode');
4178
- this.checkRequiredMarginArgument('repayMargin', symbol, marginMode);
4179
4232
  await this.loadMarkets();
4233
+ const market = this.market(symbol);
4180
4234
  const currency = this.currency(code);
4181
4235
  const request = {
4182
4236
  'currency': currency['id'],
4183
4237
  'size': this.currencyToPrecision(code, amount),
4238
+ 'symbol': market['id'],
4239
+ 'isIsolated': true,
4184
4240
  };
4185
- if (isIsolated) {
4186
- if (symbol === undefined) {
4187
- throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol parameter for isolated margin');
4188
- }
4189
- const market = this.market(symbol);
4190
- request['symbol'] = market['id'];
4191
- request['isIsolated'] = true;
4192
- }
4193
4241
  const response = await this.privatePostMarginRepay(this.extend(request, params));
4194
4242
  //
4195
4243
  // {
@@ -30,7 +30,7 @@ class mexc extends mexc$1 {
30
30
  'future': false,
31
31
  'option': false,
32
32
  'addMargin': true,
33
- 'borrowMargin': true,
33
+ 'borrowMargin': false,
34
34
  'cancelAllOrders': true,
35
35
  'cancelOrder': true,
36
36
  'cancelOrders': undefined,
@@ -102,7 +102,7 @@ class mexc extends mexc$1 {
102
102
  'fetchWithdrawal': undefined,
103
103
  'fetchWithdrawals': true,
104
104
  'reduceMargin': true,
105
- 'repayMargin': true,
105
+ 'repayMargin': false,
106
106
  'setLeverage': true,
107
107
  'setMarginMode': undefined,
108
108
  'setPositionMode': true,
@@ -213,10 +213,6 @@ class mexc extends mexc$1 {
213
213
  'capital/deposit/address': 1,
214
214
  'capital/sub-account/universalTransfer': 1,
215
215
  'capital/convert': 1,
216
- 'margin/tradeMode': 1,
217
- 'margin/order': 1,
218
- 'margin/loan': 1,
219
- 'margin/repay': 1,
220
216
  'mxDeduct/enable': 1,
221
217
  'userDataStream': 1,
222
218
  },
@@ -2130,13 +2126,7 @@ class mexc extends mexc$1 {
2130
2126
  async createSpotOrder(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
2131
2127
  await this.loadMarkets();
2132
2128
  const request = this.createSpotOrderRequest(market, type, side, amount, price, marginMode, params);
2133
- let response = undefined;
2134
- if (marginMode !== undefined) {
2135
- response = await this.spotPrivatePostMarginOrder(this.extend(request, params));
2136
- }
2137
- else {
2138
- response = await this.spotPrivatePostOrder(this.extend(request, params));
2139
- }
2129
+ const response = await this.spotPrivatePostOrder(this.extend(request, params));
2140
2130
  //
2141
2131
  // spot
2142
2132
  //
@@ -5022,82 +5012,6 @@ class mexc extends mexc$1 {
5022
5012
  'hedged': (positionMode === 1),
5023
5013
  };
5024
5014
  }
5025
- async borrowMargin(code, amount, symbol = undefined, params = {}) {
5026
- /**
5027
- * @method
5028
- * @name mexc3#borrowMargin
5029
- * @description create a loan to borrow margin
5030
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#loan
5031
- * @param {string} code unified currency code of the currency to borrow
5032
- * @param {float} amount the amount to borrow
5033
- * @param {string} symbol unified market symbol
5034
- * @param {object} [params] extra parameters specific to the mexc3 api endpoint
5035
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
5036
- */
5037
- if (symbol === undefined) {
5038
- throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
5039
- }
5040
- await this.loadMarkets();
5041
- const market = this.market(symbol);
5042
- const currency = this.currency(code);
5043
- const request = {
5044
- 'asset': currency['id'],
5045
- 'amount': this.currencyToPrecision(code, amount),
5046
- 'symbol': market['id'],
5047
- };
5048
- const response = await this.spotPrivatePostMarginLoan(this.extend(request, params));
5049
- //
5050
- // {
5051
- // "tranId": "762407666453712896"
5052
- // }
5053
- //
5054
- const transaction = this.parseMarginLoan(response, currency);
5055
- return this.extend(transaction, {
5056
- 'amount': amount,
5057
- 'symbol': symbol,
5058
- });
5059
- }
5060
- async repayMargin(code, amount, symbol = undefined, params = {}) {
5061
- /**
5062
- * @method
5063
- * @name mexc3#repayMargin
5064
- * @description repay borrowed margin and interest
5065
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#repayment
5066
- * @param {string} code unified currency code of the currency to repay
5067
- * @param {float} amount the amount to repay
5068
- * @param {string} symbol unified market symbol
5069
- * @param {object} [params] extra parameters specific to the mexc3 api endpoint
5070
- * @param {string} [params.borrowId] transaction id '762407666453712896'
5071
- * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
5072
- */
5073
- if (symbol === undefined) {
5074
- throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
5075
- }
5076
- await this.loadMarkets();
5077
- const id = this.safeString2(params, 'id', 'borrowId');
5078
- if (id === undefined) {
5079
- throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a borrowId argument in the params');
5080
- }
5081
- const market = this.market(symbol);
5082
- const currency = this.currency(code);
5083
- const request = {
5084
- 'asset': currency['id'],
5085
- 'amount': this.currencyToPrecision(code, amount),
5086
- 'borrowId': id,
5087
- 'symbol': market['id'],
5088
- };
5089
- const response = await this.spotPrivatePostMarginRepay(this.extend(request, params));
5090
- //
5091
- // {
5092
- // "tranId": "762407666453712896"
5093
- // }
5094
- //
5095
- const transaction = this.parseMarginLoan(response, currency);
5096
- return this.extend(transaction, {
5097
- 'amount': amount,
5098
- 'symbol': symbol,
5099
- });
5100
- }
5101
5015
  async fetchTransactionFees(codes = undefined, params = {}) {
5102
5016
  /**
5103
5017
  * @method
@@ -5285,22 +5199,6 @@ class mexc extends mexc$1 {
5285
5199
  }
5286
5200
  return this.assignDefaultDepositWithdrawFees(result);
5287
5201
  }
5288
- parseMarginLoan(info, currency = undefined) {
5289
- //
5290
- // {
5291
- // "tranId": "762407666453712896"
5292
- // }
5293
- //
5294
- return {
5295
- 'id': this.safeString(info, 'tranId'),
5296
- 'currency': this.safeCurrencyCode(undefined, currency),
5297
- 'amount': undefined,
5298
- 'symbol': undefined,
5299
- 'timestamp': undefined,
5300
- 'datetime': undefined,
5301
- 'info': info,
5302
- };
5303
- }
5304
5202
  handleMarginModeAndParams(methodName, params = {}, defaultValue = undefined) {
5305
5203
  /**
5306
5204
  * @ignore
@@ -116,7 +116,7 @@ class okx extends okx$1 {
116
116
  'fetchWithdrawals': true,
117
117
  'fetchWithdrawalWhitelist': false,
118
118
  'reduceMargin': true,
119
- 'repayMargin': true,
119
+ 'repayCrossMargin': true,
120
120
  'setLeverage': true,
121
121
  'setMargin': false,
122
122
  'setMarginMode': true,
@@ -6403,15 +6403,14 @@ class okx extends okx$1 {
6403
6403
  'info': info,
6404
6404
  };
6405
6405
  }
6406
- async borrowMargin(code, amount, symbol = undefined, params = {}) {
6406
+ async borrowCrossMargin(code, amount, params = {}) {
6407
6407
  /**
6408
6408
  * @method
6409
- * @name okx#borrowMargin
6410
- * @description create a loan to borrow margin
6409
+ * @name okx#borrowCrossMargin
6410
+ * @description create a loan to borrow margin (need to be VIP 5 and above)
6411
6411
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
6412
6412
  * @param {string} code unified currency code of the currency to borrow
6413
6413
  * @param {float} amount the amount to borrow
6414
- * @param {string} symbol not used by okx.borrowMargin ()
6415
6414
  * @param {object} [params] extra parameters specific to the okx api endpoint
6416
6415
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6417
6416
  */
@@ -6442,20 +6441,16 @@ class okx extends okx$1 {
6442
6441
  //
6443
6442
  const data = this.safeValue(response, 'data', []);
6444
6443
  const loan = this.safeValue(data, 0);
6445
- const transaction = this.parseMarginLoan(loan, currency);
6446
- return this.extend(transaction, {
6447
- 'symbol': symbol,
6448
- });
6444
+ return this.parseMarginLoan(loan, currency);
6449
6445
  }
6450
- async repayMargin(code, amount, symbol = undefined, params = {}) {
6446
+ async repayCrossMargin(code, amount, params = {}) {
6451
6447
  /**
6452
6448
  * @method
6453
- * @name okx#repayMargin
6449
+ * @name okx#repayCrossMargin
6454
6450
  * @description repay borrowed margin and interest
6455
6451
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
6456
6452
  * @param {string} code unified currency code of the currency to repay
6457
6453
  * @param {float} amount the amount to repay
6458
- * @param {string} symbol not used by okx.repayMargin ()
6459
6454
  * @param {object} [params] extra parameters specific to the okx api endpoint
6460
6455
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6461
6456
  */
@@ -6486,10 +6481,7 @@ class okx extends okx$1 {
6486
6481
  //
6487
6482
  const data = this.safeValue(response, 'data', []);
6488
6483
  const loan = this.safeValue(data, 0);
6489
- const transaction = this.parseMarginLoan(loan, currency);
6490
- return this.extend(transaction, {
6491
- 'symbol': symbol,
6492
- });
6484
+ return this.parseMarginLoan(loan, currency);
6493
6485
  }
6494
6486
  parseMarginLoan(info, currency = undefined) {
6495
6487
  //
@@ -18,6 +18,13 @@ class bitget extends bitget$1 {
18
18
  return this.deepExtend(super.describe(), {
19
19
  'has': {
20
20
  'ws': true,
21
+ 'createOrderWs': false,
22
+ 'editOrderWs': false,
23
+ 'fetchOpenOrdersWs': false,
24
+ 'fetchOrderWs': false,
25
+ 'cancelOrderWs': false,
26
+ 'cancelOrdersWs': false,
27
+ 'cancelAllOrdersWs': false,
21
28
  'watchBalance': true,
22
29
  'watchMyTrades': true,
23
30
  'watchOHLCV': true,
@@ -11,6 +11,13 @@ class bitmart extends bitmart$1 {
11
11
  describe() {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
+ 'createOrderWs': false,
15
+ 'editOrderWs': false,
16
+ 'fetchOpenOrdersWs': false,
17
+ 'fetchOrderWs': false,
18
+ 'cancelOrderWs': false,
19
+ 'cancelOrdersWs': false,
20
+ 'cancelAllOrdersWs': false,
14
21
  'ws': true,
15
22
  'watchTicker': true,
16
23
  'watchOrderBook': true,
@@ -13,6 +13,15 @@ class bittrex extends bittrex$1 {
13
13
  return this.deepExtend(super.describe(), {
14
14
  'has': {
15
15
  'ws': true,
16
+ 'cancelAllOrdersWs': false,
17
+ 'cancelOrdersWs': false,
18
+ 'cancelOrderWs': false,
19
+ 'createOrderWs': false,
20
+ 'editOrderWs': false,
21
+ 'fetchBalanceWs': false,
22
+ 'fetchOpenOrdersWs': false,
23
+ 'fetchOrderWs': false,
24
+ 'fetchTradesWs': false,
16
25
  'watchBalance': true,
17
26
  'watchHeartbeat': true,
18
27
  'watchMyTrades': true,
@@ -12,6 +12,15 @@ class bitvavo extends bitvavo$1 {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
14
  'ws': true,
15
+ 'createOrderWs': false,
16
+ 'editOrderWs': false,
17
+ 'fetchOpenOrdersWs': false,
18
+ 'fetchOrderWs': false,
19
+ 'cancelOrderWs': false,
20
+ 'cancelOrdersWs': false,
21
+ 'cancelAllOrdersWs': false,
22
+ 'fetchTradesWs': false,
23
+ 'fetchBalanceWs': false,
15
24
  'watchOrderBook': true,
16
25
  'watchTrades': true,
17
26
  'watchTicker': true,
@@ -12,6 +12,15 @@ class bybit extends bybit$1 {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
14
  'ws': true,
15
+ 'createOrderWs': false,
16
+ 'editOrderWs': false,
17
+ 'fetchOpenOrdersWs': false,
18
+ 'fetchOrderWs': false,
19
+ 'cancelOrderWs': false,
20
+ 'cancelOrdersWs': false,
21
+ 'cancelAllOrdersWs': false,
22
+ 'fetchTradesWs': false,
23
+ 'fetchBalanceWs': false,
15
24
  'watchBalance': true,
16
25
  'watchMyTrades': true,
17
26
  'watchOHLCV': true,
@@ -12,6 +12,15 @@ class htx extends htx$1 {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
14
  'ws': true,
15
+ 'createOrderWs': false,
16
+ 'editOrderWs': false,
17
+ 'fetchOpenOrdersWs': false,
18
+ 'fetchOrderWs': false,
19
+ 'cancelOrderWs': false,
20
+ 'cancelOrdersWs': false,
21
+ 'cancelAllOrdersWs': false,
22
+ 'fetchTradesWs': false,
23
+ 'fetchBalanceWs': false,
15
24
  'watchOrderBook': true,
16
25
  'watchOrders': true,
17
26
  'watchTickers': false,
@@ -701,8 +710,8 @@ class htx extends htx$1 {
701
710
  let orderType = this.safeString(this.options, 'orderType', 'orders'); // orders or matchOrders
702
711
  orderType = this.safeString(params, 'orderType', orderType);
703
712
  params = this.omit(params, 'orderType');
704
- const marketCode = (market !== undefined) ? market['lowercaseId'] : undefined;
705
- const baseId = (market !== undefined) ? market['lowercaseBaseId'] : undefined;
713
+ const marketCode = (market !== undefined) ? market['lowercaseId'].toLowerCase() : undefined;
714
+ const baseId = (market !== undefined) ? market['baseId'] : undefined;
706
715
  const prefix = orderType;
707
716
  messageHash = prefix;
708
717
  if (subType === 'linear') {
@@ -721,7 +730,7 @@ class htx extends htx$1 {
721
730
  else if (type === 'future') {
722
731
  // inverse futures Example: BCH/USD:BCH-220408
723
732
  if (baseId !== undefined) {
724
- channel = prefix + '.' + baseId;
733
+ channel = prefix + '.' + baseId.toLowerCase();
725
734
  messageHash = channel;
726
735
  }
727
736
  else {
@@ -955,7 +964,8 @@ class htx extends htx$1 {
955
964
  // when we make a global subscription (for contracts only) our message hash can't have a symbol/currency attached
956
965
  // so we're removing it here
957
966
  let genericMessageHash = messageHash.replace('.' + market['lowercaseId'], '');
958
- genericMessageHash = genericMessageHash.replace('.' + market['lowercaseBaseId'], '');
967
+ const lowerCaseBaseId = this.safeStringLower(market, 'baseId');
968
+ genericMessageHash = genericMessageHash.replace('.' + lowerCaseBaseId, '');
959
969
  client.resolve(this.orders, genericMessageHash);
960
970
  }
961
971
  parseWsOrder(order, market = undefined) {
@@ -2129,7 +2139,8 @@ class htx extends htx$1 {
2129
2139
  // since this is a global sub, our messageHash does not specify any symbol (ex: orders_cross:trade)
2130
2140
  // so we must remove it
2131
2141
  let genericOrderHash = messageHash.replace('.' + market['lowercaseId'], '');
2132
- genericOrderHash = genericOrderHash.replace('.' + market['lowercaseBaseId'], '');
2142
+ const lowerCaseBaseId = this.safeStringLower(market, 'baseId');
2143
+ genericOrderHash = genericOrderHash.replace('.' + lowerCaseBaseId, '');
2133
2144
  const genericTradesHash = genericOrderHash + ':' + 'trade';
2134
2145
  client.resolve(this.myTrades, genericTradesHash);
2135
2146
  }
@@ -11,6 +11,13 @@ class kucoin extends kucoin$1 {
11
11
  return this.deepExtend(super.describe(), {
12
12
  'has': {
13
13
  'ws': true,
14
+ 'createOrderWs': false,
15
+ 'editOrderWs': false,
16
+ 'fetchOpenOrdersWs': false,
17
+ 'fetchOrderWs': false,
18
+ 'cancelOrderWs': false,
19
+ 'cancelOrdersWs': false,
20
+ 'cancelAllOrdersWs': false,
14
21
  'watchOrderBook': true,
15
22
  'watchOrders': true,
16
23
  'watchMyTrades': true,
@@ -12,6 +12,15 @@ class mexc extends mexc$1 {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
14
  'ws': true,
15
+ 'cancelAllOrdersWs': false,
16
+ 'cancelOrdersWs': false,
17
+ 'cancelOrderWs': false,
18
+ 'createOrderWs': false,
19
+ 'editOrderWs': false,
20
+ 'fetchBalanceWs': false,
21
+ 'fetchOpenOrdersWs': false,
22
+ 'fetchOrderWs': false,
23
+ 'fetchTradesWs': false,
15
24
  'watchBalance': true,
16
25
  'watchMyTrades': true,
17
26
  'watchOHLCV': true,