ccxt 4.2.65 → 4.2.67

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.67';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -5330,7 +5330,10 @@ class Exchange {
5330
5330
  const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
5331
5331
  const responseLength = response.length;
5332
5332
  if (this.verbose) {
5333
- const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5333
+ let backwardMessage = 'Dynamic pagination call ' + this.numberToString(calls) + ' method ' + method + ' response length ' + this.numberToString(responseLength);
5334
+ if (paginationTimestamp !== undefined) {
5335
+ backwardMessage += ' timestamp ' + this.numberToString(paginationTimestamp);
5336
+ }
5334
5337
  this.log(backwardMessage);
5335
5338
  }
5336
5339
  if (responseLength === 0) {
@@ -5349,7 +5352,10 @@ class Exchange {
5349
5352
  const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
5350
5353
  const responseLength = response.length;
5351
5354
  if (this.verbose) {
5352
- const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5355
+ let forwardMessage = 'Dynamic pagination call ' + this.numberToString(calls) + ' method ' + method + ' response length ' + this.numberToString(responseLength);
5356
+ if (paginationTimestamp !== undefined) {
5357
+ forwardMessage += ' timestamp ' + this.numberToString(paginationTimestamp);
5358
+ }
5353
5359
  this.log(forwardMessage);
5354
5360
  }
5355
5361
  if (responseLength === 0) {
@@ -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;
@@ -1384,9 +1384,11 @@ class bitfinex2 extends bitfinex2$1 {
1384
1384
  'symbol': market['id'],
1385
1385
  'timeframe': this.safeString(this.timeframes, timeframe, timeframe),
1386
1386
  'sort': 1,
1387
- 'start': since,
1388
1387
  'limit': limit,
1389
1388
  };
1389
+ if (since !== undefined) {
1390
+ request['start'] = since;
1391
+ }
1390
1392
  [request, params] = this.handleUntilOption('end', request, params);
1391
1393
  const response = await this.publicGetCandlesTradeTimeframeSymbolHist(this.extend(request, params));
1392
1394
  //
@@ -2959,7 +2961,7 @@ class bitfinex2 extends bitfinex2$1 {
2959
2961
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2960
2962
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
2961
2963
  */
2962
- return this.fetchFundingRates([symbol], params);
2964
+ return await this.fetchFundingRates([symbol], params);
2963
2965
  }
2964
2966
  async fetchFundingRates(symbols = undefined, params = {}) {
2965
2967
  /**
@@ -3082,10 +3084,10 @@ class bitfinex2 extends bitfinex2$1 {
3082
3084
  }
3083
3085
  const reversedArray = [];
3084
3086
  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];
3087
+ const ratesLength = rawRates.length;
3088
+ for (let i = 0; i < ratesLength; i++) {
3089
+ const index = ratesLength - i - 1;
3090
+ const valueAtIndex = rawRates[index];
3089
3091
  reversedArray.push(valueAtIndex);
3090
3092
  }
3091
3093
  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 {
@@ -2241,7 +2241,8 @@ class gate extends gate$1 {
2241
2241
  const [request, requestParams] = this.prepareRequest(market, type, query);
2242
2242
  request['type'] = 'fund'; // 'dnw' 'pnl' 'fee' 'refr' 'fund' 'point_dnw' 'point_fee' 'point_refr'
2243
2243
  if (since !== undefined) {
2244
- request['from'] = since / 1000;
2244
+ // from should be integer
2245
+ request['from'] = this.parseToInt(since / 1000);
2245
2246
  }
2246
2247
  if (limit !== undefined) {
2247
2248
  request['limit'] = limit;
@@ -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.66";
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.67';
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>;
@@ -5317,7 +5317,10 @@ export default class Exchange {
5317
5317
  const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
5318
5318
  const responseLength = response.length;
5319
5319
  if (this.verbose) {
5320
- const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5320
+ let backwardMessage = 'Dynamic pagination call ' + this.numberToString(calls) + ' method ' + method + ' response length ' + this.numberToString(responseLength);
5321
+ if (paginationTimestamp !== undefined) {
5322
+ backwardMessage += ' timestamp ' + this.numberToString(paginationTimestamp);
5323
+ }
5321
5324
  this.log(backwardMessage);
5322
5325
  }
5323
5326
  if (responseLength === 0) {
@@ -5336,7 +5339,10 @@ export default class Exchange {
5336
5339
  const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
5337
5340
  const responseLength = response.length;
5338
5341
  if (this.verbose) {
5339
- const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
5342
+ let forwardMessage = 'Dynamic pagination call ' + this.numberToString(calls) + ' method ' + method + ' response length ' + this.numberToString(responseLength);
5343
+ if (paginationTimestamp !== undefined) {
5344
+ forwardMessage += ' timestamp ' + this.numberToString(paginationTimestamp);
5345
+ }
5340
5346
  this.log(forwardMessage);
5341
5347
  }
5342
5348
  if (responseLength === 0) {
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;
@@ -1387,9 +1387,11 @@ export default class bitfinex2 extends Exchange {
1387
1387
  'symbol': market['id'],
1388
1388
  'timeframe': this.safeString(this.timeframes, timeframe, timeframe),
1389
1389
  'sort': 1,
1390
- 'start': since,
1391
1390
  'limit': limit,
1392
1391
  };
1392
+ if (since !== undefined) {
1393
+ request['start'] = since;
1394
+ }
1393
1395
  [request, params] = this.handleUntilOption('end', request, params);
1394
1396
  const response = await this.publicGetCandlesTradeTimeframeSymbolHist(this.extend(request, params));
1395
1397
  //
@@ -2962,7 +2964,7 @@ export default class bitfinex2 extends Exchange {
2962
2964
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2963
2965
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
2964
2966
  */
2965
- return this.fetchFundingRates([symbol], params);
2967
+ return await this.fetchFundingRates([symbol], params);
2966
2968
  }
2967
2969
  async fetchFundingRates(symbols = undefined, params = {}) {
2968
2970
  /**
@@ -3085,10 +3087,10 @@ export default class bitfinex2 extends Exchange {
3085
3087
  }
3086
3088
  const reversedArray = [];
3087
3089
  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];
3090
+ const ratesLength = rawRates.length;
3091
+ for (let i = 0; i < ratesLength; i++) {
3092
+ const index = ratesLength - i - 1;
3093
+ const valueAtIndex = rawRates[index];
3092
3094
  reversedArray.push(valueAtIndex);
3093
3095
  }
3094
3096
  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/gate.js CHANGED
@@ -2244,7 +2244,8 @@ export default class gate extends Exchange {
2244
2244
  const [request, requestParams] = this.prepareRequest(market, type, query);
2245
2245
  request['type'] = 'fund'; // 'dnw' 'pnl' 'fee' 'refr' 'fund' 'point_dnw' 'point_fee' 'point_refr'
2246
2246
  if (since !== undefined) {
2247
- request['from'] = since / 1000;
2247
+ // from should be integer
2248
+ request['from'] = this.parseToInt(since / 1000);
2248
2249
  }
2249
2250
  if (limit !== undefined) {
2250
2251
  request['limit'] = limit;
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.67",
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",