ccxt 4.0.90 → 4.0.91

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/README.md CHANGED
@@ -215,13 +215,13 @@ console.log(version, Object.keys(exchanges));
215
215
 
216
216
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
217
217
 
218
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.90/dist/ccxt.browser.js
219
- * unpkg: https://unpkg.com/ccxt@4.0.90/dist/ccxt.browser.js
218
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.91/dist/ccxt.browser.js
219
+ * unpkg: https://unpkg.com/ccxt@4.0.91/dist/ccxt.browser.js
220
220
 
221
221
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
222
222
 
223
223
  ```HTML
224
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.90/dist/ccxt.browser.js"></script>
224
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.91/dist/ccxt.browser.js"></script>
225
225
  ```
226
226
 
227
227
  Creates a global `ccxt` object:
@@ -16229,6 +16229,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16229
16229
  'continuousKlines': { 'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]] },
16230
16230
  'indexPriceKlines': { 'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]] },
16231
16231
  'markPriceKlines': { 'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]] },
16232
+ 'premiumIndexKlines': { 'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]] },
16232
16233
  'ticker/24hr': { 'cost': 1, 'noSymbol': 40 },
16233
16234
  'ticker/price': { 'cost': 1, 'noSymbol': 2 },
16234
16235
  'ticker/bookTicker': { 'cost': 1, 'noSymbol': 2 },
@@ -16248,6 +16249,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16248
16249
  'dapiPrivate': {
16249
16250
  'get': {
16250
16251
  'positionSide/dual': 30,
16252
+ 'orderAmendment': 1,
16251
16253
  'order': 1,
16252
16254
  'openOrder': 1,
16253
16255
  'openOrders': { 'cost': 1, 'noSymbol': 5 },
@@ -16261,8 +16263,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16261
16263
  'leverageBracket': 1,
16262
16264
  'forceOrders': { 'cost': 20, 'noSymbol': 50 },
16263
16265
  'adlQuantile': 5,
16264
- 'orderAmendment': 1,
16265
- 'pmAccountInfo': 5,
16266
+ 'commissionRate': 20,
16267
+ 'income/asyn': 5,
16268
+ 'income/asyn/id': 5,
16269
+ 'pmExchangeInfo': 0.5,
16270
+ 'pmAccountInfo': 0.5, // Weight(IP): 5 => cost = 0.1 * 5 = 0.5
16266
16271
  },
16267
16272
  'post': {
16268
16273
  'positionSide/dual': 1,
@@ -164104,7 +164109,9 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
164104
164109
  //
164105
164110
  // {}
164106
164111
  //
164107
- status = Object.keys(response).length ? this.json(response) : 'ok';
164112
+ const keys = Object.keys(response);
164113
+ const length = keys.length;
164114
+ status = length ? this.json(response) : 'ok';
164108
164115
  }
164109
164116
  else if (marketType === 'swap') {
164110
164117
  response = await this.contractPublicGetPing(query);
@@ -224983,7 +224990,8 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
224983
224990
  const symbol = symbols[i];
224984
224991
  marketIds.push(this.marketId(symbol));
224985
224992
  }
224986
- if (symbols.length === 1) {
224993
+ const length = symbols.length;
224994
+ if (length === 1) {
224987
224995
  const market = this.market(marketIds[0]);
224988
224996
  messageHash = messageHash + ':' + market['symbol'];
224989
224997
  }
@@ -225501,7 +225509,8 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
225501
225509
  symbols[symbol] = true;
225502
225510
  cachedOrders.append(parsed);
225503
225511
  }
225504
- if (this.orders.length) {
225512
+ const length = this.orders.length;
225513
+ if (length > 0) {
225505
225514
  client.resolve(this.orders, 'orders');
225506
225515
  const keys = Object.keys(symbols);
225507
225516
  for (let i = 0; i < keys.length; i++) {
@@ -230915,9 +230924,10 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230915
230924
  // for context: https://www.okx.com/help-center/changes-to-v5-api-websocket-subscription-parameter-and-url
230916
230925
  const isSandbox = this.options['sandboxMode'];
230917
230926
  const sandboxSuffix = isSandbox ? '?brokerId=9999' : '';
230927
+ const isBusiness = (access === 'business');
230918
230928
  const isPublic = (access === 'public');
230919
230929
  const url = this.urls['api']['ws'];
230920
- if ((channel.indexOf('candle') > -1) || (channel === 'orders-algo')) {
230930
+ if (isBusiness || (channel.indexOf('candle') > -1) || (channel === 'orders-algo')) {
230921
230931
  return url + '/business' + sandboxSuffix;
230922
230932
  }
230923
230933
  else if (isPublic) {
@@ -231636,13 +231646,13 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
231636
231646
  * @param {bool} [params.stop] true if fetching trigger or conditional trades
231637
231647
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
231638
231648
  */
231639
- await this.loadMarkets();
231640
- await this.authenticate();
231641
231649
  // By default, receive order updates from any instrument type
231642
231650
  let type = undefined;
231643
231651
  [type, params] = this.handleOptionAndParams(params, 'watchMyTrades', 'type', 'ANY');
231644
231652
  const isStop = this.safeValue(params, 'stop', false);
231645
231653
  params = this.omit(params, ['stop']);
231654
+ await this.loadMarkets();
231655
+ await this.authenticate({ 'access': isStop ? 'business' : 'private' });
231646
231656
  const channel = isStop ? 'orders-algo' : 'orders';
231647
231657
  let messageHash = channel + '::myTrades';
231648
231658
  let market = undefined;
@@ -231678,13 +231688,13 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
231678
231688
  * @param {bool} [params.stop] true if fetching trigger or conditional orders
231679
231689
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
231680
231690
  */
231681
- await this.loadMarkets();
231682
- await this.authenticate();
231683
231691
  let type = undefined;
231684
231692
  // By default, receive order updates from any instrument type
231685
231693
  [type, params] = this.handleOptionAndParams(params, 'watchOrders', 'type', 'ANY');
231686
231694
  const isStop = this.safeValue(params, 'stop', false);
231687
231695
  params = this.omit(params, ['stop']);
231696
+ await this.loadMarkets();
231697
+ await this.authenticate({ 'access': isStop ? 'business' : 'private' });
231688
231698
  let market = undefined;
231689
231699
  if (symbol !== undefined) {
231690
231700
  market = this.market(symbol);
@@ -235150,7 +235160,8 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
235150
235160
  limit = orders.getLimit(symbol, limit);
235151
235161
  }
235152
235162
  orders = this.filterBySymbolSinceLimit(orders, symbol, since, limit);
235153
- if (orders.length === 0) {
235163
+ const length = orders.length;
235164
+ if (length === 0) {
235154
235165
  return await this.watchOrders(symbol, since, limit, params);
235155
235166
  }
235156
235167
  return orders;
@@ -236133,7 +236144,8 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
236133
236144
  // }
236134
236145
  //
236135
236146
  const rawTrades = this.safeValue(message, 'data', []);
236136
- if (rawTrades.length === 0) {
236147
+ const length = rawTrades.length;
236148
+ if (length === 0) {
236137
236149
  return;
236138
236150
  }
236139
236151
  const reset = this.safeValue(message, 'reset', false);
@@ -236219,7 +236231,8 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
236219
236231
  // }
236220
236232
  //
236221
236233
  const rawOrders = this.safeValue(message, 'data', []);
236222
- if (rawOrders.length === 0) {
236234
+ const length = rawOrders.length;
236235
+ if (length === 0) {
236223
236236
  return;
236224
236237
  }
236225
236238
  const messageHash = 'orders';
@@ -274857,7 +274870,7 @@ SOFTWARE.
274857
274870
 
274858
274871
  //-----------------------------------------------------------------------------
274859
274872
  // this is updated by vss.js when building
274860
- const version = '4.0.90';
274873
+ const version = '4.0.91';
274861
274874
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
274862
274875
  //-----------------------------------------------------------------------------
274863
274876