ccxt 4.1.34 → 4.1.35

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.
@@ -11458,6 +11458,8 @@ __webpack_require__.r(__webpack_exports__);
11458
11458
  /* harmony export */ "NotSupported": () => (/* binding */ NotSupported),
11459
11459
  /* harmony export */ "NullResponse": () => (/* binding */ NullResponse),
11460
11460
  /* harmony export */ "OnMaintenance": () => (/* binding */ OnMaintenance),
11461
+ /* harmony export */ "OperationFailed": () => (/* binding */ OperationFailed),
11462
+ /* harmony export */ "OperationRejected": () => (/* binding */ OperationRejected),
11461
11463
  /* harmony export */ "OrderImmediatelyFillable": () => (/* binding */ OrderImmediatelyFillable),
11462
11464
  /* harmony export */ "OrderNotCached": () => (/* binding */ OrderNotCached),
11463
11465
  /* harmony export */ "OrderNotFillable": () => (/* binding */ OrderNotFillable),
@@ -11511,6 +11513,12 @@ class ExchangeError extends Error {
11511
11513
  this.name = 'ExchangeError';
11512
11514
  }
11513
11515
  }
11516
+ class OperationFailed extends ExchangeError {
11517
+ constructor(message) {
11518
+ super(message);
11519
+ this.name = 'OperationFailed';
11520
+ }
11521
+ }
11514
11522
  class AuthenticationError extends ExchangeError {
11515
11523
  constructor(message) {
11516
11524
  super(message);
@@ -11547,6 +11555,12 @@ class BadRequest extends ExchangeError {
11547
11555
  this.name = 'BadRequest';
11548
11556
  }
11549
11557
  }
11558
+ class OperationRejected extends BadRequest {
11559
+ constructor(message) {
11560
+ super(message);
11561
+ this.name = 'OperationRejected';
11562
+ }
11563
+ }
11550
11564
  class BadSymbol extends BadRequest {
11551
11565
  constructor(message) {
11552
11566
  super(message);
@@ -11699,7 +11713,7 @@ class RequestTimeout extends NetworkError {
11699
11713
  // // Derived class hierarchy
11700
11714
  // errorHierarchy
11701
11715
  // )
11702
- const errors = { 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, ContractUnavailable, NoChange };
11716
+ const errors = { 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, ContractUnavailable, NoChange, OperationRejected, OperationFailed };
11703
11717
 
11704
11718
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (errors);
11705
11719
 
@@ -26596,7 +26610,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
26596
26610
  * @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20Symbols
26597
26611
  * @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Contract%20Information
26598
26612
  * @param {object} [params] extra parameters specific to the exchange api endpoint
26599
- * @returns {[object]} an array of objects representing market data
26613
+ * @returns {object[]} an array of objects representing market data
26600
26614
  */
26601
26615
  const requests = [this.fetchSpotMarkets(params), this.fetchSwapMarkets(params)];
26602
26616
  const promises = await Promise.all(requests);
@@ -26619,7 +26633,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
26619
26633
  * @param {object} [params] extra parameters specific to the bingx api endpoint
26620
26634
  * @param {int} [params.until] timestamp in ms of the latest candle to fetch
26621
26635
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
26622
- * @returns {[[int]]} A list of candles ordered as timestamp, open, high, low, close, volume
26636
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
26623
26637
  */
26624
26638
  await this.loadMarkets();
26625
26639
  let paginate = false;
@@ -26725,7 +26739,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
26725
26739
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
26726
26740
  * @param {int} [limit] the maximum amount of trades to fetch
26727
26741
  * @param {object} [params] extra parameters specific to the bingx api endpoint
26728
- * @returns {[object]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
26742
+ * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
26729
26743
  */
26730
26744
  await this.loadMarkets();
26731
26745
  const market = this.market(symbol);
@@ -27055,7 +27069,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27055
27069
  * @param {object} [params] extra parameters specific to the bingx api endpoint
27056
27070
  * @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
27057
27071
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
27058
- * @returns {[object]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
27072
+ * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
27059
27073
  */
27060
27074
  this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
27061
27075
  await this.loadMarkets();
@@ -27218,7 +27232,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27218
27232
  * @name bingx#fetchTickers
27219
27233
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
27220
27234
  * @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Ticker
27221
- * @param {[string]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
27235
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
27222
27236
  * @param {object} [params] extra parameters specific to the bingx api endpoint
27223
27237
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
27224
27238
  */
@@ -27455,10 +27469,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27455
27469
  * @description fetch all open positions
27456
27470
  * @see https://bingx-api.github.io/docs/#/swapV2/account-api.html#Perpetual%20Swap%20Positions
27457
27471
  * @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Query%20standard%20contract%20balance
27458
- * @param {[string]|undefined} symbols list of unified market symbols
27472
+ * @param {string[]|undefined} symbols list of unified market symbols
27459
27473
  * @param {object} [params] extra parameters specific to the bingx api endpoint
27460
27474
  * @param {boolean} [params.standard] whether to fetch standard contract positions
27461
- * @returns {[object]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
27475
+ * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
27462
27476
  */
27463
27477
  await this.loadMarkets();
27464
27478
  symbols = this.marketSymbols(symbols);
@@ -27982,7 +27996,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27982
27996
  * @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20All%20Orders
27983
27997
  * @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
27984
27998
  * @param {object} [params] extra parameters specific to the bingx api endpoint
27985
- * @returns {[object]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
27999
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
27986
28000
  */
27987
28001
  this.checkRequiredSymbol('cancelAllOrders', symbol);
27988
28002
  await this.loadMarkets();
@@ -28032,7 +28046,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28032
28046
  * @description cancel multiple orders
28033
28047
  * @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20a%20Batch%20of%20Orders
28034
28048
  * @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Cancel%20a%20Batch%20of%20Orders
28035
- * @param {[string]} ids order ids
28049
+ * @param {string[]} ids order ids
28036
28050
  * @param {string} symbol unified market symbol, default is undefined
28037
28051
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28038
28052
  * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
@@ -28181,7 +28195,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28181
28195
  * @param {int} [since] the earliest time in ms to fetch open orders for
28182
28196
  * @param {int} [limit] the maximum number of open order structures to retrieve
28183
28197
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28184
- * @returns {[object]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
28198
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
28185
28199
  */
28186
28200
  this.checkRequiredSymbol('fetchOrders', symbol);
28187
28201
  await this.loadMarkets();
@@ -28270,7 +28284,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28270
28284
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28271
28285
  * @param {int} [params.until] the latest time in ms to fetch orders for
28272
28286
  * @param {boolean} [params.standard] whether to fetch standard contract orders
28273
- * @returns {[object]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
28287
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
28274
28288
  */
28275
28289
  this.checkRequiredSymbol('fetchClosedOrders', symbol);
28276
28290
  await this.loadMarkets();
@@ -28401,7 +28415,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28401
28415
  * @param {int} [since] the earliest time in ms to fetch transfers for
28402
28416
  * @param {int} [limit] the maximum number of transfers structures to retrieve
28403
28417
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28404
- * @returns {[object]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
28418
+ * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
28405
28419
  */
28406
28420
  await this.loadMarkets();
28407
28421
  let currency = undefined;
@@ -28546,7 +28560,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28546
28560
  * @param {int} [since] the earliest time in ms to fetch deposits for
28547
28561
  * @param {int} [limit] the maximum number of deposits structures to retrieve
28548
28562
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28549
- * @returns {[object]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
28563
+ * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
28550
28564
  */
28551
28565
  await this.loadMarkets();
28552
28566
  const request = {};
@@ -28591,7 +28605,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28591
28605
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
28592
28606
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
28593
28607
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28594
- * @returns {[object]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
28608
+ * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
28595
28609
  */
28596
28610
  await this.loadMarkets();
28597
28611
  const request = {};
@@ -28864,7 +28878,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28864
28878
  * @param {int} [limit] the maximum number of trades structures to retrieve
28865
28879
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28866
28880
  * @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
28867
- * @returns {[object]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
28881
+ * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
28868
28882
  */
28869
28883
  this.checkRequiredArgument('fetchMyTrades', symbol, 'symbol');
28870
28884
  this.checkRequiredArgument('fetchMyTrades', since, 'since');
@@ -28974,7 +28988,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28974
28988
  * @name bingx#fetchDepositWithdrawFees
28975
28989
  * @description fetch deposit and withdraw fees
28976
28990
  * @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins'%20Information
28977
- * @param {[string]|undefined} codes list of unified currency codes
28991
+ * @param {string[]|undefined} codes list of unified currency codes
28978
28992
  * @param {object} [params] extra parameters specific to the bingx api endpoint
28979
28993
  * @returns {object} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
28980
28994
  */
@@ -111046,7 +111060,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
111046
111060
  'swap': true,
111047
111061
  'future': false,
111048
111062
  'option': false,
111049
- 'addMargin': false,
111063
+ 'addMargin': true,
111050
111064
  'cancelOrder': true,
111051
111065
  'cancelOrders': true,
111052
111066
  'createOrder': true,
@@ -111098,10 +111112,10 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
111098
111112
  'fetchTradingFees': false,
111099
111113
  'fetchTransfers': true,
111100
111114
  'fetchWithdrawals': true,
111101
- 'reduceMargin': false,
111115
+ 'reduceMargin': true,
111102
111116
  'setLeverage': true,
111103
111117
  'setMargin': false,
111104
- 'setMarginMode': false,
111118
+ 'setMarginMode': true,
111105
111119
  'setPositionMode': false,
111106
111120
  'transfer': true,
111107
111121
  'withdraw': true,
@@ -114843,6 +114857,88 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
114843
114857
  }
114844
114858
  return depositWithdrawFees;
114845
114859
  }
114860
+ async addMargin(symbol, amount, params = {}) {
114861
+ /**
114862
+ * @method
114863
+ * @name digifinex#addMargin
114864
+ * @description add margin to a position
114865
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#positionmargin
114866
+ * @param {string} symbol unified market symbol
114867
+ * @param {float} amount amount of margin to add
114868
+ * @param {object} [params] extra parameters specific to the digifinex api endpoint
114869
+ * @param {string} params.side the position side: 'long' or 'short'
114870
+ * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-structure}
114871
+ */
114872
+ const side = this.safeString(params, 'side');
114873
+ this.checkRequiredArgument('addMargin', side, 'side', ['long', 'short']);
114874
+ return await this.modifyMarginHelper(symbol, amount, 1, params);
114875
+ }
114876
+ async reduceMargin(symbol, amount, params = {}) {
114877
+ /**
114878
+ * @method
114879
+ * @name digifinex#reduceMargin
114880
+ * @description remove margin from a position
114881
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#positionmargin
114882
+ * @param {string} symbol unified market symbol
114883
+ * @param {float} amount the amount of margin to remove
114884
+ * @param {object} [params] extra parameters specific to the digifinex api endpoint
114885
+ * @param {string} params.side the position side: 'long' or 'short'
114886
+ * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-structure}
114887
+ */
114888
+ const side = this.safeString(params, 'side');
114889
+ this.checkRequiredArgument('reduceMargin', side, 'side', ['long', 'short']);
114890
+ return await this.modifyMarginHelper(symbol, amount, 2, params);
114891
+ }
114892
+ async modifyMarginHelper(symbol, amount, type, params = {}) {
114893
+ await this.loadMarkets();
114894
+ const side = this.safeString(params, 'side');
114895
+ const market = this.market(symbol);
114896
+ const request = {
114897
+ 'instrument_id': market['id'],
114898
+ 'amount': this.numberToString(amount),
114899
+ 'type': type,
114900
+ 'side': side,
114901
+ };
114902
+ const response = await this.privateSwapPostAccountPositionMargin(this.extend(request, params));
114903
+ //
114904
+ // {
114905
+ // "code": 0,
114906
+ // "data": {
114907
+ // "instrument_id": "BTCUSDTPERP",
114908
+ // "side": "long",
114909
+ // "type": 1,
114910
+ // "amount": "3.6834"
114911
+ // }
114912
+ // }
114913
+ //
114914
+ const code = this.safeInteger(response, 'code');
114915
+ const status = (code === 0) ? 'ok' : 'failed';
114916
+ const data = this.safeValue(response, 'data', {});
114917
+ return this.extend(this.parseMarginModification(data, market), {
114918
+ 'status': status,
114919
+ });
114920
+ }
114921
+ parseMarginModification(data, market = undefined) {
114922
+ //
114923
+ // {
114924
+ // "instrument_id": "BTCUSDTPERP",
114925
+ // "side": "long",
114926
+ // "type": 1,
114927
+ // "amount": "3.6834"
114928
+ // }
114929
+ //
114930
+ const marketId = this.safeString(data, 'instrument_id');
114931
+ const rawType = this.safeInteger(data, 'type');
114932
+ return {
114933
+ 'info': data,
114934
+ 'type': (rawType === 1) ? 'add' : 'reduce',
114935
+ 'amount': this.safeNumber(data, 'amount'),
114936
+ 'total': undefined,
114937
+ 'code': market['settle'],
114938
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
114939
+ 'status': undefined,
114940
+ };
114941
+ }
114846
114942
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
114847
114943
  /**
114848
114944
  * @method
@@ -114909,6 +115005,30 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
114909
115005
  'amount': this.safeNumber(income, 'amount'),
114910
115006
  };
114911
115007
  }
115008
+ async setMarginMode(marginMode, symbol = undefined, params = {}) {
115009
+ /**
115010
+ * @method
115011
+ * @name digifinex#setMarginMode
115012
+ * @description set margin mode to 'cross' or 'isolated'
115013
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#positionmode
115014
+ * @param {string} marginMode 'cross' or 'isolated'
115015
+ * @param {string} symbol unified market symbol
115016
+ * @param {object} [params] extra parameters specific to the digifinex api endpoint
115017
+ * @returns {object} response from the exchange
115018
+ */
115019
+ this.checkRequiredSymbol('setMarginMode', symbol);
115020
+ await this.loadMarkets();
115021
+ const market = this.market(symbol);
115022
+ marginMode = marginMode.toLowerCase();
115023
+ if (marginMode === 'cross') {
115024
+ marginMode = 'crossed';
115025
+ }
115026
+ const request = {
115027
+ 'instrument_id': market['id'],
115028
+ 'margin_mode': marginMode,
115029
+ };
115030
+ return await this.privateSwapPostAccountPositionMode(this.extend(request, params));
115031
+ }
114912
115032
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
114913
115033
  const signed = api[0] === 'private';
114914
115034
  const endpoint = api[1];
@@ -132219,41 +132339,195 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
132219
132339
  },
132220
132340
  'networks': {
132221
132341
  // by displaynames
132222
- 'ALGO': 'ALGO',
132223
- 'ALGORAND': 'ALGO',
132224
- 'BEP20': 'BEP20',
132225
- 'BSC': 'BEP20',
132226
- 'ERC20': 'ERC20',
132227
- 'ETH': 'ERC20',
132228
- 'AVALANCHE': 'AVAXCCHAIN',
132229
- 'AVAX': 'AVAXCCHAIN',
132230
- 'HRC20': 'HECO',
132231
- 'HECO': 'HECO',
132232
- // 'HT': 'HECO', // HT is not acceptable networkcode for unification
132233
- 'TRC20': 'TRC20',
132234
- 'TRX': 'TRC20',
132235
- 'BTC': 'BTC',
132236
- 'BITCOIN': 'BTC',
132237
- 'ARBITRUM': 'ARB',
132238
- 'ARB': 'ARB',
132239
- 'SOLANA': 'SOL',
132240
- 'SOL': 'SOL',
132241
- 'SPL': 'SOL',
132242
- 'PRC20': 'PRC20',
132243
- 'POLYGON': 'PRC20',
132244
- 'MATIC': 'PRC20',
132245
- },
132246
- 'networksById': {
132247
- 'ALGO': 'ALGO',
132248
- 'BEP20': 'BEP20',
132249
- 'ERC20': 'ERC20',
132250
- 'AVAXCCHAIN': 'AVALANCHE',
132251
- 'HECO': 'HRC20',
132252
- 'TRC20': 'TRC20',
132342
+ 'TRC20': 'TRX',
132253
132343
  'BTC': 'BTC',
132254
- 'ARB': 'ARBITRUM',
132344
+ 'ERC20': 'ETH',
132255
132345
  'SOL': 'SOLANA',
132256
- 'PRC20': 'POLYGON',
132346
+ 'HRC20': 'HECO',
132347
+ 'BEP20': 'BSC',
132348
+ 'XMR': 'XMR',
132349
+ 'LTC': 'LTC',
132350
+ 'XRP': 'XRP',
132351
+ 'XLM': 'XLM',
132352
+ 'CRONOS': 'CRO',
132353
+ 'CRO': 'CRO',
132354
+ 'GLMR': 'GLMR',
132355
+ 'POLYGON': 'MATIC',
132356
+ 'MATIC': 'MATIC',
132357
+ 'BTT': 'BTT',
132358
+ 'CUBE': 'CUBE',
132359
+ 'IOST': 'IOST',
132360
+ 'NEO': 'NEO',
132361
+ 'KLAY': 'KLAY',
132362
+ 'EOS': 'EOS',
132363
+ 'THETA': 'THETA',
132364
+ 'NAS': 'NAS',
132365
+ 'NULS': 'NULS',
132366
+ 'QTUM': 'QTUM',
132367
+ 'FTM': 'FTM',
132368
+ 'CELO': 'CELO',
132369
+ 'DOGE': 'DOGE',
132370
+ 'DOGECHAIN': 'DOGECHAIN',
132371
+ 'NEAR': 'NEAR',
132372
+ 'STEP': 'STEP',
132373
+ 'BITCI': 'BITCI',
132374
+ 'CARDANO': 'ADA',
132375
+ 'ADA': 'ADA',
132376
+ 'ETC': 'ETC',
132377
+ 'LUK': 'LUK',
132378
+ 'MINEPLEX': 'MINEPLEX',
132379
+ 'DASH': 'DASH',
132380
+ 'ZEC': 'ZEC',
132381
+ 'IOTA': 'IOTA',
132382
+ 'NEON3': 'NEON3',
132383
+ 'XEM': 'XEM',
132384
+ 'HC': 'HC',
132385
+ 'LSK': 'LSK',
132386
+ 'DCR': 'DCR',
132387
+ 'BTG': 'BTG',
132388
+ 'STEEM': 'STEEM',
132389
+ 'BTS': 'BTS',
132390
+ 'ICX': 'ICX',
132391
+ 'WAVES': 'WAVES',
132392
+ 'CMT': 'CMT',
132393
+ 'BTM': 'BTM',
132394
+ 'VET': 'VET',
132395
+ 'XZC': 'XZC',
132396
+ 'ACT': 'ACT',
132397
+ 'SMT': 'SMT',
132398
+ 'BCD': 'BCD',
132399
+ 'WAX': 'WAX1',
132400
+ 'WICC': 'WICC',
132401
+ 'ELF': 'ELF',
132402
+ 'ZIL': 'ZIL',
132403
+ 'ELA': 'ELA',
132404
+ 'BCX': 'BCX',
132405
+ 'SBTC': 'SBTC',
132406
+ 'BIFI': 'BIFI',
132407
+ 'CTXC': 'CTXC',
132408
+ 'WAN': 'WAN',
132409
+ 'POLYX': 'POLYX',
132410
+ 'PAI': 'PAI',
132411
+ 'WTC': 'WTC',
132412
+ 'DGB': 'DGB',
132413
+ 'XVG': 'XVG',
132414
+ 'AAC': 'AAC',
132415
+ 'AE': 'AE',
132416
+ 'SEELE': 'SEELE',
132417
+ 'BCV': 'BCV',
132418
+ 'GRS': 'GRS',
132419
+ 'ARDR': 'ARDR',
132420
+ 'NANO': 'NANO',
132421
+ 'ZEN': 'ZEN',
132422
+ 'RBTC': 'RBTC',
132423
+ 'BSV': 'BSV',
132424
+ 'GAS': 'GAS',
132425
+ 'XTZ': 'XTZ',
132426
+ 'LAMB': 'LAMB',
132427
+ 'CVNT1': 'CVNT1',
132428
+ 'DOCK': 'DOCK',
132429
+ 'SC': 'SC',
132430
+ 'KMD': 'KMD',
132431
+ 'ETN': 'ETN',
132432
+ 'TOP': 'TOP',
132433
+ 'IRIS': 'IRIS',
132434
+ 'UGAS': 'UGAS',
132435
+ 'TT': 'TT',
132436
+ 'NEWTON': 'NEWTON',
132437
+ 'VSYS': 'VSYS',
132438
+ 'FSN': 'FSN',
132439
+ 'BHD': 'BHD',
132440
+ 'ONE': 'ONE',
132441
+ 'EM': 'EM',
132442
+ 'CKB': 'CKB',
132443
+ 'EOSS': 'EOSS',
132444
+ 'HIVE': 'HIVE',
132445
+ 'RVN': 'RVN',
132446
+ 'DOT': 'DOT',
132447
+ 'KSM': 'KSM',
132448
+ 'BAND': 'BAND',
132449
+ 'OEP4': 'OEP4',
132450
+ 'NBS': 'NBS',
132451
+ 'FIS': 'FIS',
132452
+ 'AR': 'AR',
132453
+ 'HBAR': 'HBAR',
132454
+ 'FIL': 'FIL',
132455
+ 'MASS': 'MASS',
132456
+ 'KAVA': 'KAVA',
132457
+ 'XYM': 'XYM',
132458
+ 'ENJ': 'ENJ',
132459
+ 'CRUST': 'CRUST',
132460
+ 'ICP': 'ICP',
132461
+ 'CSPR': 'CSPR',
132462
+ 'FLOW': 'FLOW',
132463
+ 'IOTX': 'IOTX',
132464
+ 'LAT': 'LAT',
132465
+ 'APT': 'APT',
132466
+ 'XCH': 'XCH',
132467
+ 'MINA': 'MINA',
132468
+ 'XEC': 'ECASH',
132469
+ 'XPRT': 'XPRT',
132470
+ 'CCA': 'ACA',
132471
+ 'AOTI': 'COTI',
132472
+ 'AKT': 'AKT',
132473
+ 'ARS': 'ARS',
132474
+ 'ASTR': 'ASTR',
132475
+ 'AZERO': 'AZERO',
132476
+ 'BLD': 'BLD',
132477
+ 'BRISE': 'BRISE',
132478
+ 'CORE': 'CORE',
132479
+ 'DESO': 'DESO',
132480
+ 'DFI': 'DFI',
132481
+ 'EGLD': 'EGLD',
132482
+ 'ERG': 'ERG',
132483
+ 'ETHF': 'ETHFAIR',
132484
+ 'ETHW': 'ETHW',
132485
+ 'EVMOS': 'EVMOS',
132486
+ 'FIO': 'FIO',
132487
+ 'FLR': 'FLR',
132488
+ 'FINSCHIA': 'FINSCHIA',
132489
+ 'KMA': 'KMA',
132490
+ 'KYVE': 'KYVE',
132491
+ 'MEV': 'MEV',
132492
+ 'MOVR': 'MOVR',
132493
+ 'NODL': 'NODL',
132494
+ 'OAS': 'OAS',
132495
+ 'OSMO': 'OSMO',
132496
+ 'PAYCOIN': 'PAYCOIN',
132497
+ 'POKT': 'POKT',
132498
+ 'PYG': 'PYG',
132499
+ 'REI': 'REI',
132500
+ 'SCRT': 'SCRT',
132501
+ 'SDN': 'SDN',
132502
+ 'SEI': 'SEI',
132503
+ 'SGB': 'SGB',
132504
+ 'SUI': 'SUI',
132505
+ 'SXP': 'SOLAR',
132506
+ 'SYS': 'SYS',
132507
+ 'TENET': 'TENET',
132508
+ 'TON': 'TON',
132509
+ 'UNQ': 'UNQ',
132510
+ 'UYU': 'UYU',
132511
+ 'WEMIX': 'WEMIX',
132512
+ 'XDC': 'XDC',
132513
+ 'XPLA': 'XPLA',
132514
+ // todo: below
132515
+ // 'LUNC': 'LUNC',
132516
+ // 'TERRA': 'TERRA', // tbd
132517
+ // 'LUNA': 'LUNA', tbd
132518
+ // 'FCT2': 'FCT2',
132519
+ // FIL-0X ?
132520
+ // 'COSMOS': 'ATOM1',
132521
+ // 'ATOM': 'ATOM1',
132522
+ // 'CRO': 'CRO',
132523
+ // 'OP': [ 'OPTIMISM', 'OPTIMISMETH' ]
132524
+ // 'ARB': ['ARB', 'ARBITRUMETH']
132525
+ // 'CHZ': [ 'CHZ', 'CZH' ],
132526
+ // todo: AVAXCCHAIN CCHAIN AVAX
132527
+ // 'ALGO': ['ALGO', 'ALGOUSDT']
132528
+ // 'ONT': [ 'ONT', 'ONTOLOGY' ],
132529
+ // 'BCC': 'BCC', BCH's somewhat chain
132530
+ // 'DBC1': 'DBC1',
132257
132531
  },
132258
132532
  // https://github.com/ccxt/ccxt/issues/5376
132259
132533
  'fetchOrdersByStatesMethod': 'spot_private_get_v1_order_orders',
@@ -134204,10 +134478,10 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
134204
134478
  for (let j = 0; j < chains.length; j++) {
134205
134479
  const chainEntry = chains[j];
134206
134480
  const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
134207
- const title = this.safeString(chainEntry, 'displayName');
134481
+ const title = this.safeString2(chainEntry, 'baseChain', 'displayName'); // baseChain and baseChainProtocol are together existent or inexistent in entries, but baseChain is preferred. when they are both inexistent, then we use generic displayName
134208
134482
  this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
134209
134483
  this.options['networkNamesByChainIds'][uniqueChainId] = title;
134210
- const networkCode = this.networkIdToCode(title, code);
134484
+ const networkCode = this.networkIdToCode(uniqueChainId);
134211
134485
  minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
134212
134486
  maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
134213
134487
  const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
@@ -134227,6 +134501,10 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
134227
134501
  'id': uniqueChainId,
134228
134502
  'network': networkCode,
134229
134503
  'limits': {
134504
+ 'deposit': {
134505
+ 'min': undefined,
134506
+ 'max': undefined,
134507
+ },
134230
134508
  'withdraw': {
134231
134509
  'min': minWithdraw,
134232
134510
  'max': maxWithdraw,
@@ -134257,6 +134535,10 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
134257
134535
  'min': minWithdraw,
134258
134536
  'max': maxWithdraw,
134259
134537
  },
134538
+ 'deposit': {
134539
+ 'min': undefined,
134540
+ 'max': undefined,
134541
+ },
134260
134542
  },
134261
134543
  'precision': this.parseNumber(minPrecision),
134262
134544
  'networks': networks,
@@ -134284,8 +134566,13 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
134284
134566
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' networkCodeToId() - markets need to be loaded at first');
134285
134567
  }
134286
134568
  const uniqueNetworkIds = this.safeValue(this.options['networkChainIdsByNames'], currencyCode, {});
134287
- const networkTitle = super.networkCodeToId(networkCode);
134288
- return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
134569
+ if (networkCode in uniqueNetworkIds) {
134570
+ return uniqueNetworkIds[networkCode];
134571
+ }
134572
+ else {
134573
+ const networkTitle = super.networkCodeToId(networkCode);
134574
+ return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
134575
+ }
134289
134576
  }
134290
134577
  async fetchBalance(params = {}) {
134291
134578
  /**
@@ -136724,7 +137011,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
136724
137011
  'currency': code,
136725
137012
  'address': address,
136726
137013
  'tag': tag,
136727
- 'network': this.networkIdToCode(networkId, code),
137014
+ 'network': this.networkIdToCode(networkId),
136728
137015
  'note': note,
136729
137016
  'info': depositAddress,
136730
137017
  };
@@ -136999,7 +137286,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
136999
137286
  'txid': txHash,
137000
137287
  'timestamp': timestamp,
137001
137288
  'datetime': this.iso8601(timestamp),
137002
- 'network': this.networkIdToCode(networkId, code),
137289
+ 'network': this.networkIdToCode(networkId),
137003
137290
  'address': this.safeString(transaction, 'address'),
137004
137291
  'addressTo': undefined,
137005
137292
  'addressFrom': undefined,
@@ -146386,8 +146673,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146386
146673
  for (let i = 0; i < currencyIds.length; i++) {
146387
146674
  const currencyId = currencyIds[i];
146388
146675
  const code = this.safeCurrencyCode(currencyId);
146676
+ const balance = this.safeValue(balances, currencyId, {});
146389
146677
  const account = this.account();
146390
- account['total'] = this.safeString(balances, currencyId);
146678
+ account['used'] = this.safeString(balance, 'hold_trade');
146679
+ account['total'] = this.safeString(balance, 'balance');
146391
146680
  result[code] = account;
146392
146681
  }
146393
146682
  return this.safeBalance(result);
@@ -146397,19 +146686,24 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146397
146686
  * @method
146398
146687
  * @name kraken#fetchBalance
146399
146688
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
146400
- * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getAccountBalance
146689
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getExtendedBalance
146401
146690
  * @param {object} [params] extra parameters specific to the kraken api endpoint
146402
146691
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
146403
146692
  */
146404
146693
  await this.loadMarkets();
146405
- const response = await this.privatePostBalance(params);
146694
+ const response = await this.privatePostBalanceEx(params);
146406
146695
  //
146407
146696
  // {
146408
- // "error":[],
146409
- // "result":{
146410
- // "ZUSD":"58.8649",
146411
- // "KFEE":"4399.43",
146412
- // "XXBT":"0.0000034506",
146697
+ // "error": [],
146698
+ // "result": {
146699
+ // "ZUSD": {
146700
+ // "balance": 25435.21,
146701
+ // "hold_trade": 8249.76
146702
+ // },
146703
+ // "XXBT": {
146704
+ // "balance": 1.2435,
146705
+ // "hold_trade": 0.8423
146706
+ // }
146413
146707
  // }
146414
146708
  // }
146415
146709
  //
@@ -150256,11 +150550,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150256
150550
  'id': 'kucoin',
150257
150551
  'name': 'KuCoin',
150258
150552
  'countries': ['SC'],
150259
- // note "only some endpoints are rate-limited"
150260
- // so I set the 'ratelimit' on those which supposedly 'arent ratelimited'
150261
- // to the limit of the cheapest endpoint
150262
- // 60 requests in 3 seconds = 20 requests per second => ( 1000ms / 20 ) = 50 ms between requests on average
150263
- 'rateLimit': 50,
150553
+ 'rateLimit': 10,
150264
150554
  'version': 'v2',
150265
150555
  'certified': true,
150266
150556
  'pro': true,
@@ -150289,7 +150579,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150289
150579
  'fetchBorrowInterest': true,
150290
150580
  'fetchBorrowRate': false,
150291
150581
  'fetchBorrowRateHistories': false,
150292
- 'fetchBorrowRateHistory': true,
150582
+ 'fetchBorrowRateHistory': false,
150293
150583
  'fetchBorrowRates': false,
150294
150584
  'fetchClosedOrders': true,
150295
150585
  'fetchCurrencies': true,
@@ -150350,13 +150640,6 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150350
150640
  'futuresPublic': 'https://api-futures.kucoin.com',
150351
150641
  'webExchange': 'https://kucoin.com/_api',
150352
150642
  },
150353
- 'test': {
150354
- 'public': 'https://openapi-sandbox.kucoin.com',
150355
- 'private': 'https://openapi-sandbox.kucoin.com',
150356
- 'futuresPrivate': 'https://api-sandbox-futures.kucoin.com',
150357
- 'futuresPublic': 'https://api-sandbox-futures.kucoin.com',
150358
- 'webExchange': 'https://kucoin.com/_api',
150359
- },
150360
150643
  'www': 'https://www.kucoin.com',
150361
150644
  'doc': [
150362
150645
  'https://docs.kucoin.com',
@@ -150368,205 +150651,229 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150368
150651
  'password': true,
150369
150652
  },
150370
150653
  'api': {
150654
+ // level VIP0
150655
+ // Spot => 3000/30s => 100/s
150656
+ // Weight = x => 100/(100/x) = x
150657
+ // Futures Management Public => 2000/30s => 200/3/s
150658
+ // Weight = x => 100/(200/3/x) = x*1.5
150371
150659
  'public': {
150372
150660
  'get': {
150373
- 'timestamp': 1,
150374
- 'status': 1,
150375
- 'symbols': 1,
150376
- 'markets': 1,
150377
- 'market/allTickers': 1,
150378
- 'market/orderbook/level{level}_{limit}': 1,
150379
- 'market/orderbook/level2_20': 1,
150380
- 'market/orderbook/level2_100': 1,
150381
- 'market/histories': 1,
150382
- 'market/candles': 1,
150383
- 'market/stats': 1,
150384
- 'currencies': 1,
150385
- 'currencies/{currency}': 1,
150386
- 'prices': 1,
150387
- 'mark-price/{symbol}/current': 1,
150388
- 'margin/config': 1,
150389
- 'margin/trade/last': 1,
150661
+ // spot trading
150662
+ 'currencies': 4.5,
150663
+ 'currencies/{currency}': 4.5,
150664
+ 'symbols': 6,
150665
+ 'market/orderbook/level1': 3,
150666
+ 'market/allTickers': 22.5,
150667
+ 'market/stats': 22.5,
150668
+ 'markets': 4.5,
150669
+ 'market/orderbook/level{level}_{limit}': 6,
150670
+ 'market/orderbook/level2_20': 3,
150671
+ 'market/orderbook/level2_100': 6,
150672
+ 'market/histories': 4.5,
150673
+ 'market/candles': 4.5,
150674
+ 'prices': 4.5,
150675
+ 'timestamp': 4.5,
150676
+ 'status': 4.5,
150677
+ // margin trading
150678
+ 'mark-price/{symbol}/current': 3,
150679
+ 'margin/config': 25, // 25SW
150390
150680
  },
150391
150681
  'post': {
150392
- 'bullet-public': 1,
150682
+ // ws
150683
+ 'bullet-public': 15, // 10PW
150393
150684
  },
150394
150685
  },
150395
150686
  'private': {
150396
150687
  'get': {
150397
- 'market/orderbook/level{level}': 1,
150398
- 'market/orderbook/level2': { 'v3': 2 },
150399
- 'market/orderbook/level3': 1,
150400
- 'accounts': 1,
150401
- 'accounts/{accountId}': 1,
150402
- // 'accounts/{accountId}/ledgers': 1, Deprecated endpoint
150403
- 'accounts/ledgers': 3.333,
150404
- 'accounts/{accountId}/holds': 1,
150405
- 'accounts/transferable': 1,
150406
- 'base-fee': 1,
150407
- 'sub/user': 1,
150408
- 'user-info': 1,
150409
- 'sub/api-key': 1,
150410
- 'sub-accounts': 1,
150411
- 'sub-accounts/{subUserId}': 1,
150412
- 'deposit-addresses': 1,
150413
- 'deposits': 10,
150414
- 'hist-deposits': 10,
150415
- // 'hist-orders': 1, Deprecated endpoint
150416
- 'hist-withdrawals': 10,
150417
- 'withdrawals': 10,
150418
- 'withdrawals/quotas': 1,
150419
- 'orders': 2,
150420
- 'order/client-order/{clientOid}': 1,
150421
- 'orders/{orderId}': 1,
150422
- 'limit/orders': 1,
150423
- 'fills': 6.66667,
150424
- 'limit/fills': 1,
150425
- 'isolated/accounts': 2,
150426
- 'isolated/account/{symbol}': 2,
150427
- 'isolated/borrow/outstanding': 2,
150428
- 'isolated/borrow/repaid': 2,
150429
- 'isolated/symbols': 2,
150430
- 'margin/account': 1,
150431
- 'margin/borrow': 1,
150432
- 'margin/borrow/outstanding': 1,
150433
- 'margin/borrow/repaid': 1,
150434
- 'margin/lend/active': 1,
150435
- 'margin/lend/done': 1,
150436
- 'margin/lend/trade/unsettled': 1,
150437
- 'margin/lend/trade/settled': 1,
150438
- 'margin/lend/assets': 1,
150439
- 'margin/market': 1,
150440
- 'stop-order/{orderId}': 1,
150441
- 'stop-order': 1,
150442
- 'stop-order/queryOrderByClientOid': 1,
150443
- 'trade-fees': 1.3333,
150444
- 'hf/accounts/ledgers': 3.33,
150688
+ // account
150689
+ 'user-info': 30,
150690
+ 'accounts': 7.5,
150691
+ 'accounts/{accountId}': 7.5,
150692
+ 'accounts/ledgers': 3,
150693
+ 'hf/accounts/ledgers': 2,
150694
+ 'hf/margin/account/ledgers': 2,
150695
+ 'transaction-history': 3,
150696
+ 'sub/user': 30,
150697
+ 'sub-accounts/{subUserId}': 22.5,
150698
+ 'sub-accounts': 30,
150699
+ 'sub/api-key': 30,
150700
+ // funding
150701
+ 'margin/account': 40,
150702
+ 'margin/accounts': 15,
150703
+ 'isolated/accounts': 15,
150704
+ 'deposit-addresses': 7.5,
150705
+ 'deposits': 7.5,
150706
+ 'hist-deposits': 7.5,
150707
+ 'withdrawals': 30,
150708
+ 'hist-withdrawals': 30,
150709
+ 'withdrawals/quotas': 30,
150710
+ 'accounts/transferable': 30,
150711
+ 'transfer-list': 30,
150712
+ 'base-fee': 3,
150713
+ 'trade-fees': 3,
150714
+ // spot trading
150715
+ 'market/orderbook/level{level}': 3,
150716
+ 'market/orderbook/level2': 3,
150717
+ 'market/orderbook/level3': 3,
150445
150718
  'hf/orders/active': 2,
150446
- 'hf/orders/active/symbols': 20,
150719
+ 'hf/orders/active/symbols': 2,
150447
150720
  'hf/orders/done': 2,
150448
- 'hf/orders/{orderId}': 1,
150721
+ 'hf/orders/{orderId}': 2,
150449
150722
  'hf/orders/client-order/{clientOid}': 2,
150450
- 'hf/fills': 6.67,
150451
- 'margin/repay': 1,
150452
- 'project/list': 1,
150453
- 'project/marketInterestRate': 1,
150454
- 'redeem/orders': 1,
150455
- 'purchase/orders': 1,
150723
+ 'hf/orders/dead-cancel-all/query': 2,
150724
+ 'hf/fills': 2,
150725
+ 'orders': 2,
150726
+ 'limit/orders': 3,
150727
+ 'orders/{orderId}': 2,
150728
+ 'order/client-order/{clientOid}': 3,
150729
+ 'fills': 10,
150730
+ 'limit/fills': 20,
150731
+ 'stop-order': 8,
150732
+ 'stop-order/{orderId}': 3,
150733
+ 'stop-order/queryOrderByClientOid': 3,
150734
+ // margin trading
150735
+ 'hf/margin/orders/active': 4,
150736
+ 'hf/margin/orders/done': 10,
150737
+ 'hf/margin/orders/{orderId}': 4,
150738
+ 'hf/margin/orders/client-order/{clientOid}': 5,
150739
+ 'hf/margin/fills': 5,
150740
+ 'etf/info': 25,
150741
+ 'risk/limit/strategy': 20,
150742
+ 'isolated/symbols': 20,
150743
+ 'isolated/account/{symbol}': 50,
150744
+ 'margin/borrow': 15,
150745
+ 'margin/repay': 15,
150746
+ 'project/list': 10,
150747
+ 'project/marketInterestRate': 7.5,
150748
+ 'redeem/orders': 10,
150749
+ 'purchase/orders': 10, // 10SW
150456
150750
  },
150457
150751
  'post': {
150458
- 'accounts': 1,
150459
- 'accounts/inner-transfer': { 'v2': 1 },
150460
- 'accounts/sub-transfer': { 'v2': 25 },
150461
- 'deposit-addresses': 1,
150462
- 'withdrawals': 1,
150463
- 'orders': 4,
150464
- 'orders/test': 4,
150465
- 'orders/multi': 20,
150466
- 'isolated/borrow': 2,
150467
- 'isolated/repay/all': 2,
150468
- 'isolated/repay/single': 2,
150469
- 'margin/borrow': 1,
150470
- 'margin/order': 1,
150471
- 'margin/order/test': 1,
150472
- 'margin/repay/all': 1,
150473
- 'margin/repay/single': 1,
150474
- 'margin/lend': 1,
150475
- 'margin/toggle-auto-lend': 1,
150476
- 'bullet-private': 1,
150477
- 'stop-order': 1,
150478
- 'sub/user': 1,
150479
- 'sub/api-key': 1,
150480
- 'sub/api-key/update': 1,
150481
- 'hf/orders': 0.4,
150482
- 'hf/orders/sync': 1.33,
150483
- 'hf/orders/multi': 20,
150484
- 'hf/orders/multi/sync': 20,
150485
- 'hf/orders/alter': 1,
150486
- 'margin/repay': 1,
150487
- 'purchase': 1,
150488
- 'redeem': 1,
150489
- 'lend/purchase/update': 1,
150752
+ // account
150753
+ 'sub/user/created': 22.5,
150754
+ 'sub/api-key': 30,
150755
+ 'sub/api-key/update': 45,
150756
+ // funding
150757
+ 'deposit-addresses': 30,
150758
+ 'withdrawals': 7.5,
150759
+ 'accounts/universal-transfer': 6,
150760
+ 'accounts/sub-transfer': 45,
150761
+ 'accounts/inner-transfer': 15,
150762
+ 'transfer-out': 30,
150763
+ 'transfer-in': 30,
150764
+ // spot trading
150765
+ 'hf/orders': 1,
150766
+ 'hf/orders/test': 1,
150767
+ 'hf/orders/sync': 1,
150768
+ 'hf/orders/multi': 1,
150769
+ 'hf/orders/multi/sync': 1,
150770
+ 'hf/orders/alter': 3,
150771
+ 'hf/orders/dead-cancel-all': 2,
150772
+ 'orders': 2,
150773
+ 'orders/test': 2,
150774
+ 'orders/multi': 3,
150775
+ 'stop-order': 2,
150776
+ // margin trading
150777
+ 'hf/margin/order': 5,
150778
+ 'hf/margin/order/test': 5,
150779
+ 'margin/order': 5,
150780
+ 'margin/order/test': 5,
150781
+ 'margin/borrow': 15,
150782
+ 'margin/repay': 10,
150783
+ 'purchase': 15,
150784
+ 'redeem': 15,
150785
+ 'lend/purchase/update': 10,
150786
+ // ws
150787
+ 'bullet-private': 10, // 10SW
150490
150788
  },
150491
150789
  'delete': {
150492
- 'withdrawals/{withdrawalId}': 1,
150790
+ // account
150791
+ 'sub/api-key': 45,
150792
+ // funding
150793
+ 'withdrawals/{withdrawalId}': 30,
150794
+ // spot trading
150795
+ 'hf/orders/{orderId}': 1,
150796
+ 'hf/orders/sync/{orderId}': 1,
150797
+ 'hf/orders/client-order/{clientOid}': 1,
150798
+ 'hf/orders/sync/client-order/{clientOid}': 1,
150799
+ 'hf/orders/cancel/{orderId}': 2,
150800
+ 'hf/orders': 2,
150801
+ 'orders/{orderId}': 3,
150802
+ 'order/client-order/{clientOid}': 5,
150493
150803
  'orders': 20,
150494
- 'order/client-order/{clientOid}': 1,
150495
- 'orders/{orderId}': 1,
150496
- 'margin/lend/{orderId}': 1,
150497
- 'stop-order/cancelOrderByClientOid': 1,
150498
- 'stop-order/{orderId}': 1,
150499
- 'stop-order/cancel': 1,
150500
- 'sub/api-key': 1,
150501
- 'hf/orders/{orderId}': 0.4,
150502
- 'hf/orders/sync/{orderId}': 0.4,
150503
- 'hf/orders/client-order/{clientOid}': 0.4,
150504
- 'hf/orders/sync/client-order/{clientOid}': 0.4,
150505
- 'hf/orders/cancel/{orderId}': 1,
150506
- 'hf/orders': 20, // 3 times/3s = 1/s => cost = 20 / 1 = 20
150804
+ 'stop-order/{orderId}': 3,
150805
+ 'stop-order/cancelOrderByClientOid': 5,
150806
+ 'stop-order/cancel': 3,
150807
+ // margin trading
150808
+ 'hf/margin/orders/{orderId}': 5,
150809
+ 'hf/margin/orders/client-order/{clientOid}': 5,
150810
+ 'hf/margin/orders': 10, // 10SW
150507
150811
  },
150508
150812
  },
150509
150813
  'futuresPublic': {
150510
- // cheapest futures 'limited' endpoint is 40 requests per 3 seconds = 14.333 per second => cost = 20/14.333 = 1.3953
150511
150814
  'get': {
150512
- 'contracts/active': 1.3953,
150513
- 'contracts/{symbol}': 1.3953,
150514
- 'ticker': 1.3953,
150515
- 'level2/snapshot': 2,
150516
- 'level2/depth20': 1.3953,
150517
- 'level2/depth100': 1.3953,
150815
+ 'contracts/active': 4.5,
150816
+ 'contracts/{symbol}': 4.5,
150817
+ 'ticker': 3,
150818
+ 'level2/snapshot': 4.5,
150819
+ 'level2/depth20': 7.5,
150820
+ 'level2/depth100': 15,
150821
+ 'trade/history': 7.5,
150822
+ 'kline/query': 4.5,
150823
+ 'interest/query': 7.5,
150824
+ 'index/query': 3,
150825
+ 'mark-price/{symbol}/current': 4.5,
150826
+ 'premium/query': 4.5,
150827
+ 'funding-rate/{symbol}/current': 3,
150828
+ 'timestamp': 3,
150829
+ 'status': 6,
150830
+ // ?
150518
150831
  'level2/message/query': 1.3953,
150519
- 'level3/message/query': 1.3953,
150520
- 'level3/snapshot': 1.3953,
150521
- 'trade/history': 1.3953,
150522
- 'interest/query': 1.3953,
150523
- 'index/query': 1.3953,
150524
- 'mark-price/{symbol}/current': 1.3953,
150525
- 'premium/query': 1.3953,
150526
- 'funding-rate/{symbol}/current': 1.3953,
150527
- 'timestamp': 1.3953,
150528
- 'status': 1.3953,
150529
- 'kline/query': 1.3953,
150530
150832
  },
150531
150833
  'post': {
150532
- 'bullet-public': 1.3953,
150834
+ // ws
150835
+ 'bullet-public': 15, // 10PW
150533
150836
  },
150534
150837
  },
150535
150838
  'futuresPrivate': {
150536
150839
  'get': {
150537
- 'account-overview': 2,
150538
- 'transaction-history': 6.666,
150539
- 'deposit-address': 1.3953,
150540
- 'deposit-list': 1.3953,
150541
- 'withdrawals/quotas': 1.3953,
150542
- 'withdrawal-list': 1.3953,
150543
- 'transfer-list': 1.3953,
150544
- 'orders': 1.3953,
150545
- 'stopOrders': 1.3953,
150546
- 'recentDoneOrders': 1.3953,
150547
- 'orders/{orderId}': 1.3953,
150548
- 'orders/byClientOid': 1.3953,
150549
- 'fills': 6.666,
150550
- 'recentFills': 6.666,
150551
- 'openOrderStatistics': 1.3953,
150552
- 'position': 1.3953,
150553
- 'positions': 6.666,
150554
- 'funding-history': 6.666, // 9 requests per 3 seconds = 3 per second => cost = 20/3 = 6.666
150840
+ // account
150841
+ 'transaction-history': 3,
150842
+ // funding
150843
+ 'account-overview': 7.5,
150844
+ 'account-overview-all': 9,
150845
+ 'transfer-list': 30,
150846
+ // futures
150847
+ 'orders': 3,
150848
+ 'stopOrders': 9,
150849
+ 'recentDoneOrders': 7.5,
150850
+ 'orders/{orderId}': 7.5,
150851
+ 'orders/byClientOid': 7.5,
150852
+ 'fills': 7.5,
150853
+ 'recentFills': 4.5,
150854
+ 'openOrderStatistics': 15,
150855
+ 'position': 3,
150856
+ 'positions': 3,
150857
+ 'contracts/risk-limit/{symbol}': 7.5,
150858
+ 'funding-history': 7.5, // 5FW
150555
150859
  },
150556
150860
  'post': {
150557
- 'withdrawals': 1.3953,
150558
- 'transfer-out': 1.3953,
150559
- 'orders': 1.3953,
150560
- 'position/margin/auto-deposit-status': 1.3953,
150561
- 'position/margin/deposit-margin': 1.3953,
150562
- 'bullet-private': 1.3953,
150861
+ // funding
150862
+ 'transfer-out': 30,
150863
+ 'transfer-in': 30,
150864
+ // futures
150865
+ 'orders': 3,
150866
+ 'orders/test': 3,
150867
+ 'position/margin/auto-deposit-status': 6,
150868
+ 'position/margin/deposit-margin': 6,
150869
+ 'position/risk-limit-level/change': 6,
150870
+ // ws
150871
+ 'bullet-private': 15, // 10FW
150563
150872
  },
150564
150873
  'delete': {
150565
- 'withdrawals/{withdrawalId}': 1.3953,
150566
- 'cancel/transfer-out': 1.3953,
150567
- 'orders/{orderId}': 1.3953,
150568
- 'orders': 6.666,
150569
- 'stopOrders': 1.3953,
150874
+ 'orders/{orderId}': 1.5,
150875
+ 'orders': 45,
150876
+ 'stopOrders': 22.5, // 15FW
150570
150877
  },
150571
150878
  },
150572
150879
  'webExchange': {
@@ -150733,27 +151040,35 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150733
151040
  'versions': {
150734
151041
  'public': {
150735
151042
  'GET': {
151043
+ // spot trading
150736
151044
  'currencies': 'v3',
150737
- 'currencies/{currency}': 'v2',
150738
- 'status': 'v1',
150739
- 'market/orderbook/level2_20': 'v1',
150740
- 'market/orderbook/level2_100': 'v1',
150741
- 'market/orderbook/level{level}_{limit}': 'v1',
151045
+ 'currencies/{currency}': 'v3',
151046
+ 'symbols': 'v2',
150742
151047
  },
150743
151048
  },
150744
151049
  'private': {
150745
151050
  'GET': {
151051
+ // account
151052
+ 'user-info': 'v2',
151053
+ 'hf/margin/account/ledgers': 'v3',
151054
+ 'sub/user': 'v2',
151055
+ 'sub-accounts': 'v2',
151056
+ // funding
151057
+ 'margin/accounts': 'v3',
151058
+ 'isolated/accounts': 'v3',
151059
+ // 'deposit-addresses': 'v2',
151060
+ 'deposit-addresses': 'v1',
151061
+ // spot trading
150746
151062
  'market/orderbook/level2': 'v3',
150747
151063
  'market/orderbook/level3': 'v3',
150748
151064
  'market/orderbook/level{level}': 'v3',
150749
- 'deposit-addresses': 'v1',
150750
- 'hf/accounts/ledgers': 'v1',
150751
- 'hf/orders/active': 'v1',
150752
- 'hf/orders/active/symbols': 'v1',
150753
- 'hf/orders/done': 'v1',
150754
- 'hf/orders/{orderId}': 'v1',
150755
- 'hf/orders/client-order/{clientOid}': 'v1',
150756
- 'hf/fills': 'v1',
151065
+ // margin trading
151066
+ 'hf/margin/orders/active': 'v3',
151067
+ 'hf/margin/orders/done': 'v3',
151068
+ 'hf/margin/orders/{orderId}': 'v3',
151069
+ 'hf/margin/orders/client-order/{clientOid}': 'v3',
151070
+ 'hf/margin/fills': 'v3',
151071
+ 'etf/info': 'v3',
150757
151072
  'margin/borrow': 'v3',
150758
151073
  'margin/repay': 'v3',
150759
151074
  'project/list': 'v3',
@@ -150762,14 +151077,17 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150762
151077
  'purchase/orders': 'v3',
150763
151078
  },
150764
151079
  'POST': {
150765
- 'accounts/inner-transfer': 'v2',
151080
+ // account
151081
+ 'sub/user/created': 'v2',
151082
+ // funding
151083
+ 'accounts/universal-transfer': 'v3',
150766
151084
  'accounts/sub-transfer': 'v2',
150767
- 'accounts': 'v1',
150768
- 'hf/orders': 'v1',
150769
- 'hf/orders/sync': 'v1',
150770
- 'hf/orders/multi': 'v1',
150771
- 'hf/orders/multi/sync': 'v1',
150772
- 'hf/orders/alter': 'v1',
151085
+ 'accounts/inner-transfer': 'v2',
151086
+ 'transfer-out': 'v3',
151087
+ // spot trading
151088
+ // margin trading
151089
+ 'hf/margin/order': 'v3',
151090
+ 'hf/margin/order/test': 'v3',
150773
151091
  'margin/borrow': 'v3',
150774
151092
  'margin/repay': 'v3',
150775
151093
  'purchase': 'v3',
@@ -150777,26 +151095,18 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
150777
151095
  'lend/purchase/update': 'v3',
150778
151096
  },
150779
151097
  'DELETE': {
150780
- 'hf/orders/{orderId}': 'v1',
150781
- 'hf/orders/sync/{orderId}': 'v1',
150782
- 'hf/orders/client-order/{clientOid}': 'v1',
150783
- 'hf/orders/sync/client-order/{clientOid}': 'v1',
150784
- 'hf/orders/cancel/{orderId}': 'v1',
150785
- 'hf/orders': 'v1',
151098
+ // account
151099
+ // funding
151100
+ // spot trading
151101
+ 'hf/margin/orders/{orderId}': 'v3',
151102
+ 'hf/margin/orders/client-order/{clientOid}': 'v3',
151103
+ 'hf/margin/orders': 'v3',
151104
+ // margin trading
150786
151105
  },
150787
151106
  },
150788
151107
  'futuresPrivate': {
150789
- 'GET': {
150790
- 'account-overview': 'v1',
150791
- 'positions': 'v1',
150792
- },
150793
151108
  'POST': {
150794
- 'transfer-out': 'v2',
150795
- },
150796
- },
150797
- 'futuresPublic': {
150798
- 'GET': {
150799
- 'level3/snapshot': 'v2',
151109
+ 'transfer-out': 'v3',
150800
151110
  },
150801
151111
  },
150802
151112
  },
@@ -154114,42 +154424,6 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
154114
154424
  }
154115
154425
  return this.safeValue(config, 'cost', 1);
154116
154426
  }
154117
- async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
154118
- /**
154119
- * @method
154120
- * @name kucoin#fetchBorrowRateHistory
154121
- * @description retrieves a history of a currencies borrow interest rate at specific time slots
154122
- * @see https://docs.kucoin.com/#margin-trade-data
154123
- * @param {string} code unified currency code
154124
- * @param {int} [since] timestamp for the earliest borrow rate
154125
- * @param {int} [limit] the maximum number of [borrow rate structures]
154126
- * @param {object} [params] extra parameters specific to the kucoin api endpoint
154127
- * @returns {object[]} an array of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
154128
- */
154129
- await this.loadMarkets();
154130
- const currency = this.currency(code);
154131
- const request = {
154132
- 'currency': currency['id'],
154133
- };
154134
- const response = await this.publicGetMarginTradeLast(this.extend(request, params));
154135
- //
154136
- // {
154137
- // "code": "200000",
154138
- // "data": [
154139
- // {
154140
- // "tradeId": "62db2dcaff219600012b56cd",
154141
- // "currency": "USDT",
154142
- // "size": "10",
154143
- // "dailyIntRate": "0.00003",
154144
- // "term": 7,
154145
- // "timestamp": 1658531274508488480
154146
- // },
154147
- // ]
154148
- // }
154149
- //
154150
- const data = this.safeValue(response, 'data', {});
154151
- return this.parseBorrowRateHistory(data, code, since, limit);
154152
- }
154153
154427
  parseBorrowRateHistory(response, code, since, limit) {
154154
154428
  const result = [];
154155
154429
  for (let i = 0; i < response.length; i++) {
@@ -154530,10 +154804,6 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
154530
154804
  let endpart = '';
154531
154805
  headers = (headers !== undefined) ? headers : {};
154532
154806
  let url = this.urls['api'][api];
154533
- const isSandbox = url.indexOf('sandbox') >= 0;
154534
- if (path === 'symbols' && !isSandbox) {
154535
- endpoint = '/api/v2/' + this.implodeParams(path, params);
154536
- }
154537
154807
  if (Object.keys(query).length) {
154538
154808
  if ((method === 'GET') || (method === 'DELETE')) {
154539
154809
  endpoint += '?' + this.rawencode(query);
@@ -236623,7 +236893,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
236623
236893
  const request = {
236624
236894
  'instType': uppercaseType,
236625
236895
  };
236626
- const orders = await this.subscribe('private', messageHash, channel, symbol, this.extend(request, params));
236896
+ const orders = await this.subscribe('private', messageHash, channel, undefined, this.extend(request, params));
236627
236897
  if (this.newUpdates) {
236628
236898
  limit = orders.getLimit(symbol, limit);
236629
236899
  }
@@ -279954,7 +280224,7 @@ SOFTWARE.
279954
280224
 
279955
280225
  //-----------------------------------------------------------------------------
279956
280226
  // this is updated by vss.js when building
279957
- const version = '4.1.34';
280227
+ const version = '4.1.35';
279958
280228
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
279959
280229
  //-----------------------------------------------------------------------------
279960
280230