ccxt 4.5.55 → 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 (321) hide show
  1. package/README.md +215 -10
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -11
  4. package/dist/cjs/src/aftermath.js +10 -5
  5. package/dist/cjs/src/alpaca.js +2 -2
  6. package/dist/cjs/src/apex.js +26 -17
  7. package/dist/cjs/src/arkham.js +10 -7
  8. package/dist/cjs/src/ascendex.js +8 -5
  9. package/dist/cjs/src/aster.js +7 -4
  10. package/dist/cjs/src/backpack.js +4 -4
  11. package/dist/cjs/src/base/Exchange.js +72 -35
  12. package/dist/cjs/src/base/functions/io.js +25 -0
  13. package/dist/cjs/src/base/functions.js +1 -0
  14. package/dist/cjs/src/bigone.js +10 -7
  15. package/dist/cjs/src/binance.js +196 -198
  16. package/dist/cjs/src/bingx.js +7 -7
  17. package/dist/cjs/src/bitfinex.js +71 -58
  18. package/dist/cjs/src/bitflyer.js +2 -1
  19. package/dist/cjs/src/bitget.js +16 -5
  20. package/dist/cjs/src/bitmart.js +18 -10
  21. package/dist/cjs/src/bitmex.js +8 -5
  22. package/dist/cjs/src/bitopro.js +2 -2
  23. package/dist/cjs/src/bitrue.js +4 -3
  24. package/dist/cjs/src/bitso.js +7 -4
  25. package/dist/cjs/src/bitstamp.js +7 -4
  26. package/dist/cjs/src/bitteam.js +1 -1
  27. package/dist/cjs/src/bittrade.js +2 -2
  28. package/dist/cjs/src/bitvavo.js +457 -34
  29. package/dist/cjs/src/blofin.js +28 -4
  30. package/dist/cjs/src/bullish.js +6 -5
  31. package/dist/cjs/src/bybit.js +19 -17
  32. package/dist/cjs/src/bybiteu.js +1 -0
  33. package/dist/cjs/src/bydfi.js +1 -1
  34. package/dist/cjs/src/cex.js +3 -3
  35. package/dist/cjs/src/coinbase.js +75 -65
  36. package/dist/cjs/src/coinbaseexchange.js +4 -3
  37. package/dist/cjs/src/coinbaseinternational.js +17 -10
  38. package/dist/cjs/src/coinex.js +79 -77
  39. package/dist/cjs/src/coinmetro.js +1 -1
  40. package/dist/cjs/src/coinsph.js +5 -5
  41. package/dist/cjs/src/cryptocom.js +52 -54
  42. package/dist/cjs/src/cryptomus.js +43 -39
  43. package/dist/cjs/src/deepcoin.js +9 -5
  44. package/dist/cjs/src/delta.js +53 -53
  45. package/dist/cjs/src/deribit.js +35 -35
  46. package/dist/cjs/src/derive.js +31 -31
  47. package/dist/cjs/src/digifinex.js +45 -45
  48. package/dist/cjs/src/exmo.js +104 -122
  49. package/dist/cjs/src/extended.js +3497 -0
  50. package/dist/cjs/src/foxbit.js +72 -76
  51. package/dist/cjs/src/gate.js +53 -53
  52. package/dist/cjs/src/gemini.js +45 -45
  53. package/dist/cjs/src/grvt.js +17 -11
  54. package/dist/cjs/src/hashkey.js +56 -58
  55. package/dist/cjs/src/hibachi.js +1 -1
  56. package/dist/cjs/src/hitbtc.js +5 -14
  57. package/dist/cjs/src/hollaex.js +51 -54
  58. package/dist/cjs/src/htx.js +84 -72
  59. package/dist/cjs/src/hyperliquid.js +60 -55
  60. package/dist/cjs/src/indodax.js +4 -3
  61. package/dist/cjs/src/kraken.js +71 -71
  62. package/dist/cjs/src/krakenfutures.js +2 -1
  63. package/dist/cjs/src/kucoin.js +3 -2
  64. package/dist/cjs/src/latoken.js +30 -32
  65. package/dist/cjs/src/lbank.js +64 -60
  66. package/dist/cjs/src/lighter.js +36 -38
  67. package/dist/cjs/src/luno.js +36 -44
  68. package/dist/cjs/src/mercado.js +2 -1
  69. package/dist/cjs/src/mexc.js +72 -63
  70. package/dist/cjs/src/modetrade.js +51 -53
  71. package/dist/cjs/src/ndax.js +35 -37
  72. package/dist/cjs/src/okx.js +23 -5
  73. package/dist/cjs/src/onetrading.js +21 -23
  74. package/dist/cjs/src/p2b.js +8 -4
  75. package/dist/cjs/src/paradex.js +3 -2
  76. package/dist/cjs/src/phemex.js +47 -47
  77. package/dist/cjs/src/poloniex.js +19 -13
  78. package/dist/cjs/src/pro/alpaca.js +1 -1
  79. package/dist/cjs/src/pro/apex.js +11 -2
  80. package/dist/cjs/src/pro/arkham.js +1 -1
  81. package/dist/cjs/src/pro/aster.js +10 -9
  82. package/dist/cjs/src/pro/backpack.js +1 -1
  83. package/dist/cjs/src/pro/binance.js +6 -6
  84. package/dist/cjs/src/pro/bingx.js +7 -2
  85. package/dist/cjs/src/pro/bitget.js +1 -1
  86. package/dist/cjs/src/pro/bithumb.js +1 -1
  87. package/dist/cjs/src/pro/bitmart.js +10 -0
  88. package/dist/cjs/src/pro/bitmex.js +1 -1
  89. package/dist/cjs/src/pro/bitstamp.js +1 -1
  90. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  91. package/dist/cjs/src/pro/bybit.js +1 -1
  92. package/dist/cjs/src/pro/cex.js +1 -1
  93. package/dist/cjs/src/pro/coinex.js +1 -1
  94. package/dist/cjs/src/pro/coinone.js +1 -1
  95. package/dist/cjs/src/pro/cryptocom.js +3 -1
  96. package/dist/cjs/src/pro/dydx.js +1 -1
  97. package/dist/cjs/src/pro/exmo.js +1 -1
  98. package/dist/cjs/src/pro/extended.js +865 -0
  99. package/dist/cjs/src/pro/gate.js +1 -1
  100. package/dist/cjs/src/pro/grvt.js +8 -0
  101. package/dist/cjs/src/pro/htx.js +4 -4
  102. package/dist/cjs/src/pro/independentreserve.js +1 -1
  103. package/dist/cjs/src/pro/krakenfutures.js +16 -4
  104. package/dist/cjs/src/pro/kucoin.js +1 -1
  105. package/dist/cjs/src/pro/luno.js +3 -3
  106. package/dist/cjs/src/pro/modetrade.js +3 -3
  107. package/dist/cjs/src/pro/okx.js +4 -4
  108. package/dist/cjs/src/pro/onetrading.js +1 -1
  109. package/dist/cjs/src/pro/toobit.js +1 -1
  110. package/dist/cjs/src/pro/weex.js +1 -1
  111. package/dist/cjs/src/pro/woo.js +4 -4
  112. package/dist/cjs/src/pro/woofipro.js +3 -3
  113. package/dist/cjs/src/pro/xt.js +1 -1
  114. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
  115. package/dist/cjs/src/tokocrypto.js +1 -1
  116. package/dist/cjs/src/toobit.js +3 -3
  117. package/dist/cjs/src/upbit.js +3 -3
  118. package/dist/cjs/src/weex.js +57 -62
  119. package/dist/cjs/src/whitebit.js +61 -63
  120. package/dist/cjs/src/woo.js +66 -55
  121. package/dist/cjs/src/woofipro.js +54 -48
  122. package/dist/cjs/src/xt.js +3 -2
  123. package/dist/cjs/src/yobit.js +4 -2
  124. package/dist/cjs/src/zebpay.js +73 -75
  125. package/js/ccxt.d.ts +8 -14
  126. package/js/ccxt.js +6 -10
  127. package/js/src/abstract/bitvavo.d.ts +15 -7
  128. package/js/src/abstract/extended.d.ts +58 -0
  129. package/js/src/abstract/mexc.d.ts +1 -0
  130. package/js/src/aftermath.js +10 -5
  131. package/js/src/alpaca.js +2 -2
  132. package/js/src/apex.d.ts +1 -1
  133. package/js/src/apex.js +26 -17
  134. package/js/src/arkham.js +10 -7
  135. package/js/src/ascendex.js +8 -5
  136. package/js/src/aster.js +7 -4
  137. package/js/src/backpack.js +4 -4
  138. package/js/src/base/Exchange.d.ts +10 -6
  139. package/js/src/base/Exchange.js +72 -35
  140. package/js/src/base/functions/io.d.ts +7 -0
  141. package/js/src/base/functions/io.js +24 -0
  142. package/js/src/bigone.js +10 -7
  143. package/js/src/binance.d.ts +2 -0
  144. package/js/src/binance.js +200 -202
  145. package/js/src/bingx.js +7 -7
  146. package/js/src/bitfinex.d.ts +2 -0
  147. package/js/src/bitfinex.js +71 -58
  148. package/js/src/bitflyer.js +2 -1
  149. package/js/src/bitget.js +16 -5
  150. package/js/src/bitmart.js +18 -10
  151. package/js/src/bitmex.js +8 -5
  152. package/js/src/bitopro.js +2 -2
  153. package/js/src/bitrue.js +4 -3
  154. package/js/src/bitso.js +7 -4
  155. package/js/src/bitstamp.js +7 -4
  156. package/js/src/bitteam.js +1 -1
  157. package/js/src/bittrade.js +2 -2
  158. package/js/src/bitvavo.d.ts +114 -21
  159. package/js/src/bitvavo.js +457 -34
  160. package/js/src/blofin.d.ts +1 -0
  161. package/js/src/blofin.js +28 -4
  162. package/js/src/bullish.js +6 -5
  163. package/js/src/bybit.d.ts +1 -1
  164. package/js/src/bybit.js +19 -17
  165. package/js/src/bybiteu.js +1 -0
  166. package/js/src/bydfi.js +1 -1
  167. package/js/src/cex.js +3 -3
  168. package/js/src/coinbase.d.ts +63 -56
  169. package/js/src/coinbase.js +75 -65
  170. package/js/src/coinbaseexchange.js +4 -3
  171. package/js/src/coinbaseinternational.d.ts +1 -1
  172. package/js/src/coinbaseinternational.js +17 -10
  173. package/js/src/coinex.d.ts +2 -1
  174. package/js/src/coinex.js +79 -77
  175. package/js/src/coinmetro.d.ts +1 -1
  176. package/js/src/coinmetro.js +1 -1
  177. package/js/src/coinsph.js +5 -5
  178. package/js/src/cryptocom.d.ts +1 -0
  179. package/js/src/cryptocom.js +52 -54
  180. package/js/src/cryptomus.d.ts +2 -1
  181. package/js/src/cryptomus.js +43 -39
  182. package/js/src/deepcoin.js +9 -5
  183. package/js/src/delta.d.ts +1 -0
  184. package/js/src/delta.js +53 -53
  185. package/js/src/deribit.d.ts +1 -0
  186. package/js/src/deribit.js +35 -35
  187. package/js/src/derive.d.ts +1 -0
  188. package/js/src/derive.js +31 -31
  189. package/js/src/digifinex.d.ts +1 -0
  190. package/js/src/digifinex.js +45 -45
  191. package/js/src/exmo.d.ts +1 -0
  192. package/js/src/exmo.js +104 -122
  193. package/js/src/extended.d.ts +554 -0
  194. package/js/src/extended.js +3490 -0
  195. package/js/src/foxbit.d.ts +1 -0
  196. package/js/src/foxbit.js +72 -76
  197. package/js/src/gate.d.ts +1 -0
  198. package/js/src/gate.js +53 -53
  199. package/js/src/gemini.d.ts +2 -1
  200. package/js/src/gemini.js +45 -45
  201. package/js/src/grvt.d.ts +1 -1
  202. package/js/src/grvt.js +17 -11
  203. package/js/src/hashkey.d.ts +1 -0
  204. package/js/src/hashkey.js +56 -58
  205. package/js/src/hibachi.d.ts +1 -1
  206. package/js/src/hibachi.js +1 -1
  207. package/js/src/hitbtc.d.ts +0 -1
  208. package/js/src/hitbtc.js +5 -14
  209. package/js/src/hollaex.d.ts +1 -0
  210. package/js/src/hollaex.js +51 -54
  211. package/js/src/htx.d.ts +1 -0
  212. package/js/src/htx.js +84 -72
  213. package/js/src/hyperliquid.d.ts +5 -4
  214. package/js/src/hyperliquid.js +60 -55
  215. package/js/src/indodax.js +4 -3
  216. package/js/src/kraken.d.ts +2 -1
  217. package/js/src/kraken.js +71 -71
  218. package/js/src/krakenfutures.js +2 -1
  219. package/js/src/kucoin.js +3 -2
  220. package/js/src/latoken.d.ts +1 -0
  221. package/js/src/latoken.js +30 -32
  222. package/js/src/lbank.d.ts +1 -0
  223. package/js/src/lbank.js +64 -60
  224. package/js/src/lighter.d.ts +2 -1
  225. package/js/src/lighter.js +36 -38
  226. package/js/src/luno.d.ts +1 -0
  227. package/js/src/luno.js +36 -44
  228. package/js/src/mercado.js +2 -1
  229. package/js/src/mexc.d.ts +4 -3
  230. package/js/src/mexc.js +72 -63
  231. package/js/src/modetrade.d.ts +1 -0
  232. package/js/src/modetrade.js +51 -53
  233. package/js/src/ndax.d.ts +1 -0
  234. package/js/src/ndax.js +35 -37
  235. package/js/src/okx.js +23 -5
  236. package/js/src/onetrading.d.ts +2 -1
  237. package/js/src/onetrading.js +21 -23
  238. package/js/src/p2b.js +8 -4
  239. package/js/src/paradex.js +3 -2
  240. package/js/src/phemex.d.ts +1 -0
  241. package/js/src/phemex.js +47 -47
  242. package/js/src/poloniex.js +19 -13
  243. package/js/src/pro/alpaca.js +1 -1
  244. package/js/src/pro/apex.js +11 -2
  245. package/js/src/pro/arkham.js +1 -1
  246. package/js/src/pro/aster.js +10 -9
  247. package/js/src/pro/backpack.js +1 -1
  248. package/js/src/pro/binance.d.ts +1 -1
  249. package/js/src/pro/binance.js +6 -6
  250. package/js/src/pro/bingx.js +7 -2
  251. package/js/src/pro/bitget.js +1 -1
  252. package/js/src/pro/bithumb.js +1 -1
  253. package/js/src/pro/bitmart.js +10 -0
  254. package/js/src/pro/bitmex.js +1 -1
  255. package/js/src/pro/bitstamp.js +1 -1
  256. package/js/src/pro/blockchaincom.js +1 -1
  257. package/js/src/pro/bybit.js +1 -1
  258. package/js/src/pro/cex.js +1 -1
  259. package/js/src/pro/coinex.js +1 -1
  260. package/js/src/pro/coinone.js +1 -1
  261. package/js/src/pro/cryptocom.js +3 -1
  262. package/js/src/pro/dydx.js +1 -1
  263. package/js/src/pro/exmo.js +1 -1
  264. package/js/src/pro/extended.d.ts +126 -0
  265. package/js/src/pro/extended.js +858 -0
  266. package/js/src/pro/gate.js +1 -1
  267. package/js/src/pro/grvt.js +8 -0
  268. package/js/src/pro/htx.d.ts +4 -4
  269. package/js/src/pro/htx.js +4 -4
  270. package/js/src/pro/independentreserve.js +1 -1
  271. package/js/src/pro/krakenfutures.d.ts +4 -4
  272. package/js/src/pro/krakenfutures.js +16 -4
  273. package/js/src/pro/kucoin.js +1 -1
  274. package/js/src/pro/luno.d.ts +1 -1
  275. package/js/src/pro/luno.js +3 -3
  276. package/js/src/pro/modetrade.d.ts +3 -3
  277. package/js/src/pro/modetrade.js +3 -3
  278. package/js/src/pro/okx.d.ts +4 -4
  279. package/js/src/pro/okx.js +4 -4
  280. package/js/src/pro/onetrading.js +1 -1
  281. package/js/src/pro/toobit.js +1 -1
  282. package/js/src/pro/weex.js +1 -1
  283. package/js/src/pro/woo.d.ts +4 -4
  284. package/js/src/pro/woo.js +4 -4
  285. package/js/src/pro/woofipro.d.ts +3 -3
  286. package/js/src/pro/woofipro.js +3 -3
  287. package/js/src/pro/xt.js +1 -1
  288. package/js/src/tokocrypto.js +1 -1
  289. package/js/src/toobit.d.ts +1 -1
  290. package/js/src/toobit.js +3 -3
  291. package/js/src/upbit.js +3 -3
  292. package/js/src/weex.d.ts +1 -0
  293. package/js/src/weex.js +57 -62
  294. package/js/src/whitebit.d.ts +1 -0
  295. package/js/src/whitebit.js +61 -63
  296. package/js/src/woo.d.ts +1 -0
  297. package/js/src/woo.js +66 -55
  298. package/js/src/woofipro.d.ts +1 -0
  299. package/js/src/woofipro.js +54 -48
  300. package/js/src/xt.js +3 -2
  301. package/js/src/yobit.js +4 -2
  302. package/js/src/zebpay.d.ts +2 -1
  303. package/js/src/zebpay.js +73 -75
  304. package/package.json +25 -11
  305. package/dist/cjs/src/gateio.js +0 -18
  306. package/dist/cjs/src/oxfun.js +0 -2931
  307. package/dist/cjs/src/pro/gateio.js +0 -18
  308. package/dist/cjs/src/pro/oxfun.js +0 -1113
  309. package/js/src/abstract/gateio.d.ts +0 -346
  310. package/js/src/abstract/gateio.js +0 -5
  311. package/js/src/abstract/oxfun.d.ts +0 -37
  312. package/js/src/gateio.d.ts +0 -4
  313. package/js/src/gateio.js +0 -11
  314. package/js/src/oxfun.d.ts +0 -442
  315. package/js/src/oxfun.js +0 -2924
  316. package/js/src/pro/gateio.d.ts +0 -4
  317. package/js/src/pro/gateio.js +0 -11
  318. package/js/src/pro/oxfun.d.ts +0 -234
  319. package/js/src/pro/oxfun.js +0 -1106
  320. /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
  321. /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
@@ -367,83 +367,79 @@ class foxbit extends foxbit$1["default"] {
367
367
  // ]
368
368
  // }
369
369
  const data = this.safeList(response, 'data', []);
370
- const result = {};
371
- for (let i = 0; i < data.length; i++) {
372
- const currency = data[i];
373
- const precision = this.safeInteger(currency, 'precision');
374
- const currencyId = this.safeString(currency, 'symbol');
375
- const name = this.safeString(currency, 'name');
376
- const code = this.safeCurrencyCode(currencyId);
377
- const depositInfo = this.safeDict(currency, 'deposit_info');
378
- const withdrawInfo = this.safeDict(currency, 'withdraw_info');
379
- const networks = this.safeList(currency, 'networks', []);
380
- const type = this.safeStringLower(currency, 'type');
381
- const parsedNetworks = {};
382
- for (let j = 0; j < networks.length; j++) {
383
- const network = networks[j];
384
- const networkId = this.safeString(network, 'code');
385
- const networkCode = this.networkIdToCode(networkId, code);
386
- const networkWithdrawInfo = this.safeDict(network, 'withdraw_info');
387
- const networkDepositInfo = this.safeDict(network, 'deposit_info');
388
- const isWithdrawEnabled = this.safeString(networkWithdrawInfo, 'status') === 'ENABLED';
389
- const isDepositEnabled = this.safeString(networkDepositInfo, 'status') === 'ENABLED';
390
- parsedNetworks[networkCode] = {
391
- 'info': currency,
392
- 'id': networkId,
393
- 'network': networkCode,
394
- 'name': this.safeString(network, 'name'),
395
- 'deposit': isDepositEnabled,
396
- 'withdraw': isWithdrawEnabled,
397
- 'active': true,
398
- 'precision': precision,
399
- 'fee': this.safeNumber(networkWithdrawInfo, 'fee'),
400
- 'limits': {
401
- 'amount': {
402
- 'min': undefined,
403
- 'max': undefined,
404
- },
405
- 'deposit': {
406
- 'min': this.safeNumber(depositInfo, 'min_amount'),
407
- 'max': undefined,
408
- },
409
- 'withdraw': {
410
- 'min': this.safeNumber(withdrawInfo, 'min_amount'),
411
- 'max': undefined,
412
- },
370
+ return this.parseCurrencies(data);
371
+ }
372
+ parseCurrency(rawCurrency) {
373
+ const precision = this.safeInteger(rawCurrency, 'precision');
374
+ const currencyId = this.safeString(rawCurrency, 'symbol');
375
+ const name = this.safeString(rawCurrency, 'name');
376
+ const code = this.safeCurrencyCode(currencyId);
377
+ const depositInfo = this.safeDict(rawCurrency, 'deposit_info');
378
+ const withdrawInfo = this.safeDict(rawCurrency, 'withdraw_info');
379
+ const networks = this.safeList(rawCurrency, 'networks', []);
380
+ const type = this.safeStringLower(rawCurrency, 'type');
381
+ const parsedNetworks = {};
382
+ for (let j = 0; j < networks.length; j++) {
383
+ const network = networks[j];
384
+ const networkId = this.safeString(network, 'code');
385
+ const networkCode = this.networkIdToCode(networkId, code);
386
+ const networkWithdrawInfo = this.safeDict(network, 'withdraw_info');
387
+ const networkDepositInfo = this.safeDict(network, 'deposit_info');
388
+ const isWithdrawEnabled = this.safeString(networkWithdrawInfo, 'status') === 'ENABLED';
389
+ const isDepositEnabled = this.safeString(networkDepositInfo, 'status') === 'ENABLED';
390
+ parsedNetworks[networkCode] = {
391
+ 'info': rawCurrency,
392
+ 'id': networkId,
393
+ 'network': networkCode,
394
+ 'name': this.safeString(network, 'name'),
395
+ 'deposit': isDepositEnabled,
396
+ 'withdraw': isWithdrawEnabled,
397
+ 'active': true,
398
+ 'precision': precision,
399
+ 'fee': this.safeNumber(networkWithdrawInfo, 'fee'),
400
+ 'limits': {
401
+ 'amount': {
402
+ 'min': undefined,
403
+ 'max': undefined,
413
404
  },
414
- };
415
- }
416
- if (this.safeDict(result, code) === undefined) {
417
- result[code] = this.safeCurrencyStructure({
418
- 'id': currencyId,
419
- 'code': code,
420
- 'info': currency,
421
- 'name': name,
422
- 'active': true,
423
- 'type': type,
424
- 'deposit': this.safeBool(depositInfo, 'enabled', false),
425
- 'withdraw': this.safeBool(withdrawInfo, 'enabled', false),
426
- 'fee': this.safeNumber(withdrawInfo, 'fee'),
427
- 'precision': precision,
428
- 'limits': {
429
- 'amount': {
430
- 'min': undefined,
431
- 'max': undefined,
432
- },
433
- 'deposit': {
434
- 'min': this.safeNumber(depositInfo, 'min_amount'),
435
- 'max': undefined,
436
- },
437
- 'withdraw': {
438
- 'min': this.safeNumber(withdrawInfo, 'min_amount'),
439
- 'max': undefined,
440
- },
405
+ 'deposit': {
406
+ 'min': this.safeNumber(depositInfo, 'min_amount'),
407
+ 'max': undefined,
441
408
  },
442
- 'networks': parsedNetworks,
443
- });
444
- }
409
+ 'withdraw': {
410
+ 'min': this.safeNumber(withdrawInfo, 'min_amount'),
411
+ 'max': undefined,
412
+ },
413
+ },
414
+ };
445
415
  }
446
- return result;
416
+ return this.safeCurrencyStructure({
417
+ 'id': currencyId,
418
+ 'code': code,
419
+ 'info': rawCurrency,
420
+ 'name': name,
421
+ 'active': true,
422
+ 'type': type,
423
+ 'deposit': this.safeBool(depositInfo, 'enabled', false),
424
+ 'withdraw': this.safeBool(withdrawInfo, 'enabled', false),
425
+ 'fee': this.safeNumber(withdrawInfo, 'fee'),
426
+ 'precision': precision,
427
+ 'limits': {
428
+ 'amount': {
429
+ 'min': undefined,
430
+ 'max': undefined,
431
+ },
432
+ 'deposit': {
433
+ 'min': this.safeNumber(depositInfo, 'min_amount'),
434
+ 'max': undefined,
435
+ },
436
+ 'withdraw': {
437
+ 'min': this.safeNumber(withdrawInfo, 'min_amount'),
438
+ 'max': undefined,
439
+ },
440
+ },
441
+ 'networks': parsedNetworks,
442
+ });
447
443
  }
448
444
  /**
449
445
  * @method
@@ -1144,7 +1140,7 @@ class foxbit extends foxbit$1["default"] {
1144
1140
  // "remark": "A remarkable note for the order.",
1145
1141
  // "funds_received": "290.0"
1146
1142
  // }
1147
- return this.parseOrder(response, undefined);
1143
+ return this.parseOrder(response);
1148
1144
  }
1149
1145
  /**
1150
1146
  * @method
@@ -1538,7 +1534,7 @@ class foxbit extends foxbit$1["default"] {
1538
1534
  let networkCode = undefined;
1539
1535
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
1540
1536
  if (networkCode !== undefined) {
1541
- request['network_code'] = this.networkCodeToId(networkCode);
1537
+ request['network_code'] = this.networkCodeToId(networkCode, code);
1542
1538
  }
1543
1539
  const response = await this.v3PrivatePostWithdrawals(this.extend(request, params));
1544
1540
  // {
@@ -1992,56 +1992,53 @@ class gate extends gate$1["default"] {
1992
1992
  // },
1993
1993
  // ]
1994
1994
  //
1995
- const indexedCurrencies = this.indexBy(response, 'currency');
1996
- const result = {};
1997
- for (let i = 0; i < response.length; i++) {
1998
- const entry = response[i];
1999
- const currencyId = this.safeString(entry, 'currency');
2000
- const code = this.safeCurrencyCode(currencyId);
2001
- // check leveraged tokens (e.g. BTC3S, ETH5L)
2002
- const type = this.isLeveragedCurrency(currencyId, true, indexedCurrencies) ? 'leveraged' : 'crypto';
2003
- const chains = this.safeList(entry, 'chains', []);
2004
- const networks = {};
2005
- for (let j = 0; j < chains.length; j++) {
2006
- const chain = chains[j];
2007
- const networkId = this.safeString(chain, 'name');
2008
- const networkCode = this.networkIdToCode(networkId);
2009
- networks[networkCode] = {
2010
- 'info': chain,
2011
- 'id': networkId,
2012
- 'network': networkCode,
2013
- 'active': undefined,
2014
- 'deposit': !this.safeBool(chain, 'deposit_disabled'),
2015
- 'withdraw': !this.safeBool(chain, 'withdraw_disabled'),
2016
- 'fee': undefined,
2017
- 'precision': this.parseNumber('0.0001'),
2018
- 'limits': {
2019
- 'deposit': {
2020
- 'min': undefined,
2021
- 'max': undefined,
2022
- },
2023
- 'withdraw': {
2024
- 'min': undefined,
2025
- 'max': undefined,
2026
- },
2027
- },
2028
- };
2029
- }
2030
- result[code] = this.safeCurrencyStructure({
2031
- 'id': currencyId,
2032
- 'code': code,
2033
- 'name': this.safeString(entry, 'name'),
2034
- 'type': type,
2035
- 'active': !this.safeBool(entry, 'delisted'),
2036
- 'deposit': !this.safeBool(entry, 'deposit_disabled'),
2037
- 'withdraw': !this.safeBool(entry, 'withdraw_disabled'),
1995
+ return this.parseCurrencies(response);
1996
+ }
1997
+ parseCurrency(rawCurrency) {
1998
+ const currencyId = this.safeString(rawCurrency, 'currency');
1999
+ const code = this.safeCurrencyCode(currencyId);
2000
+ // check leveraged tokens (e.g. BTC3S, ETH5L)
2001
+ const type = this.isLeveragedCurrency(currencyId) ? 'leveraged' : 'crypto';
2002
+ const chains = this.safeList(rawCurrency, 'chains', []);
2003
+ const networks = {};
2004
+ for (let j = 0; j < chains.length; j++) {
2005
+ const chain = chains[j];
2006
+ const networkId = this.safeString(chain, 'name');
2007
+ const networkCode = this.networkIdToCode(networkId, code);
2008
+ networks[networkCode] = {
2009
+ 'info': chain,
2010
+ 'id': networkId,
2011
+ 'network': networkCode,
2012
+ 'active': undefined,
2013
+ 'deposit': !this.safeBool(chain, 'deposit_disabled'),
2014
+ 'withdraw': !this.safeBool(chain, 'withdraw_disabled'),
2038
2015
  'fee': undefined,
2039
- 'networks': networks,
2040
2016
  'precision': this.parseNumber('0.0001'),
2041
- 'info': entry,
2042
- });
2017
+ 'limits': {
2018
+ 'deposit': {
2019
+ 'min': undefined,
2020
+ 'max': undefined,
2021
+ },
2022
+ 'withdraw': {
2023
+ 'min': undefined,
2024
+ 'max': undefined,
2025
+ },
2026
+ },
2027
+ };
2043
2028
  }
2044
- return result;
2029
+ return this.safeCurrencyStructure({
2030
+ 'id': currencyId,
2031
+ 'code': code,
2032
+ 'name': this.safeString(rawCurrency, 'name'),
2033
+ 'type': type,
2034
+ 'active': !this.safeBool(rawCurrency, 'delisted'),
2035
+ 'deposit': !this.safeBool(rawCurrency, 'deposit_disabled'),
2036
+ 'withdraw': !this.safeBool(rawCurrency, 'withdraw_disabled'),
2037
+ 'fee': undefined,
2038
+ 'networks': networks,
2039
+ 'precision': this.parseNumber('0.0001'),
2040
+ 'info': rawCurrency,
2041
+ });
2045
2042
  }
2046
2043
  /**
2047
2044
  * @method
@@ -2345,12 +2342,13 @@ class gate extends gate$1["default"] {
2345
2342
  //
2346
2343
  const address = this.safeString(depositAddress, 'address');
2347
2344
  this.checkAddress(address);
2345
+ const code = this.safeString(currency, 'code');
2348
2346
  return {
2349
2347
  'info': depositAddress,
2350
- 'currency': this.safeString(currency, 'code'),
2348
+ 'currency': code,
2351
2349
  'address': address,
2352
2350
  'tag': this.safeString(depositAddress, 'payment_id'),
2353
- 'network': this.networkIdToCode(this.safeString(depositAddress, 'chain')),
2351
+ 'network': this.networkIdToCode(this.safeString(depositAddress, 'chain'), code),
2354
2352
  };
2355
2353
  }
2356
2354
  /**
@@ -2499,7 +2497,7 @@ class gate extends gate$1["default"] {
2499
2497
  const networkIds = Object.keys(withdrawFixOnChains);
2500
2498
  for (let j = 0; j < networkIds.length; j++) {
2501
2499
  const networkId = networkIds[j];
2502
- const networkCode = this.networkIdToCode(networkId);
2500
+ const networkCode = this.networkIdToCode(networkId, code);
2503
2501
  withdrawFees[networkCode] = this.parseNumber(withdrawFixOnChains[networkId]);
2504
2502
  }
2505
2503
  }
@@ -2579,7 +2577,9 @@ class gate extends gate$1["default"] {
2579
2577
  const chainKeys = Object.keys(withdrawFixOnChains);
2580
2578
  for (let i = 0; i < chainKeys.length; i++) {
2581
2579
  const chainKey = chainKeys[i];
2582
- const networkCode = this.networkIdToCode(chainKey, this.safeString(fee, 'currency'));
2580
+ const currencyId = this.safeString(fee, 'currency');
2581
+ const code = this.safeCurrencyCode(currencyId, currency);
2582
+ const networkCode = this.networkIdToCode(chainKey, code);
2583
2583
  result['networks'][networkCode] = {
2584
2584
  'withdraw': {
2585
2585
  'fee': this.parseNumber(withdrawFixOnChains[chainKey]),
@@ -4100,7 +4100,7 @@ class gate extends gate$1["default"] {
4100
4100
  let networkCode = undefined;
4101
4101
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
4102
4102
  if (networkCode !== undefined) {
4103
- request['chain'] = this.networkCodeToId(networkCode);
4103
+ request['chain'] = this.networkCodeToId(networkCode, code);
4104
4104
  }
4105
4105
  const response = await this.privateWithdrawalsPostWithdrawals(this.extend(request, params));
4106
4106
  //
@@ -4232,7 +4232,7 @@ class gate extends gate$1["default"] {
4232
4232
  'txid': txid,
4233
4233
  'currency': code,
4234
4234
  'amount': this.parseNumber(amountString),
4235
- 'network': this.networkIdToCode(networkId),
4235
+ 'network': this.networkIdToCode(networkId, code),
4236
4236
  'address': address,
4237
4237
  'addressTo': undefined,
4238
4238
  'addressFrom': undefined,
@@ -440,51 +440,28 @@ class gemini extends gemini$1["default"] {
440
440
  // ]
441
441
  // }
442
442
  //
443
- const result = {};
444
443
  this.options['tradingPairs'] = this.safeList(data, 'tradingPairs');
445
444
  const currenciesArray = this.safeValue(data, 'currencies', []);
446
- for (let i = 0; i < currenciesArray.length; i++) {
447
- const currency = currenciesArray[i];
448
- const id = this.safeString(currency, 0);
449
- const code = this.safeCurrencyCode(id);
450
- const type = this.safeString(currency, 7) ? 'fiat' : 'crypto';
451
- const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 5)));
452
- const networks = {};
453
- const networkId = this.safeString(currency, 9);
454
- let networkCode = undefined;
455
- if (networkId !== undefined) {
456
- networkCode = this.networkIdToCode(networkId);
457
- networks[networkCode] = {
458
- 'info': currency,
459
- 'id': networkId,
460
- 'network': networkCode,
461
- 'active': undefined,
462
- 'deposit': undefined,
463
- 'withdraw': undefined,
464
- 'fee': undefined,
465
- 'precision': precision,
466
- 'limits': {
467
- 'deposit': {
468
- 'min': undefined,
469
- 'max': undefined,
470
- },
471
- 'withdraw': {
472
- 'min': undefined,
473
- 'max': undefined,
474
- },
475
- },
476
- };
477
- }
478
- result[code] = this.safeCurrencyStructure({
479
- 'info': currency,
480
- 'id': id,
481
- 'code': code,
482
- 'name': this.safeString(currency, 1),
445
+ return this.parseCurrencies(currenciesArray);
446
+ }
447
+ parseCurrency(rawCurrency) {
448
+ const id = this.safeString(rawCurrency, 0);
449
+ const code = this.safeCurrencyCode(id);
450
+ const type = this.safeString(rawCurrency, 7) ? 'fiat' : 'crypto';
451
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 5)));
452
+ const networks = {};
453
+ const networkId = this.safeString(rawCurrency, 9);
454
+ let networkCode = undefined;
455
+ if (networkId !== undefined) {
456
+ networkCode = this.networkIdToCode(networkId, code);
457
+ networks[networkCode] = {
458
+ 'info': rawCurrency,
459
+ 'id': networkId,
460
+ 'network': networkCode,
483
461
  'active': undefined,
484
462
  'deposit': undefined,
485
463
  'withdraw': undefined,
486
464
  'fee': undefined,
487
- 'type': type,
488
465
  'precision': precision,
489
466
  'limits': {
490
467
  'deposit': {
@@ -496,10 +473,31 @@ class gemini extends gemini$1["default"] {
496
473
  'max': undefined,
497
474
  },
498
475
  },
499
- 'networks': networks,
500
- });
476
+ };
501
477
  }
502
- return result;
478
+ return this.safeCurrencyStructure({
479
+ 'info': rawCurrency,
480
+ 'id': id,
481
+ 'code': code,
482
+ 'name': this.safeString(rawCurrency, 1),
483
+ 'active': undefined,
484
+ 'deposit': undefined,
485
+ 'withdraw': undefined,
486
+ 'fee': undefined,
487
+ 'type': type,
488
+ 'precision': precision,
489
+ 'limits': {
490
+ 'deposit': {
491
+ 'min': undefined,
492
+ 'max': undefined,
493
+ },
494
+ 'withdraw': {
495
+ 'min': undefined,
496
+ 'max': undefined,
497
+ },
498
+ },
499
+ 'networks': networks,
500
+ });
503
501
  }
504
502
  /**
505
503
  * @method
@@ -825,6 +823,7 @@ class gemini extends gemini$1["default"] {
825
823
  inverse = false;
826
824
  }
827
825
  const type = swap ? 'swap' : 'spot';
826
+ const isSpot = !swap;
828
827
  return {
829
828
  'id': marketId,
830
829
  'symbol': symbol,
@@ -835,7 +834,7 @@ class gemini extends gemini$1["default"] {
835
834
  'quoteId': quoteId,
836
835
  'settleId': settleId,
837
836
  'type': type,
838
- 'spot': !swap,
837
+ 'spot': isSpot,
839
838
  'margin': false,
840
839
  'swap': swap,
841
840
  'future': false,
@@ -1911,7 +1910,7 @@ class gemini extends gemini$1["default"] {
1911
1910
  if (networkCode === undefined) {
1912
1911
  throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddresses() requires a network parameter');
1913
1912
  }
1914
- const networkId = this.networkCodeToId(networkCode);
1913
+ const networkId = this.networkCodeToId(networkCode, currency['code']);
1915
1914
  const request = {
1916
1915
  'network': networkId,
1917
1916
  };
@@ -1929,8 +1928,9 @@ class gemini extends gemini$1["default"] {
1929
1928
  throw new errors.AuthenticationError(this.id + ' sign() requires an account-key, master-keys are not-supported');
1930
1929
  }
1931
1930
  const nonce = this.nonce().toString();
1931
+ const finalUrl = url;
1932
1932
  const request = this.extend({
1933
- 'request': url,
1933
+ 'request': finalUrl,
1934
1934
  'nonce': nonce,
1935
1935
  }, query);
1936
1936
  let payload = this.json(request);
@@ -1593,13 +1593,15 @@ class grvt extends grvt$1["default"] {
1593
1593
  let networkCode = undefined;
1594
1594
  let addressFrom = this.safeString(transaction, 'from_account_id');
1595
1595
  let addressTo = this.safeString(transaction, 'to_account_id');
1596
+ const currencyId = this.safeString(transaction, 'currency');
1597
+ const code = this.safeCurrencyCode(currencyId, currency);
1596
1598
  if ('transfer_metadata' in transaction) {
1597
1599
  const metaData = this.omitZero(this.safeString(transaction, 'transfer_metadata'));
1598
1600
  if (metaData !== undefined) {
1599
1601
  const parsedMeta = this.parseJson(metaData);
1600
1602
  direction = this.safeStringLower(parsedMeta, 'direction');
1601
1603
  txId = this.safeString(parsedMeta, 'provider_tx_id');
1602
- networkCode = this.networkIdToCode(this.safeString(parsedMeta, 'chainid'));
1604
+ networkCode = this.networkIdToCode(this.safeString(parsedMeta, 'chainid'), code);
1603
1605
  if (direction === 'withdrawal') {
1604
1606
  addressTo = this.safeString(parsedMeta, 'endpoint');
1605
1607
  }
@@ -1609,8 +1611,6 @@ class grvt extends grvt$1["default"] {
1609
1611
  }
1610
1612
  }
1611
1613
  const timestamp = this.safeIntegerProduct2(transaction, 'event_time', 'initiated_time', 0.000001);
1612
- const currencyId = this.safeString(transaction, 'currency');
1613
- const code = this.safeCurrencyCode(currencyId, currency);
1614
1614
  return {
1615
1615
  'info': transaction,
1616
1616
  'id': undefined,
@@ -1831,7 +1831,7 @@ class grvt extends grvt$1["default"] {
1831
1831
  }
1832
1832
  async loadAccountInfos() {
1833
1833
  if (this.safeString(this.options, 'userMainAccountId') !== undefined) {
1834
- return;
1834
+ return false;
1835
1835
  }
1836
1836
  const promises = [];
1837
1837
  promises.push(this.privateTradingPostFullV1AggregatedAccountSummary());
@@ -1884,6 +1884,7 @@ class grvt extends grvt$1["default"] {
1884
1884
  const subAccountId = this.safeString(subAccountIds, 0);
1885
1885
  this.options['accountId'] = subAccountId;
1886
1886
  }
1887
+ return true;
1887
1888
  }
1888
1889
  /**
1889
1890
  * @method
@@ -1911,7 +1912,7 @@ class grvt extends grvt$1["default"] {
1911
1912
  'signature': this.defaultSignature(),
1912
1913
  };
1913
1914
  const [networkCode, query] = this.handleNetworkCodeAndParams(params);
1914
- const networkId = this.networkCodeToId(networkCode);
1915
+ const networkId = this.networkCodeToId(networkCode, code);
1915
1916
  if (networkId === undefined) {
1916
1917
  throw new errors.BadRequest(this.id + ' withdraw() requires a network parameter');
1917
1918
  }
@@ -1976,8 +1977,10 @@ class grvt extends grvt$1["default"] {
1976
1977
  }
1977
1978
  params = this.omit(params, ['clientOrderId']);
1978
1979
  const isMarketOrder = (type === 'market');
1980
+ const subAccountId = this.getSubAccountId(params);
1981
+ const isReduceOnly = this.safeBool(params, 'reduceOnly', false);
1979
1982
  const orderRequest = {
1980
- 'sub_account_id': this.getSubAccountId(params),
1983
+ 'sub_account_id': subAccountId,
1981
1984
  'time_in_force': undefined,
1982
1985
  'legs': [orderLeg],
1983
1986
  'signature': this.defaultSignature(),
@@ -1986,7 +1989,7 @@ class grvt extends grvt$1["default"] {
1986
1989
  },
1987
1990
  'is_market': isMarketOrder,
1988
1991
  'post_only': false,
1989
- 'reduce_only': this.safeBool(params, 'reduceOnly', false),
1992
+ 'reduce_only': isReduceOnly,
1990
1993
  // 'order_id': null,
1991
1994
  // 'state': null,
1992
1995
  };
@@ -2619,8 +2622,9 @@ class grvt extends grvt$1["default"] {
2619
2622
  */
2620
2623
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2621
2624
  await this.loadMarketsAndSignIn();
2625
+ const subAccountId = this.getSubAccountId(params);
2622
2626
  let request = {
2623
- 'sub_account_id': this.getSubAccountId(params),
2627
+ 'sub_account_id': subAccountId,
2624
2628
  };
2625
2629
  let market = undefined;
2626
2630
  if (symbol !== undefined) {
@@ -2796,8 +2800,9 @@ class grvt extends grvt$1["default"] {
2796
2800
  */
2797
2801
  async fetchOrder(id, symbol = undefined, params = {}) {
2798
2802
  await this.loadMarketsAndSignIn();
2803
+ const subAccountId = this.getSubAccountId(params);
2799
2804
  const request = {
2800
- 'sub_account_id': this.getSubAccountId(params),
2805
+ 'sub_account_id': subAccountId,
2801
2806
  };
2802
2807
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
2803
2808
  if (clientOrderId !== undefined) {
@@ -3060,7 +3065,7 @@ class grvt extends grvt$1["default"] {
3060
3065
  // }
3061
3066
  //
3062
3067
  const result = this.safeDict(response, 'result', {});
3063
- return this.parseOrders([result], undefined);
3068
+ return this.parseOrders([result]);
3064
3069
  }
3065
3070
  /**
3066
3071
  * @method
@@ -3075,8 +3080,9 @@ class grvt extends grvt$1["default"] {
3075
3080
  */
3076
3081
  async cancelOrder(id, symbol = undefined, params = {}) {
3077
3082
  await this.loadMarketsAndSignIn();
3083
+ const subAccoubntId = this.getSubAccountId(params);
3078
3084
  const request = {
3079
- 'sub_account_id': this.getSubAccountId(params),
3085
+ 'sub_account_id': subAccoubntId,
3080
3086
  };
3081
3087
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
3082
3088
  if (clientOrderId !== undefined) {