ccxt 4.2.54 → 4.2.55

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
@@ -209,13 +209,13 @@ console.log(version, Object.keys(exchanges));
209
209
 
210
210
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
211
211
 
212
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.54/dist/ccxt.browser.js
213
- * unpkg: https://unpkg.com/ccxt@4.2.54/dist/ccxt.browser.js
212
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.55/dist/ccxt.browser.js
213
+ * unpkg: https://unpkg.com/ccxt@4.2.55/dist/ccxt.browser.js
214
214
 
215
215
  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.
216
216
 
217
217
  ```HTML
218
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.54/dist/ccxt.browser.js"></script>
218
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.55/dist/ccxt.browser.js"></script>
219
219
  ```
220
220
 
221
221
  Creates a global `ccxt` object:
@@ -82459,6 +82459,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82459
82459
  'fetchIsolatedBorrowRate': false,
82460
82460
  'fetchIsolatedBorrowRates': false,
82461
82461
  'fetchLedger': true,
82462
+ 'fetchLeverage': true,
82462
82463
  'fetchMarketLeverageTiers': true,
82463
82464
  'fetchMarkets': true,
82464
82465
  'fetchMarkOHLCV': true,
@@ -82489,7 +82490,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82489
82490
  'fetchUnderlyingAssets': false,
82490
82491
  'fetchVolatilityHistory': true,
82491
82492
  'fetchWithdrawals': true,
82492
- 'fetchLeverage': true,
82493
82493
  'repayCrossMargin': true,
82494
82494
  'setLeverage': true,
82495
82495
  'setMarginMode': true,
@@ -132275,7 +132275,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132275
132275
  'spot': 'https://api.gateio.ws/api/v4',
132276
132276
  'options': 'https://api.gateio.ws/api/v4',
132277
132277
  'subAccounts': 'https://api.gateio.ws/api/v4',
132278
- 'portfolio': 'https://api.gateio.ws/api/v4',
132278
+ 'unified': 'https://api.gateio.ws/api/v4',
132279
132279
  'rebate': 'https://api.gateio.ws/api/v4',
132280
132280
  'earn': 'https://api.gateio.ws/api/v4',
132281
132281
  'account': 'https://api.gateio.ws/api/v4',
@@ -132498,11 +132498,14 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132498
132498
  'saved_address': 1,
132499
132499
  'fee': 1,
132500
132500
  'total_balance': 2.5,
132501
+ 'small_balance': 1,
132502
+ 'small_balance_history': 1,
132501
132503
  },
132502
132504
  'post': {
132503
132505
  'transfers': 2.5,
132504
132506
  'sub_account_transfers': 2.5,
132505
132507
  'sub_account_to_sub_account': 2.5,
132508
+ 'small_balance': 1,
132506
132509
  },
132507
132510
  },
132508
132511
  'subAccounts': {
@@ -132525,7 +132528,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132525
132528
  'sub_accounts/{user_id}/keys/{key}': 2.5,
132526
132529
  },
132527
132530
  },
132528
- 'portfolio': {
132531
+ 'unified': {
132529
132532
  'get': {
132530
132533
  'accounts': 20 / 15,
132531
132534
  'account_mode': 20 / 15,
@@ -132534,6 +132537,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132534
132537
  'loans': 20 / 15,
132535
132538
  'loan_records': 20 / 15,
132536
132539
  'interest_records': 20 / 15,
132540
+ 'estimate_rate': 20 / 15,
132537
132541
  },
132538
132542
  'post': {
132539
132543
  'account_mode': 20 / 15,
@@ -198631,6 +198635,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
198631
198635
  '50027': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
198632
198636
  '50028': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198633
198637
  '50044': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
198638
+ '50062': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198634
198639
  // API Class
198635
198640
  '50100': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198636
198641
  '50101': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
@@ -198685,6 +198690,15 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
198685
198690
  '51072': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198686
198691
  '51073': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198687
198692
  '51074': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198693
+ '51090': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198694
+ '51091': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198695
+ '51092': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198696
+ '51093': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198697
+ '51094': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198698
+ '51095': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198699
+ '51096': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198700
+ '51098': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198701
+ '51099': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198688
198702
  '51100': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198689
198703
  '51101': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198690
198704
  '51102': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
@@ -200812,7 +200826,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200812
200826
  }
200813
200827
  request['tpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
200814
200828
  const takeProfitLimitPrice = this.safeValueN(takeProfit, ['price', 'takeProfitPrice', 'tpOrdPx']);
200815
- const takeProfitOrderType = this.safeString(takeProfit, 'type');
200829
+ const takeProfitOrderType = this.safeString2(takeProfit, 'type', 'tpOrdKind');
200816
200830
  if (takeProfitOrderType !== undefined) {
200817
200831
  const takeProfitLimitOrderType = (takeProfitOrderType === 'limit');
200818
200832
  const takeProfitMarketOrderType = (takeProfitOrderType === 'market');
@@ -200824,6 +200838,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200824
200838
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires a limit price in params["takeProfit"]["price"] or params["takeProfit"]["tpOrdPx"] for a take profit limit order');
200825
200839
  }
200826
200840
  else {
200841
+ request['tpOrdKind'] = takeProfitOrderType;
200827
200842
  request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice);
200828
200843
  }
200829
200844
  }
@@ -200832,6 +200847,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200832
200847
  }
200833
200848
  }
200834
200849
  else if (takeProfitLimitPrice !== undefined) {
200850
+ request['tpOrdKind'] = 'limit';
200835
200851
  request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice); // limit tp order
200836
200852
  }
200837
200853
  else {
@@ -200856,6 +200872,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200856
200872
  const twoWayCondition = ((takeProfitPrice !== undefined) && (stopLossPrice !== undefined));
200857
200873
  // if TP and SL are sent together
200858
200874
  // as ordType 'conditional' only stop-loss order will be applied
200875
+ // tpOrdKind is 'condition' which is the default
200859
200876
  if (twoWayCondition) {
200860
200877
  request['ordType'] = 'oco';
200861
200878
  }
@@ -200909,6 +200926,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200909
200926
  * @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
200910
200927
  * @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
200911
200928
  * @param {string} [params.trailingPercent] the percent to trail away from the current market price
200929
+ * @param {string} [params.tpOrdKind] 'condition' or 'limit', the default is 'condition'
200912
200930
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
200913
200931
  */
200914
200932
  await this.loadMarkets();
@@ -201074,6 +201092,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
201074
201092
  takeProfitTriggerPrice = this.safeValue(takeProfit, 'triggerPrice');
201075
201093
  takeProfitPrice = this.safeValue(takeProfit, 'price');
201076
201094
  const takeProfitType = this.safeString(takeProfit, 'type');
201095
+ request['newTpOrdKind'] = (takeProfitType === 'limit') ? takeProfitType : 'condition';
201077
201096
  request['newTpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
201078
201097
  request['newTpOrdPx'] = (takeProfitType === 'market') ? '-1' : this.priceToPrecision(symbol, takeProfitPrice);
201079
201098
  request['newTpTriggerPxType'] = takeProfitTriggerPriceType;
@@ -201119,6 +201138,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
201119
201138
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
201120
201139
  * @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
201121
201140
  * @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
201141
+ * @param {string} [params.newTpOrdKind] 'condition' or 'limit', the default is 'condition'
201122
201142
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201123
201143
  */
201124
201144
  await this.loadMarkets();
@@ -307615,7 +307635,7 @@ SOFTWARE.
307615
307635
 
307616
307636
  //-----------------------------------------------------------------------------
307617
307637
  // this is updated by vss.js when building
307618
- const version = '4.2.54';
307638
+ const version = '4.2.55';
307619
307639
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
307620
307640
  //-----------------------------------------------------------------------------
307621
307641