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
@@ -453,66 +453,65 @@ class lbank extends lbank$1["default"] {
453
453
  //
454
454
  const currenciesData = this.safeList(response, 'data', []);
455
455
  const grouped = this.groupBy(currenciesData, 'assetCode');
456
- const groupedKeys = Object.keys(grouped);
457
- const result = {};
458
- for (let i = 0; i < groupedKeys.length; i++) {
459
- const id = (groupedKeys[i]).toString(); // some currencies are numeric
460
- const code = this.safeCurrencyCode(id);
461
- const networksRaw = grouped[id];
462
- const networks = {};
463
- for (let j = 0; j < networksRaw.length; j++) {
464
- const networkEntry = networksRaw[j];
465
- let networkId = this.safeString(networkEntry, 'chain');
466
- if (networkId === undefined) {
467
- networkId = this.safeString(networkEntry, 'assetCode'); // use type as fallback if networkId is not present
468
- }
469
- const networkCode = this.networkIdToCode(networkId);
470
- networks[networkCode] = {
471
- 'id': networkId,
472
- 'network': networkCode,
473
- 'limits': {
474
- 'withdraw': {
475
- 'min': this.safeNumber(networkEntry, 'min'),
476
- 'max': undefined,
477
- },
478
- 'deposit': {
479
- 'min': this.safeNumber(networkEntry, 'minTransfer'),
480
- 'max': undefined,
481
- },
482
- },
483
- 'active': undefined,
484
- 'deposit': undefined,
485
- 'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
486
- 'fee': this.safeNumber(networkEntry, 'fee'),
487
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
488
- 'info': networkEntry,
489
- };
456
+ const values = Object.values(grouped);
457
+ return this.parseCurrencies(values);
458
+ }
459
+ parseCurrency(rawCurrency) {
460
+ const id = this.safeString(rawCurrency[0], 'assetCode'); // first member is guaranteed
461
+ const code = this.safeCurrencyCode(id);
462
+ const networksRaw = rawCurrency;
463
+ const networks = {};
464
+ for (let j = 0; j < networksRaw.length; j++) {
465
+ const networkEntry = networksRaw[j];
466
+ let networkId = this.safeString(networkEntry, 'chain');
467
+ if (networkId === undefined) {
468
+ networkId = this.safeString(networkEntry, 'assetCode'); // use type as fallback if networkId is not present
490
469
  }
491
- result[code] = this.safeCurrencyStructure({
492
- 'id': id,
493
- 'code': code,
494
- 'precision': undefined,
495
- 'type': undefined,
496
- 'name': undefined,
497
- 'active': undefined,
498
- 'deposit': undefined,
499
- 'withdraw': undefined,
500
- 'fee': undefined,
470
+ const networkCode = this.networkIdToCode(networkId, code);
471
+ networks[networkCode] = {
472
+ 'id': networkId,
473
+ 'network': networkCode,
501
474
  'limits': {
502
475
  'withdraw': {
503
- 'min': undefined,
476
+ 'min': this.safeNumber(networkEntry, 'min'),
504
477
  'max': undefined,
505
478
  },
506
479
  'deposit': {
507
- 'min': undefined,
480
+ 'min': this.safeNumber(networkEntry, 'minTransfer'),
508
481
  'max': undefined,
509
482
  },
510
483
  },
511
- 'networks': networks,
512
- 'info': networksRaw,
513
- });
484
+ 'active': undefined,
485
+ 'deposit': undefined,
486
+ 'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
487
+ 'fee': this.safeNumber(networkEntry, 'fee'),
488
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
489
+ 'info': networkEntry,
490
+ };
514
491
  }
515
- return result;
492
+ return this.safeCurrencyStructure({
493
+ 'id': id,
494
+ 'code': code,
495
+ 'precision': undefined,
496
+ 'type': undefined,
497
+ 'name': undefined,
498
+ 'active': undefined,
499
+ 'deposit': undefined,
500
+ 'withdraw': undefined,
501
+ 'fee': undefined,
502
+ 'limits': {
503
+ 'withdraw': {
504
+ 'min': undefined,
505
+ 'max': undefined,
506
+ },
507
+ 'deposit': {
508
+ 'min': undefined,
509
+ 'max': undefined,
510
+ },
511
+ },
512
+ 'networks': networks,
513
+ 'info': networksRaw,
514
+ });
516
515
  }
517
516
  /**
518
517
  * @method
@@ -1060,9 +1059,10 @@ class lbank extends lbank$1["default"] {
1060
1059
  let fee = undefined;
1061
1060
  const feeCost = this.safeString(trade, 'tradeFee');
1062
1061
  if (feeCost !== undefined) {
1062
+ const feeCurr = (side === 'buy') ? market['base'] : market['quote'];
1063
1063
  fee = {
1064
1064
  'cost': feeCost,
1065
- 'currency': (side === 'buy') ? market['base'] : market['quote'],
1065
+ 'currency': feeCurr,
1066
1066
  'rate': this.safeString(trade, 'tradeFeeRate'),
1067
1067
  };
1068
1068
  }
@@ -1185,11 +1185,13 @@ class lbank extends lbank$1["default"] {
1185
1185
  const duration = this.parseTimeframe(timeframe);
1186
1186
  since = this.milliseconds() - (duration * 1000 * limit);
1187
1187
  }
1188
+ const parsedSince = this.parseToInt(since / 1000);
1189
+ const parsedLimit = Math.min(limit + 1, 2000); // max 2000;
1188
1190
  const request = {
1189
1191
  'symbol': market['id'],
1190
1192
  'type': this.safeString(this.timeframes, timeframe, timeframe),
1191
- 'time': this.parseToInt(since / 1000),
1192
- 'size': Math.min(limit + 1, 2000), // max 2000
1193
+ 'time': parsedSince,
1194
+ 'size': parsedLimit,
1193
1195
  };
1194
1196
  const response = await this.spotPublicGetKline(this.extend(request, params));
1195
1197
  const ohlcvs = this.safeList(response, 'data', []);
@@ -2272,7 +2274,7 @@ class lbank extends lbank$1["default"] {
2272
2274
  return {
2273
2275
  'info': response,
2274
2276
  'currency': code,
2275
- 'network': this.networkIdToCode(this.safeString(result, 'netWork')),
2277
+ 'network': this.networkIdToCode(this.safeString(result, 'netWork'), code),
2276
2278
  'address': address,
2277
2279
  'tag': tag,
2278
2280
  };
@@ -2461,7 +2463,7 @@ class lbank extends lbank$1["default"] {
2461
2463
  'txid': txid,
2462
2464
  'timestamp': timestamp,
2463
2465
  'datetime': this.iso8601(timestamp),
2464
- 'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
2466
+ 'network': this.networkIdToCode(this.safeString(transaction, 'networkName'), code),
2465
2467
  'address': address,
2466
2468
  'addressTo': addressTo,
2467
2469
  'addressFrom': addressFrom,
@@ -2666,7 +2668,7 @@ class lbank extends lbank$1["default"] {
2666
2668
  const networkEntry = networkList[j];
2667
2669
  const fee = this.safeNumber(networkEntry, 'withdrawFee');
2668
2670
  if (fee !== undefined) {
2669
- const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2671
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
2670
2672
  withdrawFees[code][networkCode] = fee;
2671
2673
  }
2672
2674
  }
@@ -2718,7 +2720,7 @@ class lbank extends lbank$1["default"] {
2718
2720
  if (canWithdraw === 'true') {
2719
2721
  const currencyId = this.safeString(item, 'assetCode');
2720
2722
  const codeInner = this.safeCurrencyCode(currencyId);
2721
- let network = this.networkIdToCode(this.safeString(item, 'chain'));
2723
+ let network = this.networkIdToCode(this.safeString(item, 'chain'), codeInner);
2722
2724
  if (network === undefined) {
2723
2725
  network = codeInner;
2724
2726
  }
@@ -2869,7 +2871,7 @@ class lbank extends lbank$1["default"] {
2869
2871
  const resultCodeInfo = result[code]['info'];
2870
2872
  resultCodeInfo.push(fee);
2871
2873
  }
2872
- const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
2874
+ const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'), code);
2873
2875
  if (networkCode !== undefined) {
2874
2876
  result[code]['networks'][networkCode] = {
2875
2877
  'withdraw': {
@@ -2922,10 +2924,11 @@ class lbank extends lbank$1["default"] {
2922
2924
  // }
2923
2925
  //
2924
2926
  const result = this.depositWithdrawFee(fee);
2927
+ const code = this.safeString(currency, 'code');
2925
2928
  const networkList = this.safeValue(fee, 'networkList', []);
2926
2929
  for (let j = 0; j < networkList.length; j++) {
2927
2930
  const networkEntry = networkList[j];
2928
- const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2931
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
2929
2932
  const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
2930
2933
  const isDefault = this.safeValue(networkEntry, 'isDefault');
2931
2934
  if (withdrawFee !== undefined) {
@@ -2978,9 +2981,10 @@ class lbank extends lbank$1["default"] {
2978
2981
  else {
2979
2982
  signatureMethod = 'HmacSHA256';
2980
2983
  }
2984
+ const finalSig = signatureMethod; // java req
2981
2985
  const auth = this.rawencode(this.keysort(this.extend({
2982
2986
  'echostr': echostr,
2983
- 'signature_method': signatureMethod,
2987
+ 'signature_method': finalSig,
2984
2988
  'timestamp': timestamp,
2985
2989
  }, query)));
2986
2990
  const encoded = this.encode(auth);
@@ -443,7 +443,7 @@ class lighter extends lighter$1["default"] {
443
443
  * @method
444
444
  * @name lighter#preLoadLighterLibrary
445
445
  * @description if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
446
- * @param params
446
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
447
447
  * @returns {boolean} true if the signer was loaded, false otherwise
448
448
  */
449
449
  async preLoadLighterLibrary(params = {}) {
@@ -1275,44 +1275,42 @@ class lighter extends lighter$1["default"] {
1275
1275
  // }
1276
1276
  //
1277
1277
  const data = this.safeList(response, 'asset_details', []);
1278
- const result = {};
1279
- for (let i = 0; i < data.length; i++) {
1280
- const entry = data[i];
1281
- const id = this.safeString(entry, 'asset_id');
1282
- const code = this.safeCurrencyCode(this.safeString(entry, 'symbol'));
1283
- const decimals = this.safeString(entry, 'decimals');
1284
- const isUSDC = (code === 'USDC');
1285
- let depositMin = undefined;
1286
- let withdrawMin = undefined;
1287
- if (isUSDC) {
1288
- depositMin = this.safeNumber(entry, 'min_transfer_amount');
1289
- withdrawMin = this.safeNumber(entry, 'min_withdrawal_amount');
1290
- }
1291
- result[code] = this.safeCurrencyStructure({
1292
- 'id': id,
1293
- 'name': code,
1294
- 'code': code,
1295
- 'precision': this.parseNumber('1e-' + decimals),
1296
- 'active': true,
1297
- 'fee': undefined,
1298
- 'networks': {},
1299
- 'deposit': isUSDC,
1300
- 'withdraw': isUSDC,
1301
- 'type': 'crypto',
1302
- 'limits': {
1303
- 'deposit': {
1304
- 'min': depositMin,
1305
- 'max': undefined,
1306
- },
1307
- 'withdraw': {
1308
- 'min': withdrawMin,
1309
- 'max': undefined,
1310
- },
1278
+ return this.parseCurrencies(data);
1279
+ }
1280
+ parseCurrency(rawCurrency) {
1281
+ const id = this.safeString(rawCurrency, 'asset_id');
1282
+ const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'symbol'));
1283
+ const decimals = this.safeString(rawCurrency, 'decimals');
1284
+ const isUSDC = (code === 'USDC');
1285
+ let depositMin = undefined;
1286
+ let withdrawMin = undefined;
1287
+ if (isUSDC) {
1288
+ depositMin = this.safeNumber(rawCurrency, 'min_transfer_amount');
1289
+ withdrawMin = this.safeNumber(rawCurrency, 'min_withdrawal_amount');
1290
+ }
1291
+ return this.safeCurrencyStructure({
1292
+ 'id': id,
1293
+ 'name': code,
1294
+ 'code': code,
1295
+ 'precision': this.parseNumber('1e-' + decimals),
1296
+ 'active': true,
1297
+ 'fee': undefined,
1298
+ 'networks': {},
1299
+ 'deposit': isUSDC,
1300
+ 'withdraw': isUSDC,
1301
+ 'type': 'crypto',
1302
+ 'limits': {
1303
+ 'deposit': {
1304
+ 'min': depositMin,
1305
+ 'max': undefined,
1311
1306
  },
1312
- 'info': entry,
1313
- });
1314
- }
1315
- return result;
1307
+ 'withdraw': {
1308
+ 'min': withdrawMin,
1309
+ 'max': undefined,
1310
+ },
1311
+ },
1312
+ 'info': rawCurrency,
1313
+ });
1316
1314
  }
1317
1315
  /**
1318
1316
  * @method
@@ -331,39 +331,19 @@ class luno extends luno$1["default"] {
331
331
  // }
332
332
  //
333
333
  const currenciesData = this.safeList(response, 'data', []);
334
- const result = {};
335
- for (let i = 0; i < currenciesData.length; i++) {
336
- const networkEntry = currenciesData[i];
337
- const id = this.safeString(networkEntry, 'native_currency');
338
- const code = this.safeCurrencyCode(id);
339
- if (!(code in result)) {
340
- result[code] = {
341
- 'id': id,
342
- 'code': code,
343
- 'precision': undefined,
344
- 'type': undefined,
345
- 'name': undefined,
346
- 'active': undefined,
347
- 'deposit': undefined,
348
- 'withdraw': undefined,
349
- 'fee': undefined,
350
- 'limits': {
351
- 'withdraw': {
352
- 'min': undefined,
353
- 'max': undefined,
354
- },
355
- 'deposit': {
356
- 'min': undefined,
357
- 'max': undefined,
358
- },
359
- },
360
- 'networks': {},
361
- 'info': {},
362
- };
363
- }
334
+ const grouped = this.groupBy(currenciesData, 'native_currency');
335
+ const values = Object.values(grouped);
336
+ return this.parseCurrencies(values);
337
+ }
338
+ parseCurrency(rawCurrency) {
339
+ const id = this.safeString(rawCurrency[0], 'native_currency'); // first item is guaranteed
340
+ const code = this.safeCurrencyCode(id);
341
+ const networks = {};
342
+ for (let i = 0; i < rawCurrency.length; i++) {
343
+ const networkEntry = rawCurrency[i];
364
344
  const networkId = this.safeString(networkEntry, 'name');
365
- const networkCode = this.networkIdToCode(networkId);
366
- result[code]['networks'][networkCode] = {
345
+ const networkCode = this.networkIdToCode(networkId, code);
346
+ networks[networkCode] = {
367
347
  'id': networkId,
368
348
  'network': networkCode,
369
349
  'limits': {
@@ -383,18 +363,30 @@ class luno extends luno$1["default"] {
383
363
  'precision': undefined,
384
364
  'info': networkEntry,
385
365
  };
386
- // add entry in info
387
- const info = this.safeList(result[code], 'info', []);
388
- info.push(networkEntry);
389
- result[code]['info'] = info;
390
366
  }
391
- // only after all entries are formed in currencies, restructure each entry
392
- const allKeys = Object.keys(result);
393
- for (let i = 0; i < allKeys.length; i++) {
394
- const code = allKeys[i];
395
- result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
396
- }
397
- return result;
367
+ return this.safeCurrencyStructure({
368
+ 'id': id,
369
+ 'code': code,
370
+ 'precision': undefined,
371
+ 'type': undefined,
372
+ 'name': undefined,
373
+ 'active': undefined,
374
+ 'deposit': undefined,
375
+ 'withdraw': undefined,
376
+ 'fee': undefined,
377
+ 'limits': {
378
+ 'withdraw': {
379
+ 'min': undefined,
380
+ 'max': undefined,
381
+ },
382
+ 'deposit': {
383
+ 'min': undefined,
384
+ 'max': undefined,
385
+ },
386
+ },
387
+ 'networks': networks,
388
+ 'info': rawCurrency,
389
+ });
398
390
  }
399
391
  /**
400
392
  * @method
@@ -1276,7 +1268,7 @@ class luno extends luno$1["default"] {
1276
1268
  const firstWord = this.safeString(words, 0);
1277
1269
  const thirdWord = this.safeString(words, 2);
1278
1270
  const fourthWord = this.safeString(words, 3);
1279
- let type = this.safeString(types, firstWord, undefined);
1271
+ let type = this.safeString(types, firstWord);
1280
1272
  if ((type === undefined) && (thirdWord === 'fee')) {
1281
1273
  type = 'fee';
1282
1274
  }
@@ -685,6 +685,7 @@ class mercado extends mercado$1["default"] {
685
685
  const filled = this.safeString(order, 'executed_quantity');
686
686
  const lastTradeTimestamp = this.safeTimestamp(order, 'updated_timestamp');
687
687
  const rawTrades = this.safeValue(order, 'operations', []);
688
+ const symbol = market['symbol'];
688
689
  return this.safeOrder({
689
690
  'info': order,
690
691
  'id': id,
@@ -692,7 +693,7 @@ class mercado extends mercado$1["default"] {
692
693
  'timestamp': timestamp,
693
694
  'datetime': this.iso8601(timestamp),
694
695
  'lastTradeTimestamp': lastTradeTimestamp,
695
- 'symbol': market['symbol'],
696
+ 'symbol': symbol,
696
697
  'type': 'limit',
697
698
  'timeInForce': undefined,
698
699
  'postOnly': undefined,