ccxt 4.2.83 → 4.2.84

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
@@ -213,13 +213,13 @@ console.log(version, Object.keys(exchanges));
213
213
 
214
214
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
215
215
 
216
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.83/dist/ccxt.browser.js
217
- * unpkg: https://unpkg.com/ccxt@4.2.83/dist/ccxt.browser.js
216
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.84/dist/ccxt.browser.js
217
+ * unpkg: https://unpkg.com/ccxt@4.2.84/dist/ccxt.browser.js
218
218
 
219
219
  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.
220
220
 
221
221
  ```HTML
222
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.83/dist/ccxt.browser.js"></script>
222
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.84/dist/ccxt.browser.js"></script>
223
223
  ```
224
224
 
225
225
  Creates a global `ccxt` object:
@@ -48102,6 +48102,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48102
48102
  * @see https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
48103
48103
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
48104
48104
  * @param {object} [params] extra parameters specific to the exchange API endpoint
48105
+ * @param {string} [params.subType] *contract only* 'linear', 'inverse'
48105
48106
  * @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
48106
48107
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
48107
48108
  */
@@ -48118,16 +48119,21 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48118
48119
  market = this.market(symbol);
48119
48120
  }
48120
48121
  }
48122
+ let response = undefined;
48121
48123
  const request = {};
48122
48124
  let type = undefined;
48123
48125
  [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
48124
- let response = undefined;
48125
- if (type === 'spot') {
48126
+ // Calls like `.fetchTickers (undefined, {subType:'inverse'})` should be supported for this exchange, so
48127
+ // as "options.defaultSubType" is also set in exchange options, we should consider `params.subType`
48128
+ // with higher priority and only default to spot, if `subType` is not set in params
48129
+ const passedSubType = this.safeString(params, 'subType');
48130
+ let productType = undefined;
48131
+ [productType, params] = this.handleProductTypeAndParams(market, params);
48132
+ // only if passedSubType && productType is undefined, then use spot
48133
+ if (type === 'spot' && passedSubType === undefined) {
48126
48134
  response = await this.publicSpotGetV2SpotMarketTickers(this.extend(request, params));
48127
48135
  }
48128
48136
  else {
48129
- let productType = undefined;
48130
- [productType, params] = this.handleProductTypeAndParams(market, params);
48131
48137
  request['productType'] = productType;
48132
48138
  response = await this.publicMixGetV2MixMarketTickers(this.extend(request, params));
48133
48139
  }
@@ -84124,7 +84130,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
84124
84130
  'v5/account/mmp-modify': 5,
84125
84131
  'v5/account/mmp-reset': 5,
84126
84132
  // asset
84127
- 'v5/asset/transfer/inter-transfer': 150,
84133
+ 'v5/asset/transfer/inter-transfer': 50,
84128
84134
  'v5/asset/transfer/save-transfer-sub-member': 150,
84129
84135
  'v5/asset/transfer/universal-transfer': 10,
84130
84136
  'v5/asset/deposit/deposit-to-account': 5,
@@ -86496,11 +86502,11 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
86496
86502
  request['category'] = 'option';
86497
86503
  }
86498
86504
  else if (market['linear']) {
86499
- // limit: [1, 200]. Default: 25
86505
+ // limit: [1, 500]. Default: 25
86500
86506
  request['category'] = 'linear';
86501
86507
  }
86502
86508
  else if (market['inverse']) {
86503
- // limit: [1, 200]. Default: 25
86509
+ // limit: [1, 500]. Default: 25
86504
86510
  request['category'] = 'inverse';
86505
86511
  }
86506
86512
  }
@@ -106349,8 +106355,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
106349
106355
  // }
106350
106356
  //
106351
106357
  const marketId = this.safeString(position, 'market');
106352
- const defaultType = this.safeString(this.options, 'defaultType');
106353
- market = this.safeMarket(marketId, market, undefined, defaultType);
106358
+ market = this.safeMarket(marketId, market, undefined, 'swap');
106354
106359
  const symbol = market['symbol'];
106355
106360
  const positionId = this.safeInteger(position, 'position_id');
106356
106361
  const marginModeInteger = this.safeInteger(position, 'type');
@@ -153801,7 +153806,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
153801
153806
  // "ts":1639547261293
153802
153807
  // }
153803
153808
  //
153804
- // inverse swaps, linear swaps, inverse futures
153809
+ // linear swap, linear future, inverse swap, inverse future
153805
153810
  //
153806
153811
  // {
153807
153812
  // "status":"ok",
@@ -153818,37 +153823,15 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
153818
153823
  // "high":"0.10725",
153819
153824
  // "amount":"2340267.415144052378486261756692535687481566",
153820
153825
  // "count":882,
153821
- // "vol":"24706"
153826
+ // "vol":"24706",
153827
+ // "trade_turnover":"840726.5048", // only in linear futures
153828
+ // "business_type":"futures", // only in linear futures
153829
+ // "contract_code":"BTC-USDT-CW", // only in linear futures, instead of 'symbol'
153822
153830
  // }
153823
153831
  // ],
153824
153832
  // "ts":1637504679376
153825
153833
  // }
153826
153834
  //
153827
- // linear futures
153828
- //
153829
- // {
153830
- // "status":"ok",
153831
- // "ticks":[
153832
- // {
153833
- // "id":1640745627,
153834
- // "ts":1640745627957,
153835
- // "ask":[48079.1,20],
153836
- // "bid":[47713.8,125],
153837
- // "business_type":"futures",
153838
- // "contract_code":"BTC-USDT-CW",
153839
- // "open":"49011.8",
153840
- // "close":"47934",
153841
- // "low":"47292.3",
153842
- // "high":"49011.8",
153843
- // "amount":"17.398",
153844
- // "count":1515,
153845
- // "vol":"17398",
153846
- // "trade_turnover":"840726.5048"
153847
- // }
153848
- // ],
153849
- // "ts":1640745627988
153850
- // }
153851
- //
153852
153835
  const tickers = this.safeValue2(response, 'data', 'ticks', []);
153853
153836
  const timestamp = this.safeInteger(response, 'ts');
153854
153837
  const result = {};
@@ -174950,6 +174933,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
174950
174933
  'Order size below the minimum requirement.': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
174951
174934
  'The withdrawal amount is below the minimum requirement.': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
174952
174935
  'Unsuccessful! Exceeded the max. funds out-transfer limit': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
174936
+ 'The amount increment is invalid.': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
174953
174937
  '400': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
174954
174938
  '401': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
174955
174939
  '403': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported,
@@ -176687,6 +176671,14 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
176687
176671
  data = this.safeList(data, 'data', []);
176688
176672
  return this.parseOrders(data);
176689
176673
  }
176674
+ marketOrderAmountToPrecision(symbol, amount) {
176675
+ const market = this.market(symbol);
176676
+ const result = this.decimalToPrecision(amount, _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TRUNCATE */ .tk, market['info']['quoteIncrement'], this.precisionMode, this.paddingMode);
176677
+ if (result === '0') {
176678
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' amount of ' + market['symbol'] + ' must be greater than minimum amount precision of ' + this.numberToString(market['precision']['amount']));
176679
+ }
176680
+ return result;
176681
+ }
176690
176682
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
176691
176683
  const market = this.market(symbol);
176692
176684
  // required param, cannot be used twice
@@ -176707,7 +176699,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
176707
176699
  if (quoteAmount !== undefined) {
176708
176700
  params = this.omit(params, ['cost', 'funds']);
176709
176701
  // kucoin uses base precision even for quote values
176710
- costString = this.amountToPrecision(symbol, quoteAmount);
176702
+ costString = this.marketOrderAmountToPrecision(symbol, quoteAmount);
176711
176703
  request['funds'] = costString;
176712
176704
  }
176713
176705
  else {
@@ -323853,7 +323845,7 @@ SOFTWARE.
323853
323845
 
323854
323846
  //-----------------------------------------------------------------------------
323855
323847
  // this is updated by vss.js when building
323856
- const version = '4.2.83';
323848
+ const version = '4.2.84';
323857
323849
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
323858
323850
  //-----------------------------------------------------------------------------
323859
323851