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
@@ -462,50 +462,49 @@ class hyperliquid extends hyperliquid$1["default"] {
462
462
  const tokens = this.safeList(response, 'tokens', []);
463
463
  // const meta = this.safeList (response, 'universe', []);
464
464
  this.options['cachedCurrenciesById'] = {}; // used to map hip3 markets
465
- const result = {};
466
- for (let i = 0; i < tokens.length; i++) {
467
- const data = this.safeDict(tokens, i, {});
468
- // const id = i;
469
- const id = this.safeString(data, 'index');
470
- const name = this.safeString(data, 'name');
471
- const code = this.safeCurrencyCode(name);
472
- this.options['cachedCurrenciesById'][id] = name;
473
- result[code] = this.safeCurrencyStructure({
474
- 'id': id,
475
- 'name': name,
476
- 'code': code,
477
- 'precision': this.parsePrecision(this.safeString(data, 'weiDecimals')),
478
- 'info': data,
479
- 'active': undefined,
480
- 'deposit': undefined,
481
- 'withdraw': undefined,
482
- 'networks': undefined,
483
- 'fee': undefined,
484
- 'type': 'crypto',
485
- 'limits': {
486
- 'amount': {
487
- 'min': undefined,
488
- 'max': undefined,
489
- },
490
- 'withdraw': {
491
- 'min': undefined,
492
- 'max': undefined,
493
- },
465
+ return this.parseCurrencies(tokens);
466
+ }
467
+ parseCurrency(rawCurrency) {
468
+ // const id = i;
469
+ const id = this.safeString(rawCurrency, 'index');
470
+ const name = this.safeString(rawCurrency, 'name');
471
+ const code = this.safeCurrencyCode(name);
472
+ this.options['cachedCurrenciesById'][id] = name;
473
+ const result = this.safeCurrencyStructure({
474
+ 'id': id,
475
+ 'name': name,
476
+ 'code': code,
477
+ 'precision': this.parsePrecision(this.safeString(rawCurrency, 'weiDecimals')),
478
+ 'info': rawCurrency,
479
+ 'active': undefined,
480
+ 'deposit': undefined,
481
+ 'withdraw': undefined,
482
+ 'networks': undefined,
483
+ 'fee': undefined,
484
+ 'type': 'crypto',
485
+ 'limits': {
486
+ 'amount': {
487
+ 'min': undefined,
488
+ 'max': undefined,
494
489
  },
495
- });
496
- // add in wrapped map
497
- const fullName = this.safeString(data, 'fullName');
498
- if (fullName !== undefined && name !== undefined) {
499
- const isWrapped = fullName.startsWith('Unit ') && name.startsWith('U');
500
- if (isWrapped) {
501
- const parts = name.split('U');
502
- let nameWithoutU = '';
503
- for (let j = 0; j < parts.length; j++) {
504
- nameWithoutU = nameWithoutU + parts[j];
505
- }
506
- const baseCode = this.safeCurrencyCode(nameWithoutU);
507
- this.options['spotCurrencyMapping'][code] = baseCode;
490
+ 'withdraw': {
491
+ 'min': undefined,
492
+ 'max': undefined,
493
+ },
494
+ },
495
+ });
496
+ // add in wrapped map
497
+ const fullName = this.safeString(rawCurrency, 'fullName');
498
+ if (fullName !== undefined && name !== undefined) {
499
+ const isWrapped = fullName.startsWith('Unit ') && name.startsWith('U');
500
+ if (isWrapped) {
501
+ const parts = name.split('U');
502
+ let nameWithoutU = '';
503
+ for (let j = 0; j < parts.length; j++) {
504
+ nameWithoutU = nameWithoutU + parts[j];
508
505
  }
506
+ const baseCode = this.safeCurrencyCode(nameWithoutU);
507
+ this.options['spotCurrencyMapping'][code] = baseCode;
509
508
  }
510
509
  }
511
510
  return result;
@@ -1841,8 +1840,8 @@ class hyperliquid extends hyperliquid$1["default"] {
1841
1840
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state
1842
1841
  * @description returns enableUnifiedMargin so the user can check if unified account is enabled
1843
1842
  * @param {string} method the method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
1844
- * @param address
1845
- * @param shouldRefresh
1843
+ * @param {string} [address] the wallet address to query; defaults to the configured walletAddress
1844
+ * @param {boolean} [shouldRefresh] force a fresh request instead of returning the cached value
1846
1845
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1847
1846
  * @returns {bool} enableUnifiedMargin
1848
1847
  */
@@ -1936,8 +1935,8 @@ class hyperliquid extends hyperliquid$1["default"] {
1936
1935
  * @method
1937
1936
  * @name hyperliquid#enableUserDexAbstraction
1938
1937
  * @description If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
1939
- * @param enabled
1940
- * @param params
1938
+ * @param {boolean} enabled whether to enable user dex abstraction
1939
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1941
1940
  * @param {string} [params.type] 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
1942
1941
  * @returns dictionary response from the exchange
1943
1942
  */
@@ -2149,7 +2148,7 @@ class hyperliquid extends hyperliquid$1["default"] {
2149
2148
  ordersToBeParsed.push(order);
2150
2149
  }
2151
2150
  }
2152
- return this.parseOrders(ordersToBeParsed, undefined);
2151
+ return this.parseOrders(ordersToBeParsed);
2153
2152
  }
2154
2153
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
2155
2154
  const market = this.market(symbol);
@@ -2193,10 +2192,11 @@ class hyperliquid extends hyperliquid$1["default"] {
2193
2192
  else {
2194
2193
  triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
2195
2194
  }
2195
+ const tpSlType = (isTp) ? 'tp' : 'sl';
2196
2196
  orderType['trigger'] = {
2197
2197
  'isMarket': isMarket,
2198
2198
  'triggerPx': triggerPrice,
2199
- 'tpsl': (isTp) ? 'tp' : 'sl',
2199
+ 'tpsl': tpSlType,
2200
2200
  };
2201
2201
  }
2202
2202
  else {
@@ -2517,9 +2517,10 @@ class hyperliquid extends hyperliquid$1["default"] {
2517
2517
  else {
2518
2518
  cancelAction['type'] = 'cancel';
2519
2519
  for (let i = 0; i < ids.length; i++) {
2520
+ const o = this.parseToNumeric(ids[i]);
2520
2521
  cancelReq.push({
2521
2522
  'a': baseId,
2522
- 'o': this.parseToNumeric(ids[i]),
2523
+ 'o': o,
2523
2524
  });
2524
2525
  }
2525
2526
  }
@@ -2727,10 +2728,11 @@ class hyperliquid extends hyperliquid$1["default"] {
2727
2728
  else {
2728
2729
  triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
2729
2730
  }
2731
+ const tpSlType = (isTp) ? 'tp' : 'sl';
2730
2732
  orderType['trigger'] = {
2731
2733
  'isMarket': isMarket,
2732
2734
  'triggerPx': triggerPrice,
2733
- 'tpsl': (isTp) ? 'tp' : 'sl',
2735
+ 'tpsl': tpSlType,
2734
2736
  };
2735
2737
  }
2736
2738
  else {
@@ -3321,8 +3323,9 @@ class hyperliquid extends hyperliquid$1["default"] {
3321
3323
  //
3322
3324
  const error = this.safeString(order, 'error');
3323
3325
  if (error !== undefined) {
3326
+ const finalOrder = order; // java req
3324
3327
  return this.safeOrder({
3325
- 'info': order,
3328
+ 'info': finalOrder,
3326
3329
  'status': 'rejected',
3327
3330
  });
3328
3331
  }
@@ -3357,6 +3360,7 @@ class hyperliquid extends hyperliquid$1["default"] {
3357
3360
  if (tif !== undefined) {
3358
3361
  postOnly = (tif === 'ALO');
3359
3362
  }
3363
+ const triggerPx = this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined;
3360
3364
  return this.safeOrder({
3361
3365
  'info': order,
3362
3366
  'id': this.safeString(entry, 'oid'),
@@ -3372,7 +3376,7 @@ class hyperliquid extends hyperliquid$1["default"] {
3372
3376
  'reduceOnly': this.safeBool(entry, 'reduceOnly'),
3373
3377
  'side': side,
3374
3378
  'price': this.safeString(entry, 'limitPx'),
3375
- 'triggerPrice': this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined,
3379
+ 'triggerPrice': triggerPx,
3376
3380
  'amount': totalAmount,
3377
3381
  'cost': undefined,
3378
3382
  'average': this.safeString(entry, 'avgPx'),
@@ -3644,7 +3648,7 @@ class hyperliquid extends hyperliquid$1["default"] {
3644
3648
  const data = this.safeList(response, 'assetPositions', []);
3645
3649
  const result = [];
3646
3650
  for (let i = 0; i < data.length; i++) {
3647
- result.push(this.parsePosition(data[i], undefined));
3651
+ result.push(this.parsePosition(data[i]));
3648
3652
  }
3649
3653
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
3650
3654
  }
@@ -3958,10 +3962,11 @@ class hyperliquid extends hyperliquid$1["default"] {
3958
3962
  vaultAddress = this.formatVaultAddress(vaultAddress);
3959
3963
  strAmount = strAmount + ' subaccount:' + vaultAddress;
3960
3964
  }
3965
+ const strAmountFinal = strAmount; // java req
3961
3966
  const toPerp = (toAccount === 'perp') || (toAccount === 'swap');
3962
3967
  const transferPayload = {
3963
3968
  'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
3964
- 'amount': strAmount,
3969
+ 'amount': strAmountFinal,
3965
3970
  'toPerp': toPerp,
3966
3971
  'nonce': nonce,
3967
3972
  };
@@ -3971,7 +3976,7 @@ class hyperliquid extends hyperliquid$1["default"] {
3971
3976
  'hyperliquidChain': transferPayload['hyperliquidChain'],
3972
3977
  'signatureChainId': '0x66eee',
3973
3978
  'type': 'usdClassTransfer',
3974
- 'amount': strAmount,
3979
+ 'amount': strAmountFinal,
3975
3980
  'toPerp': toPerp,
3976
3981
  'nonce': nonce,
3977
3982
  },
@@ -1384,17 +1384,18 @@ class indodax extends indodax$1["default"] {
1384
1384
  network = [];
1385
1385
  const networkIds = networkId.split(',');
1386
1386
  for (let j = 0; j < networkIds.length; j++) {
1387
- network.push(this.networkIdToCode(networkIds[j]).toUpperCase());
1387
+ network.push(this.networkIdToCode(networkIds[j], code).toUpperCase());
1388
1388
  }
1389
1389
  }
1390
1390
  else {
1391
- network = this.networkIdToCode(networkId).toUpperCase();
1391
+ network = this.networkIdToCode(networkId, code).toUpperCase();
1392
1392
  }
1393
1393
  }
1394
+ const finalNetwork = network; // java req
1394
1395
  result[code] = {
1395
1396
  'info': {},
1396
1397
  'currency': code,
1397
- 'network': network,
1398
+ 'network': finalNetwork,
1398
1399
  'address': address,
1399
1400
  'tag': undefined,
1400
1401
  };
@@ -838,66 +838,65 @@ class kraken extends kraken$1["default"] {
838
838
  // },
839
839
  // }
840
840
  //
841
- const currencies = this.safeValue(response, 'result', {});
842
- const ids = Object.keys(currencies);
843
- const result = {};
844
- for (let i = 0; i < ids.length; i++) {
845
- const id = ids[i];
846
- const currency = currencies[id];
847
- // todo: will need to rethink the fees
848
- // see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
849
- // to add support for multiple withdrawal/deposit methods and
850
- // differentiated fees for each particular method
851
- //
852
- // Notes about abbreviations:
853
- // Z and X prefixes: https://support.kraken.com/hc/en-us/articles/360001206766-Bitcoin-currency-code-XBT-vs-BTC
854
- // S and M suffixes: https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
841
+ const currencies = this.safeDict(response, 'result', {});
842
+ const enhancedArray = this.addKeyInArrayItems(currencies, '_coin_id');
843
+ return this.parseCurrencies(enhancedArray);
844
+ }
845
+ parseCurrency(rawCurrency) {
846
+ // todo: will need to rethink the fees
847
+ // see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
848
+ // to add support for multiple withdrawal/deposit methods and
849
+ // differentiated fees for each particular method
850
+ //
851
+ // Notes about abbreviations:
852
+ // Z and X prefixes: https://support.kraken.com/hc/en-us/articles/360001206766-Bitcoin-currency-code-XBT-vs-BTC
853
+ // S and M suffixes: https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
854
+ //
855
+ const id = this.safeString(rawCurrency, '_coin_id');
856
+ let code = this.safeCurrencyCode(id);
857
+ // the below cannot be reliably done in `safeCurrencyCode`, so we have to do it here
858
+ if (id.indexOf('.') < 0) {
859
+ const altName = this.safeString(rawCurrency, 'altname');
860
+ // handle cases like below:
855
861
  //
856
- let code = this.safeCurrencyCode(id);
857
- // the below can not be reliable done in `safeCurrencyCode`, so we have to do it here
858
- if (id.indexOf('.') < 0) {
859
- const altName = this.safeString(currency, 'altname');
860
- // handle cases like below:
861
- //
862
- // id | altname
863
- // ---------------
864
- // XXBT | XBT
865
- // ZUSD | USD
866
- if (id !== altName && (id.startsWith('X') || id.startsWith('Z'))) {
867
- code = this.safeCurrencyCode(altName);
868
- // also, add map in commonCurrencies:
869
- this.commonCurrencies[id] = code;
870
- }
871
- else {
872
- code = this.safeCurrencyCode(id);
873
- }
862
+ // id | altname
863
+ // ---------------
864
+ // XXBT | XBT
865
+ // ZUSD | USD
866
+ if (id !== altName && (id.startsWith('X') || id.startsWith('Z'))) {
867
+ code = this.safeCurrencyCode(altName);
868
+ // also, add map in commonCurrencies:
869
+ this.commonCurrencies[id] = code;
870
+ }
871
+ else {
872
+ code = this.safeCurrencyCode(id);
874
873
  }
875
- const isFiat = code.indexOf('.HOLD') >= 0;
876
- result[code] = this.safeCurrencyStructure({
877
- 'id': id,
878
- 'code': code,
879
- 'info': currency,
880
- 'name': this.safeString(currency, 'altname'),
881
- 'active': this.safeString(currency, 'status') === 'enabled',
882
- 'type': isFiat ? 'fiat' : 'crypto',
883
- 'deposit': undefined,
884
- 'withdraw': undefined,
885
- 'fee': undefined,
886
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
887
- 'limits': {
888
- 'amount': {
889
- 'min': undefined,
890
- 'max': undefined,
891
- },
892
- 'withdraw': {
893
- 'min': undefined,
894
- 'max': undefined,
895
- },
896
- },
897
- 'networks': {},
898
- });
899
874
  }
900
- return result;
875
+ const isFiat = code.indexOf('.HOLD') >= 0;
876
+ rawCurrency = this.omit(rawCurrency, '_coin_id');
877
+ return this.safeCurrencyStructure({
878
+ 'id': id,
879
+ 'code': code,
880
+ 'info': rawCurrency,
881
+ 'name': this.safeString(rawCurrency, 'altname'),
882
+ 'active': this.safeString(rawCurrency, 'status') === 'enabled',
883
+ 'type': isFiat ? 'fiat' : 'crypto',
884
+ 'deposit': undefined,
885
+ 'withdraw': undefined,
886
+ 'fee': undefined,
887
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'decimals'))),
888
+ 'limits': {
889
+ 'amount': {
890
+ 'min': undefined,
891
+ 'max': undefined,
892
+ },
893
+ 'withdraw': {
894
+ 'min': undefined,
895
+ 'max': undefined,
896
+ },
897
+ },
898
+ 'networks': {},
899
+ });
901
900
  }
902
901
  safeCurrencyCode(currencyId, currency = undefined) {
903
902
  if (currencyId === undefined) {
@@ -975,7 +974,7 @@ class kraken extends kraken$1["default"] {
975
974
  'tierBased': true,
976
975
  };
977
976
  }
978
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
977
+ parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
979
978
  const price = this.safeNumber(bidask, priceKey);
980
979
  const amount = this.safeNumber(bidask, amountKey);
981
980
  const timestamp = this.safeInteger(bidask, 2);
@@ -1733,10 +1732,11 @@ class kraken extends kraken$1["default"] {
1733
1732
  const amount = this.safeValue(rawOrder, 'amount');
1734
1733
  const price = this.safeValue(rawOrder, 'price');
1735
1734
  const orderParams = this.safeDict(rawOrder, 'params', {});
1735
+ const parsedAmount = this.amountToPrecision(market['symbol'], amount);
1736
1736
  const req = {
1737
1737
  'type': side,
1738
1738
  'ordertype': type,
1739
- 'volume': this.amountToPrecision(market['symbol'], amount),
1739
+ 'volume': parsedAmount,
1740
1740
  };
1741
1741
  const orderRequest = this.orderRequest('createOrders', marketId, type, req, amount, price, orderParams);
1742
1742
  ordersRequests.push(orderRequest[0]);
@@ -2074,12 +2074,12 @@ class kraken extends kraken$1["default"] {
2074
2074
  stopLossPrice = triggerPrice;
2075
2075
  }
2076
2076
  }
2077
- let finalType = this.parseOrderType(rawType);
2077
+ let typeParsed = this.parseOrderType(rawType);
2078
2078
  // unlike from endpoints which provide eg: "take-profit-limit"
2079
2079
  // for "space-delimited" orders we dont have market/limit suffixes, their format is
2080
2080
  // eg: `stop loss > limit 123`, so we need to parse them manually
2081
- if (this.inArray(finalType, ['stop loss', 'take profit'])) {
2082
- finalType = (price === undefined) ? 'market' : 'limit';
2081
+ if (this.inArray(typeParsed, ['stop loss', 'take profit'])) {
2082
+ typeParsed = (price === undefined) ? 'market' : 'limit';
2083
2083
  }
2084
2084
  const amendId = this.safeString(order, 'amend_id');
2085
2085
  if (amendId !== undefined) {
@@ -2094,7 +2094,7 @@ class kraken extends kraken$1["default"] {
2094
2094
  'lastTradeTimestamp': undefined,
2095
2095
  'status': status,
2096
2096
  'symbol': symbol,
2097
- 'type': finalType,
2097
+ 'type': typeParsed,
2098
2098
  'timeInForce': undefined,
2099
2099
  'postOnly': isPostOnly,
2100
2100
  'side': side,
@@ -3496,16 +3496,16 @@ class kraken extends kraken$1["default"] {
3496
3496
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
3497
3497
  await this.loadMarkets();
3498
3498
  const currency = this.currency(code);
3499
- fromAccount = this.parseAccountType(fromAccount);
3500
- toAccount = this.parseAccountType(toAccount);
3499
+ const fromAccountParsed = this.parseAccountType(fromAccount);
3500
+ const toAccountParsed = this.parseAccountType(toAccount);
3501
3501
  const request = {
3502
3502
  'amount': this.currencyToPrecision(code, amount),
3503
- 'from': fromAccount,
3504
- 'to': toAccount,
3503
+ 'from': fromAccountParsed,
3504
+ 'to': toAccountParsed,
3505
3505
  'asset': currency['id'],
3506
3506
  };
3507
- if (fromAccount !== 'Spot Wallet') {
3508
- throw new errors.BadRequest(this.id + ' transfer cannot transfer from ' + fromAccount + ' to ' + toAccount + '. Use krakenfutures instead to transfer from the futures account.');
3507
+ if (fromAccountParsed !== 'Spot Wallet') {
3508
+ throw new errors.BadRequest(this.id + ' transfer cannot transfer from ' + fromAccountParsed + ' to ' + toAccountParsed + '. Use krakenfutures instead to transfer from the futures account.');
3509
3509
  }
3510
3510
  const response = await this.privatePostWalletTransfer(this.extend(request, params));
3511
3511
  //
@@ -3520,8 +3520,8 @@ class kraken extends kraken$1["default"] {
3520
3520
  const transfer = this.parseTransfer(response, currency);
3521
3521
  return this.extend(transfer, {
3522
3522
  'amount': amount,
3523
- 'fromAccount': fromAccount,
3524
- 'toAccount': toAccount,
3523
+ 'fromAccount': fromAccountParsed,
3524
+ 'toAccount': toAccountParsed,
3525
3525
  });
3526
3526
  }
3527
3527
  parseTransfer(transfer, currency = undefined) {
@@ -2050,6 +2050,7 @@ class krakenfutures extends krakenfutures$1["default"] {
2050
2050
  const innerStatus = this.safeString(order, 'status');
2051
2051
  const fetchOrderPriceTriggerOptions = this.safeDict(orderDictFromFetchOrder, 'priceTriggerOptions', {});
2052
2052
  const fetchOrderTriggerPrice = this.safeString(fetchOrderPriceTriggerOptions, 'triggerPrice');
2053
+ const unifiedSymbol = this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market);
2053
2054
  return this.safeOrder({
2054
2055
  'info': order,
2055
2056
  'id': this.safeString(orderDictFromFetchOrder, 'orderId'),
@@ -2058,7 +2059,7 @@ class krakenfutures extends krakenfutures$1["default"] {
2058
2059
  'datetime': datetime,
2059
2060
  'lastTradeTimestamp': undefined,
2060
2061
  'lastUpdateTimestamp': this.parse8601(this.safeString(orderDictFromFetchOrder, 'lastUpdateTimestamp')),
2061
- 'symbol': this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market),
2062
+ 'symbol': unifiedSymbol,
2062
2063
  'type': undefined,
2063
2064
  'timeInForce': undefined,
2064
2065
  'postOnly': undefined,
@@ -3614,7 +3614,7 @@ class kucoin extends kucoin$1["default"] {
3614
3614
  let networkCode = undefined;
3615
3615
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
3616
3616
  if (networkCode !== undefined) {
3617
- request['chain'] = this.networkCodeToId(networkCode).toLowerCase();
3617
+ request['chain'] = this.networkCodeToId(networkCode, code).toLowerCase();
3618
3618
  }
3619
3619
  //
3620
3620
  // {
@@ -4292,6 +4292,7 @@ class kucoin extends kucoin$1["default"] {
4292
4292
  */
4293
4293
  async createUtaOrder(symbol, type, side, amount, price = undefined, params = {}) {
4294
4294
  await this.loadMarkets();
4295
+ const market = this.market(symbol);
4295
4296
  const request = this.createUtaOrderRequest(symbol, type, side, amount, price, params);
4296
4297
  const response = await this.utaPrivatePostAccountModeOrderPlace(request);
4297
4298
  //
@@ -4306,7 +4307,7 @@ class kucoin extends kucoin$1["default"] {
4306
4307
  // }
4307
4308
  //
4308
4309
  const data = this.safeDict(response, 'data', {});
4309
- return this.parseOrder(data);
4310
+ return this.parseOrder(data, market);
4310
4311
  }
4311
4312
  createUtaOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
4312
4313
  const market = this.market(symbol);
@@ -516,39 +516,37 @@ class latoken extends latoken$1["default"] {
516
516
  // },
517
517
  // ]
518
518
  //
519
- const result = {};
520
- for (let i = 0; i < response.length; i++) {
521
- const currency = response[i];
522
- const id = this.safeString(currency, 'id');
523
- const tag = this.safeString(currency, 'tag');
524
- const code = this.safeCurrencyCode(tag);
525
- const currencyType = this.safeString(currency, 'type');
526
- const isCrypto = (currencyType === 'CURRENCY_TYPE_CRYPTO' || currencyType === 'CURRENCY_TYPE_IEO');
527
- result[code] = this.safeCurrencyStructure({
528
- 'id': id,
529
- 'code': code,
530
- 'info': currency,
531
- 'name': this.safeString(currency, 'name'),
532
- 'type': isCrypto ? 'crypto' : 'other',
533
- 'active': this.safeString(currency, 'status') === 'CURRENCY_STATUS_ACTIVE',
534
- 'deposit': undefined,
535
- 'withdraw': undefined,
536
- 'fee': this.safeNumber(currency, 'fee'),
537
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
538
- 'limits': {
539
- 'amount': {
540
- 'min': this.safeNumber(currency, 'minTransferAmount'),
541
- 'max': undefined,
542
- },
543
- 'withdraw': {
544
- 'min': undefined,
545
- 'max': undefined,
546
- },
519
+ return this.parseCurrencies(response);
520
+ }
521
+ parseCurrency(currency) {
522
+ const id = this.safeString(currency, 'id');
523
+ const tag = this.safeString(currency, 'tag');
524
+ const code = this.safeCurrencyCode(tag);
525
+ const currencyType = this.safeString(currency, 'type');
526
+ const isCrypto = (currencyType === 'CURRENCY_TYPE_CRYPTO' || currencyType === 'CURRENCY_TYPE_IEO');
527
+ return this.safeCurrencyStructure({
528
+ 'id': id,
529
+ 'code': code,
530
+ 'info': currency,
531
+ 'name': this.safeString(currency, 'name'),
532
+ 'type': isCrypto ? 'crypto' : 'other',
533
+ 'active': this.safeString(currency, 'status') === 'CURRENCY_STATUS_ACTIVE',
534
+ 'deposit': undefined,
535
+ 'withdraw': undefined,
536
+ 'fee': this.safeNumber(currency, 'fee'),
537
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
538
+ 'limits': {
539
+ 'amount': {
540
+ 'min': this.safeNumber(currency, 'minTransferAmount'),
541
+ 'max': undefined,
547
542
  },
548
- 'networks': {},
549
- });
550
- }
551
- return result;
543
+ 'withdraw': {
544
+ 'min': undefined,
545
+ 'max': undefined,
546
+ },
547
+ },
548
+ 'networks': {},
549
+ });
552
550
  }
553
551
  /**
554
552
  * @method