ccxt 4.0.85 → 4.0.86

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.85/dist/ccxt.browser.js
219
- * unpkg: https://unpkg.com/ccxt@4.0.85/dist/ccxt.browser.js
218
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.86/dist/ccxt.browser.js
219
+ * unpkg: https://unpkg.com/ccxt@4.0.86/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.85/dist/ccxt.browser.js"></script>
224
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.86/dist/ccxt.browser.js"></script>
225
225
  ```
226
226
 
227
227
  Creates a global `ccxt` object:
@@ -39658,6 +39658,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39658
39658
  /**
39659
39659
  * @method
39660
39660
  * @name bitget#fetchBalance
39661
+ * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
39662
+ * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
39661
39663
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
39662
39664
  * @param {object} [params] extra parameters specific to the bitget api endpoint
39663
39665
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
@@ -39722,13 +39724,32 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39722
39724
  parseBalance(balance) {
39723
39725
  const result = { 'info': balance };
39724
39726
  //
39727
+ // spot
39728
+ //
39725
39729
  // {
39726
- // coinId: '1',
39727
- // coinName: 'BTC',
39728
- // available: '0.00099900',
39729
- // frozen: '0.00000000',
39730
- // lock: '0.00000000',
39731
- // uTime: '1661595535000'
39730
+ // coinId: '1',
39731
+ // coinName: 'BTC',
39732
+ // available: '0.00099900',
39733
+ // frozen: '0.00000000',
39734
+ // lock: '0.00000000',
39735
+ // uTime: '1661595535000'
39736
+ // }
39737
+ //
39738
+ // swap
39739
+ //
39740
+ // {
39741
+ // marginCoin: 'BTC',
39742
+ // locked: '0.00001948',
39743
+ // available: '0.00006622',
39744
+ // crossMaxAvailable: '0.00004674',
39745
+ // fixedMaxAvailable: '0.00004674',
39746
+ // maxTransferOut: '0.00004674',
39747
+ // equity: '0.00006622',
39748
+ // usdtEquity: '1.734307497491',
39749
+ // btcEquity: '0.000066229058',
39750
+ // crossRiskRate: '0.066308887072',
39751
+ // unrealizedPL: '0',
39752
+ // bonus: '0'
39732
39753
  // }
39733
39754
  //
39734
39755
  for (let i = 0; i < balance.length; i++) {
@@ -39736,10 +39757,12 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39736
39757
  const currencyId = this.safeString2(entry, 'coinName', 'marginCoin');
39737
39758
  const code = this.safeCurrencyCode(currencyId);
39738
39759
  const account = this.account();
39760
+ const spotAccountFree = this.safeString(entry, 'available');
39761
+ const contractAccountFree = this.safeString(entry, 'maxTransferOut');
39762
+ account['free'] = (contractAccountFree !== undefined) ? contractAccountFree : spotAccountFree;
39739
39763
  const frozen = this.safeString(entry, 'frozen');
39740
39764
  const locked = this.safeString2(entry, 'lock', 'locked');
39741
39765
  account['used'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAdd */ .O.stringAdd(frozen, locked);
39742
- account['free'] = this.safeString(entry, 'available');
39743
39766
  result[code] = account;
39744
39767
  }
39745
39768
  return this.safeBalance(result);
@@ -152301,11 +152324,18 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
152301
152324
  'leverage': 1,
152302
152325
  };
152303
152326
  const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
152327
+ const triggerPriceTypes = {
152328
+ 'mark': 'MP',
152329
+ 'last': 'TP',
152330
+ 'index': 'IP',
152331
+ };
152332
+ const triggerPriceType = this.safeString(params, 'triggerPriceType', 'mark');
152333
+ const triggerPriceTypeValue = this.safeString(triggerPriceTypes, triggerPriceType, triggerPriceType);
152304
152334
  params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice']);
152305
152335
  if (triggerPrice) {
152306
152336
  request['stop'] = (side === 'buy') ? 'up' : 'down';
152307
152337
  request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
152308
- request['stopPriceType'] = 'MP';
152338
+ request['stopPriceType'] = triggerPriceTypeValue;
152309
152339
  }
152310
152340
  else if (stopLossPrice || takeProfitPrice) {
152311
152341
  if (stopLossPrice) {
@@ -152317,7 +152347,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
152317
152347
  request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
152318
152348
  }
152319
152349
  request['reduceOnly'] = true;
152320
- request['stopPriceType'] = 'MP';
152350
+ request['stopPriceType'] = triggerPriceTypeValue;
152321
152351
  }
152322
152352
  const uppercaseType = type.toUpperCase();
152323
152353
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
@@ -273674,7 +273704,7 @@ SOFTWARE.
273674
273704
 
273675
273705
  //-----------------------------------------------------------------------------
273676
273706
  // this is updated by vss.js when building
273677
- const version = '4.0.85';
273707
+ const version = '4.0.86';
273678
273708
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273679
273709
  //-----------------------------------------------------------------------------
273680
273710