ccxt 4.2.65 → 4.2.66

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/dist/cjs/ccxt.js CHANGED
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
177
177
 
178
178
  //-----------------------------------------------------------------------------
179
179
  // this is updated by vss.js when building
180
- const version = '4.2.65';
180
+ const version = '4.2.66';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -1541,7 +1541,11 @@ class bigone extends bigone$1 {
1541
1541
  }
1542
1542
  }
1543
1543
  request['type'] = uppercaseType;
1544
- params = this.omit(params, ['stop_price', 'stopPrice', 'triggerPrice', 'timeInForce']);
1544
+ const clientOrderId = this.safeString(params, 'clientOrderId');
1545
+ if (clientOrderId !== undefined) {
1546
+ request['client_order_id'] = clientOrderId;
1547
+ }
1548
+ params = this.omit(params, ['stop_price', 'stopPrice', 'triggerPrice', 'timeInForce', 'clientOrderId']);
1545
1549
  const response = await this.privatePostOrders(this.extend(request, params));
1546
1550
  //
1547
1551
  // {
@@ -1822,7 +1826,7 @@ class bigone extends bigone$1 {
1822
1826
  }
1823
1827
  else if (method === 'POST') {
1824
1828
  headers['Content-Type'] = 'application/json';
1825
- body = query;
1829
+ body = this.json(query);
1826
1830
  }
1827
1831
  }
1828
1832
  headers['User-Agent'] = 'ccxt/' + this.id + '-' + this.version;
@@ -3082,10 +3082,10 @@ class bitfinex2 extends bitfinex2$1 {
3082
3082
  }
3083
3083
  const reversedArray = [];
3084
3084
  const rawRates = this.filterBySymbolSinceLimit(rates, symbol, since, limit);
3085
- const rawRatesLength = rawRates.length;
3086
- const ratesLength = Math.max(rawRatesLength - 1, 0);
3087
- for (let i = ratesLength; i >= 0; i--) {
3088
- const valueAtIndex = rawRates[i];
3085
+ const ratesLength = rawRates.length;
3086
+ for (let i = 0; i < ratesLength; i++) {
3087
+ const index = ratesLength - i - 1;
3088
+ const valueAtIndex = rawRates[index];
3089
3089
  reversedArray.push(valueAtIndex);
3090
3090
  }
3091
3091
  return reversedArray;
@@ -371,6 +371,8 @@ class bitget extends bitget$1 {
371
371
  'v2/spot/wallet/transfer': 2,
372
372
  'v2/spot/wallet/subaccount-transfer': 2,
373
373
  'v2/spot/wallet/withdrawal': 2,
374
+ 'v2/spot/wallet/cancel-withdrawal': 2,
375
+ 'v2/spot/wallet/modify-deposit-account': 2,
374
376
  },
375
377
  },
376
378
  'mix': {
@@ -715,9 +717,12 @@ class bitget extends bitget$1 {
715
717
  'v2/convert/currencies': 2,
716
718
  'v2/convert/quoted-price': 2,
717
719
  'v2/convert/convert-record': 2,
720
+ 'v2/convert/bgb-convert-coin-list': 2,
721
+ 'v2/convert/bgb-convert-records': 2,
718
722
  },
719
723
  'post': {
720
724
  'v2/convert/trade': 2,
725
+ 'v2/convert/bgb-convert': 2,
721
726
  },
722
727
  },
723
728
  'earn': {
@@ -4922,6 +4927,7 @@ class bitget extends bitget$1 {
4922
4927
  * @name bitget#cancelAllOrders
4923
4928
  * @description cancel all open orders
4924
4929
  * @see https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
4930
+ * @see https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
4925
4931
  * @see https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
4926
4932
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
4927
4933
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
@@ -4949,7 +4955,7 @@ class bitget extends bitget$1 {
4949
4955
  const request = {
4950
4956
  'symbol': market['id'],
4951
4957
  };
4952
- const stop = this.safeValue2(params, 'stop', 'trigger');
4958
+ const stop = this.safeBool2(params, 'stop', 'trigger');
4953
4959
  params = this.omit(params, ['stop', 'trigger']);
4954
4960
  let response = undefined;
4955
4961
  if (market['spot']) {
@@ -4962,7 +4968,15 @@ class bitget extends bitget$1 {
4962
4968
  }
4963
4969
  }
4964
4970
  else {
4965
- response = await this.privateSpotPostV2SpotTradeCancelSymbolOrder(this.extend(request, params));
4971
+ if (stop) {
4972
+ const stopRequest = {
4973
+ 'symbolList': [market['id']],
4974
+ };
4975
+ response = await this.privateSpotPostV2SpotTradeBatchCancelPlanOrder(this.extend(stopRequest, params));
4976
+ }
4977
+ else {
4978
+ response = await this.privateSpotPostV2SpotTradeCancelSymbolOrder(this.extend(request, params));
4979
+ }
4966
4980
  }
4967
4981
  }
4968
4982
  else {
@@ -1721,10 +1721,10 @@ class hitbtc extends hitbtc$1 {
1721
1721
  'symbol': market['id'],
1722
1722
  'period': this.safeString(this.timeframes, timeframe, timeframe),
1723
1723
  };
1724
- [request, params] = this.handleUntilOption('till', request, params);
1725
1724
  if (since !== undefined) {
1726
1725
  request['from'] = this.iso8601(since);
1727
1726
  }
1727
+ [request, params] = this.handleUntilOption('till', request, params);
1728
1728
  if (limit !== undefined) {
1729
1729
  request['limit'] = limit;
1730
1730
  }
@@ -320,11 +320,12 @@ class bitfinex2 extends bitfinex2$1 {
320
320
  const messageLength = message.length;
321
321
  if (messageLength === 2) {
322
322
  // initial snapshot
323
- let trades = this.safeList(message, 1, []);
323
+ const trades = this.safeList(message, 1, []);
324
324
  // needs to be reversed to make chronological order
325
- trades = trades.reverse();
326
- for (let i = 0; i < trades.length; i++) {
327
- const parsed = this.parseWsTrade(trades[i], market);
325
+ const length = trades.length;
326
+ for (let i = 0; i < length; i++) {
327
+ const index = length - i - 1;
328
+ const parsed = this.parseWsTrade(trades[index], market);
328
329
  stored.append(parsed);
329
330
  }
330
331
  }
@@ -671,10 +671,10 @@ class bitget extends bitget$1 {
671
671
  }
672
672
  const data = this.safeList(message, 'data', []);
673
673
  const length = data.length;
674
- const maxLength = Math.max(length - 1, 0);
675
674
  // fix chronological order by reversing
676
- for (let i = maxLength; i >= 0; i--) {
677
- const rawTrade = data[i];
675
+ for (let i = 0; i < length; i++) {
676
+ const index = length - i - 1;
677
+ const rawTrade = data[index];
678
678
  const parsed = this.parseWsTrade(rawTrade, market);
679
679
  stored.append(parsed);
680
680
  }
@@ -827,9 +827,9 @@ class bitmart extends bitmart$1 {
827
827
  const isSwap = ('group' in message);
828
828
  if (isSwap) {
829
829
  // in swap, chronologically decreasing: 1709536849322, 1709536848954,
830
- const maxLen = Math.max(length - 1, 0);
831
- for (let i = maxLen; i >= 0; i--) {
832
- symbol = this.handleTradeLoop(data[i]);
830
+ for (let i = 0; i < length; i++) {
831
+ const index = length - i - 1;
832
+ symbol = this.handleTradeLoop(data[index]);
833
833
  }
834
834
  }
835
835
  else {
@@ -1471,7 +1471,17 @@ class bitmart extends bitmart$1 {
1471
1471
  }
1472
1472
  //
1473
1473
  // {"event":"error","message":"Unrecognized request: {\"event\":\"subscribe\",\"channel\":\"spot/depth:BTC-USDT\"}","errorCode":30039}
1474
- // {"event":"subscribe","channel":"spot/depth:BTC-USDT"}
1474
+ //
1475
+ // subscribe events on spot:
1476
+ //
1477
+ // {"event":"subscribe", "topic":"spot/kline1m:BTC_USDT" }
1478
+ //
1479
+ // subscribe on contracts:
1480
+ //
1481
+ // {"action":"subscribe", "group":"futures/klineBin1m:BTCUSDT", "success":true, "request":{"action":"subscribe", "args":[ "futures/klineBin1m:BTCUSDT" ] } }
1482
+ //
1483
+ // regular updates - spot
1484
+ //
1475
1485
  // {
1476
1486
  // "table": "spot/depth",
1477
1487
  // "action": "partial",
@@ -1492,10 +1502,21 @@ class bitmart extends bitmart$1 {
1492
1502
  // ]
1493
1503
  // }
1494
1504
  //
1505
+ // regular updates - contracts
1506
+ //
1507
+ // {
1508
+ // group: "futures/klineBin1m:BTCUSDT",
1509
+ // data: {
1510
+ // symbol: "BTCUSDT",
1511
+ // items: [ { o: "67944.7", "h": .... } ],
1512
+ // },
1513
+ // }
1514
+ //
1495
1515
  // { data: '', table: "spot/user/order" }
1496
1516
  //
1497
- const channel = this.safeString2(message, 'table', 'group');
1498
- if (channel === undefined) {
1517
+ // the only realiable way (for both spot & swap) is to check 'data' key
1518
+ const isDataUpdate = ('data' in message);
1519
+ if (!isDataUpdate) {
1499
1520
  const event = this.safeString2(message, 'event', 'action');
1500
1521
  if (event !== undefined) {
1501
1522
  const methods = {
@@ -1511,6 +1532,7 @@ class bitmart extends bitmart$1 {
1511
1532
  }
1512
1533
  }
1513
1534
  else {
1535
+ const channel = this.safeString2(message, 'table', 'group');
1514
1536
  const methods = {
1515
1537
  'depth': this.handleOrderBook,
1516
1538
  'ticker': this.handleTicker,
package/doc/manual.rst CHANGED
@@ -4038,6 +4038,7 @@ The ``fetchStatus()`` method will return a status structure like shown below:
4038
4038
  'updated': undefined, // integer, last updated timestamp in milliseconds if updated via the API
4039
4039
  'eta': undefined, // when the maintenance or outage is expected to end
4040
4040
  'url': undefined, // a link to a GitHub issue or to an exchange post on the subject
4041
+ 'info': { ... }
4041
4042
  }
4042
4043
 
4043
4044
  The possible values in the ``status`` field are:
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.64";
7
+ declare const version = "4.2.65";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.65';
41
+ const version = '4.2.66';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -167,6 +167,8 @@ interface Exchange {
167
167
  privateSpotPostV2SpotWalletTransfer(params?: {}): Promise<implicitReturnType>;
168
168
  privateSpotPostV2SpotWalletSubaccountTransfer(params?: {}): Promise<implicitReturnType>;
169
169
  privateSpotPostV2SpotWalletWithdrawal(params?: {}): Promise<implicitReturnType>;
170
+ privateSpotPostV2SpotWalletCancelWithdrawal(params?: {}): Promise<implicitReturnType>;
171
+ privateSpotPostV2SpotWalletModifyDepositAccount(params?: {}): Promise<implicitReturnType>;
170
172
  privateMixGetMixV1AccountAccount(params?: {}): Promise<implicitReturnType>;
171
173
  privateMixGetMixV1AccountAccounts(params?: {}): Promise<implicitReturnType>;
172
174
  privateMixGetMixV1PositionSinglePosition(params?: {}): Promise<implicitReturnType>;
@@ -469,7 +471,10 @@ interface Exchange {
469
471
  privateConvertGetV2ConvertCurrencies(params?: {}): Promise<implicitReturnType>;
470
472
  privateConvertGetV2ConvertQuotedPrice(params?: {}): Promise<implicitReturnType>;
471
473
  privateConvertGetV2ConvertConvertRecord(params?: {}): Promise<implicitReturnType>;
474
+ privateConvertGetV2ConvertBgbConvertCoinList(params?: {}): Promise<implicitReturnType>;
475
+ privateConvertGetV2ConvertBgbConvertRecords(params?: {}): Promise<implicitReturnType>;
472
476
  privateConvertPostV2ConvertTrade(params?: {}): Promise<implicitReturnType>;
477
+ privateConvertPostV2ConvertBgbConvert(params?: {}): Promise<implicitReturnType>;
473
478
  privateEarnGetV2EarnSavingsProduct(params?: {}): Promise<implicitReturnType>;
474
479
  privateEarnGetV2EarnSavingsAccount(params?: {}): Promise<implicitReturnType>;
475
480
  privateEarnGetV2EarnSavingsAssets(params?: {}): Promise<implicitReturnType>;
package/js/src/bigone.js CHANGED
@@ -1544,7 +1544,11 @@ export default class bigone extends Exchange {
1544
1544
  }
1545
1545
  }
1546
1546
  request['type'] = uppercaseType;
1547
- params = this.omit(params, ['stop_price', 'stopPrice', 'triggerPrice', 'timeInForce']);
1547
+ const clientOrderId = this.safeString(params, 'clientOrderId');
1548
+ if (clientOrderId !== undefined) {
1549
+ request['client_order_id'] = clientOrderId;
1550
+ }
1551
+ params = this.omit(params, ['stop_price', 'stopPrice', 'triggerPrice', 'timeInForce', 'clientOrderId']);
1548
1552
  const response = await this.privatePostOrders(this.extend(request, params));
1549
1553
  //
1550
1554
  // {
@@ -1825,7 +1829,7 @@ export default class bigone extends Exchange {
1825
1829
  }
1826
1830
  else if (method === 'POST') {
1827
1831
  headers['Content-Type'] = 'application/json';
1828
- body = query;
1832
+ body = this.json(query);
1829
1833
  }
1830
1834
  }
1831
1835
  headers['User-Agent'] = 'ccxt/' + this.id + '-' + this.version;
@@ -3085,10 +3085,10 @@ export default class bitfinex2 extends Exchange {
3085
3085
  }
3086
3086
  const reversedArray = [];
3087
3087
  const rawRates = this.filterBySymbolSinceLimit(rates, symbol, since, limit);
3088
- const rawRatesLength = rawRates.length;
3089
- const ratesLength = Math.max(rawRatesLength - 1, 0);
3090
- for (let i = ratesLength; i >= 0; i--) {
3091
- const valueAtIndex = rawRates[i];
3088
+ const ratesLength = rawRates.length;
3089
+ for (let i = 0; i < ratesLength; i++) {
3090
+ const index = ratesLength - i - 1;
3091
+ const valueAtIndex = rawRates[index];
3092
3092
  reversedArray.push(valueAtIndex);
3093
3093
  }
3094
3094
  return reversedArray;
package/js/src/bitget.js CHANGED
@@ -374,6 +374,8 @@ export default class bitget extends Exchange {
374
374
  'v2/spot/wallet/transfer': 2,
375
375
  'v2/spot/wallet/subaccount-transfer': 2,
376
376
  'v2/spot/wallet/withdrawal': 2,
377
+ 'v2/spot/wallet/cancel-withdrawal': 2,
378
+ 'v2/spot/wallet/modify-deposit-account': 2,
377
379
  },
378
380
  },
379
381
  'mix': {
@@ -718,9 +720,12 @@ export default class bitget extends Exchange {
718
720
  'v2/convert/currencies': 2,
719
721
  'v2/convert/quoted-price': 2,
720
722
  'v2/convert/convert-record': 2,
723
+ 'v2/convert/bgb-convert-coin-list': 2,
724
+ 'v2/convert/bgb-convert-records': 2,
721
725
  },
722
726
  'post': {
723
727
  'v2/convert/trade': 2,
728
+ 'v2/convert/bgb-convert': 2,
724
729
  },
725
730
  },
726
731
  'earn': {
@@ -4925,6 +4930,7 @@ export default class bitget extends Exchange {
4925
4930
  * @name bitget#cancelAllOrders
4926
4931
  * @description cancel all open orders
4927
4932
  * @see https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
4933
+ * @see https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
4928
4934
  * @see https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
4929
4935
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
4930
4936
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
@@ -4952,7 +4958,7 @@ export default class bitget extends Exchange {
4952
4958
  const request = {
4953
4959
  'symbol': market['id'],
4954
4960
  };
4955
- const stop = this.safeValue2(params, 'stop', 'trigger');
4961
+ const stop = this.safeBool2(params, 'stop', 'trigger');
4956
4962
  params = this.omit(params, ['stop', 'trigger']);
4957
4963
  let response = undefined;
4958
4964
  if (market['spot']) {
@@ -4965,7 +4971,15 @@ export default class bitget extends Exchange {
4965
4971
  }
4966
4972
  }
4967
4973
  else {
4968
- response = await this.privateSpotPostV2SpotTradeCancelSymbolOrder(this.extend(request, params));
4974
+ if (stop) {
4975
+ const stopRequest = {
4976
+ 'symbolList': [market['id']],
4977
+ };
4978
+ response = await this.privateSpotPostV2SpotTradeBatchCancelPlanOrder(this.extend(stopRequest, params));
4979
+ }
4980
+ else {
4981
+ response = await this.privateSpotPostV2SpotTradeCancelSymbolOrder(this.extend(request, params));
4982
+ }
4969
4983
  }
4970
4984
  }
4971
4985
  else {
package/js/src/hitbtc.js CHANGED
@@ -1724,10 +1724,10 @@ export default class hitbtc extends Exchange {
1724
1724
  'symbol': market['id'],
1725
1725
  'period': this.safeString(this.timeframes, timeframe, timeframe),
1726
1726
  };
1727
- [request, params] = this.handleUntilOption('till', request, params);
1728
1727
  if (since !== undefined) {
1729
1728
  request['from'] = this.iso8601(since);
1730
1729
  }
1730
+ [request, params] = this.handleUntilOption('till', request, params);
1731
1731
  if (limit !== undefined) {
1732
1732
  request['limit'] = limit;
1733
1733
  }
@@ -323,11 +323,12 @@ export default class bitfinex2 extends bitfinex2Rest {
323
323
  const messageLength = message.length;
324
324
  if (messageLength === 2) {
325
325
  // initial snapshot
326
- let trades = this.safeList(message, 1, []);
326
+ const trades = this.safeList(message, 1, []);
327
327
  // needs to be reversed to make chronological order
328
- trades = trades.reverse();
329
- for (let i = 0; i < trades.length; i++) {
330
- const parsed = this.parseWsTrade(trades[i], market);
328
+ const length = trades.length;
329
+ for (let i = 0; i < length; i++) {
330
+ const index = length - i - 1;
331
+ const parsed = this.parseWsTrade(trades[index], market);
331
332
  stored.append(parsed);
332
333
  }
333
334
  }
@@ -674,10 +674,10 @@ export default class bitget extends bitgetRest {
674
674
  }
675
675
  const data = this.safeList(message, 'data', []);
676
676
  const length = data.length;
677
- const maxLength = Math.max(length - 1, 0);
678
677
  // fix chronological order by reversing
679
- for (let i = maxLength; i >= 0; i--) {
680
- const rawTrade = data[i];
678
+ for (let i = 0; i < length; i++) {
679
+ const index = length - i - 1;
680
+ const rawTrade = data[index];
681
681
  const parsed = this.parseWsTrade(rawTrade, market);
682
682
  stored.append(parsed);
683
683
  }
@@ -830,9 +830,9 @@ export default class bitmart extends bitmartRest {
830
830
  const isSwap = ('group' in message);
831
831
  if (isSwap) {
832
832
  // in swap, chronologically decreasing: 1709536849322, 1709536848954,
833
- const maxLen = Math.max(length - 1, 0);
834
- for (let i = maxLen; i >= 0; i--) {
835
- symbol = this.handleTradeLoop(data[i]);
833
+ for (let i = 0; i < length; i++) {
834
+ const index = length - i - 1;
835
+ symbol = this.handleTradeLoop(data[index]);
836
836
  }
837
837
  }
838
838
  else {
@@ -1474,7 +1474,17 @@ export default class bitmart extends bitmartRest {
1474
1474
  }
1475
1475
  //
1476
1476
  // {"event":"error","message":"Unrecognized request: {\"event\":\"subscribe\",\"channel\":\"spot/depth:BTC-USDT\"}","errorCode":30039}
1477
- // {"event":"subscribe","channel":"spot/depth:BTC-USDT"}
1477
+ //
1478
+ // subscribe events on spot:
1479
+ //
1480
+ // {"event":"subscribe", "topic":"spot/kline1m:BTC_USDT" }
1481
+ //
1482
+ // subscribe on contracts:
1483
+ //
1484
+ // {"action":"subscribe", "group":"futures/klineBin1m:BTCUSDT", "success":true, "request":{"action":"subscribe", "args":[ "futures/klineBin1m:BTCUSDT" ] } }
1485
+ //
1486
+ // regular updates - spot
1487
+ //
1478
1488
  // {
1479
1489
  // "table": "spot/depth",
1480
1490
  // "action": "partial",
@@ -1495,10 +1505,21 @@ export default class bitmart extends bitmartRest {
1495
1505
  // ]
1496
1506
  // }
1497
1507
  //
1508
+ // regular updates - contracts
1509
+ //
1510
+ // {
1511
+ // group: "futures/klineBin1m:BTCUSDT",
1512
+ // data: {
1513
+ // symbol: "BTCUSDT",
1514
+ // items: [ { o: "67944.7", "h": .... } ],
1515
+ // },
1516
+ // }
1517
+ //
1498
1518
  // { data: '', table: "spot/user/order" }
1499
1519
  //
1500
- const channel = this.safeString2(message, 'table', 'group');
1501
- if (channel === undefined) {
1520
+ // the only realiable way (for both spot & swap) is to check 'data' key
1521
+ const isDataUpdate = ('data' in message);
1522
+ if (!isDataUpdate) {
1502
1523
  const event = this.safeString2(message, 'event', 'action');
1503
1524
  if (event !== undefined) {
1504
1525
  const methods = {
@@ -1514,6 +1535,7 @@ export default class bitmart extends bitmartRest {
1514
1535
  }
1515
1536
  }
1516
1537
  else {
1538
+ const channel = this.safeString2(message, 'table', 'group');
1517
1539
  const methods = {
1518
1540
  'depth': this.handleOrderBook,
1519
1541
  'ticker': this.handleTicker,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.65",
3
+ "version": "4.2.66",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",