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
@@ -26,6 +26,7 @@ export default class deribit extends Exchange {
26
26
  * @returns {object} an associative dictionary of currencies
27
27
  */
28
28
  fetchCurrencies(params?: {}): Promise<Currencies>;
29
+ parseCurrency(rawCurrency: Dict): Currency;
29
30
  codeFromOptions(methodName: any, params?: {}): any;
30
31
  /**
31
32
  * @method
package/js/src/deribit.js CHANGED
@@ -638,40 +638,38 @@ export default class deribit extends Exchange {
638
638
  // }
639
639
  //
640
640
  const data = this.safeList(response, 'result', []);
641
- const result = {};
642
- for (let i = 0; i < data.length; i++) {
643
- const currency = data[i];
644
- const currencyId = this.safeString(currency, 'currency');
645
- const code = this.safeCurrencyCode(currencyId);
646
- result[code] = this.safeCurrencyStructure({
647
- 'info': currency,
648
- 'code': code,
649
- 'id': currencyId,
650
- 'name': this.safeString(currency, 'currency_long'),
651
- 'active': undefined,
652
- 'deposit': undefined,
653
- 'withdraw': undefined,
654
- 'type': 'crypto',
655
- 'fee': this.safeNumber(currency, 'withdrawal_fee'),
656
- 'precision': undefined,
657
- 'limits': {
658
- 'amount': {
659
- 'min': undefined,
660
- 'max': undefined,
661
- },
662
- 'withdraw': {
663
- 'min': undefined,
664
- 'max': undefined,
665
- },
666
- 'deposit': {
667
- 'min': undefined,
668
- 'max': undefined,
669
- },
641
+ return this.parseCurrencies(data);
642
+ }
643
+ parseCurrency(rawCurrency) {
644
+ const currencyId = this.safeString(rawCurrency, 'currency');
645
+ const code = this.safeCurrencyCode(currencyId);
646
+ return this.safeCurrencyStructure({
647
+ 'info': rawCurrency,
648
+ 'code': code,
649
+ 'id': currencyId,
650
+ 'name': this.safeString(rawCurrency, 'currency_long'),
651
+ 'active': undefined,
652
+ 'deposit': undefined,
653
+ 'withdraw': undefined,
654
+ 'type': 'crypto',
655
+ 'fee': this.safeNumber(rawCurrency, 'withdrawal_fee'),
656
+ 'precision': undefined,
657
+ 'limits': {
658
+ 'amount': {
659
+ 'min': undefined,
660
+ 'max': undefined,
670
661
  },
671
- 'networks': undefined,
672
- });
673
- }
674
- return result;
662
+ 'withdraw': {
663
+ 'min': undefined,
664
+ 'max': undefined,
665
+ },
666
+ 'deposit': {
667
+ 'min': undefined,
668
+ 'max': undefined,
669
+ },
670
+ },
671
+ 'networks': undefined,
672
+ });
675
673
  }
676
674
  codeFromOptions(methodName, params = {}) {
677
675
  const defaultCode = this.safeValue(this.options, 'code', 'BTC');
@@ -25,6 +25,7 @@ export default class derive extends Exchange {
25
25
  * @returns {object} an associative dictionary of currencies
26
26
  */
27
27
  fetchCurrencies(params?: {}): Promise<Currencies>;
28
+ parseCurrency(rawCurrency: Dict): Currency;
28
29
  /**
29
30
  * @method
30
31
  * @name derive#fetchMarkets
package/js/src/derive.js CHANGED
@@ -445,7 +445,6 @@ export default class derive extends Exchange {
445
445
  * @returns {object} an associative dictionary of currencies
446
446
  */
447
447
  async fetchCurrencies(params = {}) {
448
- const result = {};
449
448
  const tokenResponse = await this.publicGetGetAllCurrencies(params);
450
449
  //
451
450
  // {
@@ -496,34 +495,33 @@ export default class derive extends Exchange {
496
495
  // }
497
496
  //
498
497
  const currencies = this.safeList(tokenResponse, 'result', []);
499
- for (let i = 0; i < currencies.length; i++) {
500
- const currency = currencies[i];
501
- const currencyId = this.safeString(currency, 'currency');
502
- const code = this.safeCurrencyCode(currencyId);
503
- result[code] = this.safeCurrencyStructure({
504
- 'id': currencyId,
505
- 'name': undefined,
506
- 'code': code,
507
- 'precision': undefined,
508
- 'active': undefined,
509
- 'fee': undefined,
510
- 'networks': undefined,
511
- 'deposit': undefined,
512
- 'withdraw': undefined,
513
- 'limits': {
514
- 'deposit': {
515
- 'min': undefined,
516
- 'max': undefined,
517
- },
518
- 'withdraw': {
519
- 'min': undefined,
520
- 'max': undefined,
521
- },
498
+ return this.parseCurrencies(currencies);
499
+ }
500
+ parseCurrency(rawCurrency) {
501
+ const currencyId = this.safeString(rawCurrency, 'currency');
502
+ const code = this.safeCurrencyCode(currencyId);
503
+ return this.safeCurrencyStructure({
504
+ 'id': currencyId,
505
+ 'name': undefined,
506
+ 'code': code,
507
+ 'precision': undefined,
508
+ 'active': undefined,
509
+ 'fee': undefined,
510
+ 'networks': undefined,
511
+ 'deposit': undefined,
512
+ 'withdraw': undefined,
513
+ 'limits': {
514
+ 'deposit': {
515
+ 'min': undefined,
516
+ 'max': undefined,
522
517
  },
523
- 'info': currency,
524
- });
525
- }
526
- return result;
518
+ 'withdraw': {
519
+ 'min': undefined,
520
+ 'max': undefined,
521
+ },
522
+ },
523
+ 'info': rawCurrency,
524
+ });
527
525
  }
528
526
  /**
529
527
  * @method
@@ -14,6 +14,7 @@ export default class digifinex extends Exchange {
14
14
  * @returns {object} an associative dictionary of currencies
15
15
  */
16
16
  fetchCurrencies(params?: {}): Promise<Currencies>;
17
+ parseCurrency(rawCurrency: Dict): Currency;
17
18
  /**
18
19
  * @method
19
20
  * @name digifinex#fetchMarkets
@@ -409,7 +409,7 @@ export default class digifinex extends Exchange {
409
409
  'OTC': '3',
410
410
  },
411
411
  'networks': {
412
- 'ARBITRUM': 'Arbitrum',
412
+ 'ARBONE': 'Arbitrum',
413
413
  'AVALANCEC': 'AVAX-CCHAIN',
414
414
  'AVALANCEX': 'AVAX-XCHAIN',
415
415
  'BEP20': 'BEP20',
@@ -426,20 +426,19 @@ export default class digifinex extends Exchange {
426
426
  'ETHW': 'ETHW',
427
427
  'IOTA': 'MIOTA',
428
428
  'KLAYTN': 'KLAY',
429
- 'MATIC': 'Polygon',
430
429
  'METIS': 'MetisDAO',
431
430
  'MOONBEAM': 'GLMR',
432
431
  'MOONRIVER': 'Moonriver',
433
432
  'OPTIMISM': 'OPETH',
434
433
  'POLYGON': 'Polygon',
434
+ 'MATIC': 'Polygon',
435
435
  'RIPPLE': 'XRP',
436
- 'SOLANA': 'SOL',
437
- 'STELLAR': 'Stella',
436
+ 'SOL': 'SOL',
437
+ 'XLM': 'Stella',
438
438
  'TERRACLASSIC': 'TerraClassic',
439
439
  'TERRA': 'Terra',
440
440
  'TON': 'Ton',
441
441
  'TRC20': 'TRC20',
442
- 'TRON': 'TRC20',
443
442
  'TRX': 'TRC20',
444
443
  'VECHAIN': 'Vechain', // VET
445
444
  },
@@ -514,46 +513,46 @@ export default class digifinex extends Exchange {
514
513
  //
515
514
  const data = this.safeList(response, 'data', []);
516
515
  const groupedById = this.groupBy(data, 'currency');
517
- const keys = Object.keys(groupedById);
518
- const result = {};
519
- for (let i = 0; i < keys.length; i++) {
520
- const id = keys[i];
521
- const networkEntries = groupedById[id];
522
- const code = this.safeCurrencyCode(id);
523
- const networks = {};
524
- for (let j = 0; j < networkEntries.length; j++) {
525
- const networkEntry = networkEntries[j];
526
- const networkId = this.safeString2(networkEntry, 'chain', 'currency');
527
- const networkCode = this.networkIdToCode(networkId);
528
- networks[networkCode] = {
529
- 'id': networkId,
530
- 'network': networkCode,
531
- 'active': undefined,
532
- 'deposit': this.safeInteger(networkEntry, 'deposit_status') === 1,
533
- 'withdraw': this.safeInteger(networkEntry, 'withdraw_status') === 1,
534
- 'fee': this.safeNumber(networkEntry, 'min_withdraw_fee'),
535
- 'precision': undefined,
536
- 'limits': {
537
- 'withdraw': {
538
- 'min': this.safeNumber(networkEntry, 'min_withdraw_amount'),
539
- 'max': undefined,
540
- },
541
- 'deposit': {
542
- 'min': this.safeNumber(networkEntry, 'min_deposit_amount'),
543
- 'max': undefined,
544
- },
516
+ const values = Object.values(groupedById);
517
+ return this.parseCurrencies(values);
518
+ }
519
+ parseCurrency(rawCurrency) {
520
+ const networkEntries = rawCurrency;
521
+ const firstEntry = this.safeDict(networkEntries, 0, {}); // it must have at least one entry
522
+ const id = this.safeString(firstEntry, 'currency');
523
+ const code = this.safeCurrencyCode(id);
524
+ const networks = {};
525
+ for (let j = 0; j < networkEntries.length; j++) {
526
+ const networkEntry = networkEntries[j];
527
+ const networkId = this.safeString2(networkEntry, 'chain', 'currency');
528
+ const networkCode = this.networkIdToCode(networkId, code);
529
+ networks[networkCode] = {
530
+ 'id': networkId,
531
+ 'network': networkCode,
532
+ 'active': undefined,
533
+ 'deposit': this.safeInteger(networkEntry, 'deposit_status') === 1,
534
+ 'withdraw': this.safeInteger(networkEntry, 'withdraw_status') === 1,
535
+ 'fee': this.safeNumber(networkEntry, 'min_withdraw_fee'),
536
+ 'precision': undefined,
537
+ 'limits': {
538
+ 'withdraw': {
539
+ 'min': this.safeNumber(networkEntry, 'min_withdraw_amount'),
540
+ 'max': undefined,
545
541
  },
546
- 'info': networkEntry,
547
- };
548
- }
549
- result[code] = this.safeCurrencyStructure({
550
- 'id': id,
551
- 'code': code,
552
- 'info': networkEntries,
553
- 'networks': networks,
554
- });
542
+ 'deposit': {
543
+ 'min': this.safeNumber(networkEntry, 'min_deposit_amount'),
544
+ 'max': undefined,
545
+ },
546
+ },
547
+ 'info': networkEntry,
548
+ };
555
549
  }
556
- return result;
550
+ return this.safeCurrencyStructure({
551
+ 'id': id,
552
+ 'code': code,
553
+ 'info': networkEntries,
554
+ 'networks': networks,
555
+ });
557
556
  }
558
557
  /**
559
558
  * @method
@@ -4171,7 +4170,7 @@ export default class digifinex extends Exchange {
4171
4170
  'percentage': undefined,
4172
4171
  };
4173
4172
  if (networkId !== undefined) {
4174
- const networkCode = this.networkIdToCode(networkId);
4173
+ const networkCode = this.networkIdToCode(networkId, code);
4175
4174
  depositWithdrawFees[code]['networks'][networkCode] = {
4176
4175
  'withdraw': withdrawResult,
4177
4176
  'deposit': depositResult,
package/js/src/exmo.d.ts CHANGED
@@ -75,6 +75,7 @@ export default class exmo extends Exchange {
75
75
  * @returns {object} an associative dictionary of currencies
76
76
  */
77
77
  fetchCurrencies(params?: {}): Promise<Currencies>;
78
+ parseCurrency(rawCurrency: Dict): Currency;
78
79
  /**
79
80
  * @method
80
81
  * @name exmo#fetchMarkets
package/js/src/exmo.js CHANGED
@@ -626,7 +626,10 @@ export default class exmo extends Exchange {
626
626
  const provider = fee[i];
627
627
  const type = this.safeString(provider, 'type');
628
628
  const networkId = this.safeString(provider, 'name');
629
- const networkCode = this.networkIdToCode(networkId, this.safeString(currency, 'code'));
629
+ const currencyId = this.safeString(provider, 'currency_name');
630
+ currency = this.safeCurrency(currencyId, currency);
631
+ const code = this.safeString(currency, 'code');
632
+ const networkCode = this.networkIdToCode(networkId, code);
630
633
  const commissionDesc = this.safeString(provider, 'commission_desc');
631
634
  let splitCommissionDesc = [];
632
635
  let percentage = undefined;
@@ -704,97 +707,103 @@ export default class exmo extends Exchange {
704
707
  const responses = await Promise.all(promises);
705
708
  const currencyList = responses[0];
706
709
  const cryptoList = responses[1];
707
- const result = {};
710
+ const newArray = [];
708
711
  for (let i = 0; i < currencyList.length; i++) {
709
712
  const currency = currencyList[i];
710
713
  const currencyId = this.safeString(currency, 'name');
711
- const code = this.safeCurrencyCode(currencyId);
712
- let type = 'crypto';
713
- const networks = {};
714
714
  const providers = this.safeList(cryptoList, currencyId);
715
- if (providers === undefined) {
716
- type = 'fiat';
717
- }
718
- else {
719
- for (let j = 0; j < providers.length; j++) {
720
- const provider = providers[j];
721
- const name = this.safeString(provider, 'name');
722
- // get network-id by removing extra things
723
- let networkId = name.replace(currencyId + ' ', '');
724
- networkId = networkId.replace('(', '');
725
- const replaceChar = ')'; // transpiler trick
726
- networkId = networkId.replace(replaceChar, '');
727
- const networkCode = this.networkIdToCode(networkId);
728
- if (!(networkCode in networks)) {
729
- networks[networkCode] = {
730
- 'id': networkId,
731
- 'network': networkCode,
732
- 'active': undefined,
733
- 'deposit': undefined,
734
- 'withdraw': undefined,
735
- 'fee': undefined,
736
- 'limits': {
737
- 'withdraw': {
738
- 'min': undefined,
739
- 'max': undefined,
740
- },
741
- 'deposit': {
742
- 'min': undefined,
743
- 'max': undefined,
744
- },
715
+ newArray.push({ 'currency': currency, 'providers': providers });
716
+ }
717
+ return this.parseCurrencies(newArray);
718
+ }
719
+ parseCurrency(rawCurrency) {
720
+ const currency = this.safeDict(rawCurrency, 'currency', {});
721
+ const providers = this.safeList(rawCurrency, 'providers', []);
722
+ const currencyId = this.safeString(currency, 'name');
723
+ const code = this.safeCurrencyCode(currencyId);
724
+ let type = 'crypto';
725
+ const networks = {};
726
+ if (providers === undefined) {
727
+ type = 'fiat';
728
+ }
729
+ else {
730
+ for (let j = 0; j < providers.length; j++) {
731
+ const provider = providers[j];
732
+ const name = this.safeString(provider, 'name');
733
+ // get network-id by removing extra things
734
+ let networkId = name.replace(currencyId + ' ', '');
735
+ networkId = networkId.replace('(', '');
736
+ const replaceChar = ')'; // transpiler trick
737
+ networkId = networkId.replace(replaceChar, '');
738
+ const networkCode = this.networkIdToCode(networkId, code);
739
+ if (!(networkCode in networks)) {
740
+ networks[networkCode] = {
741
+ 'id': networkId,
742
+ 'network': networkCode,
743
+ 'active': undefined,
744
+ 'deposit': undefined,
745
+ 'withdraw': undefined,
746
+ 'fee': undefined,
747
+ 'limits': {
748
+ 'withdraw': {
749
+ 'min': undefined,
750
+ 'max': undefined,
751
+ },
752
+ 'deposit': {
753
+ 'min': undefined,
754
+ 'max': undefined,
745
755
  },
746
- 'info': [], // set as array, because of multiple network sub-entries
747
- };
748
- }
749
- const typeInner = this.safeString(provider, 'type');
750
- const minValue = this.safeString(provider, 'min');
751
- const maxValue = this.safeString(provider, 'max');
752
- const activeProvider = this.safeBool(provider, 'enabled');
753
- const networkEntry = networks[networkCode];
754
- if (typeInner === 'deposit') {
755
- networkEntry['deposit'] = activeProvider;
756
- networkEntry['limits']['deposit']['min'] = minValue;
757
- networkEntry['limits']['deposit']['max'] = maxValue;
758
- }
759
- else if (typeInner === 'withdraw') {
760
- networkEntry['withdraw'] = activeProvider;
761
- networkEntry['limits']['withdraw']['min'] = minValue;
762
- networkEntry['limits']['withdraw']['max'] = maxValue;
763
- }
764
- const info = this.safeList(networkEntry, 'info');
765
- info.push(provider);
766
- networkEntry['info'] = info;
767
- networks[networkCode] = networkEntry;
756
+ },
757
+ 'info': [], // set as array, because of multiple network sub-entries
758
+ };
759
+ }
760
+ const typeInner = this.safeString(provider, 'type');
761
+ const minValue = this.safeString(provider, 'min');
762
+ const maxValue = this.safeString(provider, 'max');
763
+ const activeProvider = this.safeBool(provider, 'enabled');
764
+ const networkEntry = networks[networkCode];
765
+ if (typeInner === 'deposit') {
766
+ networkEntry['deposit'] = activeProvider;
767
+ networkEntry['limits']['deposit']['min'] = minValue;
768
+ networkEntry['limits']['deposit']['max'] = maxValue;
769
+ }
770
+ else if (typeInner === 'withdraw') {
771
+ networkEntry['withdraw'] = activeProvider;
772
+ networkEntry['limits']['withdraw']['min'] = minValue;
773
+ networkEntry['limits']['withdraw']['max'] = maxValue;
768
774
  }
775
+ const info = this.safeList(networkEntry, 'info');
776
+ info.push(provider);
777
+ networkEntry['info'] = info;
778
+ networks[networkCode] = networkEntry;
769
779
  }
770
- result[code] = this.safeCurrencyStructure({
771
- 'id': currencyId,
772
- 'code': code,
773
- 'name': this.safeString(currency, 'description'),
774
- 'type': type,
775
- 'active': undefined,
776
- 'deposit': undefined,
777
- 'withdraw': undefined,
778
- 'fee': undefined,
779
- 'precision': this.parseNumber('1e-8'),
780
- 'limits': {
781
- 'withdraw': {
782
- 'min': undefined,
783
- 'max': undefined,
784
- },
785
- 'deposit': {
786
- 'min': undefined,
787
- 'max': undefined,
788
- },
780
+ }
781
+ return this.safeCurrencyStructure({
782
+ 'id': currencyId,
783
+ 'code': code,
784
+ 'name': this.safeString(currency, 'description'),
785
+ 'type': type,
786
+ 'active': undefined,
787
+ 'deposit': undefined,
788
+ 'withdraw': undefined,
789
+ 'fee': undefined,
790
+ 'precision': this.parseNumber('1e-8'),
791
+ 'limits': {
792
+ 'withdraw': {
793
+ 'min': undefined,
794
+ 'max': undefined,
789
795
  },
790
- 'info': {
791
- 'currency': currency,
792
- 'providers': providers,
796
+ 'deposit': {
797
+ 'min': undefined,
798
+ 'max': undefined,
793
799
  },
794
- 'networks': networks,
795
- });
796
- }
797
- return result;
800
+ },
801
+ 'info': {
802
+ 'currency': currency,
803
+ 'providers': providers,
804
+ },
805
+ 'networks': networks,
806
+ });
798
807
  }
799
808
  /**
800
809
  * @method