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
@@ -636,7 +636,7 @@ class gate extends gate$1["default"] {
636
636
  for (let i = 0; i < bidAsks.length; i++) {
637
637
  const bidAsk = bidAsks[i];
638
638
  if (Array.isArray(bidAsk)) {
639
- bookSide.storeArray(this.parseBidAsk(bidAsk));
639
+ bookSide.storeArray(this.parseOrderBookBidAsk(bidAsk));
640
640
  }
641
641
  else {
642
642
  const price = this.safeFloat(bidAsk, 'p');
@@ -578,6 +578,14 @@ class grvt extends grvt$1["default"] {
578
578
  orderbook['timestamp'] = timestamp;
579
579
  orderbook['datetime'] = this.iso8601(timestamp);
580
580
  }
581
+ // grvt defaults to the delta channel (v1.book.d); if the very first
582
+ // message is a delta, the freshly-created orderbook has symbol=null
583
+ // because no snapshot has reset it yet. Set it unconditionally — we
584
+ // know the symbol from the selector regardless of channel. Java's
585
+ // typed WsOrderBook surfaces this as `"symbol":null` in the output;
586
+ // Python/JS dict-backed orderbooks happen to mask it but the
587
+ // unconditional assignment is correct for every language.
588
+ orderbook['symbol'] = symbol;
581
589
  orderbook['nonce'] = sequenceNumber;
582
590
  const messageHash = 'orderbook::' + symbol;
583
591
  this.orderbooks[symbol] = orderbook;
@@ -1361,10 +1361,10 @@ class htx extends htx$1["default"] {
1361
1361
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
1362
1362
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
1363
1363
  * @description watch all open positions. Note: huobi has one channel for each marginMode and type
1364
- * @param {string[]|undefined} symbols list of unified market symbols
1365
- * @param since
1366
- * @param limit
1367
- * @param {object} params extra parameters specific to the exchange API endpoint
1364
+ * @param {string[]} [symbols] list of unified market symbols
1365
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
1366
+ * @param {int} [limit] the maximum number of positions to fetch
1367
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1368
1368
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
1369
1369
  */
1370
1370
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -241,7 +241,7 @@ class independentreserve extends independentreserve$1["default"] {
241
241
  return result;
242
242
  }
243
243
  handleDelta(bookside, delta) {
244
- const bidAsk = this.parseBidAsk(delta, 'Price', 'Volume');
244
+ const bidAsk = this.parseOrderBookBidAsk(delta, 'Price', 'Volume');
245
245
  bookside.storeArray(bidAsk);
246
246
  }
247
247
  handleDeltas(bookside, deltas) {
@@ -266,10 +266,10 @@ class krakenfutures extends krakenfutures$1["default"] {
266
266
  * @name krakenfutures#watchPositions
267
267
  * @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
268
268
  * @description watch all open positions
269
- * @param {string[]|undefined} symbols list of unified market symbols
270
- * @param since
271
- * @param limit
272
- * @param {object} params extra parameters specific to the exchange API endpoint
269
+ * @param {string[]} [symbols] list of unified market symbols
270
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
271
+ * @param {int} [limit] the maximum number of positions to fetch
272
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
273
273
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
274
274
  */
275
275
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -1542,8 +1542,20 @@ class krakenfutures extends krakenfutures$1["default"] {
1542
1542
  // event: 'alert',
1543
1543
  // message: 'Failed to subscribe to authenticated feed'
1544
1544
  // }
1545
+ // {
1546
+ // event: 'alert',
1547
+ // message: 'Already subscribed to feed, re-requesting'
1548
+ // }
1545
1549
  //
1546
1550
  const errMsg = this.safeString(message, 'message');
1551
+ // Benign "already subscribed" notice: the original subscription is still
1552
+ // active and delivering data on this socket. The generic client.reject
1553
+ // below rejects every pending future on the connection, so a stray
1554
+ // re-subscribe warning would kill unrelated in-flight watch* calls —
1555
+ // mirrors the bitmart 90008 fix.
1556
+ if (errMsg !== undefined && errMsg.indexOf('Already subscribed') >= 0) {
1557
+ return false;
1558
+ }
1547
1559
  try {
1548
1560
  throw new errors.ExchangeError(this.id + ' ' + errMsg);
1549
1561
  }
@@ -1753,7 +1753,7 @@ class kucoin extends kucoin$1["default"] {
1753
1753
  }
1754
1754
  handleBidAsks(bookSide, bidAsks) {
1755
1755
  for (let i = 0; i < bidAsks.length; i++) {
1756
- const bidAsk = this.parseBidAsk(bidAsks[i]);
1756
+ const bidAsk = this.parseOrderBookBidAsk(bidAsks[i]);
1757
1757
  bookSide.storeArray(bidAsk);
1758
1758
  }
1759
1759
  }
@@ -214,8 +214,8 @@ class luno extends luno$1["default"] {
214
214
  client.resolve(orderbook, messageHash);
215
215
  }
216
216
  customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
217
- const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
218
- const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
217
+ const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
218
+ const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
219
219
  return {
220
220
  'symbol': symbol,
221
221
  'bids': this.sortBy(bids, 0, true),
@@ -225,7 +225,7 @@ class luno extends luno$1["default"] {
225
225
  'nonce': undefined,
226
226
  };
227
227
  }
228
- parseBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
228
+ parseOrderBookBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
229
229
  bidasks = this.toArray(bidasks);
230
230
  const result = [];
231
231
  for (let i = 0; i < bidasks.length; i++) {
@@ -961,9 +961,9 @@ class modetrade extends modetrade$1["default"] {
961
961
  * @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/private/position-push
962
962
  * @description watch all open positions
963
963
  * @param {string[]} [symbols] list of unified market symbols
964
- * @param since timestamp in ms of the earliest position to fetch
965
- * @param limit the maximum number of positions to fetch
966
- * @param {object} params extra parameters specific to the exchange API endpoint
964
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
965
+ * @param {int} [limit] the maximum number of positions to fetch
966
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
967
967
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
968
968
  */
969
969
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -1702,10 +1702,10 @@ class okx extends okx$1["default"] {
1702
1702
  * @name okx#watchPositions
1703
1703
  * @see https://www.okx.com/docs-v5/en/#trading-account-websocket-positions-channel
1704
1704
  * @description watch all open positions
1705
- * @param {string[]|undefined} symbols list of unified market symbols
1706
- * @param since
1707
- * @param limit
1708
- * @param {object} params extra parameters specific to the exchange API endpoint
1705
+ * @param {string[]} [symbols] list of unified market symbols
1706
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
1707
+ * @param {int} [limit] the maximum number of positions to fetch
1708
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1709
1709
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
1710
1710
  */
1711
1711
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -391,7 +391,7 @@ class onetrading extends onetrading$1["default"] {
391
391
  //
392
392
  // [ 'BUY', "0.053595", "0" ]
393
393
  //
394
- const bidAsk = this.parseBidAsk(delta, 1, 2);
394
+ const bidAsk = this.parseOrderBookBidAsk(delta, 1, 2);
395
395
  const type = this.safeString(delta, 0);
396
396
  if (type === 'BUY') {
397
397
  const bids = orderbook['bids'];
@@ -577,7 +577,7 @@ class toobit extends toobit$1["default"] {
577
577
  }
578
578
  }
579
579
  handleDelta(bookside, delta) {
580
- const bidAsk = this.parseBidAsk(delta);
580
+ const bidAsk = this.parseOrderBookBidAsk(delta);
581
581
  bookside.storeArray(bidAsk);
582
582
  }
583
583
  handleOrderBookPartialSnapshot(client, message) {
@@ -882,7 +882,7 @@ class weex extends weex$1["default"] {
882
882
  client.resolve(orderbook, messageHash);
883
883
  }
884
884
  handleDelta(bookside, delta) {
885
- const bidAsk = this.parseBidAsk(delta);
885
+ const bidAsk = this.parseOrderBookBidAsk(delta);
886
886
  bookside.storeArray(bidAsk);
887
887
  }
888
888
  /**
@@ -1202,10 +1202,10 @@ class woo extends woo$1["default"] {
1202
1202
  * @name woo#watchPositions
1203
1203
  * @see https://docs.woox.io/#position-push
1204
1204
  * @description watch all open positions
1205
- * @param {string[]|undefined} symbols list of unified market symbols
1206
- * @param since
1207
- * @param limit
1208
- * @param {object} params extra parameters specific to the exchange API endpoint
1205
+ * @param {string[]} [symbols] list of unified market symbols
1206
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
1207
+ * @param {int} [limit] the maximum number of positions to fetch
1208
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1209
1209
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
1210
1210
  */
1211
1211
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -961,9 +961,9 @@ class woofipro extends woofipro$1["default"] {
961
961
  * @see https://orderly.network/docs/build-on-omnichain/evm-api/websocket-api/private/position-push
962
962
  * @description watch all open positions
963
963
  * @param {string[]} [symbols] list of unified market symbols
964
- * @param since timestamp in ms of the earliest position to fetch
965
- * @param limit the maximum number of positions to fetch
966
- * @param {object} params extra parameters specific to the exchange API endpoint
964
+ * @param {int} [since] timestamp in ms of the earliest position to fetch
965
+ * @param {int} [limit] the maximum number of positions to fetch
966
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
967
967
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
968
968
  */
969
969
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -603,7 +603,7 @@ class xt extends xt$1["default"] {
603
603
  }
604
604
  }
605
605
  async loadPositionsSnapshot(client, messageHash) {
606
- const positions = await this.fetchPositions(undefined);
606
+ const positions = await this.fetchPositions();
607
607
  this.positions = new Cache.ArrayCacheBySymbolBySide();
608
608
  const cache = this.positions;
609
609
  for (let i = 0; i < positions.length; i++) {
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index$1 = require('../../../scure-starknet/index.js');
5
+ var index = require('../../../scure-starknet/index.js');
6
6
  var constants = require('../../constants.js');
7
- var index = require('../calldata/index.js');
7
+ var index$1 = require('../calldata/index.js');
8
8
  var cairo = require('../calldata/cairo.js');
9
9
  require('../../../scure-base/index.js');
10
10
  var num = require('../num.js');
@@ -13,10 +13,10 @@ var num = require('../num.js');
13
13
  * Class Hash
14
14
  */
15
15
  function computePedersenHash(a, b) {
16
- return index$1.pedersen(BigInt(a), BigInt(b));
16
+ return index.pedersen(BigInt(a), BigInt(b));
17
17
  }
18
18
  function computePoseidonHash(a, b) {
19
- return num.toHex(index$1.poseidonHash(BigInt(a), BigInt(b)));
19
+ return num.toHex(index.poseidonHash(BigInt(a), BigInt(b)));
20
20
  }
21
21
  /**
22
22
  * Compute pedersen hash from data
@@ -24,19 +24,19 @@ function computePoseidonHash(a, b) {
24
24
  */
25
25
  function computeHashOnElements(data) {
26
26
  return [...data, data.length]
27
- .reduce((x, y) => index$1.pedersen(BigInt(x), BigInt(y)), 0)
27
+ .reduce((x, y) => index.pedersen(BigInt(x), BigInt(y)), 0)
28
28
  .toString();
29
29
  }
30
30
  const computePedersenHashOnElements = computeHashOnElements;
31
31
  function computePoseidonHashOnElements(data) {
32
- return num.toHex(index$1.poseidonHashMany(data.map((x) => BigInt(x))));
32
+ return num.toHex(index.poseidonHashMany(data.map((x) => BigInt(x))));
33
33
  }
34
34
  /**
35
35
  * Calculate contract address from class hash
36
36
  * @returns format: hex-string
37
37
  */
38
38
  function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) {
39
- const compiledCalldata = index.CallData.compile(constructorCalldata);
39
+ const compiledCalldata = index$1.CallData.compile(constructorCalldata);
40
40
  const constructorCalldataHash = computeHashOnElements(compiledCalldata);
41
41
  const CONTRACT_ADDRESS_PREFIX = cairo.felt('0x535441524b4e45545f434f4e54524143545f41444452455353'); // Equivalent to 'STARKNET_CONTRACT_ADDRESS'
42
42
  const hash = computeHashOnElements([
@@ -2477,7 +2477,7 @@ class tokocrypto extends tokocrypto$1["default"] {
2477
2477
  request['addressTag'] = tag;
2478
2478
  }
2479
2479
  const [networkCode, query] = this.handleNetworkCodeAndParams(params);
2480
- const networkId = this.networkCodeToId(networkCode);
2480
+ const networkId = this.networkCodeToId(networkCode, code);
2481
2481
  if (networkId !== undefined) {
2482
2482
  request['network'] = networkId.toUpperCase();
2483
2483
  }
@@ -612,7 +612,7 @@ class toobit extends toobit$1["default"] {
612
612
  for (let j = 0; j < rawNetworks.length; j++) {
613
613
  const rawNetwork = rawNetworks[j];
614
614
  const networkId = this.safeString(rawNetwork, 'chainType');
615
- const networkCode = this.networkIdToCode(networkId);
615
+ const networkCode = this.networkIdToCode(networkId, code);
616
616
  networks[networkCode] = {
617
617
  'id': networkId,
618
618
  'network': networkCode,
@@ -2518,7 +2518,7 @@ class toobit extends toobit$1["default"] {
2518
2518
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2519
2519
  return await this.fetchDepositsOrWithdrawalsHelper('withdrawals', code, since, limit, params);
2520
2520
  }
2521
- async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params) {
2521
+ async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params = {}) {
2522
2522
  await this.loadMarkets();
2523
2523
  let currency = undefined;
2524
2524
  let request = {};
@@ -2700,7 +2700,7 @@ class toobit extends toobit$1["default"] {
2700
2700
  if (networkCode === undefined) {
2701
2701
  throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() : param["network"] is required');
2702
2702
  }
2703
- request['chainType'] = this.networkCodeToId(networkCode);
2703
+ request['chainType'] = this.networkCodeToId(networkCode, code);
2704
2704
  const response = await this.privateGetApiV1AccountDepositAddress(this.extend(request, paramsOmitted));
2705
2705
  //
2706
2706
  // {
@@ -680,8 +680,8 @@ class upbit extends upbit$1["default"] {
680
680
  const timestamp = this.safeInteger(orderbook, 'timestamp');
681
681
  result[symbol] = {
682
682
  'symbol': symbol,
683
- 'bids': this.sortBy(this.parseBidsAsks(orderbook['orderbook_units'], 'bid_price', 'bid_size'), 0, true),
684
- 'asks': this.sortBy(this.parseBidsAsks(orderbook['orderbook_units'], 'ask_price', 'ask_size'), 0),
683
+ 'bids': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'bid_price', 'bid_size'), 0, true),
684
+ 'asks': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'ask_price', 'ask_size'), 0),
685
685
  'timestamp': timestamp,
686
686
  'datetime': this.iso8601(timestamp),
687
687
  'nonce': undefined,
@@ -2170,7 +2170,7 @@ class upbit extends upbit$1["default"] {
2170
2170
  return {
2171
2171
  'info': depositAddress,
2172
2172
  'currency': code,
2173
- 'network': this.networkIdToCode(networkId),
2173
+ 'network': this.networkIdToCode(networkId, code),
2174
2174
  'address': address,
2175
2175
  'tag': tag,
2176
2176
  };
@@ -496,20 +496,17 @@ class weex extends weex$1["default"] {
496
496
  'ETH': 'ERC20',
497
497
  'POLYGON': 'POLYGON(MATIC)',
498
498
  'MATIC': 'POLYGON(MATIC)',
499
- 'ARBITRUM': 'ARBITRUM(ARB)',
500
- 'ARB': 'ARBITRUM(ARB)',
501
- 'SOLANA': 'SOLANA(SOL)',
499
+ 'ARBONE': 'ARBITRUM(ARB)',
502
500
  'SOL': 'SOLANA(SOL)',
503
501
  'OP': 'OPTIMISM(OP)',
504
502
  'OPTIMISM': 'OPTIMISM(OP)',
505
- 'AVALANCHEC': 'AVALANCHE_C(AVAX_C)',
506
503
  'AVAXC': 'AVALANCHE_C(AVAX_C)',
507
504
  },
508
505
  'networksById': {
509
506
  'BEP20(BSC)': 'BEP20',
510
507
  'ERC20': 'ERC20',
511
508
  'POLYGON(MATIC)': 'MATIC',
512
- 'ARBITRUM(ARB)': 'ARB',
509
+ 'ARBITRUM(ARB)': 'ARBONE',
513
510
  'SOLANA(SOL)': 'SOL',
514
511
  'OPTIMISM(OP)': 'OP',
515
512
  'AVALANCHE_C(AVAX_C)': 'AVAXC',
@@ -853,73 +850,71 @@ class weex extends weex$1["default"] {
853
850
  // }
854
851
  // ]
855
852
  //
856
- const result = {};
857
- for (let i = 0; i < response.length; i++) {
858
- const currency = this.safeDict(response, i);
859
- const currencyId = this.safeString(currency, 'coin');
860
- const code = this.safeCurrencyCode(currencyId);
861
- const name = this.safeString(currency, 'name');
862
- const networks = {};
863
- const chains = this.safeList(currency, 'networkList', []);
864
- for (let j = 0; j < chains.length; j++) {
865
- const chain = this.safeDict(chains, j);
866
- const networkId = this.safeString(chain, 'network');
867
- const networkCode = this.networkIdToCode(networkId);
868
- networks[networkCode] = {
869
- 'info': chain,
870
- 'id': networkId,
871
- 'network': networkCode,
872
- 'active': undefined,
873
- 'deposit': this.safeBool(chain, 'depositEnable'),
874
- 'withdraw': this.safeBool(chain, 'withdrawEnable'),
875
- 'fee': this.safeNumber(chain, 'withdrawFee'),
876
- 'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
877
- 'isDefault': this.safeBool(chain, 'isDefault', false),
878
- 'limits': {
879
- 'withdraw': {
880
- 'min': this.safeNumber(chain, 'withdrawMin'),
881
- 'max': undefined,
882
- },
883
- 'deposit': {
884
- 'min': this.safeNumber(chain, 'depositDust'),
885
- 'max': undefined,
886
- },
887
- },
888
- };
889
- }
890
- const networkKeys = Object.keys(networks);
891
- const networksLength = networkKeys.length;
892
- const emptyChains = networksLength === 0; // non-functional coins
893
- const valueForEmpty = emptyChains ? false : undefined;
894
- result[code] = this.safeCurrencyStructure({
895
- 'info': currency,
896
- 'code': code,
897
- 'id': currencyId,
898
- 'type': 'crypto',
899
- 'name': name,
853
+ return this.parseCurrencies(response);
854
+ }
855
+ parseCurrency(rawCurrency) {
856
+ const currencyId = this.safeString(rawCurrency, 'coin');
857
+ const code = this.safeCurrencyCode(currencyId);
858
+ const name = this.safeString(rawCurrency, 'name');
859
+ const networks = {};
860
+ const chains = this.safeList(rawCurrency, 'networkList', []);
861
+ for (let j = 0; j < chains.length; j++) {
862
+ const chain = this.safeDict(chains, j);
863
+ const networkId = this.safeString(chain, 'network');
864
+ const networkCode = this.networkIdToCode(networkId, code);
865
+ networks[networkCode] = {
866
+ 'info': chain,
867
+ 'id': networkId,
868
+ 'network': networkCode,
900
869
  'active': undefined,
901
- 'deposit': valueForEmpty,
902
- 'withdraw': valueForEmpty,
903
- 'fee': undefined,
904
- 'precision': undefined,
870
+ 'deposit': this.safeBool(chain, 'depositEnable'),
871
+ 'withdraw': this.safeBool(chain, 'withdrawEnable'),
872
+ 'fee': this.safeNumber(chain, 'withdrawFee'),
873
+ 'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
874
+ 'isDefault': this.safeBool(chain, 'isDefault', false),
905
875
  'limits': {
906
- 'amount': {
907
- 'min': undefined,
908
- 'max': undefined,
909
- },
910
876
  'withdraw': {
911
- 'min': undefined,
877
+ 'min': this.safeNumber(chain, 'withdrawMin'),
912
878
  'max': undefined,
913
879
  },
914
880
  'deposit': {
915
- 'min': undefined,
881
+ 'min': this.safeNumber(chain, 'depositDust'),
916
882
  'max': undefined,
917
883
  },
918
884
  },
919
- 'networks': networks,
920
- });
885
+ };
921
886
  }
922
- return result;
887
+ const networkKeys = Object.keys(networks);
888
+ const networksLength = networkKeys.length;
889
+ const emptyChains = networksLength === 0; // non-functional coins
890
+ const valueForEmpty = emptyChains ? false : undefined;
891
+ return this.safeCurrencyStructure({
892
+ 'info': rawCurrency,
893
+ 'code': code,
894
+ 'id': currencyId,
895
+ 'type': 'crypto',
896
+ 'name': name,
897
+ 'active': undefined,
898
+ 'deposit': valueForEmpty,
899
+ 'withdraw': valueForEmpty,
900
+ 'fee': undefined,
901
+ 'precision': undefined,
902
+ 'limits': {
903
+ 'amount': {
904
+ 'min': undefined,
905
+ 'max': undefined,
906
+ },
907
+ 'withdraw': {
908
+ 'min': undefined,
909
+ 'max': undefined,
910
+ },
911
+ 'deposit': {
912
+ 'min': undefined,
913
+ 'max': undefined,
914
+ },
915
+ },
916
+ 'networks': networks,
917
+ });
923
918
  }
924
919
  /**
925
920
  * @method
@@ -644,76 +644,74 @@ class whitebit extends whitebit$1["default"] {
644
644
  // }
645
645
  // }
646
646
  //
647
- const ids = Object.keys(response);
648
- const result = {};
649
- for (let i = 0; i < ids.length; i++) {
650
- const id = ids[i];
651
- const currency = response[id];
652
- // const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
653
- const code = this.safeCurrencyCode(id);
654
- const hasProvider = ('providers' in currency);
655
- const networks = {};
656
- const rawNetworks = this.safeDict(currency, 'networks', {});
657
- const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
658
- const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
659
- const networkLimits = this.safeDict(currency, 'limits', {});
660
- const depositLimits = this.safeDict(networkLimits, 'deposit', {});
661
- const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
662
- const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
663
- for (let j = 0; j < allNetworks.length; j++) {
664
- const networkId = allNetworks[j];
665
- const networkCode = this.networkIdToCode(networkId);
666
- const networkDepositLimits = this.safeDict(depositLimits, networkId, {});
667
- const networkWithdrawLimits = this.safeDict(withdrawLimits, networkId, {});
668
- networks[networkCode] = {
669
- 'id': networkId,
670
- 'network': networkCode,
671
- 'active': undefined,
672
- 'deposit': this.inArray(networkId, depositsNetworks),
673
- 'withdraw': this.inArray(networkId, withdrawsNetworks),
674
- 'fee': undefined,
675
- 'precision': undefined,
676
- 'limits': {
677
- 'deposit': {
678
- 'min': this.safeNumber(networkDepositLimits, 'min'),
679
- 'max': this.safeNumber(networkDepositLimits, 'max'),
680
- },
681
- 'withdraw': {
682
- 'min': this.safeNumber(networkWithdrawLimits, 'min'),
683
- 'max': this.safeNumber(networkWithdrawLimits, 'max'),
684
- },
685
- },
686
- };
687
- }
688
- result[code] = this.safeCurrencyStructure({
689
- 'id': id,
690
- 'code': code,
691
- 'info': currency,
692
- 'name': undefined,
647
+ const enhancedArray = this.addKeyInArrayItems(response, '_coin_id');
648
+ return this.parseCurrencies(enhancedArray);
649
+ }
650
+ parseCurrency(rawCurrency) {
651
+ // const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
652
+ const id = this.safeString(rawCurrency, '_coin_id');
653
+ const code = this.safeCurrencyCode(id);
654
+ const hasProvider = ('providers' in rawCurrency);
655
+ const networks = {};
656
+ const rawNetworks = this.safeDict(rawCurrency, 'networks', {});
657
+ const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
658
+ const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
659
+ const networkLimits = this.safeDict(rawCurrency, 'limits', {});
660
+ const depositLimits = this.safeDict(networkLimits, 'deposit', {});
661
+ const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
662
+ const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
663
+ for (let j = 0; j < allNetworks.length; j++) {
664
+ const networkId = allNetworks[j];
665
+ const networkCode = this.networkIdToCode(networkId, code);
666
+ const networkDepositLimits = this.safeDict(depositLimits, networkId, {});
667
+ const networkWithdrawLimits = this.safeDict(withdrawLimits, networkId, {});
668
+ networks[networkCode] = {
669
+ 'id': networkId,
670
+ 'network': networkCode,
693
671
  'active': undefined,
694
- 'deposit': this.safeBool(currency, 'can_deposit'),
695
- 'withdraw': this.safeBool(currency, 'can_withdraw'),
672
+ 'deposit': this.inArray(networkId, depositsNetworks),
673
+ 'withdraw': this.inArray(networkId, withdrawsNetworks),
696
674
  'fee': undefined,
697
- 'networks': networks,
698
- 'type': hasProvider ? 'fiat' : 'crypto',
699
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'currency_precision'))),
675
+ 'precision': undefined,
700
676
  'limits': {
701
- 'amount': {
702
- 'min': undefined,
703
- 'max': undefined,
677
+ 'deposit': {
678
+ 'min': this.safeNumber(networkDepositLimits, 'min'),
679
+ 'max': this.safeNumber(networkDepositLimits, 'max'),
704
680
  },
705
681
  'withdraw': {
706
- 'min': this.safeNumber(currency, 'min_withdraw'),
707
- 'max': this.safeNumber(currency, 'max_withdraw'),
708
- },
709
- 'deposit': {
710
- 'min': this.safeNumber(currency, 'min_deposit'),
711
- 'max': this.safeNumber(currency, 'max_deposit'),
682
+ 'min': this.safeNumber(networkWithdrawLimits, 'min'),
683
+ 'max': this.safeNumber(networkWithdrawLimits, 'max'),
712
684
  },
713
685
  },
714
- });
686
+ };
715
687
  }
716
- return result;
688
+ return this.safeCurrencyStructure({
689
+ 'id': id,
690
+ 'code': code,
691
+ 'info': rawCurrency,
692
+ 'name': undefined,
693
+ 'active': undefined,
694
+ 'deposit': this.safeBool(rawCurrency, 'can_deposit'),
695
+ 'withdraw': this.safeBool(rawCurrency, 'can_withdraw'),
696
+ 'fee': undefined,
697
+ 'networks': networks,
698
+ 'type': hasProvider ? 'fiat' : 'crypto',
699
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'currency_precision'))),
700
+ 'limits': {
701
+ 'amount': {
702
+ 'min': undefined,
703
+ 'max': undefined,
704
+ },
705
+ 'withdraw': {
706
+ 'min': this.safeNumber(rawCurrency, 'min_withdraw'),
707
+ 'max': this.safeNumber(rawCurrency, 'max_withdraw'),
708
+ },
709
+ 'deposit': {
710
+ 'min': this.safeNumber(rawCurrency, 'min_deposit'),
711
+ 'max': this.safeNumber(rawCurrency, 'max_deposit'),
712
+ },
713
+ },
714
+ });
717
715
  }
718
716
  /**
719
717
  * @method
@@ -901,7 +899,7 @@ class whitebit extends whitebit$1["default"] {
901
899
  if (networkId !== undefined) {
902
900
  const networkLength = networkId.length;
903
901
  networkId = networkId.slice(1, networkLength - 1);
904
- const networkCode = this.networkIdToCode(networkId);
902
+ const networkCode = this.networkIdToCode(networkId, code);
905
903
  depositWithdrawFees[code]['networks'][networkCode] = {
906
904
  'withdraw': withdrawResult,
907
905
  'deposit': depositResult,