ccxt 4.0.80 → 4.0.81

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/README.md +3 -3
  3. package/dist/ccxt.browser.js +211 -116
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/binance.js +9 -0
  7. package/dist/cjs/src/bitget.js +9 -4
  8. package/dist/cjs/src/bitmex.js +3 -1
  9. package/dist/cjs/src/bybit.js +0 -9
  10. package/dist/cjs/src/delta.js +3 -0
  11. package/dist/cjs/src/exmo.js +64 -25
  12. package/dist/cjs/src/gate.js +2 -0
  13. package/dist/cjs/src/hitbtc.js +3 -1
  14. package/dist/cjs/src/huobi.js +2 -0
  15. package/dist/cjs/src/kucoin.js +96 -69
  16. package/dist/cjs/src/pro/krakenfutures.js +1 -1
  17. package/dist/cjs/src/pro/okx.js +8 -3
  18. package/dist/cjs/src/pro/probit.js +2 -2
  19. package/dist/cjs/src/upbit.js +8 -0
  20. package/js/ccxt.d.ts +1 -1
  21. package/js/ccxt.js +1 -1
  22. package/js/src/abstract/binance.d.ts +9 -0
  23. package/js/src/abstract/binancecoinm.d.ts +9 -0
  24. package/js/src/abstract/binanceus.d.ts +9 -0
  25. package/js/src/abstract/binanceusdm.d.ts +9 -0
  26. package/js/src/abstract/gate.d.ts +2 -0
  27. package/js/src/abstract/gateio.d.ts +2 -0
  28. package/js/src/abstract/huobi.d.ts +2 -0
  29. package/js/src/abstract/huobipro.d.ts +2 -0
  30. package/js/src/binance.js +9 -0
  31. package/js/src/bitget.js +9 -4
  32. package/js/src/bitmex.d.ts +1 -1
  33. package/js/src/bitmex.js +3 -1
  34. package/js/src/bybit.js +0 -9
  35. package/js/src/delta.js +3 -0
  36. package/js/src/exmo.js +64 -25
  37. package/js/src/gate.js +2 -0
  38. package/js/src/hitbtc.js +3 -1
  39. package/js/src/huobi.js +2 -0
  40. package/js/src/kucoin.js +96 -69
  41. package/js/src/pro/krakenfutures.js +1 -1
  42. package/js/src/pro/okx.js +8 -3
  43. package/js/src/pro/probit.js +2 -2
  44. package/js/src/upbit.js +9 -1
  45. package/package.json +1 -1
  46. package/skip-tests.json +7 -2
@@ -15795,6 +15795,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15795
15795
  'loan/loanable/data': 40,
15796
15796
  'loan/collateral/data': 40,
15797
15797
  'loan/repay/collateral/rate': 600,
15798
+ 'loan/flexible/ongoing/orders': 30,
15799
+ 'loan/flexible/borrow/history': 40,
15800
+ 'loan/flexible/repay/history': 40,
15801
+ 'loan/flexible/ltv/adjustment/history': 40,
15802
+ 'loan/flexible/loanable/data': 40,
15803
+ 'loan/flexible/collateral/data': 40,
15798
15804
  'loan/vip/ongoing/orders': 40,
15799
15805
  'loan/vip/repay/history': 40,
15800
15806
  'loan/vip/collateral/account': 600,
@@ -16060,6 +16066,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16060
16066
  'loan/repay': 40.002,
16061
16067
  'loan/adjust/ltv': 40.002,
16062
16068
  'loan/customize/margin_call': 40.002,
16069
+ 'loan/flexible/borrow': 40.002,
16070
+ 'loan/flexible/repay': 40.002,
16071
+ 'loan/flexible/adjust/ltv': 40.002,
16063
16072
  'loan/vip/repay': 40.002,
16064
16073
  'convert/getQuote': 1.3334,
16065
16074
  'convert/acceptQuote': 3.3335,
@@ -40924,6 +40933,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
40924
40933
  * @method
40925
40934
  * @name bitget#fetchMyTrades
40926
40935
  * @description fetch all trades made by the user
40936
+ * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
40937
+ * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
40927
40938
  * @param {string} symbol unified market symbol
40928
40939
  * @param {int} [since] the earliest time in ms to fetch trades for
40929
40940
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -40933,16 +40944,19 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
40933
40944
  this.checkRequiredSymbol('fetchMyTrades', symbol);
40934
40945
  await this.loadMarkets();
40935
40946
  const market = this.market(symbol);
40936
- if (market['swap']) {
40937
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadSymbol(this.id + ' fetchMyTrades() only supports spot markets');
40938
- }
40939
40947
  const request = {
40940
40948
  'symbol': market['id'],
40941
40949
  };
40942
40950
  if (limit !== undefined) {
40943
40951
  request['limit'] = limit;
40944
40952
  }
40945
- const response = await this.privateSpotPostTradeFills(this.extend(request, params));
40953
+ let response = undefined;
40954
+ if (market['spot']) {
40955
+ response = await this.privateSpotPostTradeFills(this.extend(request, params));
40956
+ }
40957
+ else {
40958
+ response = await this.privateMixGetOrderFills(this.extend(request, params));
40959
+ }
40946
40960
  //
40947
40961
  // {
40948
40962
  // code: '00000',
@@ -48771,7 +48785,9 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48771
48785
  filteredResponse.push(item);
48772
48786
  }
48773
48787
  }
48774
- return this.parseFundingRates(filteredResponse, symbols);
48788
+ symbols = this.marketSymbols(symbols);
48789
+ const result = this.parseFundingRates(filteredResponse);
48790
+ return this.filterByArray(result, 'symbol', symbols);
48775
48791
  }
48776
48792
  parseFundingRate(contract, market = undefined) {
48777
48793
  // see response sample under "fetchMarkets" because same endpoint is being used here
@@ -75732,9 +75748,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
75732
75748
  return this.parseOrder(order);
75733
75749
  }
75734
75750
  async editUnifiedAccountOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
75735
- if (amount === undefined && price === undefined) {
75736
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' editOrder requires either a price argument or an amount argument');
75737
- }
75738
75751
  await this.loadMarkets();
75739
75752
  const market = this.market(symbol);
75740
75753
  if (!market['linear'] && !market['option']) {
@@ -75813,9 +75826,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
75813
75826
  });
75814
75827
  }
75815
75828
  async editUnifiedMarginOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
75816
- if (amount === undefined && price === undefined) {
75817
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' editOrder requires either a price argument or an amount argument');
75818
- }
75819
75829
  await this.loadMarkets();
75820
75830
  const market = this.market(symbol);
75821
75831
  if (!market['linear'] && !market['option']) {
@@ -75912,9 +75922,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
75912
75922
  return this.parseOrder(order);
75913
75923
  }
75914
75924
  async editContractV3Order(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
75915
- if (amount === undefined && price === undefined) {
75916
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' editOrder requires either a price argument or an amount argument');
75917
- }
75918
75925
  await this.loadMarkets();
75919
75926
  const market = this.market(symbol);
75920
75927
  const request = {
@@ -103886,6 +103893,9 @@ class delta extends _abstract_delta_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
103886
103893
  for (let i = 0; i < markets.length; i++) {
103887
103894
  const market = markets[i];
103888
103895
  let type = this.safeString(market, 'contract_type');
103896
+ if (type === 'options_combos') {
103897
+ continue;
103898
+ }
103889
103899
  // const settlingAsset = this.safeValue (market, 'settling_asset', {});
103890
103900
  const quotingAsset = this.safeValue(market, 'quoting_asset', {});
103891
103901
  const underlyingAsset = this.safeValue(market, 'underlying_asset', {});
@@ -114009,20 +114019,36 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
114009
114019
  }
114010
114020
  parseBalance(response) {
114011
114021
  const result = { 'info': response };
114012
- const free = this.safeValue(response, 'balances', {});
114013
- const used = this.safeValue(response, 'reserved', {});
114014
- const currencyIds = Object.keys(free);
114015
- for (let i = 0; i < currencyIds.length; i++) {
114016
- const currencyId = currencyIds[i];
114017
- const code = this.safeCurrencyCode(currencyId);
114018
- const account = this.account();
114019
- if (currencyId in free) {
114020
- account['free'] = this.safeString(free, currencyId);
114022
+ const wallets = this.safeValue(response, 'wallets');
114023
+ if (wallets !== undefined) {
114024
+ const currencyIds = Object.keys(wallets);
114025
+ for (let i = 0; i < currencyIds.length; i++) {
114026
+ const currencyId = currencyIds[i];
114027
+ const item = wallets[currencyId];
114028
+ const currency = this.safeCurrencyCode(currencyId);
114029
+ const account = this.account();
114030
+ account['used'] = this.safeString(item, 'used');
114031
+ account['free'] = this.safeString(item, 'free');
114032
+ account['total'] = this.safeString(item, 'balance');
114033
+ result[currency] = account;
114021
114034
  }
114022
- if (currencyId in used) {
114023
- account['used'] = this.safeString(used, currencyId);
114035
+ }
114036
+ else {
114037
+ const free = this.safeValue(response, 'balances', {});
114038
+ const used = this.safeValue(response, 'reserved', {});
114039
+ const currencyIds = Object.keys(free);
114040
+ for (let i = 0; i < currencyIds.length; i++) {
114041
+ const currencyId = currencyIds[i];
114042
+ const code = this.safeCurrencyCode(currencyId);
114043
+ const account = this.account();
114044
+ if (currencyId in free) {
114045
+ account['free'] = this.safeString(free, currencyId);
114046
+ }
114047
+ if (currencyId in used) {
114048
+ account['used'] = this.safeString(used, currencyId);
114049
+ }
114050
+ result[code] = account;
114024
114051
  }
114025
- result[code] = account;
114026
114052
  }
114027
114053
  return this.safeBalance(result);
114028
114054
  }
@@ -114032,22 +114058,45 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
114032
114058
  * @name exmo#fetchBalance
114033
114059
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
114034
114060
  * @param {object} [params] extra parameters specific to the exmo api endpoint
114061
+ * @param {string} [params.marginMode] *isolated* fetches the isolated margin balance
114035
114062
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
114036
114063
  */
114037
114064
  await this.loadMarkets();
114038
- const response = await this.privatePostUserInfo(params);
114039
- //
114040
- // {
114041
- // "uid":131685,
114042
- // "server_date":1628999600,
114043
- // "balances":{
114044
- // "EXM":"0",
114045
- // "USD":"0",
114046
- // "EUR":"0",
114047
- // "GBP":"0",
114048
- // },
114049
- // }
114050
- //
114065
+ let marginMode = undefined;
114066
+ [marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
114067
+ if (marginMode === 'cross') {
114068
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' does not support cross margin');
114069
+ }
114070
+ let response = undefined;
114071
+ if (marginMode === 'isolated') {
114072
+ response = await this.privatePostMarginUserWalletList(params);
114073
+ //
114074
+ // {
114075
+ // "wallets": {
114076
+ // "USD": {
114077
+ // "balance": "1000",
114078
+ // "free": "600",
114079
+ // "used": "400"
114080
+ // }
114081
+ // }
114082
+ // }
114083
+ //
114084
+ }
114085
+ else {
114086
+ response = await this.privatePostUserInfo(params);
114087
+ //
114088
+ // {
114089
+ // "uid":131685,
114090
+ // "server_date":1628999600,
114091
+ // "balances":{
114092
+ // "EXM":"0",
114093
+ // "USD":"0",
114094
+ // "EUR":"0",
114095
+ // "GBP":"0",
114096
+ // },
114097
+ // }
114098
+ //
114099
+ }
114051
114100
  return this.parseBalance(response);
114052
114101
  }
114053
114102
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
@@ -115567,6 +115616,8 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
115567
115616
  },
115568
115617
  'portfolio': {
115569
115618
  'get': {
115619
+ 'spot/currency_pairs': 1.5,
115620
+ 'spot/currency_pairs/{currency_pair}': 1.5,
115570
115621
  'accounts': 1.5,
115571
115622
  'account_mode': 1.5,
115572
115623
  'borrowable': 1.5,
@@ -123952,7 +124003,6 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
123952
124003
  'STEPN': 'GMT',
123953
124004
  'STX': 'STOX',
123954
124005
  'TV': 'Tokenville',
123955
- 'USD': 'USDT',
123956
124006
  'XMT': 'MTL',
123957
124007
  'XPNT': 'PNT',
123958
124008
  },
@@ -124004,6 +124054,9 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
124004
124054
  const ids = Object.keys(response);
124005
124055
  for (let i = 0; i < ids.length; i++) {
124006
124056
  const id = ids[i];
124057
+ if (id.endsWith('_BQX')) {
124058
+ continue; // seems like an invalid symbol and if we try to access it individually we get: {"timestamp":"2023-09-02T14:38:20.351Z","error":{"description":"Try get /public/symbol, to get list of all available symbols.","code":2001,"message":"No such symbol: EOSUSD_BQX"},"path":"/api/3/public/symbol/EOSUSD_BQX","requestId":"e1e9fce6-16374591"}
124059
+ }
124007
124060
  const market = this.safeValue(response, id);
124008
124061
  const marketType = this.safeString(market, 'type');
124009
124062
  const expiry = this.safeInteger(market, 'expiry');
@@ -128988,6 +129041,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
128988
129041
  'linear-swap-api/v3/unified_account_info': 1,
128989
129042
  'linear-swap-api/v3/fix_position_margin_change_record': 1,
128990
129043
  'linear-swap-api/v3/swap_unified_account_type': 1,
129044
+ 'linear-swap-api/v3/linear_swap_overview_account_info': 1,
128991
129045
  },
128992
129046
  'post': {
128993
129047
  // Future Account Interface
@@ -129182,6 +129236,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
129182
129236
  'linear-swap-api/v3/swap_cross_hisorders_exact': 1,
129183
129237
  'linear-swap-api/v3/fix_position_margin_change': 1,
129184
129238
  'linear-swap-api/v3/swap_switch_account_type': 1,
129239
+ 'linear-swap-api/v3/linear_swap_fee_switch': 1,
129185
129240
  // Swap Strategy Order Interface
129186
129241
  'linear-swap-api/v1/swap_trigger_order': 1,
129187
129242
  'linear-swap-api/v1/swap_cross_trigger_order': 1,
@@ -147387,6 +147442,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147387
147442
  'versions': {
147388
147443
  'public': {
147389
147444
  'GET': {
147445
+ 'currencies': 'v3',
147390
147446
  'currencies/{currency}': 'v2',
147391
147447
  'status': 'v1',
147392
147448
  'market/orderbook/level2_20': 'v1',
@@ -147892,19 +147948,34 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147892
147948
  const promises = [];
147893
147949
  promises.push(this.publicGetCurrencies(params));
147894
147950
  //
147895
- // {
147896
- // "currency": "OMG",
147897
- // "name": "OMG",
147898
- // "fullName": "OmiseGO",
147899
- // "precision": 8,
147900
- // "confirms": 12,
147901
- // "withdrawalMinSize": "4",
147902
- // "withdrawalMinFee": "1.25",
147903
- // "isWithdrawEnabled": false,
147904
- // "isDepositEnabled": false,
147905
- // "isMarginEnabled": false,
147906
- // "isDebitEnabled": false
147907
- // }
147951
+ // {
147952
+ // "code":"200000",
147953
+ // "data":[
147954
+ // {
147955
+ // "currency":"CSP",
147956
+ // "name":"CSP",
147957
+ // "fullName":"Caspian",
147958
+ // "precision":8,
147959
+ // "confirms":null,
147960
+ // "contractAddress":null,
147961
+ // "isMarginEnabled":false,
147962
+ // "isDebitEnabled":false,
147963
+ // "chains":[
147964
+ // {
147965
+ // "chainName":"ERC20",
147966
+ // "chain":"eth",
147967
+ // "withdrawalMinSize":"2999",
147968
+ // "withdrawalMinFee":"2999",
147969
+ // "isWithdrawEnabled":false,
147970
+ // "isDepositEnabled":false,
147971
+ // "confirms":12,
147972
+ // "preConfirms":12,
147973
+ // "contractAddress":"0xa6446d655a0c34bc4f05042ee88170d056cbaf45",
147974
+ // "depositFeeRate": "0.001", // present for some currencies/networks
147975
+ // }
147976
+ // ]
147977
+ // },
147978
+ // }
147908
147979
  //
147909
147980
  promises.push(this.fetchWebEndpoint('fetchCurrencies', 'webExchangeGetCurrencyCurrencyChainInfo', true));
147910
147981
  //
@@ -147915,90 +147986,101 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147915
147986
  // "retry": false,
147916
147987
  // "data": [
147917
147988
  // {
147918
- // "withdrawMinFee": "0.0005",
147919
- // "chainName": "BTC",
147920
- // "preDepositTipEnabled": "false",
147921
- // "chain": "btc",
147989
+ // "status": "enabled",
147990
+ // "currency": "BTC",
147922
147991
  // "isChainEnabled": "true",
147923
- // "withdrawDisabledTip": "",
147924
- // "walletPrecision": "8",
147992
+ // "chain": "btc",
147993
+ // "chainName": "BTC",
147925
147994
  // "chainFullName": "Bitcoin",
147926
- // "orgAddress": "",
147995
+ // "walletPrecision": "8",
147927
147996
  // "isDepositEnabled": "true",
147928
- // "withdrawMinSize": "0.001",
147929
- // "depositDisabledTip": "",
147930
- // "userAddressName": "",
147931
- // "txUrl": "https://blockchain.info/tx/{txId}",
147932
- // "preWithdrawTipEnabled": "false",
147933
- // "withdrawFeeRate": "0",
147934
- // "confirmationCount": "2",
147935
- // "currency": "BTC",
147936
147997
  // "depositMinSize": "0.00005",
147998
+ // "confirmationCount": "2",
147937
147999
  // "isWithdrawEnabled": "true",
147938
- // "preDepositTip": "",
148000
+ // "withdrawMinSize": "0.001",
148001
+ // "withdrawMinFee": "0.0005",
148002
+ // "withdrawFeeRate": "0",
148003
+ // "depositDisabledTip": "Wallet Maintenance",
148004
+ // "preDepositTipEnabled": "true",
148005
+ // "preDepositTip": "Do not transfer from ETH network directly",
148006
+ // "withdrawDisabledTip": "",
148007
+ // "preWithdrawTipEnabled": "false",
147939
148008
  // "preWithdrawTip": "",
147940
- // "status": "enabled"
148009
+ // "orgAddress": "",
148010
+ // "userAddressName": "Memo",
147941
148011
  // },
147942
148012
  // ]
147943
148013
  // }
147944
148014
  //
147945
148015
  const responses = await Promise.all(promises);
147946
- const responseCurrencies = responses[0];
147947
- const responseChains = responses[1];
147948
- const data = this.safeValue(responseCurrencies, 'data', []);
147949
- const chainsData = this.safeValue(responseChains, 'data', []);
147950
- const currencyChains = this.groupBy(chainsData, 'currency');
148016
+ const currenciesResponse = this.safeValue(responses, 0, {});
148017
+ const currenciesData = this.safeValue(currenciesResponse, 'data', []);
148018
+ const additionalResponse = this.safeValue(responses, 1, {});
148019
+ const additionalData = this.safeValue(additionalResponse, 'data', []);
148020
+ const additionalDataGrouped = this.groupBy(additionalData, 'currency');
147951
148021
  const result = {};
147952
- for (let i = 0; i < data.length; i++) {
147953
- const entry = data[i];
148022
+ for (let i = 0; i < currenciesData.length; i++) {
148023
+ const entry = currenciesData[i];
147954
148024
  const id = this.safeString(entry, 'currency');
147955
148025
  const name = this.safeString(entry, 'fullName');
147956
148026
  const code = this.safeCurrencyCode(id);
147957
- const isWithdrawEnabled = this.safeValue(entry, 'isWithdrawEnabled', false);
147958
- const isDepositEnabled = this.safeValue(entry, 'isDepositEnabled', false);
147959
- const fee = this.safeNumber(entry, 'withdrawalMinFee');
147960
- const active = (isWithdrawEnabled && isDepositEnabled);
148027
+ let isWithdrawEnabled = undefined;
148028
+ let isDepositEnabled = undefined;
147961
148029
  const networks = {};
147962
- const chains = this.safeValue(currencyChains, id, []);
148030
+ const chains = this.safeValue(entry, 'chains', []);
148031
+ const extraChainsData = this.indexBy(this.safeValue(additionalDataGrouped, id, []), 'chain');
148032
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(entry, 'precision')));
147963
148033
  for (let j = 0; j < chains.length; j++) {
147964
148034
  const chain = chains[j];
147965
148035
  const chainId = this.safeString(chain, 'chain');
147966
- const isChainEnabled = this.safeString(chain, 'isChainEnabled'); // better than 'status'
147967
- if (isChainEnabled === 'true') {
147968
- const networkCode = this.networkIdToCode(chainId);
147969
- const chainWithdrawEnabled = this.safeValue(chain, 'isWithdrawEnabled', false);
147970
- const chainDepositEnabled = this.safeValue(chain, 'isDepositEnabled', false);
147971
- networks[networkCode] = {
147972
- 'info': chain,
147973
- 'id': chainId,
147974
- 'name': this.safeString2(chain, 'chainFullName', 'chainName'),
147975
- 'code': networkCode,
147976
- 'active': chainWithdrawEnabled && chainDepositEnabled,
147977
- 'fee': this.safeNumber(chain, 'withdrawMinFee'),
147978
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'walletPrecision'))),
147979
- 'limits': {
147980
- 'withdraw': {
147981
- 'min': this.safeNumber(chain, 'withdrawMinSize'),
147982
- 'max': undefined,
147983
- },
147984
- 'deposit': {
147985
- 'min': this.safeNumber(chain, 'depositMinSize'),
147986
- 'max': undefined,
147987
- },
147988
- },
147989
- };
148036
+ const networkCode = this.networkIdToCode(chainId);
148037
+ const chainWithdrawEnabled = this.safeValue(chain, 'isWithdrawEnabled', false);
148038
+ if (isWithdrawEnabled === undefined) {
148039
+ isWithdrawEnabled = chainWithdrawEnabled;
148040
+ }
148041
+ else {
148042
+ isWithdrawEnabled = isWithdrawEnabled || chainWithdrawEnabled;
148043
+ }
148044
+ const chainDepositEnabled = this.safeValue(chain, 'isDepositEnabled', false);
148045
+ if (isDepositEnabled === undefined) {
148046
+ isDepositEnabled = chainDepositEnabled;
147990
148047
  }
148048
+ else {
148049
+ isDepositEnabled = isDepositEnabled || chainDepositEnabled;
148050
+ }
148051
+ const chainExtraData = this.safeValue(extraChainsData, chainId, {});
148052
+ networks[networkCode] = {
148053
+ 'info': chain,
148054
+ 'id': chainId,
148055
+ 'name': this.safeString(chain, 'chainName'),
148056
+ 'code': networkCode,
148057
+ 'active': chainWithdrawEnabled && chainDepositEnabled,
148058
+ 'fee': this.safeNumber(chain, 'withdrawalMinFee'),
148059
+ 'deposit': chainDepositEnabled,
148060
+ 'withdraw': chainWithdrawEnabled,
148061
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainExtraData, 'walletPrecision'))),
148062
+ 'limits': {
148063
+ 'withdraw': {
148064
+ 'min': this.safeNumber(chain, 'withdrawalMinSize'),
148065
+ 'max': undefined,
148066
+ },
148067
+ 'deposit': {
148068
+ 'min': this.safeNumber(chainExtraData, 'depositMinSize'),
148069
+ 'max': undefined,
148070
+ },
148071
+ },
148072
+ };
147991
148073
  }
147992
148074
  result[code] = {
147993
148075
  'id': id,
147994
148076
  'name': name,
147995
148077
  'code': code,
147996
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(entry, 'precision'))),
148078
+ 'precision': precision,
147997
148079
  'info': entry,
147998
- 'active': active,
148080
+ 'active': (isDepositEnabled || isWithdrawEnabled),
147999
148081
  'deposit': isDepositEnabled,
148000
148082
  'withdraw': isWithdrawEnabled,
148001
- 'fee': fee,
148083
+ 'fee': undefined,
148002
148084
  'limits': this.limits,
148003
148085
  'networks': networks,
148004
148086
  };
@@ -224377,7 +224459,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
224377
224459
  symbols[symbol] = true;
224378
224460
  cachedOrders.append(parsed);
224379
224461
  }
224380
- if (this.orders.length > 0) {
224462
+ if (this.orders.length) {
224381
224463
  client.resolve(this.orders, 'orders');
224382
224464
  const keys = Object.keys(symbols);
224383
224465
  for (let i = 0; i < keys.length; i++) {
@@ -229612,15 +229694,17 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
229612
229694
  }
229613
229695
  getUrl(channel, access = 'public') {
229614
229696
  // for context: https://www.okx.com/help-center/changes-to-v5-api-websocket-subscription-parameter-and-url
229697
+ const isSandbox = this.options['sandboxMode'];
229698
+ const sandboxSuffix = isSandbox ? '?brokerId=9999' : '';
229615
229699
  const isPublic = (access === 'public');
229616
229700
  const url = this.urls['api']['ws'];
229617
229701
  if ((channel.indexOf('candle') > -1) || (channel === 'orders-algo')) {
229618
- return url + '/business';
229702
+ return url + '/business' + sandboxSuffix;
229619
229703
  }
229620
229704
  else if (isPublic) {
229621
- return url + '/public';
229705
+ return url + '/public' + sandboxSuffix;
229622
229706
  }
229623
- return url + '/private';
229707
+ return url + '/private' + sandboxSuffix;
229624
229708
  }
229625
229709
  async subscribeMultiple(access, channel, symbols = undefined, params = {}) {
229626
229710
  await this.loadMarkets();
@@ -230767,6 +230851,9 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230767
230851
  }
230768
230852
  return false;
230769
230853
  }
230854
+ else {
230855
+ client.reject(e);
230856
+ }
230770
230857
  }
230771
230858
  return message;
230772
230859
  }
@@ -234990,11 +235077,11 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
234990
235077
  this.handleTicker(client, message);
234991
235078
  }
234992
235079
  const trades = this.safeValue(message, 'recent_trades', []);
234993
- if (trades.length > 0) {
235080
+ if (trades.length) {
234994
235081
  this.handleTrades(client, message);
234995
235082
  }
234996
235083
  const orderBook = this.safeValueN(message, ['order_books', 'order_books_l1', 'order_books_l2', 'order_books_l3', 'order_books_l4'], []);
234997
- if (orderBook.length > 0) {
235084
+ if (orderBook.length) {
234998
235085
  this.handleOrderBook(client, message, orderBook);
234999
235086
  }
235000
235087
  }
@@ -255401,12 +255488,20 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
255401
255488
  };
255402
255489
  let method = 'privatePostWithdraws';
255403
255490
  if (code !== 'KRW') {
255491
+ // 2023-05-23 Change to required parameters for digital assets
255492
+ const network = this.safeStringUpper2(params, 'network', 'net_type');
255493
+ if (network === undefined) {
255494
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' withdraw() requires a network argument');
255495
+ }
255496
+ params = this.omit(params, ['network']);
255497
+ request['net_type'] = network;
255404
255498
  method += 'Coin';
255405
255499
  request['currency'] = currency['id'];
255406
255500
  request['address'] = address;
255407
255501
  if (tag !== undefined) {
255408
255502
  request['secondary_address'] = tag;
255409
255503
  }
255504
+ params = this.omit(params, 'network');
255410
255505
  }
255411
255506
  else {
255412
255507
  method += 'Krw';
@@ -273464,7 +273559,7 @@ SOFTWARE.
273464
273559
 
273465
273560
  //-----------------------------------------------------------------------------
273466
273561
  // this is updated by vss.js when building
273467
- const version = '4.0.80';
273562
+ const version = '4.0.81';
273468
273563
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273469
273564
  //-----------------------------------------------------------------------------
273470
273565