ccxt 4.5.56 → 4.5.57

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 (261) hide show
  1. package/README.md +10 -9
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -11
  4. package/dist/cjs/src/apex.js +1 -1
  5. package/dist/cjs/src/arkham.js +3 -3
  6. package/dist/cjs/src/ascendex.js +2 -2
  7. package/dist/cjs/src/aster.js +7 -4
  8. package/dist/cjs/src/backpack.js +4 -4
  9. package/dist/cjs/src/base/Exchange.js +69 -32
  10. package/dist/cjs/src/base/functions/io.js +25 -0
  11. package/dist/cjs/src/base/functions.js +1 -0
  12. package/dist/cjs/src/bigone.js +3 -3
  13. package/dist/cjs/src/binance.js +192 -194
  14. package/dist/cjs/src/bingx.js +3 -3
  15. package/dist/cjs/src/bitfinex.js +71 -58
  16. package/dist/cjs/src/bitget.js +2 -2
  17. package/dist/cjs/src/bitmart.js +13 -6
  18. package/dist/cjs/src/bitmex.js +1 -1
  19. package/dist/cjs/src/bitopro.js +1 -1
  20. package/dist/cjs/src/bitrue.js +2 -2
  21. package/dist/cjs/src/bitso.js +1 -1
  22. package/dist/cjs/src/bitstamp.js +2 -1
  23. package/dist/cjs/src/bitteam.js +1 -1
  24. package/dist/cjs/src/bittrade.js +0 -1
  25. package/dist/cjs/src/bitvavo.js +457 -34
  26. package/dist/cjs/src/blofin.js +26 -3
  27. package/dist/cjs/src/bullish.js +6 -5
  28. package/dist/cjs/src/bydfi.js +1 -1
  29. package/dist/cjs/src/cex.js +3 -3
  30. package/dist/cjs/src/coinbase.js +75 -65
  31. package/dist/cjs/src/coinbaseexchange.js +2 -2
  32. package/dist/cjs/src/coinbaseinternational.js +2 -1
  33. package/dist/cjs/src/coinex.js +74 -74
  34. package/dist/cjs/src/coinmetro.js +1 -1
  35. package/dist/cjs/src/coinsph.js +1 -1
  36. package/dist/cjs/src/cryptocom.js +46 -48
  37. package/dist/cjs/src/cryptomus.js +43 -39
  38. package/dist/cjs/src/deepcoin.js +3 -2
  39. package/dist/cjs/src/delta.js +51 -52
  40. package/dist/cjs/src/deribit.js +31 -33
  41. package/dist/cjs/src/derive.js +26 -28
  42. package/dist/cjs/src/digifinex.js +43 -44
  43. package/dist/cjs/src/exmo.js +92 -83
  44. package/dist/cjs/src/extended.js +3497 -0
  45. package/dist/cjs/src/foxbit.js +71 -75
  46. package/dist/cjs/src/gate.js +53 -53
  47. package/dist/cjs/src/gemini.js +41 -43
  48. package/dist/cjs/src/grvt.js +4 -4
  49. package/dist/cjs/src/hashkey.js +52 -54
  50. package/dist/cjs/src/hitbtc.js +3 -13
  51. package/dist/cjs/src/hollaex.js +51 -54
  52. package/dist/cjs/src/htx.js +75 -67
  53. package/dist/cjs/src/hyperliquid.js +41 -42
  54. package/dist/cjs/src/indodax.js +2 -2
  55. package/dist/cjs/src/kraken.js +57 -58
  56. package/dist/cjs/src/kucoin.js +3 -2
  57. package/dist/cjs/src/latoken.js +30 -32
  58. package/dist/cjs/src/lbank.js +56 -56
  59. package/dist/cjs/src/lighter.js +35 -37
  60. package/dist/cjs/src/luno.js +35 -43
  61. package/dist/cjs/src/mexc.js +48 -49
  62. package/dist/cjs/src/modetrade.js +50 -52
  63. package/dist/cjs/src/ndax.js +35 -37
  64. package/dist/cjs/src/okx.js +17 -2
  65. package/dist/cjs/src/onetrading.js +21 -23
  66. package/dist/cjs/src/phemex.js +43 -45
  67. package/dist/cjs/src/poloniex.js +17 -12
  68. package/dist/cjs/src/pro/alpaca.js +1 -1
  69. package/dist/cjs/src/pro/apex.js +1 -1
  70. package/dist/cjs/src/pro/arkham.js +1 -1
  71. package/dist/cjs/src/pro/backpack.js +1 -1
  72. package/dist/cjs/src/pro/binance.js +3 -3
  73. package/dist/cjs/src/pro/bitget.js +1 -1
  74. package/dist/cjs/src/pro/bithumb.js +1 -1
  75. package/dist/cjs/src/pro/bitstamp.js +1 -1
  76. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  77. package/dist/cjs/src/pro/bybit.js +1 -1
  78. package/dist/cjs/src/pro/cex.js +1 -1
  79. package/dist/cjs/src/pro/coinex.js +1 -1
  80. package/dist/cjs/src/pro/coinone.js +1 -1
  81. package/dist/cjs/src/pro/cryptocom.js +3 -1
  82. package/dist/cjs/src/pro/dydx.js +1 -1
  83. package/dist/cjs/src/pro/exmo.js +1 -1
  84. package/dist/cjs/src/pro/extended.js +865 -0
  85. package/dist/cjs/src/pro/gate.js +1 -1
  86. package/dist/cjs/src/pro/independentreserve.js +1 -1
  87. package/dist/cjs/src/pro/kucoin.js +1 -1
  88. package/dist/cjs/src/pro/luno.js +3 -3
  89. package/dist/cjs/src/pro/onetrading.js +1 -1
  90. package/dist/cjs/src/pro/toobit.js +1 -1
  91. package/dist/cjs/src/pro/weex.js +1 -1
  92. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
  93. package/dist/cjs/src/tokocrypto.js +1 -1
  94. package/dist/cjs/src/toobit.js +2 -2
  95. package/dist/cjs/src/upbit.js +3 -3
  96. package/dist/cjs/src/weex.js +57 -62
  97. package/dist/cjs/src/whitebit.js +61 -63
  98. package/dist/cjs/src/woo.js +65 -54
  99. package/dist/cjs/src/woofipro.js +53 -47
  100. package/dist/cjs/src/xt.js +1 -1
  101. package/dist/cjs/src/zebpay.js +70 -72
  102. package/js/ccxt.d.ts +8 -14
  103. package/js/ccxt.js +6 -10
  104. package/js/src/abstract/bitvavo.d.ts +15 -7
  105. package/js/src/abstract/extended.d.ts +58 -0
  106. package/js/src/apex.js +1 -1
  107. package/js/src/arkham.js +3 -3
  108. package/js/src/ascendex.js +2 -2
  109. package/js/src/aster.js +7 -4
  110. package/js/src/backpack.js +4 -4
  111. package/js/src/base/Exchange.d.ts +10 -6
  112. package/js/src/base/Exchange.js +69 -32
  113. package/js/src/base/functions/io.d.ts +7 -0
  114. package/js/src/base/functions/io.js +24 -0
  115. package/js/src/bigone.js +3 -3
  116. package/js/src/binance.d.ts +2 -0
  117. package/js/src/binance.js +196 -198
  118. package/js/src/bingx.js +3 -3
  119. package/js/src/bitfinex.d.ts +2 -0
  120. package/js/src/bitfinex.js +71 -58
  121. package/js/src/bitget.js +2 -2
  122. package/js/src/bitmart.js +13 -6
  123. package/js/src/bitmex.js +1 -1
  124. package/js/src/bitopro.js +1 -1
  125. package/js/src/bitrue.js +2 -2
  126. package/js/src/bitso.js +1 -1
  127. package/js/src/bitstamp.js +2 -1
  128. package/js/src/bitteam.js +1 -1
  129. package/js/src/bittrade.js +0 -1
  130. package/js/src/bitvavo.d.ts +114 -21
  131. package/js/src/bitvavo.js +457 -34
  132. package/js/src/blofin.d.ts +1 -0
  133. package/js/src/blofin.js +26 -3
  134. package/js/src/bullish.js +6 -5
  135. package/js/src/bydfi.js +1 -1
  136. package/js/src/cex.js +3 -3
  137. package/js/src/coinbase.d.ts +63 -56
  138. package/js/src/coinbase.js +75 -65
  139. package/js/src/coinbaseexchange.js +2 -2
  140. package/js/src/coinbaseinternational.js +2 -1
  141. package/js/src/coinex.d.ts +1 -0
  142. package/js/src/coinex.js +74 -74
  143. package/js/src/coinmetro.d.ts +1 -1
  144. package/js/src/coinmetro.js +1 -1
  145. package/js/src/coinsph.js +1 -1
  146. package/js/src/cryptocom.d.ts +1 -0
  147. package/js/src/cryptocom.js +46 -48
  148. package/js/src/cryptomus.d.ts +2 -1
  149. package/js/src/cryptomus.js +43 -39
  150. package/js/src/deepcoin.js +3 -2
  151. package/js/src/delta.d.ts +1 -0
  152. package/js/src/delta.js +51 -52
  153. package/js/src/deribit.d.ts +1 -0
  154. package/js/src/deribit.js +31 -33
  155. package/js/src/derive.d.ts +1 -0
  156. package/js/src/derive.js +26 -28
  157. package/js/src/digifinex.d.ts +1 -0
  158. package/js/src/digifinex.js +43 -44
  159. package/js/src/exmo.d.ts +1 -0
  160. package/js/src/exmo.js +92 -83
  161. package/js/src/extended.d.ts +554 -0
  162. package/js/src/extended.js +3490 -0
  163. package/js/src/foxbit.d.ts +1 -0
  164. package/js/src/foxbit.js +71 -75
  165. package/js/src/gate.d.ts +1 -0
  166. package/js/src/gate.js +53 -53
  167. package/js/src/gemini.d.ts +2 -1
  168. package/js/src/gemini.js +41 -43
  169. package/js/src/grvt.js +4 -4
  170. package/js/src/hashkey.d.ts +1 -0
  171. package/js/src/hashkey.js +52 -54
  172. package/js/src/hitbtc.d.ts +0 -1
  173. package/js/src/hitbtc.js +3 -13
  174. package/js/src/hollaex.d.ts +1 -0
  175. package/js/src/hollaex.js +51 -54
  176. package/js/src/htx.d.ts +1 -0
  177. package/js/src/htx.js +75 -67
  178. package/js/src/hyperliquid.d.ts +1 -0
  179. package/js/src/hyperliquid.js +41 -42
  180. package/js/src/indodax.js +2 -2
  181. package/js/src/kraken.d.ts +2 -1
  182. package/js/src/kraken.js +57 -58
  183. package/js/src/kucoin.js +3 -2
  184. package/js/src/latoken.d.ts +1 -0
  185. package/js/src/latoken.js +30 -32
  186. package/js/src/lbank.d.ts +1 -0
  187. package/js/src/lbank.js +56 -56
  188. package/js/src/lighter.d.ts +1 -0
  189. package/js/src/lighter.js +35 -37
  190. package/js/src/luno.d.ts +1 -0
  191. package/js/src/luno.js +35 -43
  192. package/js/src/mexc.d.ts +2 -1
  193. package/js/src/mexc.js +48 -49
  194. package/js/src/modetrade.d.ts +1 -0
  195. package/js/src/modetrade.js +50 -52
  196. package/js/src/ndax.d.ts +1 -0
  197. package/js/src/ndax.js +35 -37
  198. package/js/src/okx.js +17 -2
  199. package/js/src/onetrading.d.ts +2 -1
  200. package/js/src/onetrading.js +21 -23
  201. package/js/src/phemex.d.ts +1 -0
  202. package/js/src/phemex.js +43 -45
  203. package/js/src/poloniex.js +17 -12
  204. package/js/src/pro/alpaca.js +1 -1
  205. package/js/src/pro/apex.js +1 -1
  206. package/js/src/pro/arkham.js +1 -1
  207. package/js/src/pro/backpack.js +1 -1
  208. package/js/src/pro/binance.js +3 -3
  209. package/js/src/pro/bitget.js +1 -1
  210. package/js/src/pro/bithumb.js +1 -1
  211. package/js/src/pro/bitstamp.js +1 -1
  212. package/js/src/pro/blockchaincom.js +1 -1
  213. package/js/src/pro/bybit.js +1 -1
  214. package/js/src/pro/cex.js +1 -1
  215. package/js/src/pro/coinex.js +1 -1
  216. package/js/src/pro/coinone.js +1 -1
  217. package/js/src/pro/cryptocom.js +3 -1
  218. package/js/src/pro/dydx.js +1 -1
  219. package/js/src/pro/exmo.js +1 -1
  220. package/js/src/pro/extended.d.ts +126 -0
  221. package/js/src/pro/extended.js +858 -0
  222. package/js/src/pro/gate.js +1 -1
  223. package/js/src/pro/independentreserve.js +1 -1
  224. package/js/src/pro/kucoin.js +1 -1
  225. package/js/src/pro/luno.d.ts +1 -1
  226. package/js/src/pro/luno.js +3 -3
  227. package/js/src/pro/onetrading.js +1 -1
  228. package/js/src/pro/toobit.js +1 -1
  229. package/js/src/pro/weex.js +1 -1
  230. package/js/src/tokocrypto.js +1 -1
  231. package/js/src/toobit.js +2 -2
  232. package/js/src/upbit.js +3 -3
  233. package/js/src/weex.d.ts +1 -0
  234. package/js/src/weex.js +57 -62
  235. package/js/src/whitebit.d.ts +1 -0
  236. package/js/src/whitebit.js +61 -63
  237. package/js/src/woo.d.ts +1 -0
  238. package/js/src/woo.js +65 -54
  239. package/js/src/woofipro.d.ts +1 -0
  240. package/js/src/woofipro.js +53 -47
  241. package/js/src/xt.js +1 -1
  242. package/js/src/zebpay.d.ts +2 -1
  243. package/js/src/zebpay.js +70 -72
  244. package/package.json +7 -7
  245. package/dist/cjs/src/gateio.js +0 -18
  246. package/dist/cjs/src/oxfun.js +0 -2933
  247. package/dist/cjs/src/pro/gateio.js +0 -18
  248. package/dist/cjs/src/pro/oxfun.js +0 -1113
  249. package/js/src/abstract/gateio.d.ts +0 -346
  250. package/js/src/abstract/gateio.js +0 -5
  251. package/js/src/abstract/oxfun.d.ts +0 -37
  252. package/js/src/gateio.d.ts +0 -4
  253. package/js/src/gateio.js +0 -11
  254. package/js/src/oxfun.d.ts +0 -442
  255. package/js/src/oxfun.js +0 -2926
  256. package/js/src/pro/gateio.d.ts +0 -4
  257. package/js/src/pro/gateio.js +0 -11
  258. package/js/src/pro/oxfun.d.ts +0 -234
  259. package/js/src/pro/oxfun.js +0 -1106
  260. /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
  261. /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
@@ -51,6 +51,7 @@ export default class woofipro extends Exchange {
51
51
  * @returns {object} an associative dictionary of currencies
52
52
  */
53
53
  fetchCurrencies(params?: {}): Promise<Currencies>;
54
+ parseCurrency(rawCurrency: Dict): Currency;
54
55
  parseTokenAndFeeTemp(item: any, feeTokenKey: any, feeAmountKey: any): any;
55
56
  parseTrade(trade: Dict, market?: Market): Trade;
56
57
  /**
@@ -685,61 +685,67 @@ export default class woofipro extends Exchange {
685
685
  const indexedChains = this.indexBy(chainRows, 'chain_id');
686
686
  for (let i = 0; i < tokenRows.length; i++) {
687
687
  const token = tokenRows[i];
688
- const currencyId = this.safeString(token, 'token');
689
- const networks = this.safeList(token, 'chain_details');
690
- const code = this.safeCurrencyCode(currencyId);
691
- const resultingNetworks = {};
692
- for (let j = 0; j < networks.length; j++) {
693
- const networkEntry = networks[j];
694
- const networkId = this.safeString(networkEntry, 'chain_id');
695
- const networkRow = this.safeDict(indexedChains, networkId);
696
- const networkName = this.safeString(networkRow, 'name');
697
- const networkCode = this.networkIdToCode(networkName, code);
698
- resultingNetworks[networkCode] = {
699
- 'id': networkId,
700
- 'network': networkCode,
701
- 'limits': {
702
- 'withdraw': {
703
- 'min': undefined,
704
- 'max': undefined,
705
- },
706
- 'deposit': {
707
- 'min': undefined,
708
- 'max': undefined,
709
- },
710
- },
711
- 'active': undefined,
712
- 'deposit': undefined,
713
- 'withdraw': undefined,
714
- 'fee': this.safeNumber(networkEntry, 'withdrawal_fee'),
715
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'decimals'))),
716
- 'info': [networkEntry, networkRow],
717
- };
718
- }
719
- result[code] = this.safeCurrencyStructure({
720
- 'id': currencyId,
721
- 'name': undefined,
722
- 'code': code,
723
- 'precision': undefined,
724
- 'active': undefined,
725
- 'fee': undefined,
726
- 'networks': resultingNetworks,
727
- 'deposit': undefined,
728
- 'withdraw': undefined,
688
+ const parsed = this.parseCurrency({ '_token': token, '_indexedChains': indexedChains });
689
+ result[parsed['code']] = parsed;
690
+ }
691
+ return result;
692
+ }
693
+ parseCurrency(rawCurrency) {
694
+ const token = this.safeDict(rawCurrency, '_token', {});
695
+ const currencyId = this.safeString(token, 'token');
696
+ const networks = this.safeList(token, 'chain_details');
697
+ const code = this.safeCurrencyCode(currencyId);
698
+ const indexedChains = this.safeDict(rawCurrency, '_indexedChains', {});
699
+ const resultingNetworks = {};
700
+ for (let j = 0; j < networks.length; j++) {
701
+ const networkEntry = networks[j];
702
+ const networkId = this.safeString(networkEntry, 'chain_id');
703
+ const networkRow = this.safeDict(indexedChains, networkId);
704
+ const networkName = this.safeString(networkRow, 'name');
705
+ const networkCode = this.networkIdToCode(networkName, code);
706
+ resultingNetworks[networkCode] = {
707
+ 'id': networkId,
708
+ 'network': networkCode,
729
709
  'limits': {
730
- 'deposit': {
710
+ 'withdraw': {
731
711
  'min': undefined,
732
712
  'max': undefined,
733
713
  },
734
- 'withdraw': {
735
- 'min': this.safeNumber(token, 'minimum_withdraw_amount'),
714
+ 'deposit': {
715
+ 'min': undefined,
736
716
  'max': undefined,
737
717
  },
738
718
  },
739
- 'info': token,
740
- });
719
+ 'active': undefined,
720
+ 'deposit': undefined,
721
+ 'withdraw': undefined,
722
+ 'fee': this.safeNumber(networkEntry, 'withdrawal_fee'),
723
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'decimals'))),
724
+ 'info': { 'network': networkEntry, 'networkRow': networkRow },
725
+ };
741
726
  }
742
- return result;
727
+ return this.safeCurrencyStructure({
728
+ 'id': currencyId,
729
+ 'name': undefined,
730
+ 'code': code,
731
+ 'precision': undefined,
732
+ 'active': undefined,
733
+ 'fee': undefined,
734
+ 'networks': resultingNetworks,
735
+ 'deposit': undefined,
736
+ 'withdraw': undefined,
737
+ 'limits': {
738
+ 'deposit': {
739
+ 'min': undefined,
740
+ 'max': undefined,
741
+ },
742
+ 'withdraw': {
743
+ 'min': this.safeNumber(token, 'minimum_withdraw_amount'),
744
+ 'max': undefined,
745
+ },
746
+ },
747
+ 'info': token,
748
+ });
743
749
  }
744
750
  parseTokenAndFeeTemp(item, feeTokenKey, feeAmountKey) {
745
751
  const feeCost = this.safeString(item, feeAmountKey);
package/js/src/xt.js CHANGED
@@ -564,10 +564,10 @@ export default class xt extends Exchange {
564
564
  'networks': {
565
565
  'ERC20': 'Ethereum',
566
566
  'TRC20': 'Tron',
567
+ 'TRX': 'Tron',
567
568
  'BEP20': 'BNB Smart Chain',
568
569
  'BEP2': 'BNB-BEP2',
569
570
  'ETH': 'Ethereum',
570
- 'TRON': 'Tron',
571
571
  'BNB': 'BNB Smart Chain',
572
572
  'AVAX': 'AVAX C-Chain',
573
573
  'GAL': 'GAL(FT)',
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/zebpay.js';
2
- import type { Balances, Currencies, Dict, Int, int, Leverage, Leverages, MarginModification, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees } from './base/types.js';
2
+ import type { Balances, Currencies, Currency, Dict, Int, int, Leverage, Leverages, MarginModification, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees } from './base/types.js';
3
3
  /**
4
4
  * @class
5
5
  * @augments Exchange
@@ -51,6 +51,7 @@ export default class zebpay extends Exchange {
51
51
  * @returns {object} an associative dictionary of currencies
52
52
  */
53
53
  fetchCurrencies(params?: {}): Promise<Currencies>;
54
+ parseCurrency(rawCurrency: Dict): Currency;
54
55
  /**
55
56
  * @method
56
57
  * @name zebpay#fetchTradingFee
package/js/src/zebpay.js CHANGED
@@ -363,89 +363,87 @@ export default class zebpay extends Exchange {
363
363
  // }
364
364
  //
365
365
  const rows = this.safeList(response, 'data', []);
366
- const result = {};
367
- for (let i = 0; i < rows.length; i++) {
368
- const currency = rows[i];
369
- const currencyId = this.safeString(currency, 'currency');
370
- const code = this.safeCurrencyCode(currencyId);
371
- const name = this.safeString(currency, 'name');
372
- const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision')));
373
- const chains = this.safeList(currency, 'chains', []);
374
- const networks = {};
375
- let minWithdrawFeeString = undefined;
376
- let minWithdrawString = undefined;
377
- let minDepositString = undefined;
378
- let deposit = false;
379
- let withdraw = false;
380
- for (let j = 0; j < chains.length; j++) {
381
- const chain = chains[j];
382
- const networkId = this.safeString(chain, 'chainId');
383
- const networkCode = this.networkIdToCode(networkId);
384
- const depositAllowed = this.safeBool(chain, 'isDepositEnabled') === true;
385
- deposit = (depositAllowed) ? depositAllowed : deposit;
386
- const withdrawAllowed = this.safeBool(chain, 'isWithdrawEnabled') === true;
387
- withdraw = (withdrawAllowed) ? withdrawAllowed : withdraw;
388
- const withdrawFeeString = this.safeString(chain, 'withdrawalFee');
389
- if (withdrawFeeString !== undefined) {
390
- minWithdrawFeeString = (minWithdrawFeeString === undefined) ? withdrawFeeString : Precise.stringMin(withdrawFeeString, minWithdrawFeeString);
391
- }
392
- const minNetworkWithdrawString = this.safeString(chain, 'withdrawalMinSize');
393
- if (minNetworkWithdrawString !== undefined) {
394
- minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise.stringMin(minNetworkWithdrawString, minWithdrawString);
395
- }
396
- const minNetworkDepositString = this.safeString(chain, 'depositMinSize');
397
- if (minNetworkDepositString !== undefined) {
398
- minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise.stringMin(minNetworkDepositString, minDepositString);
399
- }
400
- networks[networkCode] = {
401
- 'info': chain,
402
- 'id': networkId,
403
- 'network': networkCode,
404
- 'active': depositAllowed && withdrawAllowed,
405
- 'deposit': depositAllowed,
406
- 'withdraw': withdrawAllowed,
407
- 'fee': this.parseNumber(withdrawFeeString),
408
- 'precision': precision,
409
- 'limits': {
410
- 'withdraw': {
411
- 'min': this.parseNumber(minNetworkWithdrawString),
412
- 'max': undefined,
413
- },
414
- 'deposit': {
415
- 'min': this.parseNumber(minNetworkDepositString),
416
- 'max': undefined,
417
- },
418
- },
419
- };
366
+ return this.parseCurrencies(rows);
367
+ }
368
+ parseCurrency(rawCurrency) {
369
+ const currencyId = this.safeString(rawCurrency, 'currency');
370
+ const code = this.safeCurrencyCode(currencyId);
371
+ const name = this.safeString(rawCurrency, 'name');
372
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision')));
373
+ const chains = this.safeList(rawCurrency, 'chains', []);
374
+ const networks = {};
375
+ let minWithdrawFeeString = undefined;
376
+ let minWithdrawString = undefined;
377
+ let minDepositString = undefined;
378
+ let deposit = false;
379
+ let withdraw = false;
380
+ for (let j = 0; j < chains.length; j++) {
381
+ const chain = chains[j];
382
+ const networkId = this.safeString(chain, 'chainId');
383
+ const networkCode = this.networkIdToCode(networkId, code);
384
+ const depositAllowed = this.safeBool(chain, 'isDepositEnabled') === true;
385
+ deposit = (depositAllowed) ? depositAllowed : deposit;
386
+ const withdrawAllowed = this.safeBool(chain, 'isWithdrawEnabled') === true;
387
+ withdraw = (withdrawAllowed) ? withdrawAllowed : withdraw;
388
+ const withdrawFeeString = this.safeString(chain, 'withdrawalFee');
389
+ if (withdrawFeeString !== undefined) {
390
+ minWithdrawFeeString = (minWithdrawFeeString === undefined) ? withdrawFeeString : Precise.stringMin(withdrawFeeString, minWithdrawFeeString);
391
+ }
392
+ const minNetworkWithdrawString = this.safeString(chain, 'withdrawalMinSize');
393
+ if (minNetworkWithdrawString !== undefined) {
394
+ minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise.stringMin(minNetworkWithdrawString, minWithdrawString);
395
+ }
396
+ const minNetworkDepositString = this.safeString(chain, 'depositMinSize');
397
+ if (minNetworkDepositString !== undefined) {
398
+ minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise.stringMin(minNetworkDepositString, minDepositString);
420
399
  }
421
- result[code] = this.safeCurrencyStructure({
422
- 'info': currency,
423
- 'code': code,
424
- 'id': currencyId,
425
- 'name': name,
426
- 'active': deposit && withdraw,
427
- 'deposit': deposit,
428
- 'withdraw': withdraw,
429
- 'fee': this.parseNumber(minWithdrawFeeString),
400
+ networks[networkCode] = {
401
+ 'info': chain,
402
+ 'id': networkId,
403
+ 'network': networkCode,
404
+ 'active': depositAllowed && withdrawAllowed,
405
+ 'deposit': depositAllowed,
406
+ 'withdraw': withdrawAllowed,
407
+ 'fee': this.parseNumber(withdrawFeeString),
430
408
  'precision': precision,
431
409
  'limits': {
432
- 'amount': {
433
- 'min': undefined,
434
- 'max': undefined,
435
- },
436
410
  'withdraw': {
437
- 'min': this.parseNumber(minWithdrawString),
411
+ 'min': this.parseNumber(minNetworkWithdrawString),
438
412
  'max': undefined,
439
413
  },
440
414
  'deposit': {
441
- 'min': this.parseNumber(minDepositString),
415
+ 'min': this.parseNumber(minNetworkDepositString),
442
416
  'max': undefined,
443
417
  },
444
418
  },
445
- 'networks': networks,
446
- });
419
+ };
447
420
  }
448
- return result;
421
+ return this.safeCurrencyStructure({
422
+ 'info': rawCurrency,
423
+ 'code': code,
424
+ 'id': currencyId,
425
+ 'name': name,
426
+ 'active': deposit && withdraw,
427
+ 'deposit': deposit,
428
+ 'withdraw': withdraw,
429
+ 'fee': this.parseNumber(minWithdrawFeeString),
430
+ 'precision': precision,
431
+ 'limits': {
432
+ 'amount': {
433
+ 'min': undefined,
434
+ 'max': undefined,
435
+ },
436
+ 'withdraw': {
437
+ 'min': this.parseNumber(minWithdrawString),
438
+ 'max': undefined,
439
+ },
440
+ 'deposit': {
441
+ 'min': this.parseNumber(minDepositString),
442
+ 'max': undefined,
443
+ },
444
+ },
445
+ 'networks': networks,
446
+ });
449
447
  }
450
448
  /**
451
449
  * @method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.5.56",
3
+ "version": "4.5.57",
4
4
  "description": "A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "docker": "docker-compose run --rm ccxt",
37
37
  "fixTSBug": "node build/fixTSBug",
38
38
  "transpileCsSingle": "tsx build/csharpTranspiler.ts",
39
- "transpileJavaSingle": "tsx build/javaTranspiler.ts && tsx build/javaTranspiler.ts --ws && tsx build/generateJavaWrappers.ts",
39
+ "transpileJavaSingle": "tsx build/javaTranspiler.ts",
40
40
  "transpileCS": "tsx build/csharpTranspiler.ts --multi",
41
41
  "transpileJava": "tsx build/javaTranspiler.ts --multi && tsx build/javaTranspiler.ts --ws && tsx build/generateJavaWrappers.ts",
42
42
  "transpileJavaWs": "tsx build/javaTranspiler.ts --ws",
@@ -166,10 +166,9 @@
166
166
  "request-php": "npm run request-php-sync && npm run request-php-async",
167
167
  "request-cs": "npm run ti-cs -- --requestTests",
168
168
  "request-java": "./java/gradlew -p java :tests:run -- --args=\"--requestTests\"",
169
- "response-java": "./java/gradlew -p java :tests:run -- --args=\"--responseTests\"",
170
169
  "request-go": "npm run ti-go -- --requestTests",
171
170
  "request-tests//withoutGo": "npm run request-js && npm run request-py && npm run request-php && npm run request-cs",
172
- "request-tests": "npm run request-js && npm run request-py && npm run request-php && npm run request-cs && npm run request-go",
171
+ "request-tests": "npm run request-js && npm run request-py && npm run request-php && npm run request-cs && npm run request-go && npm run request-java",
173
172
  "response-ts": "npm run ti-ts -- --responseTests",
174
173
  "response-js": "npm run ti-js -- --responseTests",
175
174
  "response-py-sync": "npm run ti-py -- --responseTests --sync",
@@ -177,10 +176,11 @@
177
176
  "response-py": "npm run response-py-sync && npm run response-py-async",
178
177
  "response-cs": "npm run ti-cs -- --responseTests",
179
178
  "response-go": "npm run ti-go -- --responseTests",
179
+ "response-java": "./java/gradlew -p java :tests:run -- --args=\"--responseTests\"",
180
180
  "response-php-async": "npm run ti-php -- --responseTests",
181
181
  "response-php-sync": "npm run ti-php -- --responseTests --sync",
182
182
  "response-php": "npm run response-php-sync && npm run response-php-async",
183
- "response-tests": "npm run response-js && npm run response-py && npm run response-php && npm run response-cs && npm run response-go",
183
+ "response-tests": "npm run response-js && npm run response-py && npm run response-php && npm run response-cs && npm run response-go && npm run response-java",
184
184
  "response-tests//withoutGo": "npm run response-js && npm run response-py && npm run response-php && npm run response-cs",
185
185
  "static-updater": "tsx ./utils/update-static-json --update",
186
186
  "id-tests-js": "npm run ti-js -- --idTests",
@@ -189,7 +189,7 @@
189
189
  "id-tests-cs": "npm run ti-cs -- --idTests",
190
190
  "id-tests-go": "npm run ti-go -- --idTests",
191
191
  "id-tests-java": "cd java/ && ./gradlew :tests:run -- --args=\"--idTests\" && cd ../",
192
- "id-tests": "npm run id-tests-js && npm run id-tests-py && npm run id-tests-php && npm run id-tests-cs",
192
+ "id-tests": "npm run id-tests-js && npm run id-tests-py && npm run id-tests-php && npm run id-tests-cs && npm run id-tests-go && npm run id-tests-java",
193
193
  "id-tests//withGO": "npm run id-tests-js && npm run id-tests-py && npm run id-tests-php && npm run id-tests-cs && npm run id-tests-go",
194
194
  "test-base-rest-ts": "npm run ti-ts -- --baseTests",
195
195
  "test-base-rest-js": "npm run ti-js -- --baseTests",
@@ -204,7 +204,7 @@
204
204
  "test-base-ws-php": "npm run ti-php -- --baseTests --ws",
205
205
  "test-base-ws-cs": "npm run ti-cs -- --baseTests --ws",
206
206
  "test-base-ws-go": "npm run ti-go -- --baseTests --ws",
207
- "test-base-rest": "npm run test-base-rest-js && npm run test-base-rest-py && npm run test-base-rest-php && npm run test-base-rest-cs",
207
+ "test-base-rest": "npm run test-base-rest-js && npm run test-base-rest-py && npm run test-base-rest-php && npm run test-base-rest-cs && npm run test-base-rest-go && npm run test-base-rest-java",
208
208
  "test-base-ws": "npm run test-base-ws-js && npm run test-base-ws-py && npm run test-base-ws-php && npm run test-base-ws-cs && npm run test-base-ws-go",
209
209
  "test": "npm run build && npm run commonjs-test && npm run id-tests && npm run request-tests && npm run response-tests && npm run live-tests",
210
210
  "commonjs-test": "node ./utils/test-commonjs.cjs",
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var gate = require('./gate.js');
6
-
7
- // ---------------------------------------------------------------------------
8
- // ---------------------------------------------------------------------------
9
- class gateio extends gate["default"] {
10
- describe() {
11
- return this.deepExtend(super.describe(), {
12
- 'id': 'gateio',
13
- 'alias': true,
14
- });
15
- }
16
- }
17
-
18
- exports["default"] = gateio;