ccxt 4.4.86 → 4.4.87

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 (70) hide show
  1. package/README.md +17 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +11 -1
  4. package/dist/cjs/src/abstract/modetrade.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +10 -8
  6. package/dist/cjs/src/binance.js +1 -1
  7. package/dist/cjs/src/bitteam.js +31 -0
  8. package/dist/cjs/src/coinmetro.js +5 -1
  9. package/dist/cjs/src/derive.js +4 -5
  10. package/dist/cjs/src/ellipx.js +2 -3
  11. package/dist/cjs/src/gate.js +92 -76
  12. package/dist/cjs/src/htx.js +10 -8
  13. package/dist/cjs/src/hyperliquid.js +32 -16
  14. package/dist/cjs/src/kraken.js +5 -8
  15. package/dist/cjs/src/modetrade.js +2839 -0
  16. package/dist/cjs/src/okx.js +95 -2
  17. package/dist/cjs/src/okxus.js +53 -0
  18. package/dist/cjs/src/paradex.js +6 -1
  19. package/dist/cjs/src/phemex.js +4 -6
  20. package/dist/cjs/src/poloniex.js +181 -170
  21. package/dist/cjs/src/pro/modetrade.js +1334 -0
  22. package/dist/cjs/src/pro/okxus.js +38 -0
  23. package/dist/cjs/src/probit.js +18 -51
  24. package/dist/cjs/src/timex.js +5 -10
  25. package/dist/cjs/src/vertex.js +3 -4
  26. package/dist/cjs/src/whitebit.js +41 -11
  27. package/dist/cjs/src/woo.js +101 -77
  28. package/dist/cjs/src/woofipro.js +24 -21
  29. package/dist/cjs/src/xt.js +36 -44
  30. package/js/ccxt.d.ts +14 -2
  31. package/js/ccxt.js +10 -2
  32. package/js/src/abstract/modetrade.d.ts +122 -0
  33. package/js/src/abstract/modetrade.js +11 -0
  34. package/js/src/abstract/okxus.d.ts +352 -0
  35. package/js/src/abstract/okxus.js +11 -0
  36. package/js/src/base/Exchange.js +10 -8
  37. package/js/src/binance.js +1 -1
  38. package/js/src/bitteam.js +31 -0
  39. package/js/src/coinmetro.js +5 -1
  40. package/js/src/derive.js +4 -3
  41. package/js/src/ellipx.d.ts +1 -1
  42. package/js/src/ellipx.js +3 -5
  43. package/js/src/gate.js +92 -76
  44. package/js/src/htx.js +10 -8
  45. package/js/src/hyperliquid.js +32 -16
  46. package/js/src/kraken.js +5 -8
  47. package/js/src/modetrade.d.ts +475 -0
  48. package/js/src/modetrade.js +2840 -0
  49. package/js/src/okx.d.ts +24 -1
  50. package/js/src/okx.js +95 -2
  51. package/js/src/okxus.d.ts +4 -0
  52. package/js/src/okxus.js +54 -0
  53. package/js/src/paradex.js +6 -1
  54. package/js/src/phemex.js +4 -6
  55. package/js/src/poloniex.d.ts +2 -0
  56. package/js/src/poloniex.js +181 -170
  57. package/js/src/pro/modetrade.d.ts +155 -0
  58. package/js/src/pro/modetrade.js +1335 -0
  59. package/js/src/pro/okxus.d.ts +4 -0
  60. package/js/src/pro/okxus.js +39 -0
  61. package/js/src/probit.js +18 -51
  62. package/js/src/timex.js +5 -10
  63. package/js/src/vertex.js +3 -4
  64. package/js/src/whitebit.js +42 -11
  65. package/js/src/woo.d.ts +2 -0
  66. package/js/src/woo.js +101 -77
  67. package/js/src/woofipro.d.ts +2 -1
  68. package/js/src/woofipro.js +24 -21
  69. package/js/src/xt.js +36 -44
  70. package/package.json +1 -1
package/js/src/gate.js CHANGED
@@ -111,7 +111,7 @@ export default class gate extends Exchange {
111
111
  'fetchCurrencies': true,
112
112
  'fetchDepositAddress': true,
113
113
  'fetchDepositAddresses': false,
114
- 'fetchDepositAddressesByNetwork': false,
114
+ 'fetchDepositAddressesByNetwork': true,
115
115
  'fetchDeposits': true,
116
116
  'fetchDepositWithdrawFee': 'emulated',
117
117
  'fetchDepositWithdrawFees': true,
@@ -720,6 +720,16 @@ export default class gate extends Exchange {
720
720
  },
721
721
  'networksById': {
722
722
  'OPETH': 'OP',
723
+ 'ETH': 'ERC20',
724
+ 'ERC20': 'ERC20',
725
+ 'TRX': 'TRC20',
726
+ 'TRC20': 'TRC20',
727
+ 'HT': 'HRC20',
728
+ 'HECO': 'HRC20',
729
+ 'BSC': 'BEP20',
730
+ 'BEP20': 'BEP20',
731
+ 'POLYGON': 'MATIC',
732
+ 'POL': 'MATIC',
723
733
  },
724
734
  'timeInForce': {
725
735
  'GTC': 'gtc',
@@ -1216,6 +1226,9 @@ export default class gate extends Exchange {
1216
1226
  if (this.options['adjustForTimeDifference']) {
1217
1227
  await this.loadTimeDifference();
1218
1228
  }
1229
+ if (this.checkRequiredCredentials(false)) {
1230
+ await this.loadUnifiedStatus();
1231
+ }
1219
1232
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1220
1233
  let rawPromises = [
1221
1234
  this.fetchContractMarkets(params),
@@ -1829,88 +1842,93 @@ export default class gate extends Exchange {
1829
1842
  if (apiBackup !== undefined) {
1830
1843
  return undefined;
1831
1844
  }
1832
- if (this.checkRequiredCredentials(false)) {
1833
- await this.loadUnifiedStatus();
1834
- }
1835
1845
  const response = await this.publicSpotGetCurrencies(params);
1836
1846
  //
1837
- // [
1838
- // {
1839
- // "currency": "USDT_ETH",
1840
- // "name": "Tether",
1841
- // "delisted": false,
1842
- // "withdraw_disabled": false,
1843
- // "withdraw_delayed": false,
1844
- // "deposit_disabled": false,
1845
- // "trade_disabled": true,
1846
- // "chain": "ETH"
1847
- // },
1848
- // ]
1847
+ // [
1848
+ // {
1849
+ // "currency": "USDT",
1850
+ // "name": "Tether",
1851
+ // "delisted": false,
1852
+ // "withdraw_disabled": false,
1853
+ // "withdraw_delayed": false,
1854
+ // "deposit_disabled": false,
1855
+ // "trade_disabled": false,
1856
+ // "fixed_rate": "",
1857
+ // "chain": "ETH",
1858
+ // "chains": [
1859
+ // {
1860
+ // "name": "ETH",
1861
+ // "addr": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1862
+ // "withdraw_disabled": false,
1863
+ // "withdraw_delayed": false,
1864
+ // "deposit_disabled": false
1865
+ // },
1866
+ // {
1867
+ // "name": "ARBEVM",
1868
+ // "addr": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1869
+ // "withdraw_disabled": false,
1870
+ // "withdraw_delayed": false,
1871
+ // "deposit_disabled": false
1872
+ // },
1873
+ // {
1874
+ // "name": "BSC",
1875
+ // "addr": "0x55d398326f99059fF775485246999027B3197955",
1876
+ // "withdraw_disabled": false,
1877
+ // "withdraw_delayed": false,
1878
+ // "deposit_disabled": false
1879
+ // },
1880
+ // ]
1881
+ // },
1882
+ // ]
1849
1883
  //
1850
1884
  const indexedCurrencies = this.indexBy(response, 'currency');
1851
1885
  const result = {};
1852
1886
  for (let i = 0; i < response.length; i++) {
1853
1887
  const entry = response[i];
1854
1888
  const currencyId = this.safeString(entry, 'currency');
1855
- const parts = currencyId.split('_');
1856
- const partFirst = this.safeString(parts, 0);
1857
- // if there's an underscore then the second part is always the chain name (except the _OLD suffix)
1858
- const currencyName = currencyId.endsWith('_OLD') ? currencyId : partFirst;
1859
- const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
1860
- const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
1861
- const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
1862
- const precision = this.parseNumber('0.0001'); // temporary safe default, because no value provided from API
1863
- const code = this.safeCurrencyCode(currencyName);
1889
+ const code = this.safeCurrencyCode(currencyId);
1864
1890
  // check leveraged tokens (e.g. BTC3S, ETH5L)
1865
- let isLeveragedToken = false;
1866
- if (currencyId.endsWith('3S') || currencyId.endsWith('3L') || currencyId.endsWith('5S') || currencyId.endsWith('5L')) {
1867
- const realCurrencyId = currencyId.slice(0, -2);
1868
- if (realCurrencyId in indexedCurrencies) {
1869
- isLeveragedToken = true;
1870
- }
1871
- }
1872
- const type = isLeveragedToken ? 'leveraged' : 'crypto';
1873
- // some networks are null, they are mostly obsolete & unsupported dead tokens, so we can default their networkId to their tokenname
1874
- const networkId = this.safeString(entry, 'chain', currencyId);
1875
- const networkCode = this.networkIdToCode(networkId, code);
1876
- const networkEntry = {
1877
- 'info': entry,
1878
- 'id': networkId,
1879
- 'network': networkCode,
1880
- 'limits': {
1881
- 'deposit': {
1882
- 'min': undefined,
1883
- 'max': undefined,
1884
- },
1885
- 'withdraw': {
1886
- 'min': undefined,
1887
- 'max': undefined,
1891
+ const type = this.isLeveragedCurrency(currencyId, true, indexedCurrencies) ? 'leveraged' : 'crypto';
1892
+ const chains = this.safeList(entry, 'chains', []);
1893
+ const networks = {};
1894
+ for (let j = 0; j < chains.length; j++) {
1895
+ const chain = chains[j];
1896
+ const networkId = this.safeString(chain, 'name');
1897
+ const networkCode = this.networkIdToCode(networkId);
1898
+ networks[networkCode] = {
1899
+ 'info': chain,
1900
+ 'id': networkId,
1901
+ 'network': networkCode,
1902
+ 'active': undefined,
1903
+ 'deposit': !this.safeBool(chain, 'deposit_disabled'),
1904
+ 'withdraw': !this.safeBool(chain, 'withdraw_disabled'),
1905
+ 'fee': undefined,
1906
+ 'precision': this.parseNumber('0.0001'),
1907
+ 'limits': {
1908
+ 'deposit': {
1909
+ 'min': undefined,
1910
+ 'max': undefined,
1911
+ },
1912
+ 'withdraw': {
1913
+ 'min': undefined,
1914
+ 'max': undefined,
1915
+ },
1888
1916
  },
1889
- },
1890
- 'active': !tradeDisabled,
1891
- 'deposit': !depositDisabled,
1892
- 'withdraw': !withdrawDisabled,
1893
- 'fee': undefined,
1894
- 'precision': precision,
1895
- };
1896
- // check if first entry for the specific currency
1897
- if (!(code in result)) {
1898
- result[code] = {
1899
- 'id': currencyName,
1900
- 'lowerCaseId': currencyName.toLowerCase(),
1901
- 'code': code,
1902
- 'type': type,
1903
- 'precision': precision,
1904
- 'limits': undefined,
1905
- 'networks': {},
1906
- 'info': [], // will be filled below
1907
1917
  };
1908
1918
  }
1909
- result[code]['networks'][networkCode] = networkEntry;
1910
- const info = this.safeList(result[code], 'info', []);
1911
- info.push(entry);
1912
- result[code]['info'] = info;
1913
- result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
1919
+ result[code] = this.safeCurrencyStructure({
1920
+ 'id': currencyId,
1921
+ 'code': code,
1922
+ 'name': this.safeString(entry, 'name'),
1923
+ 'type': type,
1924
+ 'active': !this.safeBool(entry, 'delisted'),
1925
+ 'deposit': !this.safeBool(entry, 'deposit_disabled'),
1926
+ 'withdraw': !this.safeBool(entry, 'withdraw_disabled'),
1927
+ 'fee': undefined,
1928
+ 'networks': networks,
1929
+ 'precision': this.parseNumber('0.0001'),
1930
+ 'info': entry,
1931
+ });
1914
1932
  }
1915
1933
  return result;
1916
1934
  }
@@ -2182,9 +2200,7 @@ export default class gate extends Exchange {
2182
2200
  const chains = this.safeValue(response, 'multichain_addresses', []);
2183
2201
  const currencyId = this.safeString(response, 'currency');
2184
2202
  currency = this.safeCurrency(currencyId, currency);
2185
- const parsed = this.parseDepositAddresses(chains, [currency['code']], false, {
2186
- 'currency': currency['id'],
2187
- });
2203
+ const parsed = this.parseDepositAddresses(chains, undefined, false);
2188
2204
  return this.indexBy(parsed, 'network');
2189
2205
  }
2190
2206
  /**
@@ -2202,8 +2218,8 @@ export default class gate extends Exchange {
2202
2218
  let networkCode = undefined;
2203
2219
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
2204
2220
  const chainsIndexedById = await this.fetchDepositAddressesByNetwork(code, params);
2205
- const selectedNetworkId = this.selectNetworkCodeFromUnifiedNetworks(code, networkCode, chainsIndexedById);
2206
- return chainsIndexedById[selectedNetworkId];
2221
+ const selectedNetworkIdOrCode = this.selectNetworkCodeFromUnifiedNetworks(code, networkCode, chainsIndexedById);
2222
+ return chainsIndexedById[selectedNetworkIdOrCode];
2207
2223
  }
2208
2224
  parseDepositAddress(depositAddress, currency = undefined) {
2209
2225
  //
package/js/src/htx.js CHANGED
@@ -4543,6 +4543,8 @@ export default class htx extends Exchange {
4543
4543
  const request = {};
4544
4544
  let marketType = undefined;
4545
4545
  [marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
4546
+ let subType = undefined;
4547
+ [subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params, 'linear');
4546
4548
  let response = undefined;
4547
4549
  if (marketType === 'spot') {
4548
4550
  if (symbol !== undefined) {
@@ -4571,18 +4573,18 @@ export default class htx extends Exchange {
4571
4573
  response = await this.spotPrivateGetV1OrderOpenOrders(this.extend(request, params));
4572
4574
  }
4573
4575
  else {
4574
- if (symbol === undefined) {
4575
- throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
4576
+ if (symbol !== undefined) {
4577
+ // throw new ArgumentsRequired (this.id + ' fetchOpenOrders() requires a symbol argument');
4578
+ request['contract_code'] = market['id'];
4576
4579
  }
4577
4580
  if (limit !== undefined) {
4578
4581
  request['page_size'] = limit;
4579
4582
  }
4580
- request['contract_code'] = market['id'];
4581
4583
  const trigger = this.safeBool2(params, 'stop', 'trigger');
4582
4584
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
4583
4585
  const trailing = this.safeBool(params, 'trailing', false);
4584
4586
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
4585
- if (market['linear']) {
4587
+ if (subType === 'linear') {
4586
4588
  let marginMode = undefined;
4587
4589
  [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
4588
4590
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
@@ -4615,8 +4617,8 @@ export default class htx extends Exchange {
4615
4617
  }
4616
4618
  }
4617
4619
  }
4618
- else if (market['inverse']) {
4619
- if (market['swap']) {
4620
+ else if (subType === 'inverse') {
4621
+ if (marketType === 'swap') {
4620
4622
  if (trigger) {
4621
4623
  response = await this.contractPrivatePostSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
4622
4624
  }
@@ -4630,8 +4632,8 @@ export default class htx extends Exchange {
4630
4632
  response = await this.contractPrivatePostSwapApiV1SwapOpenorders(this.extend(request, params));
4631
4633
  }
4632
4634
  }
4633
- else if (market['future']) {
4634
- request['symbol'] = market['settleId'];
4635
+ else if (marketType === 'future') {
4636
+ request['symbol'] = this.safeString(market, 'settleId', 'usdt');
4635
4637
  if (trigger) {
4636
4638
  response = await this.contractPrivatePostApiV1ContractTriggerOpenorders(this.extend(request, params));
4637
4639
  }
@@ -1529,7 +1529,9 @@ export default class hyperliquid extends Exchange {
1529
1529
  }
1530
1530
  orderReq.push(orderObj);
1531
1531
  }
1532
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1532
+ let vaultAddress = undefined;
1533
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'createOrder', 'vaultAddress');
1534
+ vaultAddress = this.formatVaultAddress(vaultAddress);
1533
1535
  const orderAction = {
1534
1536
  'type': 'order',
1535
1537
  'orders': orderReq,
@@ -1624,7 +1626,9 @@ export default class hyperliquid extends Exchange {
1624
1626
  }
1625
1627
  }
1626
1628
  cancelAction['cancels'] = cancelReq;
1627
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1629
+ let vaultAddress = undefined;
1630
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'cancelOrders', 'vaultAddress');
1631
+ vaultAddress = this.formatVaultAddress(vaultAddress);
1628
1632
  const signature = this.signL1Action(cancelAction, nonce, vaultAddress);
1629
1633
  request['action'] = cancelAction;
1630
1634
  request['signature'] = signature;
@@ -1708,7 +1712,9 @@ export default class hyperliquid extends Exchange {
1708
1712
  }
1709
1713
  cancelAction['type'] = cancelByCloid ? 'cancelByCloid' : 'cancel';
1710
1714
  cancelAction['cancels'] = cancelReq;
1711
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1715
+ let vaultAddress = undefined;
1716
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'cancelOrdersForSymbols', 'vaultAddress');
1717
+ vaultAddress = this.formatVaultAddress(vaultAddress);
1712
1718
  const signature = this.signL1Action(cancelAction, nonce, vaultAddress);
1713
1719
  request['action'] = cancelAction;
1714
1720
  request['signature'] = signature;
@@ -1754,7 +1760,9 @@ export default class hyperliquid extends Exchange {
1754
1760
  'type': 'scheduleCancel',
1755
1761
  'time': nonce + timeout,
1756
1762
  };
1757
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1763
+ let vaultAddress = undefined;
1764
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'cancelAllOrdersAfter', 'vaultAddress');
1765
+ vaultAddress = this.formatVaultAddress(vaultAddress);
1758
1766
  const signature = this.signL1Action(cancelAction, nonce, vaultAddress);
1759
1767
  request['action'] = cancelAction;
1760
1768
  request['signature'] = signature;
@@ -1879,7 +1887,9 @@ export default class hyperliquid extends Exchange {
1879
1887
  'type': 'batchModify',
1880
1888
  'modifies': modifies,
1881
1889
  };
1882
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
1890
+ let vaultAddress = undefined;
1891
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'editOrder', 'vaultAddress');
1892
+ vaultAddress = this.formatVaultAddress(vaultAddress);
1883
1893
  const signature = this.signL1Action(modifyAction, nonce, vaultAddress);
1884
1894
  const request = {
1885
1895
  'action': modifyAction,
@@ -1888,7 +1898,6 @@ export default class hyperliquid extends Exchange {
1888
1898
  // 'vaultAddress': vaultAddress,
1889
1899
  };
1890
1900
  if (vaultAddress !== undefined) {
1891
- params = this.omit(params, 'vaultAddress');
1892
1901
  request['vaultAddress'] = vaultAddress;
1893
1902
  }
1894
1903
  return request;
@@ -2743,9 +2752,9 @@ export default class hyperliquid extends Exchange {
2743
2752
  'isCross': isCross,
2744
2753
  'leverage': leverage,
2745
2754
  };
2746
- let vaultAddress = this.safeString(params, 'vaultAddress');
2755
+ let vaultAddress = undefined;
2756
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'setMarginMode', 'vaultAddress');
2747
2757
  if (vaultAddress !== undefined) {
2748
- params = this.omit(params, 'vaultAddress');
2749
2758
  if (vaultAddress.startsWith('0x')) {
2750
2759
  vaultAddress = vaultAddress.replace('0x', '');
2751
2760
  }
@@ -2798,7 +2807,9 @@ export default class hyperliquid extends Exchange {
2798
2807
  'isCross': isCross,
2799
2808
  'leverage': leverage,
2800
2809
  };
2801
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
2810
+ let vaultAddress = undefined;
2811
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'setLeverage', 'vaultAddress');
2812
+ vaultAddress = this.formatVaultAddress(vaultAddress);
2802
2813
  const signature = this.signL1Action(updateAction, nonce, vaultAddress);
2803
2814
  const request = {
2804
2815
  'action': updateAction,
@@ -2862,7 +2873,9 @@ export default class hyperliquid extends Exchange {
2862
2873
  'isBuy': true,
2863
2874
  'ntli': sz,
2864
2875
  };
2865
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
2876
+ let vaultAddress = undefined;
2877
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'modifyMargin', 'vaultAddress');
2878
+ vaultAddress = this.formatVaultAddress(vaultAddress);
2866
2879
  const signature = this.signL1Action(updateAction, nonce, vaultAddress);
2867
2880
  const request = {
2868
2881
  'action': updateAction,
@@ -2871,7 +2884,6 @@ export default class hyperliquid extends Exchange {
2871
2884
  // 'vaultAddress': vaultAddress,
2872
2885
  };
2873
2886
  if (vaultAddress !== undefined) {
2874
- params = this.omit(params, 'vaultAddress');
2875
2887
  request['vaultAddress'] = vaultAddress;
2876
2888
  }
2877
2889
  const response = await this.privatePostExchange(request);
@@ -2930,8 +2942,9 @@ export default class hyperliquid extends Exchange {
2930
2942
  throw new NotSupported(this.id + ' transfer() only support spot <> swap transfer');
2931
2943
  }
2932
2944
  let strAmount = this.numberToString(amount);
2933
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
2934
- params = this.omit(params, 'vaultAddress');
2945
+ let vaultAddress = undefined;
2946
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'transfer', 'vaultAddress');
2947
+ vaultAddress = this.formatVaultAddress(vaultAddress);
2935
2948
  if (vaultAddress !== undefined) {
2936
2949
  strAmount = strAmount + ' subaccount:' + vaultAddress;
2937
2950
  }
@@ -3034,7 +3047,9 @@ export default class hyperliquid extends Exchange {
3034
3047
  throw new NotSupported(this.id + ' withdraw() only support USDC');
3035
3048
  }
3036
3049
  }
3037
- const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
3050
+ let vaultAddress = undefined;
3051
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'withdraw', 'vaultAddress');
3052
+ vaultAddress = this.formatVaultAddress(vaultAddress);
3038
3053
  params = this.omit(params, 'vaultAddress');
3039
3054
  const nonce = this.milliseconds();
3040
3055
  let action = {};
@@ -3660,8 +3675,9 @@ export default class hyperliquid extends Exchange {
3660
3675
  }
3661
3676
  parseCreateEditOrderArgs(id, symbol, type, side, amount, price = undefined, params = {}) {
3662
3677
  const market = this.market(symbol);
3663
- const vaultAddress = this.safeString(params, 'vaultAddress');
3664
- params = this.omit(params, 'vaultAddress');
3678
+ let vaultAddress = undefined;
3679
+ [vaultAddress, params] = this.handleOptionAndParams(params, 'createOrder', 'vaultAddress');
3680
+ vaultAddress = this.formatVaultAddress(vaultAddress);
3665
3681
  symbol = market['symbol'];
3666
3682
  const order = {
3667
3683
  'symbol': symbol,
package/js/src/kraken.js CHANGED
@@ -858,24 +858,21 @@ export default class kraken extends Exchange {
858
858
  code = this.safeCurrencyCode(id);
859
859
  }
860
860
  }
861
- const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
862
- // assumes all currencies are active except those listed above
863
- const active = this.safeString(currency, 'status') === 'enabled';
864
861
  const isFiat = code.indexOf('.HOLD') >= 0;
865
- result[code] = {
862
+ result[code] = this.safeCurrencyStructure({
866
863
  'id': id,
867
864
  'code': code,
868
865
  'info': currency,
869
866
  'name': this.safeString(currency, 'altname'),
870
- 'active': active,
867
+ 'active': this.safeString(currency, 'status') === 'enabled',
871
868
  'type': isFiat ? 'fiat' : 'crypto',
872
869
  'deposit': undefined,
873
870
  'withdraw': undefined,
874
871
  'fee': undefined,
875
- 'precision': precision,
872
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
876
873
  'limits': {
877
874
  'amount': {
878
- 'min': precision,
875
+ 'min': undefined,
879
876
  'max': undefined,
880
877
  },
881
878
  'withdraw': {
@@ -884,7 +881,7 @@ export default class kraken extends Exchange {
884
881
  },
885
882
  },
886
883
  'networks': {},
887
- };
884
+ });
888
885
  }
889
886
  return result;
890
887
  }