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
@@ -57,7 +57,7 @@ function _interopNamespace(e) {
57
57
  // ----------------------------------------------------------------------------
58
58
  const { isNode, selfIsDefined, deepExtend, extend, clone, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, binaryConcat, hash,
59
59
  // ecdsa,
60
- arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep, readFile, writeFile, existsFile, getTempDir, } = functions;
60
+ arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep, readFile, writeFile, existsFile, getTempDir, filePathToFileUrlForWindows, } = functions;
61
61
  // ----------------------------------------------------------------------------
62
62
  let protobufMexc = undefined;
63
63
  let encodeAsAny = undefined;
@@ -1411,6 +1411,16 @@ class Exchange {
1411
1411
  const signature = index$1.sign(msgHash.replace('0x', ''), pri.replace('0x', ''));
1412
1412
  return this.json([signature.r.toString(), signature.s.toString()]);
1413
1413
  }
1414
+ extendedStarknetSign(msgHash, pri) {
1415
+ const signature = index$1.sign(msgHash.replace('0x', ''), pri.replace('0x', ''));
1416
+ return this.json([signature.r.toString(), signature.s.toString()]);
1417
+ }
1418
+ extendedStarknetGetSelectorFromName(name) {
1419
+ return selector.getSelectorFromName(name);
1420
+ }
1421
+ extendedStarknetComputePoseidonHashOnElements(data) {
1422
+ return classHash.computePoseidonHashOnElements(data);
1423
+ }
1414
1424
  async getZKContractSignatureObj(seed, params = {}) {
1415
1425
  const formattedSlotId = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'slotId')), sha256.sha256, 'hex'))).toString();
1416
1426
  const formattedNonce = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'nonce')), sha256.sha256, 'hex'))).toString();
@@ -1621,7 +1631,7 @@ class Exchange {
1621
1631
  if (wasmExecPath === undefined || wasmExecPath === '') {
1622
1632
  throw new Error('loadLighterLibrary() requires "wasmExecPath" that should point to `wasm_exec.js`. You can check the location of the file locally if you have GO installed or download it here https://github.com/ccxt/lighter-wasm.\nExample: exchanges.options["wasmExecPath"] = "/opt/homebrew/opt/go/libexec/lib/wasm/wasm_exec.js"');
1623
1633
  }
1624
- await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(wasmExecPath);
1634
+ await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(filePathToFileUrlForWindows(wasmExecPath));
1625
1635
  const go = new globalThis.Go();
1626
1636
  // read wasm from disks
1627
1637
  const bytes = new Uint8Array(readFile(libraryPath, null)); // it should point to lighter.wasm
@@ -2145,23 +2155,31 @@ class Exchange {
2145
2155
  }
2146
2156
  return defaultValue;
2147
2157
  }
2148
- safeBool2(dictionary, key1, key2, defaultValue = undefined) {
2158
+ safeBool2(dictionaryOrList, key1, key2, defaultValue = undefined) {
2149
2159
  /**
2150
2160
  * @ignore
2151
2161
  * @method
2152
2162
  * @description safely extract boolean value from dictionary or list
2153
2163
  * @returns {bool | undefined}
2154
2164
  */
2155
- return this.safeBoolN(dictionary, [key1, key2], defaultValue);
2165
+ const value = this.safeValue(dictionaryOrList, key1);
2166
+ if (typeof value === 'boolean') {
2167
+ return value;
2168
+ }
2169
+ const value2 = this.safeValue(dictionaryOrList, key2);
2170
+ if (typeof value2 === 'boolean') {
2171
+ return value2;
2172
+ }
2173
+ return defaultValue;
2156
2174
  }
2157
- safeBool(dictionary, key, defaultValue = undefined) {
2175
+ safeBool(dictionaryOrList, key, defaultValue = undefined) {
2158
2176
  /**
2159
2177
  * @ignore
2160
2178
  * @method
2161
2179
  * @description safely extract boolean value from dictionary or list
2162
2180
  * @returns {bool | undefined}
2163
2181
  */
2164
- const value = this.safeValue(dictionary, key, defaultValue);
2182
+ const value = this.safeValue(dictionaryOrList, key, defaultValue);
2165
2183
  if (typeof value === 'boolean') {
2166
2184
  return value;
2167
2185
  }
@@ -2183,14 +2201,14 @@ class Exchange {
2183
2201
  }
2184
2202
  return defaultValue;
2185
2203
  }
2186
- safeDict(dictionary, key, defaultValue = undefined) {
2204
+ safeDict(dictionaryOrList, key, defaultValue = undefined) {
2187
2205
  /**
2188
2206
  * @ignore
2189
2207
  * @method
2190
2208
  * @description safely extract a dictionary from dictionary or list
2191
2209
  * @returns {object | undefined}
2192
2210
  */
2193
- const value = this.safeValue(dictionary, key, defaultValue);
2211
+ const value = this.safeValue(dictionaryOrList, key, defaultValue);
2194
2212
  if (value === undefined) {
2195
2213
  return defaultValue;
2196
2214
  }
@@ -2199,14 +2217,22 @@ class Exchange {
2199
2217
  }
2200
2218
  return defaultValue;
2201
2219
  }
2202
- safeDict2(dictionary, key1, key2, defaultValue = undefined) {
2220
+ safeDict2(dictionaryOrList, key1, key2, defaultValue = undefined) {
2203
2221
  /**
2204
2222
  * @ignore
2205
2223
  * @method
2206
2224
  * @description safely extract a dictionary from dictionary or list
2207
2225
  * @returns {object | undefined}
2208
2226
  */
2209
- return this.safeDictN(dictionary, [key1, key2], defaultValue);
2227
+ const value = this.safeValue(dictionaryOrList, key1);
2228
+ if ((value !== undefined) && (typeof value === 'object') && !Array.isArray(value)) {
2229
+ return value;
2230
+ }
2231
+ const value2 = this.safeValue(dictionaryOrList, key2);
2232
+ if ((value2 !== undefined) && (typeof value2 === 'object') && !Array.isArray(value2)) {
2233
+ return value2;
2234
+ }
2235
+ return defaultValue;
2210
2236
  }
2211
2237
  safeListN(dictionaryOrList, keys, defaultValue = undefined) {
2212
2238
  /**
@@ -2234,7 +2260,15 @@ class Exchange {
2234
2260
  * @description safely extract an Array from dictionary or list
2235
2261
  * @returns {Array | undefined}
2236
2262
  */
2237
- return this.safeListN(dictionaryOrList, [key1, key2], defaultValue);
2263
+ const value = this.safeValue(dictionaryOrList, key1);
2264
+ if ((value !== undefined) && Array.isArray(value)) {
2265
+ return value;
2266
+ }
2267
+ const value2 = this.safeValue(dictionaryOrList, key2);
2268
+ if ((value2 !== undefined) && Array.isArray(value2)) {
2269
+ return value2;
2270
+ }
2271
+ return defaultValue;
2238
2272
  }
2239
2273
  safeList(dictionaryOrList, key, defaultValue = undefined) {
2240
2274
  /**
@@ -2262,7 +2296,7 @@ class Exchange {
2262
2296
  }
2263
2297
  handleDeltasWithKeys(bookSide, deltas, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
2264
2298
  for (let i = 0; i < deltas.length; i++) {
2265
- const bidAsk = this.parseBidAsk(deltas[i], priceKey, amountKey, countOrIdKey);
2299
+ const bidAsk = this.parseOrderBookBidAsk(deltas[i], priceKey, amountKey, countOrIdKey);
2266
2300
  bookSide.storeArray(bidAsk);
2267
2301
  }
2268
2302
  }
@@ -2719,6 +2753,9 @@ class Exchange {
2719
2753
  const arr = this.toArray(rawCurrencies);
2720
2754
  for (let i = 0; i < arr.length; i++) {
2721
2755
  const parsed = this.parseCurrency(arr[i]);
2756
+ if (parsed === undefined) {
2757
+ continue;
2758
+ }
2722
2759
  const code = parsed['code'];
2723
2760
  result[code] = parsed;
2724
2761
  }
@@ -3005,7 +3042,7 @@ class Exchange {
3005
3042
  }
3006
3043
  else {
3007
3044
  if (marketType === 'spot') {
3008
- this.features[marketType] = this.featuresMapper(initialFeatures, marketType, undefined);
3045
+ this.features[marketType] = this.featuresMapper(initialFeatures, marketType);
3009
3046
  }
3010
3047
  else {
3011
3048
  this.features[marketType] = {};
@@ -3244,21 +3281,6 @@ class Exchange {
3244
3281
  if (currencyWithdraw === undefined || withdraw) {
3245
3282
  currency['withdraw'] = withdraw;
3246
3283
  }
3247
- // set network 'active' to false if D or W is disabled
3248
- let active = this.safeBool(network, 'active');
3249
- if (active === undefined) {
3250
- if (deposit && withdraw) {
3251
- currency['networks'][key]['active'] = true;
3252
- }
3253
- else if (deposit !== undefined && withdraw !== undefined) {
3254
- currency['networks'][key]['active'] = false;
3255
- }
3256
- }
3257
- active = this.safeBool(currency['networks'][key], 'active'); // dict might have been updated on above lines, so access directly instead of `network` variable
3258
- const currencyActive = this.safeBool(currency, 'active');
3259
- if (currencyActive === undefined || active) {
3260
- currency['active'] = active;
3261
- }
3262
3284
  // find lowest fee (which is more desired)
3263
3285
  const fee = this.safeString(network, 'fee');
3264
3286
  const feeMain = this.safeString(currency, 'fee');
@@ -4108,6 +4130,21 @@ class Exchange {
4108
4130
  }
4109
4131
  return arr[length - 1];
4110
4132
  }
4133
+ addKeyInArrayItems(obj, keyName) {
4134
+ const result = [];
4135
+ const keys = Object.keys(obj);
4136
+ for (let i = 0; i < keys.length; i++) {
4137
+ const key = keys[i];
4138
+ const item = obj[key];
4139
+ if (item === undefined) {
4140
+ continue;
4141
+ }
4142
+ const itemWithKey = this.extend({}, item);
4143
+ itemWithKey[keyName] = key;
4144
+ result.push(itemWithKey);
4145
+ }
4146
+ return result;
4147
+ }
4111
4148
  invertFlatStringDictionary(dict) {
4112
4149
  const reversed = {};
4113
4150
  const keys = Object.keys(dict);
@@ -4534,11 +4571,11 @@ class Exchange {
4534
4571
  }
4535
4572
  return result;
4536
4573
  }
4537
- parseBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
4574
+ parseOrderBookBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
4538
4575
  bidasks = this.toArray(bidasks);
4539
4576
  const result = [];
4540
4577
  for (let i = 0; i < bidasks.length; i++) {
4541
- result.push(this.parseBidAsk(bidasks[i], priceKey, amountKey, countOrIdKey));
4578
+ result.push(this.parseOrderBookBidAsk(bidasks[i], priceKey, amountKey, countOrIdKey));
4542
4579
  }
4543
4580
  return result;
4544
4581
  }
@@ -4788,8 +4825,8 @@ class Exchange {
4788
4825
  return this.parseNumber(value, d);
4789
4826
  }
4790
4827
  parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1, countOrIdKey = 2) {
4791
- const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
4792
- const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
4828
+ const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
4829
+ const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
4793
4830
  return {
4794
4831
  'symbol': symbol,
4795
4832
  'bids': this.sortBy(bids, 0, true),
@@ -4887,7 +4924,7 @@ class Exchange {
4887
4924
  positions = this.toArray(positions);
4888
4925
  const result = [];
4889
4926
  for (let i = 0; i < positions.length; i++) {
4890
- const position = this.extend(this.parsePosition(positions[i], undefined), params);
4927
+ const position = this.extend(this.parsePosition(positions[i]), params);
4891
4928
  result.push(position);
4892
4929
  }
4893
4930
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
@@ -4900,7 +4937,7 @@ class Exchange {
4900
4937
  ranks = this.toArray(ranks);
4901
4938
  const result = [];
4902
4939
  for (let i = 0; i < ranks.length; i++) {
4903
- const rank = this.extend(this.parseADLRank(ranks[i], undefined), params);
4940
+ const rank = this.extend(this.parseADLRank(ranks[i]), params);
4904
4941
  result.push(rank);
4905
4942
  }
4906
4943
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
@@ -5347,7 +5384,7 @@ class Exchange {
5347
5384
  async fetchLedgerEntry(id, code = undefined, params = {}) {
5348
5385
  throw new errors.NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
5349
5386
  }
5350
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
5387
+ parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
5351
5388
  const price = this.safeFloat(bidask, priceKey);
5352
5389
  const amount = this.safeFloat(bidask, amountKey);
5353
5390
  const countOrId = this.safeInteger(bidask, countOrIdKey);
@@ -27,6 +27,7 @@ function _interopNamespace(e) {
27
27
  let fsSyncModule = null;
28
28
  let osSyncModule = null;
29
29
  let pathSyncModule = null;
30
+ let urlSyncModule = null;
30
31
  /* ------------------------------------------------------------------------ */
31
32
  /**
32
33
  * Initialize synchronous file system module (Node.js only)
@@ -53,6 +54,12 @@ async function initFileSystem() {
53
54
  }
54
55
  catch (e) { } // Silent fail in browser or if path is unavailable
55
56
  }
57
+ if (urlSyncModule === null) {
58
+ try {
59
+ urlSyncModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'node:url')); });
60
+ }
61
+ catch (e) { } // Silent fail in browser or if url is unavailable
62
+ }
56
63
  }
57
64
  }
58
65
  if (platform.isNode) {
@@ -152,8 +159,26 @@ function existsFile(path) {
152
159
  return false;
153
160
  }
154
161
  }
162
+ /* ------------------------------------------------------------------------ */
163
+ /**
164
+ * Convert file-path to file-url format on Windows, to avoid ESM loader error when using absolute paths, like:
165
+ * Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:195:11)
166
+ * @param filePath File path to check
167
+ * @returns filepath original or converted to file URL format on Windows
168
+ */
169
+ function filePathToFileUrlForWindows(filePath) {
170
+ if (!platform.isNode || !filePath || filePath.startsWith('file://') || osSyncModule === null || urlSyncModule === null) {
171
+ return filePath;
172
+ }
173
+ if (osSyncModule.platform() !== 'win32') {
174
+ return filePath;
175
+ }
176
+ const looksLikeWindowsPath = /^[a-zA-Z]:[\\/]/.test(filePath) || filePath.startsWith('\\\\');
177
+ return looksLikeWindowsPath ? urlSyncModule.pathToFileURL(filePath).href : filePath;
178
+ }
155
179
 
156
180
  exports.existsFile = existsFile;
181
+ exports.filePathToFileUrlForWindows = filePathToFileUrlForWindows;
157
182
  exports.getTempDir = getTempDir;
158
183
  exports.initFileSystem = initFileSystem;
159
184
  exports.readFile = readFile;
@@ -161,6 +161,7 @@ exports.roundTimeframe = misc.roundTimeframe;
161
161
  exports.selfIsDefined = misc.selfIsDefined;
162
162
  exports.vwap = misc.vwap;
163
163
  exports.existsFile = io.existsFile;
164
+ exports.filePathToFileUrlForWindows = io.filePathToFileUrlForWindows;
164
165
  exports.getTempDir = io.getTempDir;
165
166
  exports.initFileSystem = io.initFileSystem;
166
167
  exports.readFile = io.readFile;
@@ -533,7 +533,7 @@ class bigone extends bigone$1["default"] {
533
533
  for (let j = 0; j < chains.length; j++) {
534
534
  const chain = chains[j];
535
535
  const networkId = this.safeString(chain, 'gateway_name');
536
- const networkCode = this.networkIdToCode(networkId);
536
+ const networkCode = this.networkIdToCode(networkId, code);
537
537
  const deposit = this.safeBool(chain, 'is_deposit_enabled');
538
538
  const withdraw = this.safeBool(chain, 'is_withdrawal_enabled');
539
539
  const minDepositAmount = this.safeString(chain, 'min_deposit_amount');
@@ -1244,18 +1244,21 @@ class bigone extends bigone$1["default"] {
1244
1244
  const makerFeeCost = this.safeString(trade, 'maker_fee');
1245
1245
  const takerFeeCost = this.safeString(trade, 'taker_fee');
1246
1246
  if (makerFeeCost !== undefined) {
1247
+ const makerCode = makerCurrencyCode;
1247
1248
  if (takerFeeCost !== undefined) {
1249
+ const takerCode = takerCurrencyCode;
1248
1250
  result['fees'] = [
1249
- { 'cost': makerFeeCost, 'currency': makerCurrencyCode },
1250
- { 'cost': takerFeeCost, 'currency': takerCurrencyCode },
1251
+ { 'cost': makerFeeCost, 'currency': makerCode },
1252
+ { 'cost': takerFeeCost, 'currency': takerCode },
1251
1253
  ];
1252
1254
  }
1253
1255
  else {
1254
- result['fee'] = { 'cost': makerFeeCost, 'currency': makerCurrencyCode };
1256
+ result['fee'] = { 'cost': makerFeeCost, 'currency': makerCode };
1255
1257
  }
1256
1258
  }
1257
1259
  else if (takerFeeCost !== undefined) {
1258
- result['fee'] = { 'cost': takerFeeCost, 'currency': takerCurrencyCode };
1260
+ const takerCode2 = takerCurrencyCode;
1261
+ result['fee'] = { 'cost': takerFeeCost, 'currency': takerCode2 };
1259
1262
  }
1260
1263
  else {
1261
1264
  result['fee'] = undefined;
@@ -2004,7 +2007,7 @@ class bigone extends bigone$1["default"] {
2004
2007
  return {
2005
2008
  'info': response,
2006
2009
  'currency': code,
2007
- 'network': this.networkIdToCode(selectedNetworkId),
2010
+ 'network': this.networkIdToCode(selectedNetworkId, code),
2008
2011
  'address': address,
2009
2012
  'tag': tag,
2010
2013
  };
@@ -2310,7 +2313,7 @@ class bigone extends bigone$1["default"] {
2310
2313
  let networkCode = undefined;
2311
2314
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
2312
2315
  if (networkCode !== undefined) {
2313
- request['gateway_name'] = this.networkCodeToId(networkCode);
2316
+ request['gateway_name'] = this.networkCodeToId(networkCode, currency['code']);
2314
2317
  }
2315
2318
  // requires write permission on the wallet
2316
2319
  const response = await this.privatePostWithdrawals(this.extend(request, params));