ccxt 4.2.68 → 4.2.69

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
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
210
210
 
211
211
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
212
212
 
213
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.68/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.2.68/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.69/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.2.69/dist/ccxt.browser.js
215
215
 
216
216
  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.
217
217
 
218
218
  ```HTML
219
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.68/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.69/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
package/build.sh CHANGED
@@ -76,7 +76,7 @@ build_and_test_all () {
76
76
  # cd python
77
77
  # if ! tox run-parallel; then
78
78
  # exit 1
79
- # fi
79
+ # fi
80
80
  # cd ..
81
81
  # fi
82
82
  fi
@@ -68854,6 +68854,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68854
68854
  'setLeverage': false,
68855
68855
  'setMarginMode': false,
68856
68856
  'setPositionMode': false,
68857
+ 'transfer': true,
68857
68858
  'withdraw': true,
68858
68859
  },
68859
68860
  'urls': {
@@ -70888,6 +70889,73 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
70888
70889
  const response = await this[method](this.extend(request, params));
70889
70890
  return this.parseTransaction(response, currency);
70890
70891
  }
70892
+ async transfer(code, amount, fromAccount, toAccount, params = {}) {
70893
+ /**
70894
+ * @method
70895
+ * @name bitstamp#transfer
70896
+ * @description transfer currency internally between wallets on the same account
70897
+ * @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromMainToSub
70898
+ * @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromSubToMain
70899
+ * @param {string} code unified currency code
70900
+ * @param {float} amount amount to transfer
70901
+ * @param {string} fromAccount account to transfer from
70902
+ * @param {string} toAccount account to transfer to
70903
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
70904
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
70905
+ */
70906
+ await this.loadMarkets();
70907
+ const currency = this.currency(code);
70908
+ amount = this.currencyToPrecision(code, amount);
70909
+ amount = this.parseToNumeric(amount);
70910
+ const request = {
70911
+ 'amount': amount,
70912
+ 'currency': currency['id'].toUpperCase(),
70913
+ };
70914
+ let response = undefined;
70915
+ if (fromAccount === 'main') {
70916
+ request['subAccount'] = toAccount;
70917
+ response = await this.privatePostTransferFromMain(this.extend(request, params));
70918
+ }
70919
+ else if (toAccount === 'main') {
70920
+ request['subAccount'] = fromAccount;
70921
+ response = await this.privatePostTransferToMain(this.extend(request, params));
70922
+ }
70923
+ else {
70924
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' transfer() only supports from or to main');
70925
+ }
70926
+ //
70927
+ // { status: 'ok' }
70928
+ //
70929
+ const transfer = this.parseTransfer(response, currency);
70930
+ transfer['amount'] = amount;
70931
+ transfer['fromAccount'] = fromAccount;
70932
+ transfer['toAccount'] = toAccount;
70933
+ return transfer;
70934
+ }
70935
+ parseTransfer(transfer, currency = undefined) {
70936
+ //
70937
+ // { status: 'ok' }
70938
+ //
70939
+ const status = this.safeString(transfer, 'status');
70940
+ return {
70941
+ 'info': transfer,
70942
+ 'id': undefined,
70943
+ 'timestamp': undefined,
70944
+ 'datetime': undefined,
70945
+ 'currency': currency['code'],
70946
+ 'amount': undefined,
70947
+ 'fromAccount': undefined,
70948
+ 'toAccount': undefined,
70949
+ 'status': this.parseTransferStatus(status),
70950
+ };
70951
+ }
70952
+ parseTransferStatus(status) {
70953
+ const statuses = {
70954
+ 'ok': 'ok',
70955
+ 'error': 'failed',
70956
+ };
70957
+ return this.safeString(statuses, status, status);
70958
+ }
70891
70959
  nonce() {
70892
70960
  return this.milliseconds();
70893
70961
  }
@@ -137736,7 +137804,10 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
137736
137804
  if (lastTradeTimestamp === undefined) {
137737
137805
  lastTradeTimestamp = this.safeTimestamp2(order, 'update_time', 'finish_time');
137738
137806
  }
137739
- const marketType = ('currency_pair' in order) ? 'spot' : 'contract';
137807
+ let marketType = 'contract';
137808
+ if (('currency_pair' in order) || ('market' in order)) {
137809
+ marketType = 'spot';
137810
+ }
137740
137811
  const exchangeSymbol = this.safeString2(order, 'currency_pair', 'market', contract);
137741
137812
  const symbol = this.safeSymbol(exchangeSymbol, market, '_', marketType);
137742
137813
  // Everything below this(above return) is related to fees
@@ -140351,7 +140422,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140351
140422
  'CORS': undefined,
140352
140423
  'spot': true,
140353
140424
  'margin': false,
140354
- 'swap': false,
140425
+ 'swap': true,
140355
140426
  'future': false,
140356
140427
  'option': false,
140357
140428
  'addMargin': false,
@@ -140576,11 +140647,11 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140576
140647
  },
140577
140648
  },
140578
140649
  'options': {
140579
- 'fetchMarketsMethod': 'fetch_markets_from_web',
140650
+ 'fetchMarketsMethod': 'fetch_markets_from_api',
140580
140651
  'fetchMarketFromWebRetries': 10,
140581
140652
  'fetchMarketsFromAPI': {
140582
140653
  'fetchDetailsForAllSymbols': false,
140583
- 'fetchDetailsForMarketIds': [],
140654
+ 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH'],
140584
140655
  },
140585
140656
  'fetchMarkets': {
140586
140657
  'webApiEnable': true,
@@ -140636,10 +140707,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140636
140707
  }
140637
140708
  //
140638
140709
  // {
140639
- // "tradingPairs": [
140640
- // [ "BTCAUD", 2, 8, "0.00001", 10, true ],
140641
- // ...
140642
- // ],
140710
+ // "tradingPairs": [ [ 'BTCUSD', 2, 8, '0.00001', 10, true ], ... ],
140643
140711
  // "currencies": [
140644
140712
  // [ "ORCA", "Orca", 204, 6, 0, 6, 8, false, null, "solana" ], // as confirmed, precisions seem to be the 5th index
140645
140713
  // [ "ATOM", "Cosmos", 44, 6, 0, 6, 8, false, null, "cosmos" ],
@@ -140658,6 +140726,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140658
140726
  // }
140659
140727
  //
140660
140728
  const result = {};
140729
+ this.options['tradingPairs'] = this.safeList(data, 'tradingPairs');
140661
140730
  const currenciesArray = this.safeValue(data, 'currencies', []);
140662
140731
  for (let i = 0; i < currenciesArray.length; i++) {
140663
140732
  const currency = currenciesArray[i];
@@ -140867,7 +140936,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140867
140936
  return result;
140868
140937
  }
140869
140938
  async fetchMarketsFromAPI(params = {}) {
140870
- const response = await this.publicGetV1Symbols(params);
140939
+ const marketIdsRaw = await this.publicGetV1Symbols(params);
140871
140940
  //
140872
140941
  // [
140873
140942
  // "btcusd",
@@ -140875,93 +140944,185 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140875
140944
  // ...
140876
140945
  // ]
140877
140946
  //
140878
- const result = {};
140879
- for (let i = 0; i < response.length; i++) {
140880
- const marketId = response[i];
140881
- const market = {
140882
- 'symbol': marketId,
140883
- };
140884
- result[marketId] = this.parseMarket(market);
140947
+ const result = [];
140948
+ const options = this.safeDict(this.options, 'fetchMarketsFromAPI', {});
140949
+ const bugSymbol = 'efilfil'; // we skip this inexistent test symbol, which bugs other functions
140950
+ const marketIds = [];
140951
+ for (let i = 0; i < marketIdsRaw.length; i++) {
140952
+ if (marketIdsRaw[i] !== bugSymbol) {
140953
+ marketIds.push(marketIdsRaw[i]);
140954
+ }
140885
140955
  }
140886
- const options = this.safeValue(this.options, 'fetchMarketsFromAPI', {});
140887
- const fetchDetailsForAllSymbols = this.safeBool(options, 'fetchDetailsForAllSymbols', false);
140888
- const fetchDetailsForMarketIds = this.safeValue(options, 'fetchDetailsForMarketIds', []);
140889
- let promises = [];
140890
- let marketIds = [];
140891
- if (fetchDetailsForAllSymbols) {
140892
- marketIds = response;
140956
+ if (this.safeBool(options, 'fetchDetailsForAllSymbols', false)) {
140957
+ const promises = [];
140958
+ for (let i = 0; i < marketIds.length; i++) {
140959
+ const marketId = marketIds[i];
140960
+ const request = {
140961
+ 'symbol': marketId,
140962
+ };
140963
+ promises.push(this.publicGetV1SymbolsDetailsSymbol(this.extend(request, params)));
140964
+ //
140965
+ // {
140966
+ // "symbol": "BTCUSD",
140967
+ // "base_currency": "BTC",
140968
+ // "quote_currency": "USD",
140969
+ // "tick_size": 1E-8,
140970
+ // "quote_increment": 0.01,
140971
+ // "min_order_size": "0.00001",
140972
+ // "status": "open",
140973
+ // "wrap_enabled": false
140974
+ // }
140975
+ //
140976
+ }
140977
+ const responses = await Promise.all(promises);
140978
+ for (let i = 0; i < responses.length; i++) {
140979
+ result.push(this.parseMarket(responses[i]));
140980
+ }
140893
140981
  }
140894
140982
  else {
140895
- marketIds = fetchDetailsForMarketIds;
140896
- }
140897
- for (let i = 0; i < marketIds.length; i++) {
140898
- const marketId = marketIds[i];
140899
- const request = {
140900
- 'symbol': marketId,
140901
- };
140902
- promises.push(this.publicGetV1SymbolsDetailsSymbol(this.extend(request, params)));
140903
- //
140904
- // {
140905
- // "symbol": "BTCUSD",
140906
- // "base_currency": "BTC",
140907
- // "quote_currency": "USD",
140908
- // "tick_size": 1E-8,
140909
- // "quote_increment": 0.01,
140910
- // "min_order_size": "0.00001",
140911
- // "status": "open",
140912
- // "wrap_enabled": false
140913
- // }
140914
- //
140915
- }
140916
- promises = await Promise.all(promises);
140917
- for (let i = 0; i < promises.length; i++) {
140918
- const responseInner = promises[i];
140919
- const marketId = this.safeStringLower(responseInner, 'symbol');
140920
- result[marketId] = this.parseMarket(responseInner);
140983
+ // use trading-pairs info, if it was fetched
140984
+ const tradingPairs = this.safeList(this.options, 'tradingPairs');
140985
+ if (tradingPairs !== undefined) {
140986
+ const indexedTradingPairs = this.indexBy(tradingPairs, 0);
140987
+ for (let i = 0; i < marketIds.length; i++) {
140988
+ const marketId = marketIds[i];
140989
+ const tradingPair = this.safeList(indexedTradingPairs, marketId.toUpperCase());
140990
+ if (tradingPair !== undefined) {
140991
+ result.push(this.parseMarket(tradingPair));
140992
+ }
140993
+ }
140994
+ }
140995
+ else {
140996
+ for (let i = 0; i < marketIds.length; i++) {
140997
+ result.push(this.parseMarket(marketIds[i]));
140998
+ }
140999
+ }
140921
141000
  }
140922
- return this.toArray(result);
141001
+ return result;
140923
141002
  }
140924
141003
  parseMarket(response) {
140925
- const marketId = this.safeStringLower(response, 'symbol');
140926
- let baseId = this.safeString(response, 'base_currency');
140927
- let quoteId = this.safeString(response, 'quote_currency');
140928
- if (baseId === undefined) {
140929
- const idLength = marketId.length - 0;
140930
- const isUSDT = marketId.indexOf('usdt') >= 0;
140931
- const quoteSize = isUSDT ? 4 : 3;
140932
- baseId = marketId.slice(0, idLength - quoteSize); // Not true for all markets
140933
- quoteId = marketId.slice(idLength - quoteSize, idLength);
141004
+ //
141005
+ // response might be:
141006
+ //
141007
+ // btcusd
141008
+ //
141009
+ // or
141010
+ //
141011
+ // [
141012
+ // 'BTCUSD', // symbol
141013
+ // 2, // priceTickDecimalPlaces
141014
+ // 8, // quantityTickDecimalPlaces
141015
+ // '0.00001', // quantityMinimum
141016
+ // 10, // quantityRoundDecimalPlaces
141017
+ // true // minimumsAreInclusive
141018
+ // ],
141019
+ //
141020
+ // or
141021
+ //
141022
+ // {
141023
+ // "symbol": "BTCUSD", // perpetuals have 'PERP' suffix, i.e. DOGEUSDPERP
141024
+ // "base_currency": "BTC",
141025
+ // "quote_currency": "USD",
141026
+ // "tick_size": 1E-8,
141027
+ // "quote_increment": 0.01,
141028
+ // "min_order_size": "0.00001",
141029
+ // "status": "open",
141030
+ // "wrap_enabled": false
141031
+ // "product_type": "swap", // only in perps
141032
+ // "contract_type": "linear", // only in perps
141033
+ // "contract_price_currency": "GUSD" // only in perps
141034
+ // }
141035
+ //
141036
+ let marketId = undefined;
141037
+ let baseId = undefined;
141038
+ let quoteId = undefined;
141039
+ let settleId = undefined;
141040
+ let tickSize = undefined;
141041
+ let increment = undefined;
141042
+ let minSize = undefined;
141043
+ let status = undefined;
141044
+ let swap = false;
141045
+ let contractSize = undefined;
141046
+ let linear = undefined;
141047
+ let inverse = undefined;
141048
+ const isString = (typeof response === 'string');
141049
+ const isArray = (Array.isArray(response));
141050
+ if (!isString && !isArray) {
141051
+ marketId = this.safeStringLower(response, 'symbol');
141052
+ minSize = this.safeNumber(response, 'min_order_size');
141053
+ tickSize = this.safeNumber(response, 'tick_size');
141054
+ increment = this.safeNumber(response, 'quote_increment');
141055
+ status = this.parseMarketActive(this.safeString(response, 'status'));
141056
+ baseId = this.safeString(response, 'base_currency');
141057
+ quoteId = this.safeString(response, 'quote_currency');
141058
+ settleId = this.safeString(response, 'contract_price_currency');
141059
+ }
141060
+ else {
141061
+ // if no detailed API was called, then parse either string or array
141062
+ if (isString) {
141063
+ marketId = response;
141064
+ }
141065
+ else {
141066
+ marketId = this.safeStringLower(response, 0);
141067
+ minSize = this.safeNumber(response, 3);
141068
+ tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1)));
141069
+ increment = this.parseNumber(this.parsePrecision(this.safeString(response, 2)));
141070
+ }
141071
+ const marketIdUpper = marketId.toUpperCase();
141072
+ const isPerp = (marketIdUpper.indexOf('PERP') >= 0);
141073
+ const marketIdWithoutPerp = marketIdUpper.replace('PERP', '');
141074
+ const quoteQurrencies = this.handleOption('fetchMarketsFromAPI', 'quoteCurrencies', []);
141075
+ for (let i = 0; i < quoteQurrencies.length; i++) {
141076
+ const quoteCurrency = quoteQurrencies[i];
141077
+ if (marketIdWithoutPerp.endsWith(quoteCurrency)) {
141078
+ baseId = marketIdWithoutPerp.replace(quoteCurrency, '');
141079
+ quoteId = quoteCurrency;
141080
+ if (isPerp) {
141081
+ settleId = quoteCurrency; // always same
141082
+ }
141083
+ break;
141084
+ }
141085
+ }
140934
141086
  }
140935
141087
  const base = this.safeCurrencyCode(baseId);
140936
141088
  const quote = this.safeCurrencyCode(quoteId);
140937
- const status = this.safeString(response, 'status');
141089
+ const settle = this.safeCurrencyCode(settleId);
141090
+ let symbol = base + '/' + quote;
141091
+ if (settleId !== undefined) {
141092
+ symbol = symbol + ':' + settle;
141093
+ swap = true;
141094
+ contractSize = tickSize; // always same
141095
+ linear = true; // always linear
141096
+ inverse = false;
141097
+ }
141098
+ const type = swap ? 'swap' : 'spot';
140938
141099
  return {
140939
141100
  'id': marketId,
140940
- 'symbol': base + '/' + quote,
141101
+ 'symbol': symbol,
140941
141102
  'base': base,
140942
141103
  'quote': quote,
140943
- 'settle': undefined,
141104
+ 'settle': settle,
140944
141105
  'baseId': baseId,
140945
141106
  'quoteId': quoteId,
140946
- 'settleId': undefined,
140947
- 'type': 'spot',
140948
- 'spot': true,
141107
+ 'settleId': settleId,
141108
+ 'type': type,
141109
+ 'spot': !swap,
140949
141110
  'margin': false,
140950
- 'swap': false,
141111
+ 'swap': swap,
140951
141112
  'future': false,
140952
141113
  'option': false,
140953
- 'active': this.parseMarketActive(status),
140954
- 'contract': false,
140955
- 'linear': undefined,
140956
- 'inverse': undefined,
140957
- 'contractSize': undefined,
141114
+ 'active': status,
141115
+ 'contract': swap,
141116
+ 'linear': linear,
141117
+ 'inverse': inverse,
141118
+ 'contractSize': contractSize,
140958
141119
  'expiry': undefined,
140959
141120
  'expiryDatetime': undefined,
140960
141121
  'strike': undefined,
140961
141122
  'optionType': undefined,
140962
141123
  'precision': {
140963
- 'price': this.safeNumber(response, 'quote_increment'),
140964
- 'amount': this.safeNumber(response, 'tick_size'),
141124
+ 'price': increment,
141125
+ 'amount': tickSize,
140965
141126
  },
140966
141127
  'limits': {
140967
141128
  'leverage': {
@@ -140969,7 +141130,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140969
141130
  'max': undefined,
140970
141131
  },
140971
141132
  'amount': {
140972
- 'min': this.safeNumber(response, 'min_order_size'),
141133
+ 'min': minSize,
140973
141134
  'max': undefined,
140974
141135
  },
140975
141136
  'price': {
@@ -142473,6 +142634,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
142473
142634
  '2012': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
142474
142635
  '2020': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
142475
142636
  '2022': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
142637
+ '2024': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
142476
142638
  '10001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
142477
142639
  '10021': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
142478
142640
  '10022': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
@@ -142490,6 +142652,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
142490
142652
  '20012': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142491
142653
  '20014': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142492
142654
  '20016': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142655
+ '20018': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142493
142656
  '20031': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142494
142657
  '20032': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142495
142658
  '20033': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
@@ -142500,10 +142663,15 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
142500
142663
  '20043': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142501
142664
  '20044': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
142502
142665
  '20045': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
142666
+ '20047': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
142667
+ '20048': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
142668
+ '20049': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
142503
142669
  '20080': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142504
142670
  '21001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142505
142671
  '21003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
142506
142672
  '21004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
142673
+ '22004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
142674
+ '22008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError, // Gateway timeout exceeded.
142507
142675
  },
142508
142676
  'broad': {},
142509
142677
  },
@@ -148242,6 +148410,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
148242
148410
  'v2/sub-user/api-key-modification': 1,
148243
148411
  'v2/sub-user/api-key-deletion': 1,
148244
148412
  'v1/subuser/transfer': 10,
148413
+ 'v1/trust/user/active/credit': 10,
148245
148414
  // Trading
148246
148415
  'v1/order/orders/place': 0.2,
148247
148416
  'v1/order/batch-orders': 0.4,
@@ -171037,6 +171206,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
171037
171206
  '12h': '12hour',
171038
171207
  '1d': '1day',
171039
171208
  '1w': '1week',
171209
+ '1M': '1month',
171040
171210
  },
171041
171211
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
171042
171212
  'exceptions': {
@@ -175086,7 +175256,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
175086
175256
  url = url + endpoint;
175087
175257
  const isFuturePrivate = (api === 'futuresPrivate');
175088
175258
  const isPrivate = (api === 'private');
175089
- const isBroker = (api === 'private');
175259
+ const isBroker = (api === 'broker');
175090
175260
  if (isPrivate || isFuturePrivate || isBroker) {
175091
175261
  this.checkRequiredCredentials();
175092
175262
  const timestamp = this.nonce().toString();
@@ -175118,7 +175288,9 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
175118
175288
  }
175119
175289
  if (isBroker) {
175120
175290
  const brokerName = this.safeString(partner, 'name');
175121
- headers['KC-BROKER-NAME'] = brokerName;
175291
+ if (brokerName !== undefined) {
175292
+ headers['KC-BROKER-NAME'] = brokerName;
175293
+ }
175122
175294
  }
175123
175295
  }
175124
175296
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -261889,7 +262061,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
261889
262061
  // "volume":6.3607,
261890
262062
  // "amount":77148.9303,
261891
262063
  // "price":12129,
261892
- // "direction":"sell",
262064
+ // "direction":"sell", // or "sell_market"
261893
262065
  // "TS":"2019-06-28T19:55:49.460"
261894
262066
  // },
261895
262067
  // "type":"trade",
@@ -261929,7 +262101,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
261929
262101
  // "volume":6.3607,
261930
262102
  // "amount":77148.9303,
261931
262103
  // "price":12129,
261932
- // "direction":"sell",
262104
+ // "direction":"sell", // or "sell_market"
261933
262105
  // "TS":"2019-06-28T19:55:49.460"
261934
262106
  // }
261935
262107
  //
@@ -261938,6 +262110,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
261938
262110
  if (timestamp === undefined) {
261939
262111
  timestamp = this.parse8601(datetime);
261940
262112
  }
262113
+ let side = this.safeString2(trade, 'direction', 3);
262114
+ side = side.replace('_market', '');
261941
262115
  return this.safeTrade({
261942
262116
  'timestamp': timestamp,
261943
262117
  'datetime': datetime,
@@ -261946,7 +262120,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
261946
262120
  'order': undefined,
261947
262121
  'type': undefined,
261948
262122
  'takerOrMaker': undefined,
261949
- 'side': this.safeString2(trade, 'direction', 3),
262123
+ 'side': side,
261950
262124
  'price': this.safeString2(trade, 'price', 1),
261951
262125
  'amount': this.safeString2(trade, 'volume', 2),
261952
262126
  'cost': this.safeString(trade, 'amount'),
@@ -316927,7 +317101,7 @@ SOFTWARE.
316927
317101
 
316928
317102
  //-----------------------------------------------------------------------------
316929
317103
  // this is updated by vss.js when building
316930
- const version = '4.2.68';
317104
+ const version = '4.2.69';
316931
317105
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
316932
317106
  //-----------------------------------------------------------------------------
316933
317107