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
@@ -551,6 +551,7 @@ class blofin extends blofin$1["default"] {
551
551
  let maxLeverage = this.safeString(market, 'maxLeverage', '100');
552
552
  maxLeverage = Precise["default"].stringMax(maxLeverage, '1');
553
553
  const isActive = (this.safeString(market, 'state') === 'live');
554
+ const isMargin = spot && (Precise["default"].stringGt(maxLeverage, '1'));
554
555
  return this.safeMarketStructure({
555
556
  'id': id,
556
557
  'symbol': symbol,
@@ -563,7 +564,7 @@ class blofin extends blofin$1["default"] {
563
564
  'type': type,
564
565
  'spot': spot,
565
566
  'option': option,
566
- 'margin': spot && (Precise["default"].stringGt(maxLeverage, '1')),
567
+ 'margin': isMargin,
567
568
  'swap': swap,
568
569
  'future': future,
569
570
  'active': isActive,
@@ -1463,6 +1464,7 @@ class blofin extends blofin$1["default"] {
1463
1464
  * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
1464
1465
  * @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
1465
1466
  * @param {float} [params.stopLoss.price] stop loss order price (if not provided the order will be a market order)
1467
+ * @param {float} [params.tpsl] whether to force to send the order to the combined TPSL oco order endpoint
1466
1468
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
1467
1469
  */
1468
1470
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -1471,7 +1473,9 @@ class blofin extends blofin$1["default"] {
1471
1473
  const isStopLossPriceDefined = this.safeString(params, 'stopLossPrice') !== undefined;
1472
1474
  const isTakeProfitPriceDefined = this.safeString(params, 'takeProfitPrice') !== undefined;
1473
1475
  const isTriggerOrder = this.safeString(params, 'triggerPrice') !== undefined;
1474
- const isCombinedSlTp = (isStopLossPriceDefined && isTakeProfitPriceDefined);
1476
+ let isTpslEndpoint = false;
1477
+ [isTpslEndpoint, params] = this.handleOptionAndParams(params, 'createOrder', 'tpsl', false);
1478
+ const isCombinedSlTp = (isStopLossPriceDefined && isTakeProfitPriceDefined) || isTpslEndpoint;
1475
1479
  const isSlOrTp = isStopLossPriceDefined || isTakeProfitPriceDefined;
1476
1480
  let response = undefined;
1477
1481
  const reduceOnly = this.safeBool(params, 'reduceOnly');
@@ -1526,11 +1530,31 @@ class blofin extends blofin$1["default"] {
1526
1530
  const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
1527
1531
  if (stopLossPrice !== undefined) {
1528
1532
  request['slTriggerPrice'] = this.priceToPrecision(symbol, stopLossPrice);
1529
- request['slOrderPrice'] = (type === 'market') ? '-1' : this.priceToPrecision(symbol, price);
1533
+ if (type === 'market') {
1534
+ request['slOrderPrice'] = '-1';
1535
+ }
1536
+ else {
1537
+ const slLimitPrice = this.safeString(params, 'stopLossLimitPrice');
1538
+ if (slLimitPrice === undefined) {
1539
+ throw new errors.ArgumentsRequired(this.id + ' createTpslOrder() requires a "stopLossLimitPrice" parameter (instead of "price" argument) for stop loss orders when the order type is not market');
1540
+ }
1541
+ request['slOrderPrice'] = this.priceToPrecision(symbol, slLimitPrice);
1542
+ params = this.omit(params, 'stopLossLimitPrice');
1543
+ }
1530
1544
  }
1531
1545
  if (takeProfitPrice !== undefined) {
1532
1546
  request['tpTriggerPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
1533
- request['tpOrderPrice'] = (type === 'market') ? '-1' : this.priceToPrecision(symbol, price);
1547
+ if (type === 'market') {
1548
+ request['tpOrderPrice'] = '-1';
1549
+ }
1550
+ else {
1551
+ const tpLimitPrice = this.safeString(params, 'takeProfitLimitPrice');
1552
+ if (tpLimitPrice === undefined) {
1553
+ throw new errors.ArgumentsRequired(this.id + ' createTpslOrder() requires a "takeProfitLimitPrice" parameter (instead of "price" argument) for take profit orders when the order type is not market');
1554
+ }
1555
+ request['tpOrderPrice'] = this.priceToPrecision(symbol, tpLimitPrice);
1556
+ params = this.omit(params, 'takeProfitLimitPrice');
1557
+ }
1534
1558
  }
1535
1559
  request['marginMode'] = marginMode;
1536
1560
  params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'reduceOnly', 'hedged']);
@@ -2099,7 +2099,7 @@ class bullish extends bullish$1["default"] {
2099
2099
  let networkCode = undefined;
2100
2100
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
2101
2101
  if (networkCode !== undefined) {
2102
- request['network'] = this.networkCodeToId(networkCode);
2102
+ request['network'] = this.networkCodeToId(networkCode, code);
2103
2103
  }
2104
2104
  else {
2105
2105
  throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a network parameter');
@@ -2173,7 +2173,7 @@ class bullish extends bullish$1["default"] {
2173
2173
  'txid': txid,
2174
2174
  'timestamp': timestamp,
2175
2175
  'datetime': this.iso8601(timestamp),
2176
- 'network': this.networkIdToCode(network),
2176
+ 'network': this.networkIdToCode(network, code),
2177
2177
  'addressFrom': sourceAddress,
2178
2178
  'address': address,
2179
2179
  'addressTo': address,
@@ -2370,7 +2370,7 @@ class bullish extends bullish$1["default"] {
2370
2370
  for (let i = 0; i < safeResponse.length; i++) {
2371
2371
  const entry = this.safeDict(safeResponse, i, {});
2372
2372
  const networkId = this.safeString(entry, 'network');
2373
- const networkCode = this.networkIdToCode(networkId);
2373
+ const networkCode = this.networkIdToCode(networkId, code);
2374
2374
  if (network === networkCode) {
2375
2375
  data = entry;
2376
2376
  break;
@@ -2386,10 +2386,11 @@ class bullish extends bullish$1["default"] {
2386
2386
  parseDepositAddress(depositAddress, currency = undefined) {
2387
2387
  const id = this.safeString(depositAddress, 'symbol');
2388
2388
  const network = this.safeString(depositAddress, 'network');
2389
+ const code = this.safeCurrencyCode(id, currency);
2389
2390
  return {
2390
2391
  'info': depositAddress,
2391
- 'currency': this.safeCurrencyCode(id, currency),
2392
- 'network': this.networkIdToCode(network),
2392
+ 'currency': code,
2393
+ 'network': this.networkIdToCode(network, code),
2393
2394
  'address': this.safeString(depositAddress, 'address'),
2394
2395
  'tag': undefined,
2395
2396
  };
@@ -1546,8 +1546,9 @@ class bybit extends bybit$1["default"] {
1546
1546
  amountPrecision = this.parseNumber('1');
1547
1547
  pricePrecision = this.parseNumber('0.01');
1548
1548
  }
1549
+ const convertedExpireDate = this.convertExpireDateToMarketIdDate(expiry);
1549
1550
  return {
1550
- 'id': base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType,
1551
+ 'id': base + '-' + convertedExpireDate + '-' + strike + '-' + optionType,
1551
1552
  'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
1552
1553
  'base': base,
1553
1554
  'quote': quote,
@@ -1954,8 +1955,8 @@ class bybit extends bybit$1["default"] {
1954
1955
  }
1955
1956
  return result;
1956
1957
  }
1957
- async fetchFutureMarkets(params) {
1958
- params = this.extend(params);
1958
+ async fetchFutureMarkets(params = {}) {
1959
+ params = this.extend(params, {});
1959
1960
  params['limit'] = 1000; // minimize number of requests
1960
1961
  let preLaunchMarkets = [];
1961
1962
  const usePrivateInstrumentsInfo = this.safeBool(this.options, 'usePrivateInstrumentsInfo', false);
@@ -2098,7 +2099,7 @@ class bybit extends bybit$1["default"] {
2098
2099
  symbol = symbol + '-' + this.yymmdd(expiry);
2099
2100
  }
2100
2101
  const contractSize = inverse ? this.safeNumber2(lotSizeFilter, 'minTradingQty', 'minOrderQty') : this.parseNumber('1');
2101
- result.push(this.safeMarketStructure({
2102
+ const parsedMarket = this.safeMarketStructure({
2102
2103
  'id': id,
2103
2104
  'symbol': symbol,
2104
2105
  'base': base,
@@ -2148,7 +2149,8 @@ class bybit extends bybit$1["default"] {
2148
2149
  },
2149
2150
  'created': this.safeInteger(market, 'launchTime'),
2150
2151
  'info': market,
2151
- }));
2152
+ });
2153
+ result.push(parsedMarket);
2152
2154
  }
2153
2155
  return result;
2154
2156
  }
@@ -4954,7 +4956,7 @@ class bybit extends bybit$1["default"] {
4954
4956
  //
4955
4957
  const result = this.safeDict(response, 'result', {});
4956
4958
  const row = this.safeList(result, 'list', []);
4957
- return this.parseOrders(row, undefined);
4959
+ return this.parseOrders(row);
4958
4960
  }
4959
4961
  /**
4960
4962
  * @method
@@ -5791,7 +5793,7 @@ class bybit extends bybit$1["default"] {
5791
5793
  */
5792
5794
  async fetchDepositAddressesByNetwork(code, params = {}) {
5793
5795
  await this.loadMarkets();
5794
- let currency = this.currency(code);
5796
+ const currency = this.currency(code);
5795
5797
  const request = {
5796
5798
  'coin': currency['id'],
5797
5799
  };
@@ -5823,9 +5825,9 @@ class bybit extends bybit$1["default"] {
5823
5825
  const result = this.safeDict(response, 'result', {});
5824
5826
  const chains = this.safeList(result, 'chains', []);
5825
5827
  const coin = this.safeString(result, 'coin');
5826
- currency = this.currency(coin);
5827
- const parsed = this.parseDepositAddresses(chains, [currency['code']], false, {
5828
- 'currency': currency['code'],
5828
+ const currencyFromResponse = this.currency(coin);
5829
+ const parsed = this.parseDepositAddresses(chains, [currencyFromResponse['code']], false, {
5830
+ 'currency': currencyFromResponse['code'],
5829
5831
  });
5830
5832
  return this.indexBy(parsed, 'network');
5831
5833
  }
@@ -7099,7 +7101,7 @@ class bybit extends bybit$1["default"] {
7099
7101
  }
7100
7102
  async fetchDerivativesOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
7101
7103
  await this.loadMarkets();
7102
- let market = this.market(symbol);
7104
+ const market = this.market(symbol);
7103
7105
  const subType = market['linear'] ? 'linear' : 'inverse';
7104
7106
  const category = this.safeString(params, 'category', subType);
7105
7107
  const intervals = this.safeDict(this.options, 'intervals');
@@ -7150,8 +7152,8 @@ class bybit extends bybit$1["default"] {
7150
7152
  const result = this.safeDict(response, 'result', {});
7151
7153
  const data = this.addPaginationCursorToResult(response);
7152
7154
  const id = this.safeString(result, 'symbol');
7153
- market = this.safeMarket(id, market, undefined, 'contract');
7154
- return this.parseOpenInterestsHistory(data, market, since, limit);
7155
+ const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
7156
+ return this.parseOpenInterestsHistory(data, safeMarketObj, since, limit);
7155
7157
  }
7156
7158
  /**
7157
7159
  * @method
@@ -7166,7 +7168,7 @@ class bybit extends bybit$1["default"] {
7166
7168
  */
7167
7169
  async fetchOpenInterest(symbol, params = {}) {
7168
7170
  await this.loadMarkets();
7169
- let market = this.market(symbol);
7171
+ const market = this.market(symbol);
7170
7172
  if (!market['contract']) {
7171
7173
  throw new errors.BadRequest(this.id + ' fetchOpenInterest() supports contract markets only');
7172
7174
  }
@@ -7209,9 +7211,9 @@ class bybit extends bybit$1["default"] {
7209
7211
  //
7210
7212
  const result = this.safeDict(response, 'result', {});
7211
7213
  const id = this.safeString(result, 'symbol');
7212
- market = this.safeMarket(id, market, undefined, 'contract');
7214
+ const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
7213
7215
  const data = this.addPaginationCursorToResult(response);
7214
- return this.parseOpenInterest(data[0], market);
7216
+ return this.parseOpenInterest(data[0], safeMarketObj);
7215
7217
  }
7216
7218
  /**
7217
7219
  * @method
@@ -7376,7 +7378,7 @@ class bybit extends bybit$1["default"] {
7376
7378
  //
7377
7379
  const data = this.safeDict(response, 'result', {});
7378
7380
  const rows = this.safeList(data, 'loanAccountList', []);
7379
- const interest = this.parseBorrowInterests(rows, undefined);
7381
+ const interest = this.parseBorrowInterests(rows);
7380
7382
  return this.filterByCurrencySinceLimit(interest, code, since, limit);
7381
7383
  }
7382
7384
  /**
@@ -55,6 +55,7 @@ class bybiteu extends bybit["default"] {
55
55
  'margin': true,
56
56
  'swap': false,
57
57
  'future': false,
58
+ 'option': undefined,
58
59
  },
59
60
  });
60
61
  }
@@ -2819,7 +2819,7 @@ class bydfi extends bydfi$1["default"] {
2819
2819
  'txid': this.safeString(transaction, 'txId'),
2820
2820
  'type': undefined,
2821
2821
  'currency': code,
2822
- 'network': this.networkIdToCode(this.safeString(transaction, 'network')),
2822
+ 'network': this.networkIdToCode(this.safeString(transaction, 'network'), code),
2823
2823
  'amount': this.safeNumber(transaction, 'amount'),
2824
2824
  'status': this.parseTransactionStatus(rawStatus),
2825
2825
  'timestamp': timestamp,
@@ -373,7 +373,7 @@ class cex extends cex$1["default"] {
373
373
  for (let j = 0; j < keys.length; j++) {
374
374
  const networkId = keys[j];
375
375
  const rawNetwork = rawNetworks[networkId];
376
- const networkCode = this.networkIdToCode(networkId);
376
+ const networkCode = this.networkIdToCode(networkId, code);
377
377
  const deposit = this.safeString(rawNetwork, 'deposit') === 'enabled';
378
378
  const withdraw = this.safeString(rawNetwork, 'withdrawal') === 'enabled';
379
379
  networks[networkCode] = {
@@ -1701,7 +1701,7 @@ class cex extends cex$1["default"] {
1701
1701
  const request = {
1702
1702
  'accountId': accountId,
1703
1703
  'currency': currency['id'],
1704
- 'blockchain': this.networkCodeToId(networkCode),
1704
+ 'blockchain': this.networkCodeToId(networkCode, currency['code']),
1705
1705
  };
1706
1706
  const response = await this.privatePostGetDepositAddress(this.extend(request, params));
1707
1707
  //
@@ -1726,7 +1726,7 @@ class cex extends cex$1["default"] {
1726
1726
  return {
1727
1727
  'info': depositAddress,
1728
1728
  'currency': currency['code'],
1729
- 'network': this.networkIdToCode(this.safeString(depositAddress, 'blockchain')),
1729
+ 'network': this.networkIdToCode(this.safeString(depositAddress, 'blockchain'), currency['code']),
1730
1730
  'address': address,
1731
1731
  'tag': undefined,
1732
1732
  };