ccxt 4.4.82 → 4.4.86

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 (145) hide show
  1. package/README.md +6 -9
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +6 -17
  4. package/dist/cjs/src/abstract/bittrade.js +9 -0
  5. package/dist/cjs/src/apex.js +2 -1
  6. package/dist/cjs/src/ascendex.js +189 -155
  7. package/dist/cjs/src/base/Exchange.js +15 -2
  8. package/dist/cjs/src/bequant.js +1 -1
  9. package/dist/cjs/src/bitget.js +6 -7
  10. package/dist/cjs/src/bitmart.js +1 -1
  11. package/dist/cjs/src/bitrue.js +14 -35
  12. package/dist/cjs/src/bitso.js +33 -0
  13. package/dist/cjs/src/bitstamp.js +33 -0
  14. package/dist/cjs/src/bittrade.js +2049 -0
  15. package/dist/cjs/src/blofin.js +154 -13
  16. package/dist/cjs/src/btcbox.js +25 -5
  17. package/dist/cjs/src/bybit.js +16 -40
  18. package/dist/cjs/src/cex.js +2 -4
  19. package/dist/cjs/src/coinbase.js +58 -46
  20. package/dist/cjs/src/coinbaseexchange.js +142 -32
  21. package/dist/cjs/src/coincatch.js +14 -67
  22. package/dist/cjs/src/coinex.js +29 -32
  23. package/dist/cjs/src/coinlist.js +16 -15
  24. package/dist/cjs/src/coinmetro.js +22 -11
  25. package/dist/cjs/src/coinone.js +8 -10
  26. package/dist/cjs/src/coinsph.js +126 -1
  27. package/dist/cjs/src/cryptocom.js +111 -1
  28. package/dist/cjs/src/cryptomus.js +43 -89
  29. package/dist/cjs/src/delta.js +76 -36
  30. package/dist/cjs/src/deribit.js +4 -5
  31. package/dist/cjs/src/derive.js +46 -10
  32. package/dist/cjs/src/ellipx.js +175 -79
  33. package/dist/cjs/src/gate.js +1 -1
  34. package/dist/cjs/src/gemini.js +3 -5
  35. package/dist/cjs/src/hitbtc.js +56 -69
  36. package/dist/cjs/src/hollaex.js +107 -49
  37. package/dist/cjs/src/htx.js +20 -44
  38. package/dist/cjs/src/hyperliquid.js +6 -6
  39. package/dist/cjs/src/kraken.js +29 -24
  40. package/dist/cjs/src/kucoinfutures.js +6 -0
  41. package/dist/cjs/src/lbank.js +1 -1
  42. package/dist/cjs/src/mexc.js +2 -2
  43. package/dist/cjs/src/ndax.js +25 -24
  44. package/dist/cjs/src/okcoin.js +12 -31
  45. package/dist/cjs/src/okx.js +9 -0
  46. package/dist/cjs/src/onetrading.js +9 -6
  47. package/dist/cjs/src/oxfun.js +42 -114
  48. package/dist/cjs/src/paradex.js +124 -4
  49. package/dist/cjs/src/pro/binance.js +32 -33
  50. package/dist/cjs/src/pro/bithumb.js +5 -3
  51. package/dist/cjs/src/pro/bittrade.js +605 -0
  52. package/dist/cjs/src/pro/kraken.js +289 -79
  53. package/dist/cjs/src/pro/luno.js +6 -5
  54. package/dist/cjs/src/pro/mexc.js +304 -7
  55. package/dist/cjs/src/pro/poloniex.js +6 -2
  56. package/examples/js/cli.js +127 -13
  57. package/js/ccxt.d.ts +8 -20
  58. package/js/ccxt.js +6 -14
  59. package/js/src/abstract/blofin.d.ts +8 -0
  60. package/js/src/abstract/btcbox.d.ts +1 -0
  61. package/js/src/abstract/myokx.d.ts +2 -0
  62. package/js/src/abstract/okx.d.ts +2 -0
  63. package/js/src/apex.js +2 -1
  64. package/js/src/ascendex.d.ts +2 -0
  65. package/js/src/ascendex.js +189 -155
  66. package/js/src/base/Exchange.d.ts +15 -1
  67. package/js/src/base/Exchange.js +15 -2
  68. package/js/src/base/types.d.ts +3 -0
  69. package/js/src/bequant.js +1 -1
  70. package/js/src/bitget.js +6 -7
  71. package/js/src/bitmart.js +1 -1
  72. package/js/src/bitrue.js +14 -35
  73. package/js/src/bitso.js +33 -0
  74. package/js/src/bitstamp.js +33 -0
  75. package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
  76. package/js/src/{huobijp.js → bittrade.js} +35 -35
  77. package/js/src/blofin.d.ts +42 -2
  78. package/js/src/blofin.js +154 -13
  79. package/js/src/btcbox.js +25 -5
  80. package/js/src/bybit.js +16 -40
  81. package/js/src/cex.js +2 -4
  82. package/js/src/coinbase.js +58 -46
  83. package/js/src/coinbaseexchange.js +142 -32
  84. package/js/src/coincatch.js +14 -67
  85. package/js/src/coinex.js +28 -29
  86. package/js/src/coinlist.js +16 -15
  87. package/js/src/coinmetro.js +22 -11
  88. package/js/src/coinone.js +8 -10
  89. package/js/src/coinsph.d.ts +10 -1
  90. package/js/src/coinsph.js +126 -1
  91. package/js/src/cryptocom.d.ts +10 -1
  92. package/js/src/cryptocom.js +111 -1
  93. package/js/src/cryptomus.js +43 -89
  94. package/js/src/delta.js +76 -36
  95. package/js/src/deribit.js +4 -5
  96. package/js/src/derive.js +46 -10
  97. package/js/src/ellipx.d.ts +2 -3
  98. package/js/src/ellipx.js +175 -80
  99. package/js/src/gate.js +1 -1
  100. package/js/src/gemini.js +3 -5
  101. package/js/src/hitbtc.js +56 -69
  102. package/js/src/hollaex.js +107 -49
  103. package/js/src/htx.js +20 -44
  104. package/js/src/hyperliquid.js +6 -6
  105. package/js/src/kraken.js +29 -24
  106. package/js/src/kucoinfutures.d.ts +1 -0
  107. package/js/src/kucoinfutures.js +6 -0
  108. package/js/src/lbank.js +1 -1
  109. package/js/src/mexc.js +2 -2
  110. package/js/src/ndax.js +25 -24
  111. package/js/src/okcoin.js +12 -31
  112. package/js/src/okx.js +9 -0
  113. package/js/src/onetrading.js +9 -6
  114. package/js/src/oxfun.js +42 -114
  115. package/js/src/paradex.d.ts +12 -1
  116. package/js/src/paradex.js +124 -4
  117. package/js/src/pro/binance.d.ts +26 -26
  118. package/js/src/pro/binance.js +32 -33
  119. package/js/src/pro/bithumb.js +5 -3
  120. package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
  121. package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
  122. package/js/src/pro/kraken.d.ts +7 -6
  123. package/js/src/pro/kraken.js +290 -80
  124. package/js/src/pro/luno.js +6 -5
  125. package/js/src/pro/mexc.d.ts +58 -0
  126. package/js/src/pro/mexc.js +304 -7
  127. package/js/src/pro/poloniex.d.ts +1 -1
  128. package/js/src/pro/poloniex.js +6 -2
  129. package/package.json +1 -1
  130. package/js/src/abstract/bl3p.d.ts +0 -22
  131. package/js/src/abstract/huobijp.js +0 -11
  132. package/js/src/abstract/idex.d.ts +0 -29
  133. package/js/src/abstract/idex.js +0 -11
  134. package/js/src/abstract/kuna.d.ts +0 -185
  135. package/js/src/abstract/kuna.js +0 -11
  136. package/js/src/bl3p.d.ts +0 -116
  137. package/js/src/bl3p.js +0 -552
  138. package/js/src/idex.d.ts +0 -312
  139. package/js/src/idex.js +0 -1961
  140. package/js/src/kuna.d.ts +0 -335
  141. package/js/src/kuna.js +0 -2006
  142. package/js/src/pro/idex.d.ts +0 -81
  143. package/js/src/pro/idex.js +0 -720
  144. /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
  145. /package/js/src/abstract/{bl3p.js → bittrade.js} +0 -0
@@ -918,29 +918,46 @@ class hitbtc extends hitbtc$1 {
918
918
  async fetchCurrencies(params = {}) {
919
919
  const response = await this.publicGetPublicCurrency(params);
920
920
  //
921
- // {
922
- // "WEALTH": {
923
- // "full_name": "ConnectWealth",
924
- // "payin_enabled": false,
925
- // "payout_enabled": false,
926
- // "transfer_enabled": true,
927
- // "precision_transfer": "0.001",
928
- // "networks": [
929
- // {
930
- // "network": "ETH",
931
- // "protocol": "ERC20",
932
- // "default": true,
933
- // "payin_enabled": false,
934
- // "payout_enabled": false,
935
- // "precision_payout": "0.001",
936
- // "payout_fee": "0.016800000000",
937
- // "payout_is_payment_id": false,
938
- // "payin_payment_id": false,
939
- // "payin_confirmations": "2"
940
- // }
941
- // ]
942
- // }
943
- // }
921
+ // {
922
+ // "DFC": {
923
+ // "full_name": "DeFiScale",
924
+ // "crypto": true,
925
+ // "payin_enabled": false,
926
+ // "payout_enabled": true,
927
+ // "transfer_enabled": false,
928
+ // "transfer_to_wallet_enabled": true,
929
+ // "transfer_to_exchange_enabled": false,
930
+ // "sign": "D",
931
+ // "crypto_payment_id_name": "",
932
+ // "crypto_explorer": "https://etherscan.io/tx/{tx}",
933
+ // "precision_transfer": "0.00000001",
934
+ // "delisted": false,
935
+ // "networks": [
936
+ // {
937
+ // "code": "ETH",
938
+ // "network_name": "Ethereum",
939
+ // "network": "ETH",
940
+ // "protocol": "ERC-20",
941
+ // "default": true,
942
+ // "is_ens_available": true,
943
+ // "payin_enabled": true,
944
+ // "payout_enabled": true,
945
+ // "precision_payout": "0.000000000000000001",
946
+ // "payout_fee": "277000.0000000000",
947
+ // "payout_is_payment_id": false,
948
+ // "payin_payment_id": false,
949
+ // "payin_confirmations": "2",
950
+ // "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af",
951
+ // "crypto_payment_id_name": "",
952
+ // "crypto_explorer": "https://etherscan.io/tx/{tx}",
953
+ // "is_multichain": true,
954
+ // "asset_id": {
955
+ // "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af"
956
+ // }
957
+ // }
958
+ // ]
959
+ // },
960
+ // }
944
961
  //
945
962
  const result = {};
946
963
  const currencies = Object.keys(response);
@@ -948,50 +965,22 @@ class hitbtc extends hitbtc$1 {
948
965
  const currencyId = currencies[i];
949
966
  const code = this.safeCurrencyCode(currencyId);
950
967
  const entry = response[currencyId];
951
- const name = this.safeString(entry, 'full_name');
952
- const precision = this.safeNumber(entry, 'precision_transfer');
953
- const payinEnabled = this.safeBool(entry, 'payin_enabled', false);
954
- const payoutEnabled = this.safeBool(entry, 'payout_enabled', false);
955
- const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
956
- const active = payinEnabled && payoutEnabled && transferEnabled;
957
- const rawNetworks = this.safeValue(entry, 'networks', []);
958
- const isCrypto = this.safeBool(entry, 'crypto');
959
- const type = isCrypto ? 'crypto' : 'fiat';
968
+ const rawNetworks = this.safeList(entry, 'networks', []);
960
969
  const networks = {};
961
- let fee = undefined;
962
- let depositEnabled = undefined;
963
- let withdrawEnabled = undefined;
964
970
  for (let j = 0; j < rawNetworks.length; j++) {
965
971
  const rawNetwork = rawNetworks[j];
966
972
  const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
967
973
  let networkCode = this.networkIdToCode(networkId);
968
- networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : undefined;
969
- fee = this.safeNumber(rawNetwork, 'payout_fee');
970
- const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
971
- const payinEnabledNetwork = this.safeBool(rawNetwork, 'payin_enabled', false);
972
- const payoutEnabledNetwork = this.safeBool(rawNetwork, 'payout_enabled', false);
973
- const activeNetwork = payinEnabledNetwork && payoutEnabledNetwork;
974
- if (payinEnabledNetwork && !depositEnabled) {
975
- depositEnabled = true;
976
- }
977
- else if (!payinEnabledNetwork) {
978
- depositEnabled = false;
979
- }
980
- if (payoutEnabledNetwork && !withdrawEnabled) {
981
- withdrawEnabled = true;
982
- }
983
- else if (!payoutEnabledNetwork) {
984
- withdrawEnabled = false;
985
- }
974
+ networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : code; // as hitbtc is white label, ensure we safeguard from possible bugs
986
975
  networks[networkCode] = {
987
976
  'info': rawNetwork,
988
977
  'id': networkId,
989
978
  'network': networkCode,
990
- 'fee': fee,
991
- 'active': activeNetwork,
992
- 'deposit': payinEnabledNetwork,
993
- 'withdraw': payoutEnabledNetwork,
994
- 'precision': networkPrecision,
979
+ 'active': undefined,
980
+ 'fee': this.safeNumber(rawNetwork, 'payout_fee'),
981
+ 'deposit': this.safeBool(rawNetwork, 'payin_enabled'),
982
+ 'withdraw': this.safeBool(rawNetwork, 'payout_enabled'),
983
+ 'precision': this.safeNumber(rawNetwork, 'precision_payout'),
995
984
  'limits': {
996
985
  'withdraw': {
997
986
  'min': undefined,
@@ -1000,27 +989,25 @@ class hitbtc extends hitbtc$1 {
1000
989
  },
1001
990
  };
1002
991
  }
1003
- const networksKeys = Object.keys(networks);
1004
- const networksLength = networksKeys.length;
1005
- result[code] = {
992
+ result[code] = this.safeCurrencyStructure({
1006
993
  'info': entry,
1007
994
  'code': code,
1008
995
  'id': currencyId,
1009
- 'precision': precision,
1010
- 'name': name,
1011
- 'active': active,
1012
- 'deposit': depositEnabled,
1013
- 'withdraw': withdrawEnabled,
996
+ 'precision': this.safeNumber(entry, 'precision_transfer'),
997
+ 'name': this.safeString(entry, 'full_name'),
998
+ 'active': !this.safeBool(entry, 'delisted'),
999
+ 'deposit': this.safeBool(entry, 'payin_enabled'),
1000
+ 'withdraw': this.safeBool(entry, 'payout_enabled'),
1014
1001
  'networks': networks,
1015
- 'fee': (networksLength <= 1) ? fee : undefined,
1002
+ 'fee': undefined,
1016
1003
  'limits': {
1017
1004
  'amount': {
1018
1005
  'min': undefined,
1019
1006
  'max': undefined,
1020
1007
  },
1021
1008
  },
1022
- 'type': type,
1023
- };
1009
+ 'type': undefined, // 'crypto' field emits incorrect values
1010
+ });
1024
1011
  }
1025
1012
  return result;
1026
1013
  }
@@ -284,6 +284,14 @@ class hollaex extends hollaex$1 {
284
284
  'BNB': 'bnb',
285
285
  'MATIC': 'matic',
286
286
  },
287
+ 'networksById': {
288
+ 'eth': 'ERC20',
289
+ 'ETH': 'ERC20',
290
+ 'ERC20': 'ERC20',
291
+ 'trx': 'TRC20',
292
+ 'TRX': 'TRC20',
293
+ 'TRC20': 'TRC20',
294
+ },
287
295
  },
288
296
  });
289
297
  }
@@ -414,66 +422,116 @@ class hollaex extends hollaex$1 {
414
422
  async fetchCurrencies(params = {}) {
415
423
  const response = await this.publicGetConstants(params);
416
424
  //
417
- // {
418
- // "coins":{
419
- // "bch":{
420
- // "id":4,
421
- // "fullname":"Bitcoin Cash",
422
- // "symbol":"bch",
423
- // "active":true,
424
- // "verified":true,
425
- // "allow_deposit":true,
426
- // "allow_withdrawal":true,
427
- // "withdrawal_fee":0.0002,
428
- // "min":0.001,
429
- // "max":100000,
430
- // "increment_unit":0.001,
431
- // "logo":"https://bitholla.s3.ap-northeast-2.amazonaws.com/icon/BCH-hollaex-asset-01.svg",
432
- // "code":"bch",
433
- // "is_public":true,
434
- // "meta":{},
435
- // "estimated_price":null,
436
- // "description":null,
437
- // "type":"blockchain",
438
- // "network":null,
439
- // "standard":null,
440
- // "issuer":"HollaEx",
441
- // "withdrawal_fees":null,
442
- // "created_at":"2019-08-09T10:45:43.367Z",
443
- // "updated_at":"2021-12-13T03:08:32.372Z",
444
- // "created_by":1,
445
- // "owner_id":1
446
- // },
425
+ // {
426
+ // "coins": {
427
+ // "usdt": {
428
+ // "id": "6",
429
+ // "fullname": "USD Tether",
430
+ // "symbol": "usdt",
431
+ // "active": true,
432
+ // "verified": true,
433
+ // "allow_deposit": true,
434
+ // "allow_withdrawal": true,
435
+ // "withdrawal_fee": "20",
436
+ // "min": "1",
437
+ // "max": "10000000",
438
+ // "increment_unit": "0.0001",
439
+ // "logo": "https://hollaex-resources.s3.ap-southeast-1.amazonaws.com/icons/usdt.svg",
440
+ // "code": "usdt",
441
+ // "is_public": true,
442
+ // "meta": {
443
+ // "color": "#27a17a",
444
+ // "website": "https://tether.to",
445
+ // "explorer": "https://blockchair.com/tether",
446
+ // "decimal_points": "6"
447
+ // },
448
+ // "estimated_price": "1",
449
+ // "description": "<p>Tether (USDT) is a stablecoin pegged 1:1 to the US dollar. It is a digital currency that aims to maintain its value while allowing for fast and secure transfer of funds. It was the first stablecoin, and is the most widely used due stablecoin due to its stability and low volatility compared to other cryptocurrencies. It was launched in 2014 by Tether Limited.</p>",
450
+ // "type": "blockchain",
451
+ // "network": "eth,trx,bnb,matic",
452
+ // "standard": "",
453
+ // "issuer": "HollaEx",
454
+ // "withdrawal_fees": {
455
+ // "bnb": {
456
+ // "value": "0.8",
457
+ // "active": true,
458
+ // "symbol": "usdt"
459
+ // },
460
+ // "eth": {
461
+ // "value": "1.5",
462
+ // "active": true,
463
+ // "symbol": "usdt"
464
+ // },
465
+ // "trx": {
466
+ // "value": "4",
467
+ // "active": true,
468
+ // "symbol": "usdt"
469
+ // },
470
+ // "matic": {
471
+ // "value": "0.3",
472
+ // "active": true,
473
+ // "symbol": "usdt"
474
+ // }
475
+ // },
476
+ // "display_name": null,
477
+ // "deposit_fees": null,
478
+ // "is_risky": false,
479
+ // "market_cap": "144568098696.29",
480
+ // "category": "stable",
481
+ // "created_at": "2019-08-09T10:45:43.367Z",
482
+ // "updated_at": "2025-03-25T17:12:37.970Z",
483
+ // "created_by": "168",
484
+ // "owner_id": "1"
485
+ // },
447
486
  // },
448
487
  // "network":"https://api.hollaex.network"
449
488
  // }
450
489
  //
451
- const coins = this.safeValue(response, 'coins', {});
490
+ const coins = this.safeDict(response, 'coins', {});
452
491
  const keys = Object.keys(coins);
453
492
  const result = {};
454
493
  for (let i = 0; i < keys.length; i++) {
455
494
  const key = keys[i];
456
495
  const currency = coins[key];
457
496
  const id = this.safeString(currency, 'symbol');
458
- const numericId = this.safeInteger(currency, 'id');
459
497
  const code = this.safeCurrencyCode(id);
460
- const name = this.safeString(currency, 'fullname');
461
- const depositEnabled = this.safeValue(currency, 'allow_deposit');
462
- const withdrawEnabled = this.safeValue(currency, 'allow_withdrawal');
463
- const isActive = this.safeValue(currency, 'active');
464
- const active = isActive && depositEnabled && withdrawEnabled;
465
- const fee = this.safeNumber(currency, 'withdrawal_fee');
466
- const withdrawalLimits = this.safeValue(currency, 'withdrawal_limits', []);
467
- result[code] = {
498
+ const withdrawalLimits = this.safeList(currency, 'withdrawal_limits', []);
499
+ const rawType = this.safeString(currency, 'type');
500
+ const type = (rawType === 'blockchain') ? 'crypto' : 'other';
501
+ const rawNetworks = this.safeDict(currency, 'withdrawal_fees', {});
502
+ const networks = {};
503
+ const networkIds = Object.keys(rawNetworks);
504
+ for (let j = 0; j < networkIds.length; j++) {
505
+ const networkId = networkIds[j];
506
+ const networkEntry = this.safeDict(rawNetworks, networkId);
507
+ const networkCode = this.networkIdToCode(networkId);
508
+ networks[networkCode] = {
509
+ 'id': networkId,
510
+ 'network': networkCode,
511
+ 'active': this.safeBool(networkEntry, 'active'),
512
+ 'deposit': undefined,
513
+ 'withdraw': undefined,
514
+ 'fee': this.safeNumber(networkEntry, 'value'),
515
+ 'precision': undefined,
516
+ 'limits': {
517
+ 'withdraw': {
518
+ 'min': undefined,
519
+ 'max': undefined,
520
+ },
521
+ },
522
+ 'info': networkEntry,
523
+ };
524
+ }
525
+ result[code] = this.safeCurrencyStructure({
468
526
  'id': id,
469
- 'numericId': numericId,
527
+ 'numericId': this.safeInteger(currency, 'id'),
470
528
  'code': code,
471
529
  'info': currency,
472
- 'name': name,
473
- 'active': active,
474
- 'deposit': depositEnabled,
475
- 'withdraw': withdrawEnabled,
476
- 'fee': fee,
530
+ 'name': this.safeString(currency, 'fullname'),
531
+ 'active': this.safeBool(currency, 'active'),
532
+ 'deposit': this.safeBool(currency, 'allow_deposit'),
533
+ 'withdraw': this.safeBool(currency, 'allow_withdrawal'),
534
+ 'fee': this.safeNumber(currency, 'withdrawal_fee'),
477
535
  'precision': this.safeNumber(currency, 'increment_unit'),
478
536
  'limits': {
479
537
  'amount': {
@@ -485,9 +543,9 @@ class hollaex extends hollaex$1 {
485
543
  'max': this.safeValue(withdrawalLimits, 0),
486
544
  },
487
545
  },
488
- 'networks': {},
489
- 'type': 'crypto',
490
- };
546
+ 'networks': networks,
547
+ 'type': type,
548
+ });
491
549
  }
492
550
  return result;
493
551
  }
@@ -3433,9 +3433,8 @@ class htx extends htx$1 {
3433
3433
  // }
3434
3434
  // ]
3435
3435
  // }
3436
- // }
3437
3436
  //
3438
- const data = this.safeValue(response, 'data', []);
3437
+ const data = this.safeList(response, 'data', []);
3439
3438
  const result = {};
3440
3439
  this.options['networkChainIdsByNames'] = {};
3441
3440
  this.options['networkNamesByChainIds'] = {};
@@ -3443,19 +3442,11 @@ class htx extends htx$1 {
3443
3442
  const entry = data[i];
3444
3443
  const currencyId = this.safeString(entry, 'currency');
3445
3444
  const code = this.safeCurrencyCode(currencyId);
3446
- this.options['networkChainIdsByNames'][code] = {};
3447
- const chains = this.safeValue(entry, 'chains', []);
3448
- const networks = {};
3449
- const instStatus = this.safeString(entry, 'instStatus');
3450
3445
  const assetType = this.safeString(entry, 'assetType');
3451
3446
  const type = assetType === '1' ? 'crypto' : 'fiat';
3452
- const currencyActive = instStatus === 'normal';
3453
- let minPrecision = undefined;
3454
- let minDeposit = undefined;
3455
- let minWithdraw = undefined;
3456
- let maxWithdraw = undefined;
3457
- let deposit = false;
3458
- let withdraw = false;
3447
+ this.options['networkChainIdsByNames'][code] = {};
3448
+ const chains = this.safeList(entry, 'chains', []);
3449
+ const networks = {};
3459
3450
  for (let j = 0; j < chains.length; j++) {
3460
3451
  const chainEntry = chains[j];
3461
3452
  const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
@@ -3463,49 +3454,34 @@ class htx extends htx$1 {
3463
3454
  this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
3464
3455
  this.options['networkNamesByChainIds'][uniqueChainId] = title;
3465
3456
  const networkCode = this.networkIdToCode(uniqueChainId);
3466
- minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
3467
- minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
3468
- maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
3469
- const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
3470
- const depositStatus = this.safeString(chainEntry, 'depositStatus');
3471
- const withdrawEnabled = (withdrawStatus === 'allowed');
3472
- const depositEnabled = (depositStatus === 'allowed');
3473
- withdraw = (withdrawEnabled) ? withdrawEnabled : withdraw;
3474
- deposit = (depositEnabled) ? depositEnabled : deposit;
3475
- const active = withdrawEnabled && depositEnabled;
3476
- const precision = this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'));
3477
- if (precision !== undefined) {
3478
- minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
3479
- }
3480
- const fee = this.safeNumber(chainEntry, 'transactFeeWithdraw');
3481
3457
  networks[networkCode] = {
3482
3458
  'info': chainEntry,
3483
3459
  'id': uniqueChainId,
3484
3460
  'network': networkCode,
3485
3461
  'limits': {
3486
3462
  'deposit': {
3487
- 'min': minDeposit,
3463
+ 'min': this.safeNumber(chainEntry, 'minDepositAmt'),
3488
3464
  'max': undefined,
3489
3465
  },
3490
3466
  'withdraw': {
3491
- 'min': minWithdraw,
3492
- 'max': maxWithdraw,
3467
+ 'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
3468
+ 'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
3493
3469
  },
3494
3470
  },
3495
- 'active': active,
3496
- 'deposit': depositEnabled,
3497
- 'withdraw': withdrawEnabled,
3498
- 'fee': fee,
3499
- 'precision': this.parseNumber(precision),
3471
+ 'active': undefined,
3472
+ 'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
3473
+ 'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
3474
+ 'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
3475
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
3500
3476
  };
3501
3477
  }
3502
- result[code] = {
3478
+ result[code] = this.safeCurrencyStructure({
3503
3479
  'info': entry,
3504
3480
  'code': code,
3505
3481
  'id': currencyId,
3506
- 'active': currencyActive,
3507
- 'deposit': deposit,
3508
- 'withdraw': withdraw,
3482
+ 'active': this.safeString(entry, 'instStatus') === 'normal',
3483
+ 'deposit': undefined,
3484
+ 'withdraw': undefined,
3509
3485
  'fee': undefined,
3510
3486
  'name': undefined,
3511
3487
  'type': type,
@@ -3515,17 +3491,17 @@ class htx extends htx$1 {
3515
3491
  'max': undefined,
3516
3492
  },
3517
3493
  'withdraw': {
3518
- 'min': minWithdraw,
3519
- 'max': maxWithdraw,
3494
+ 'min': undefined,
3495
+ 'max': undefined,
3520
3496
  },
3521
3497
  'deposit': {
3522
3498
  'min': undefined,
3523
3499
  'max': undefined,
3524
3500
  },
3525
3501
  },
3526
- 'precision': this.parseNumber(minPrecision),
3502
+ 'precision': undefined,
3527
3503
  'networks': networks,
3528
- };
3504
+ });
3529
3505
  }
3530
3506
  return result;
3531
3507
  }
@@ -175,12 +175,12 @@ class hyperliquid extends hyperliquid$1 {
175
175
  },
176
176
  'fees': {
177
177
  'swap': {
178
- 'taker': this.parseNumber('0.00035'),
179
- 'maker': this.parseNumber('0.0001'),
178
+ 'taker': this.parseNumber('0.00045'),
179
+ 'maker': this.parseNumber('0.00015'),
180
180
  },
181
181
  'spot': {
182
- 'taker': this.parseNumber('0.00035'),
183
- 'maker': this.parseNumber('0.0001'),
182
+ 'taker': this.parseNumber('0.0007'),
183
+ 'maker': this.parseNumber('0.0004'),
184
184
  },
185
185
  },
186
186
  'requiredCredentials': {
@@ -357,7 +357,7 @@ class hyperliquid extends hyperliquid$1 {
357
357
  const id = i;
358
358
  const name = this.safeString(data, 'name');
359
359
  const code = this.safeCurrencyCode(name);
360
- result[code] = {
360
+ result[code] = this.safeCurrencyStructure({
361
361
  'id': id,
362
362
  'name': name,
363
363
  'code': code,
@@ -379,7 +379,7 @@ class hyperliquid extends hyperliquid$1 {
379
379
  'max': undefined,
380
380
  },
381
381
  },
382
- };
382
+ });
383
383
  }
384
384
  return result;
385
385
  }
@@ -1646,6 +1646,8 @@ class kraken extends kraken$1 {
1646
1646
  'volume': this.amountToPrecision(symbol, amount),
1647
1647
  };
1648
1648
  const orderRequest = this.orderRequest('createOrder', symbol, type, request, amount, price, params);
1649
+ const flags = this.safeString(orderRequest[0], 'oflags', '');
1650
+ const isUsingCost = flags.indexOf('viqc') > -1;
1649
1651
  const response = await this.privatePostAddOrder(this.extend(orderRequest[0], orderRequest[1]));
1650
1652
  //
1651
1653
  // {
@@ -1657,6 +1659,10 @@ class kraken extends kraken$1 {
1657
1659
  // }
1658
1660
  //
1659
1661
  const result = this.safeDict(response, 'result');
1662
+ result['usingCost'] = isUsingCost;
1663
+ // it's impossible to know if the order was created using cost or base currency
1664
+ // becuase kraken only returns something like this: { order: 'buy 10.00000000 LTCUSD @ market' }
1665
+ // this usingCost flag is used to help the parsing but omited from the order
1660
1666
  return this.parseOrder(result);
1661
1667
  }
1662
1668
  findMarketByAltnameOrId(id) {
@@ -1749,22 +1755,15 @@ class kraken extends kraken$1 {
1749
1755
  // }
1750
1756
  //
1751
1757
  // ws - createOrder
1752
- // {
1753
- // "descr": 'sell 0.00010000 XBTUSDT @ market',
1754
- // "event": 'addOrderStatus',
1755
- // "reqid": 1,
1756
- // "status": 'ok',
1757
- // "txid": 'OAVXZH-XIE54-JCYYDG'
1758
- // }
1758
+ // {
1759
+ // "order_id": "OXM2QD-EALR2-YBAVEU"
1760
+ // }
1761
+ //
1759
1762
  // ws - editOrder
1760
- // {
1761
- // "descr": "order edited price = 9000.00000000",
1762
- // "event": "editOrderStatus",
1763
- // "originaltxid": "O65KZW-J4AW3-VFS74A",
1764
- // "reqid": 3,
1765
- // "status": "ok",
1766
- // "txid": "OTI672-HJFAO-XOIPPK"
1767
- // }
1763
+ // {
1764
+ // "amend_id": "TJSMEH-AA67V-YUSQ6O",
1765
+ // "order_id": "OXM2QD-EALR2-YBAVEU"
1766
+ // }
1768
1767
  //
1769
1768
  // {
1770
1769
  // "error": [],
@@ -1832,6 +1831,8 @@ class kraken extends kraken$1 {
1832
1831
  // "oflags": "fciq"
1833
1832
  // }
1834
1833
  //
1834
+ const isUsingCost = this.safeBool(order, 'usingCost', false);
1835
+ order = this.omit(order, 'usingCost');
1835
1836
  const description = this.safeDict(order, 'descr', {});
1836
1837
  const orderDescriptionObj = this.safeDict(order, 'descr'); // can be null
1837
1838
  let orderDescription = undefined;
@@ -1846,11 +1847,17 @@ class kraken extends kraken$1 {
1846
1847
  let marketId = undefined;
1847
1848
  let price = undefined;
1848
1849
  let amount = undefined;
1850
+ let cost = undefined;
1849
1851
  let triggerPrice = undefined;
1850
1852
  if (orderDescription !== undefined) {
1851
1853
  const parts = orderDescription.split(' ');
1852
1854
  side = this.safeString(parts, 0);
1853
- amount = this.safeString(parts, 1);
1855
+ if (!isUsingCost) {
1856
+ amount = this.safeString(parts, 1);
1857
+ }
1858
+ else {
1859
+ cost = this.safeString(parts, 1);
1860
+ }
1854
1861
  marketId = this.safeString(parts, 2);
1855
1862
  const part4 = this.safeString(parts, 4);
1856
1863
  const part5 = this.safeString(parts, 5);
@@ -1887,15 +1894,13 @@ class kraken extends kraken$1 {
1887
1894
  // kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
1888
1895
  // const cost = this.safeString (order, 'cost');
1889
1896
  price = this.safeString(description, 'price', price);
1890
- // when type = trailling stop returns price = '+50.0000%'
1891
- if ((price !== undefined) && price.endsWith('%')) {
1897
+ // when type = trailing stop returns price = '+50.0000%'
1898
+ if ((price !== undefined) && (price.endsWith('%') || Precise["default"].stringEquals(price, '0.00000') || Precise["default"].stringEquals(price, '0'))) {
1892
1899
  price = undefined; // this is not the price we want
1893
1900
  }
1894
- if ((price === undefined) || Precise["default"].stringEquals(price, '0')) {
1901
+ if (price === undefined) {
1895
1902
  price = this.safeString(description, 'price2');
1896
- }
1897
- if ((price === undefined) || Precise["default"].stringEquals(price, '0')) {
1898
- price = this.safeString(order, 'price', price);
1903
+ price = this.safeString2(order, 'limitprice', 'price', price);
1899
1904
  }
1900
1905
  const flags = this.safeString(order, 'oflags', '');
1901
1906
  let isPostOnly = flags.indexOf('post') > -1;
@@ -1917,7 +1922,7 @@ class kraken extends kraken$1 {
1917
1922
  }
1918
1923
  }
1919
1924
  const status = this.parseOrderStatus(this.safeString(order, 'status'));
1920
- let id = this.safeStringN(order, ['id', 'txid', 'amend_id']);
1925
+ let id = this.safeStringN(order, ['id', 'txid', 'order_id', 'amend_id']);
1921
1926
  if ((id === undefined) || (id.startsWith('['))) {
1922
1927
  const txid = this.safeList(order, 'txid');
1923
1928
  id = this.safeString(txid, 0);
@@ -1985,7 +1990,7 @@ class kraken extends kraken$1 {
1985
1990
  'triggerPrice': triggerPrice,
1986
1991
  'takeProfitPrice': takeProfitPrice,
1987
1992
  'stopLossPrice': stopLossPrice,
1988
- 'cost': undefined,
1993
+ 'cost': cost,
1989
1994
  'amount': amount,
1990
1995
  'filled': filled,
1991
1996
  'average': average,