ccxt 4.2.31 → 4.2.35

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 (302) hide show
  1. package/.gitattributes +1 -0
  2. package/CONTRIBUTING.md +20 -1
  3. package/README.md +8 -7
  4. package/build.sh +9 -2
  5. package/cleanup.sh +3 -0
  6. package/dist/ccxt.browser.js +741 -501
  7. package/dist/ccxt.browser.min.js +3 -3
  8. package/dist/cjs/ccxt.js +1 -1
  9. package/dist/cjs/src/ace.js +3 -2
  10. package/dist/cjs/src/ascendex.js +1 -1
  11. package/dist/cjs/src/base/Exchange.js +62 -20
  12. package/dist/cjs/src/bigone.js +21 -1
  13. package/dist/cjs/src/binance.js +59 -15
  14. package/dist/cjs/src/bingx.js +4 -3
  15. package/dist/cjs/src/bit2c.js +12 -0
  16. package/dist/cjs/src/bitfinex2.js +12 -1
  17. package/dist/cjs/src/bitget.js +3 -3
  18. package/dist/cjs/src/bitmart.js +1 -1
  19. package/dist/cjs/src/bitrue.js +3 -3
  20. package/dist/cjs/src/blockchaincom.js +1 -1
  21. package/dist/cjs/src/bybit.js +1 -1
  22. package/dist/cjs/src/coinbase.js +2 -2
  23. package/dist/cjs/src/coinex.js +1 -1
  24. package/dist/cjs/src/cryptocom.js +10 -10
  25. package/dist/cjs/src/gate.js +34 -29
  26. package/dist/cjs/src/kraken.js +39 -0
  27. package/dist/cjs/src/krakenfutures.js +25 -3
  28. package/dist/cjs/src/kucoin.js +1 -1
  29. package/dist/cjs/src/mexc.js +2 -1
  30. package/dist/cjs/src/okx.js +4 -3
  31. package/dist/cjs/src/phemex.js +8 -8
  32. package/dist/cjs/src/pro/alpaca.js +8 -4
  33. package/dist/cjs/src/pro/ascendex.js +1 -2
  34. package/dist/cjs/src/pro/binance.js +17 -13
  35. package/dist/cjs/src/pro/bingx.js +1 -1
  36. package/dist/cjs/src/pro/bitfinex.js +21 -24
  37. package/dist/cjs/src/pro/bitfinex2.js +13 -17
  38. package/dist/cjs/src/pro/bitget.js +3 -1
  39. package/dist/cjs/src/pro/bitmart.js +3 -8
  40. package/dist/cjs/src/pro/bitmex.js +4 -7
  41. package/dist/cjs/src/pro/bitopro.js +2 -5
  42. package/dist/cjs/src/pro/bitrue.js +1 -1
  43. package/dist/cjs/src/pro/bitstamp.js +2 -3
  44. package/dist/cjs/src/pro/bitvavo.js +12 -5
  45. package/dist/cjs/src/pro/blockchaincom.js +22 -23
  46. package/dist/cjs/src/pro/bybit.js +5 -5
  47. package/dist/cjs/src/pro/cex.js +7 -7
  48. package/dist/cjs/src/pro/coinbase.js +3 -2
  49. package/dist/cjs/src/pro/coinbasepro.js +1 -1
  50. package/dist/cjs/src/pro/coinex.js +15 -13
  51. package/dist/cjs/src/pro/currencycom.js +5 -7
  52. package/dist/cjs/src/pro/deribit.js +4 -4
  53. package/dist/cjs/src/pro/exmo.js +15 -13
  54. package/dist/cjs/src/pro/gate.js +1 -1
  55. package/dist/cjs/src/pro/gemini.js +4 -2
  56. package/dist/cjs/src/pro/hitbtc.js +9 -8
  57. package/dist/cjs/src/pro/hollaex.js +2 -2
  58. package/dist/cjs/src/pro/htx.js +6 -7
  59. package/dist/cjs/src/pro/huobijp.js +3 -5
  60. package/dist/cjs/src/pro/idex.js +1 -1
  61. package/dist/cjs/src/pro/independentreserve.js +14 -13
  62. package/dist/cjs/src/pro/kraken.js +10 -16
  63. package/dist/cjs/src/pro/krakenfutures.js +10 -6
  64. package/dist/cjs/src/pro/kucoin.js +10 -11
  65. package/dist/cjs/src/pro/kucoinfutures.js +12 -11
  66. package/dist/cjs/src/pro/lbank.js +10 -10
  67. package/dist/cjs/src/pro/luno.js +12 -14
  68. package/dist/cjs/src/pro/mexc.js +3 -2
  69. package/dist/cjs/src/pro/ndax.js +7 -13
  70. package/dist/cjs/src/pro/okcoin.js +7 -12
  71. package/dist/cjs/src/pro/okx.js +6 -11
  72. package/dist/cjs/src/pro/onetrading.js +16 -15
  73. package/dist/cjs/src/pro/p2b.js +5 -3
  74. package/dist/cjs/src/pro/phemex.js +16 -11
  75. package/dist/cjs/src/pro/poloniex.js +6 -4
  76. package/dist/cjs/src/pro/poloniexfutures.js +14 -9
  77. package/dist/cjs/src/pro/probit.js +15 -11
  78. package/dist/cjs/src/pro/upbit.js +8 -8
  79. package/dist/cjs/src/pro/wazirx.js +6 -3
  80. package/dist/cjs/src/pro/woo.js +8 -6
  81. package/dist/cjs/src/probit.js +3 -3
  82. package/dist/cjs/src/tokocrypto.js +2 -2
  83. package/dist/cjs/src/wavesexchange.js +2 -1
  84. package/dist/cjs/src/woo.js +1 -1
  85. package/dist/cjs/src/yobit.js +39 -0
  86. package/js/ccxt.d.ts +1 -1
  87. package/js/ccxt.js +1 -1
  88. package/js/src/ace.d.ts +1 -1
  89. package/js/src/ace.js +3 -2
  90. package/js/src/alpaca.d.ts +1 -1
  91. package/js/src/ascendex.d.ts +5 -15
  92. package/js/src/ascendex.js +1 -1
  93. package/js/src/base/Exchange.d.ts +86 -78
  94. package/js/src/base/Exchange.js +62 -20
  95. package/js/src/base/types.d.ts +90 -6
  96. package/js/src/bigone.d.ts +5 -15
  97. package/js/src/bigone.js +21 -1
  98. package/js/src/binance.d.ts +13 -23
  99. package/js/src/binance.js +59 -15
  100. package/js/src/bingx.d.ts +6 -16
  101. package/js/src/bingx.js +4 -3
  102. package/js/src/bit2c.d.ts +1 -1
  103. package/js/src/bit2c.js +12 -0
  104. package/js/src/bitbank.d.ts +2 -2
  105. package/js/src/bitbns.d.ts +1 -1
  106. package/js/src/bitfinex.d.ts +5 -5
  107. package/js/src/bitfinex2.d.ts +7 -17
  108. package/js/src/bitfinex2.js +12 -1
  109. package/js/src/bitflyer.d.ts +5 -5
  110. package/js/src/bitforex.d.ts +1 -1
  111. package/js/src/bitget.d.ts +8 -38
  112. package/js/src/bitget.js +3 -3
  113. package/js/src/bithumb.d.ts +2 -2
  114. package/js/src/bitmart.d.ts +10 -21
  115. package/js/src/bitmart.js +1 -1
  116. package/js/src/bitmex.d.ts +3 -3
  117. package/js/src/bitopro.d.ts +2 -2
  118. package/js/src/bitrue.d.ts +5 -15
  119. package/js/src/bitrue.js +3 -3
  120. package/js/src/bitso.d.ts +4 -4
  121. package/js/src/bitstamp.d.ts +2 -2
  122. package/js/src/bitteam.d.ts +1 -1
  123. package/js/src/bitvavo.d.ts +3 -3
  124. package/js/src/bl3p.d.ts +1 -1
  125. package/js/src/blockchaincom.d.ts +2 -2
  126. package/js/src/blockchaincom.js +1 -1
  127. package/js/src/btcalpha.d.ts +1 -1
  128. package/js/src/btcbox.d.ts +1 -1
  129. package/js/src/btcmarkets.d.ts +3 -3
  130. package/js/src/btcturk.d.ts +1 -1
  131. package/js/src/bybit.d.ts +8 -8
  132. package/js/src/bybit.js +1 -1
  133. package/js/src/cex.d.ts +1 -1
  134. package/js/src/coinbase.d.ts +6 -50
  135. package/js/src/coinbase.js +2 -2
  136. package/js/src/coinbasepro.d.ts +2 -2
  137. package/js/src/coincheck.d.ts +1 -1
  138. package/js/src/coinex.d.ts +8 -8
  139. package/js/src/coinex.js +1 -1
  140. package/js/src/coinlist.d.ts +4 -14
  141. package/js/src/coinmate.d.ts +2 -2
  142. package/js/src/coinmetro.d.ts +2 -2
  143. package/js/src/coinone.d.ts +1 -1
  144. package/js/src/coinsph.d.ts +2 -2
  145. package/js/src/coinspot.d.ts +1 -1
  146. package/js/src/cryptocom.d.ts +4 -4
  147. package/js/src/cryptocom.js +10 -10
  148. package/js/src/currencycom.d.ts +2 -2
  149. package/js/src/delta.d.ts +2 -2
  150. package/js/src/deribit.d.ts +4 -14
  151. package/js/src/digifinex.d.ts +10 -38
  152. package/js/src/exmo.d.ts +2 -2
  153. package/js/src/gate.d.ts +8 -18
  154. package/js/src/gate.js +34 -29
  155. package/js/src/gemini.d.ts +2 -2
  156. package/js/src/hitbtc.d.ts +6 -16
  157. package/js/src/hollaex.d.ts +2 -2
  158. package/js/src/htx.d.ts +11 -21
  159. package/js/src/huobijp.d.ts +4 -4
  160. package/js/src/idex.d.ts +3 -3
  161. package/js/src/independentreserve.d.ts +2 -2
  162. package/js/src/indodax.d.ts +2 -2
  163. package/js/src/kraken.d.ts +5 -5
  164. package/js/src/kraken.js +39 -0
  165. package/js/src/krakenfutures.d.ts +7 -7
  166. package/js/src/krakenfutures.js +25 -3
  167. package/js/src/kucoin.d.ts +8 -29
  168. package/js/src/kucoin.js +1 -1
  169. package/js/src/kucoinfutures.d.ts +4 -4
  170. package/js/src/kuna.d.ts +2 -2
  171. package/js/src/latoken.d.ts +4 -14
  172. package/js/src/lbank.d.ts +2 -5
  173. package/js/src/luno.d.ts +1 -1
  174. package/js/src/lykke.d.ts +2 -2
  175. package/js/src/mercado.d.ts +2 -2
  176. package/js/src/mexc.d.ts +6 -6
  177. package/js/src/mexc.js +2 -1
  178. package/js/src/ndax.d.ts +2 -2
  179. package/js/src/novadax.d.ts +4 -15
  180. package/js/src/oceanex.d.ts +1 -1
  181. package/js/src/okcoin.d.ts +5 -15
  182. package/js/src/okx.d.ts +8 -18
  183. package/js/src/okx.js +4 -3
  184. package/js/src/onetrading.d.ts +2 -2
  185. package/js/src/p2b.d.ts +1 -1
  186. package/js/src/paymium.d.ts +3 -13
  187. package/js/src/phemex.d.ts +5 -5
  188. package/js/src/phemex.js +8 -8
  189. package/js/src/poloniex.d.ts +4 -14
  190. package/js/src/poloniexfutures.d.ts +1 -1
  191. package/js/src/pro/alpaca.d.ts +2 -2
  192. package/js/src/pro/alpaca.js +8 -4
  193. package/js/src/pro/ascendex.d.ts +2 -2
  194. package/js/src/pro/ascendex.js +1 -2
  195. package/js/src/pro/binance.d.ts +3 -3
  196. package/js/src/pro/binance.js +17 -13
  197. package/js/src/pro/bingx.d.ts +1 -1
  198. package/js/src/pro/bingx.js +1 -1
  199. package/js/src/pro/bitfinex.d.ts +2 -2
  200. package/js/src/pro/bitfinex.js +21 -24
  201. package/js/src/pro/bitfinex2.d.ts +2 -2
  202. package/js/src/pro/bitfinex2.js +13 -17
  203. package/js/src/pro/bitget.js +3 -1
  204. package/js/src/pro/bitmart.d.ts +3 -3
  205. package/js/src/pro/bitmart.js +3 -8
  206. package/js/src/pro/bitmex.d.ts +1 -1
  207. package/js/src/pro/bitmex.js +4 -7
  208. package/js/src/pro/bitopro.d.ts +1 -1
  209. package/js/src/pro/bitopro.js +2 -5
  210. package/js/src/pro/bitrue.js +1 -1
  211. package/js/src/pro/bitstamp.d.ts +1 -1
  212. package/js/src/pro/bitstamp.js +2 -3
  213. package/js/src/pro/bitvavo.d.ts +3 -3
  214. package/js/src/pro/bitvavo.js +12 -5
  215. package/js/src/pro/blockchaincom.d.ts +8 -8
  216. package/js/src/pro/blockchaincom.js +22 -23
  217. package/js/src/pro/bybit.d.ts +2 -2
  218. package/js/src/pro/bybit.js +5 -5
  219. package/js/src/pro/cex.d.ts +1 -1
  220. package/js/src/pro/cex.js +7 -7
  221. package/js/src/pro/coinbase.d.ts +1 -1
  222. package/js/src/pro/coinbase.js +3 -2
  223. package/js/src/pro/coinbasepro.d.ts +1 -1
  224. package/js/src/pro/coinbasepro.js +1 -1
  225. package/js/src/pro/coinex.d.ts +2 -2
  226. package/js/src/pro/coinex.js +15 -13
  227. package/js/src/pro/currencycom.d.ts +1 -1
  228. package/js/src/pro/currencycom.js +5 -7
  229. package/js/src/pro/deribit.d.ts +2 -2
  230. package/js/src/pro/deribit.js +4 -4
  231. package/js/src/pro/exmo.d.ts +2 -2
  232. package/js/src/pro/exmo.js +15 -13
  233. package/js/src/pro/gate.js +1 -1
  234. package/js/src/pro/gemini.d.ts +1 -1
  235. package/js/src/pro/gemini.js +4 -2
  236. package/js/src/pro/hitbtc.d.ts +2 -2
  237. package/js/src/pro/hitbtc.js +9 -8
  238. package/js/src/pro/hollaex.d.ts +2 -2
  239. package/js/src/pro/hollaex.js +2 -2
  240. package/js/src/pro/htx.d.ts +2 -2
  241. package/js/src/pro/htx.js +6 -7
  242. package/js/src/pro/huobijp.d.ts +1 -1
  243. package/js/src/pro/huobijp.js +3 -5
  244. package/js/src/pro/idex.js +1 -1
  245. package/js/src/pro/independentreserve.d.ts +1 -1
  246. package/js/src/pro/independentreserve.js +14 -13
  247. package/js/src/pro/kraken.d.ts +2 -2
  248. package/js/src/pro/kraken.js +10 -16
  249. package/js/src/pro/krakenfutures.d.ts +1 -1
  250. package/js/src/pro/krakenfutures.js +10 -6
  251. package/js/src/pro/kucoin.d.ts +3 -3
  252. package/js/src/pro/kucoin.js +10 -11
  253. package/js/src/pro/kucoinfutures.d.ts +3 -3
  254. package/js/src/pro/kucoinfutures.js +12 -11
  255. package/js/src/pro/lbank.d.ts +1 -1
  256. package/js/src/pro/lbank.js +10 -10
  257. package/js/src/pro/luno.d.ts +2 -2
  258. package/js/src/pro/luno.js +12 -14
  259. package/js/src/pro/mexc.d.ts +2 -2
  260. package/js/src/pro/mexc.js +3 -2
  261. package/js/src/pro/ndax.d.ts +3 -3
  262. package/js/src/pro/ndax.js +7 -13
  263. package/js/src/pro/okcoin.d.ts +1 -1
  264. package/js/src/pro/okcoin.js +7 -12
  265. package/js/src/pro/okx.d.ts +1 -1
  266. package/js/src/pro/okx.js +6 -11
  267. package/js/src/pro/onetrading.d.ts +1 -1
  268. package/js/src/pro/onetrading.js +16 -15
  269. package/js/src/pro/p2b.d.ts +1 -1
  270. package/js/src/pro/p2b.js +5 -3
  271. package/js/src/pro/phemex.d.ts +3 -3
  272. package/js/src/pro/phemex.js +16 -11
  273. package/js/src/pro/poloniex.d.ts +1 -1
  274. package/js/src/pro/poloniex.js +6 -4
  275. package/js/src/pro/poloniexfutures.d.ts +4 -4
  276. package/js/src/pro/poloniexfutures.js +13 -10
  277. package/js/src/pro/probit.d.ts +1 -1
  278. package/js/src/pro/probit.js +14 -12
  279. package/js/src/pro/upbit.js +8 -8
  280. package/js/src/pro/wazirx.d.ts +1 -1
  281. package/js/src/pro/wazirx.js +6 -3
  282. package/js/src/pro/woo.d.ts +3 -3
  283. package/js/src/pro/woo.js +8 -6
  284. package/js/src/probit.d.ts +3 -3
  285. package/js/src/probit.js +3 -3
  286. package/js/src/timex.d.ts +1 -1
  287. package/js/src/tokocrypto.d.ts +3 -3
  288. package/js/src/tokocrypto.js +2 -2
  289. package/js/src/upbit.d.ts +2 -2
  290. package/js/src/wavesexchange.d.ts +3 -4
  291. package/js/src/wavesexchange.js +2 -1
  292. package/js/src/wazirx.d.ts +1 -1
  293. package/js/src/whitebit.d.ts +5 -15
  294. package/js/src/woo.d.ts +5 -15
  295. package/js/src/woo.js +1 -1
  296. package/js/src/yobit.d.ts +21 -6
  297. package/js/src/yobit.js +39 -0
  298. package/js/src/zaif.d.ts +2 -2
  299. package/js/src/zonda.d.ts +4 -14
  300. package/package.json +22 -8
  301. package/skip-tests.json +9 -1
  302. package/tests-manager.sh +1 -2
@@ -2484,8 +2484,9 @@ class ace extends _abstract_ace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
2484
2484
  const feedback = this.id + ' ' + body;
2485
2485
  const status = this.safeNumber(response, 'status', 200);
2486
2486
  if (status > 200) {
2487
- this.throwExactlyMatchedException(this.exceptions['exact'], status, feedback);
2488
- this.throwBroadlyMatchedException(this.exceptions['broad'], status, feedback);
2487
+ const statusStr = status.toString();
2488
+ this.throwExactlyMatchedException(this.exceptions['exact'], statusStr, feedback);
2489
+ this.throwBroadlyMatchedException(this.exceptions['broad'], statusStr, feedback);
2489
2490
  }
2490
2491
  return undefined;
2491
2492
  }
@@ -6767,7 +6768,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
6767
6768
  * @method
6768
6769
  * @name ascendex#transfer
6769
6770
  * @description transfer currency internally between wallets on the same account
6770
- * @param {string} code unified currency code
6771
+ * @param {string} code unified currency codeåå
6771
6772
  * @param {float} amount amount to transfer
6772
6773
  * @param {string} fromAccount account to transfer from
6773
6774
  * @param {string} toAccount account to transfer to
@@ -7043,6 +7044,7 @@ const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sor
7043
7044
  */
7044
7045
  class Exchange {
7045
7046
  constructor(userConfig = {}) {
7047
+ this.throttleProp = undefined;
7046
7048
  this.api = undefined;
7047
7049
  this.userAgent = undefined;
7048
7050
  this.user_agent = undefined;
@@ -7124,6 +7126,7 @@ class Exchange {
7124
7126
  this.clients = {};
7125
7127
  this.newUpdates = true;
7126
7128
  this.streaming = {};
7129
+ this.alias = false;
7127
7130
  this.deepExtend = deepExtend;
7128
7131
  this.isNode = isNode;
7129
7132
  this.keys = _functions_js__WEBPACK_IMPORTED_MODULE_1__/* .keys */ .XP;
@@ -7705,7 +7708,7 @@ class Exchange {
7705
7708
  // @ts-ignore
7706
7709
  this.httpProxyAgentModule = await import(/* webpackIgnore: true */ 'https-proxy-agent');
7707
7710
  }
7708
- catch { }
7711
+ catch (e) { }
7709
7712
  }
7710
7713
  if (this.socksProxyAgentModuleChecked === false) {
7711
7714
  this.socksProxyAgentModuleChecked = true;
@@ -7967,7 +7970,7 @@ class Exchange {
7967
7970
  const markets = await this.fetchMarkets(params);
7968
7971
  return this.setMarkets(markets, currencies);
7969
7972
  }
7970
- loadMarkets(reload = false, params = {}) {
7973
+ async loadMarkets(reload = false, params = {}) {
7971
7974
  // this method is async, it returns a promise
7972
7975
  if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
7973
7976
  this.reloadingMarkets = true;
@@ -7981,28 +7984,28 @@ class Exchange {
7981
7984
  }
7982
7985
  return this.marketsLoading;
7983
7986
  }
7984
- fetchCurrencies(params = {}) {
7987
+ async fetchCurrencies(params = {}) {
7985
7988
  // markets are returned as a list
7986
7989
  // currencies are returned as a dict
7987
7990
  // this is for historical reasons
7988
7991
  // and may be changed for consistency later
7989
7992
  return new Promise((resolve, reject) => resolve(this.currencies));
7990
7993
  }
7991
- fetchCurrenciesWs(params = {}) {
7994
+ async fetchCurrenciesWs(params = {}) {
7992
7995
  // markets are returned as a list
7993
7996
  // currencies are returned as a dict
7994
7997
  // this is for historical reasons
7995
7998
  // and may be changed for consistency later
7996
7999
  return new Promise((resolve, reject) => resolve(this.currencies));
7997
8000
  }
7998
- fetchMarkets(params = {}) {
8001
+ async fetchMarkets(params = {}) {
7999
8002
  // markets are returned as a list
8000
8003
  // currencies are returned as a dict
8001
8004
  // this is for historical reasons
8002
8005
  // and may be changed for consistency later
8003
8006
  return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
8004
8007
  }
8005
- fetchMarketsWs(params = {}) {
8008
+ async fetchMarketsWs(params = {}) {
8006
8009
  // markets are returned as a list
8007
8010
  // currencies are returned as a dict
8008
8011
  // this is for historical reasons
@@ -8077,6 +8080,9 @@ class Exchange {
8077
8080
  }
8078
8081
  handleMessage(client, message) { } // stub to override
8079
8082
  // ping (client) {} // stub to override
8083
+ // ping (client) {
8084
+ // return undefined;
8085
+ // }
8080
8086
  client(url) {
8081
8087
  this.clients = this.clients || {};
8082
8088
  if (!this.clients[url]) {
@@ -8458,6 +8464,9 @@ class Exchange {
8458
8464
  * @returns {object | undefined}
8459
8465
  */
8460
8466
  const value = this.safeValueN(dictionaryOrList, keys, defaultValue);
8467
+ if (value === undefined) {
8468
+ return defaultValue;
8469
+ }
8461
8470
  if (typeof value === 'object') {
8462
8471
  return value;
8463
8472
  }
@@ -8489,6 +8498,9 @@ class Exchange {
8489
8498
  * @returns {Array | undefined}
8490
8499
  */
8491
8500
  const value = this.safeValueN(dictionaryOrList, keys, defaultValue);
8501
+ if (value === undefined) {
8502
+ return defaultValue;
8503
+ }
8492
8504
  if (Array.isArray(value)) {
8493
8505
  return value;
8494
8506
  }
@@ -8706,6 +8718,9 @@ class Exchange {
8706
8718
  }
8707
8719
  }
8708
8720
  if (fromStart) {
8721
+ if (limit > arrayLength) {
8722
+ limit = arrayLength;
8723
+ }
8709
8724
  array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
8710
8725
  }
8711
8726
  else {
@@ -8934,6 +8949,18 @@ class Exchange {
8934
8949
  async setLeverage(leverage, symbol = undefined, params = {}) {
8935
8950
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setLeverage() is not supported yet');
8936
8951
  }
8952
+ async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
8953
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterestHistory() is not supported yet');
8954
+ }
8955
+ async fetchOpenInterest(symbol, params = {}) {
8956
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
8957
+ }
8958
+ async signIn(params = {}) {
8959
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' signIn() is not supported yet');
8960
+ }
8961
+ async fetchPaymentMethods(params = {}) {
8962
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchPaymentMethods() is not supported yet');
8963
+ }
8937
8964
  parseToInt(number) {
8938
8965
  // Solve Common parseInt misuse ex: parseInt ((since / 1000).toString ())
8939
8966
  // using a number as parameter which is not valid in ts
@@ -10544,6 +10571,15 @@ class Exchange {
10544
10571
  async fetchBidsAsks(symbols = undefined, params = {}) {
10545
10572
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBidsAsks() is not supported yet');
10546
10573
  }
10574
+ async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
10575
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBorrowInterest() is not supported yet');
10576
+ }
10577
+ async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
10578
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchLedger() is not supported yet');
10579
+ }
10580
+ async fetchLedgerEntry(id, code = undefined, params = {}) {
10581
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
10582
+ }
10547
10583
  parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
10548
10584
  const price = this.safeNumber(bidask, priceKey);
10549
10585
  const amount = this.safeNumber(bidask, amountKey);
@@ -10844,6 +10880,9 @@ class Exchange {
10844
10880
  return this.handleOptionAndParams(params, methodName, 'marginMode', defaultValue);
10845
10881
  }
10846
10882
  throwExactlyMatchedException(exact, string, message) {
10883
+ if (string === undefined) {
10884
+ return;
10885
+ }
10847
10886
  if (string in exact) {
10848
10887
  throw new exact[string](message);
10849
10888
  }
@@ -11267,21 +11306,18 @@ class Exchange {
11267
11306
  */
11268
11307
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
11269
11308
  }
11270
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
11309
+ async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11271
11310
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDeposits() is not supported yet');
11272
11311
  }
11312
+ async fetchWithdrawals(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11313
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
11314
+ }
11273
11315
  async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
11274
11316
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
11275
11317
  }
11276
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
11277
- throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
11278
- }
11279
11318
  async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
11280
11319
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
11281
11320
  }
11282
- async fetchOpenInterest(symbol, params = {}) {
11283
- throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
11284
- }
11285
11321
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11286
11322
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
11287
11323
  }
@@ -11369,7 +11405,7 @@ class Exchange {
11369
11405
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
11370
11406
  }
11371
11407
  handleWithdrawTagAndParams(tag, params) {
11372
- if (typeof tag === 'object') {
11408
+ if ((tag !== undefined) && (typeof tag === 'object')) {
11373
11409
  params = this.extend(tag, params);
11374
11410
  tag = undefined;
11375
11411
  }
@@ -11503,14 +11539,14 @@ class Exchange {
11503
11539
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchMarketLeverageTiers() is not supported yet');
11504
11540
  }
11505
11541
  }
11506
- async createPostOnlyOrder(symbol, type, side, amount, price, params = {}) {
11542
+ async createPostOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
11507
11543
  if (!this.has['createPostOnlyOrder']) {
11508
11544
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createPostOnlyOrder() is not supported yet');
11509
11545
  }
11510
11546
  const query = this.extend(params, { 'postOnly': true });
11511
11547
  return await this.createOrder(symbol, type, side, amount, price, query);
11512
11548
  }
11513
- async createReduceOnlyOrder(symbol, type, side, amount, price, params = {}) {
11549
+ async createReduceOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
11514
11550
  if (!this.has['createReduceOnlyOrder']) {
11515
11551
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createReduceOnlyOrder() is not supported yet');
11516
11552
  }
@@ -12133,7 +12169,8 @@ class Exchange {
12133
12169
  const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
12134
12170
  const responseLength = response.length;
12135
12171
  if (this.verbose) {
12136
- this.log('Dynamic pagination call', calls, 'method', method, 'response length', responseLength, 'timestamp', paginationTimestamp);
12172
+ const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
12173
+ this.log(backwardMessage);
12137
12174
  }
12138
12175
  if (responseLength === 0) {
12139
12176
  break;
@@ -12151,7 +12188,8 @@ class Exchange {
12151
12188
  const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
12152
12189
  const responseLength = response.length;
12153
12190
  if (this.verbose) {
12154
- this.log('Dynamic pagination call', calls, 'method', method, 'response length', responseLength, 'timestamp', paginationTimestamp);
12191
+ const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
12192
+ this.log(forwardMessage);
12155
12193
  }
12156
12194
  if (responseLength === 0) {
12157
12195
  break;
@@ -12197,6 +12235,7 @@ class Exchange {
12197
12235
  throw e;
12198
12236
  }
12199
12237
  }
12238
+ return undefined;
12200
12239
  }
12201
12240
  async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
12202
12241
  let maxCalls = undefined;
@@ -12261,7 +12300,9 @@ class Exchange {
12261
12300
  errors = 0;
12262
12301
  const responseLength = response.length;
12263
12302
  if (this.verbose) {
12264
- this.log('Cursor pagination call', i + 1, 'method', method, 'response length', responseLength, 'cursor', cursorValue);
12303
+ const iteration = (i + 1).toString();
12304
+ const cursorMessage = 'Cursor pagination call ' + iteration + ' method ' + method + ' response length ' + responseLength.toString() + ' cursor ' + cursorValue;
12305
+ this.log(cursorMessage);
12265
12306
  }
12266
12307
  if (responseLength === 0) {
12267
12308
  break;
@@ -12305,7 +12346,9 @@ class Exchange {
12305
12346
  errors = 0;
12306
12347
  const responseLength = response.length;
12307
12348
  if (this.verbose) {
12308
- this.log('Incremental pagination call', i + 1, 'method', method, 'response length', responseLength);
12349
+ const iteration = (i + 1).toString();
12350
+ const incrementalMessage = 'Incremental pagination call ' + iteration + ' method ' + method + ' response length ' + responseLength.toString();
12351
+ this.log(incrementalMessage);
12309
12352
  }
12310
12353
  if (responseLength === 0) {
12311
12354
  break;
@@ -16181,6 +16224,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16181
16224
  * @method
16182
16225
  * @name bigone#fetchMarkets
16183
16226
  * @description retrieves data on all markets for bigone
16227
+ * @see https://open.big.one/docs/spot_asset_pair.html
16184
16228
  * @param {object} [params] extra parameters specific to the exchange API endpoint
16185
16229
  * @returns {object[]} an array of objects representing market data
16186
16230
  */
@@ -16443,6 +16487,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16443
16487
  * @method
16444
16488
  * @name bigone#fetchTicker
16445
16489
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
16490
+ * @see https://open.big.one/docs/spot_tickers.html
16446
16491
  * @param {string} symbol unified symbol of the market to fetch the ticker for
16447
16492
  * @param {object} [params] extra parameters specific to the exchange API endpoint
16448
16493
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -16485,6 +16530,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16485
16530
  * @method
16486
16531
  * @name bigone#fetchTickers
16487
16532
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
16533
+ * @see https://open.big.one/docs/spot_tickers.html
16488
16534
  * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
16489
16535
  * @param {object} [params] extra parameters specific to the exchange API endpoint
16490
16536
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -16572,6 +16618,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16572
16618
  * @method
16573
16619
  * @name bigone#fetchTime
16574
16620
  * @description fetches the current integer timestamp in milliseconds from the exchange server
16621
+ * @see https://open.big.one/docs/spot_ping.html
16575
16622
  * @param {object} [params] extra parameters specific to the exchange API endpoint
16576
16623
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
16577
16624
  */
@@ -16592,6 +16639,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16592
16639
  * @method
16593
16640
  * @name bigone#fetchOrderBook
16594
16641
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
16642
+ * @see https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot
16595
16643
  * @param {string} symbol unified symbol of the market to fetch the order book for
16596
16644
  * @param {int} [limit] the maximum amount of order book entries to return
16597
16645
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -16834,6 +16882,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16834
16882
  * @method
16835
16883
  * @name bigone#fetchTrades
16836
16884
  * @description get the list of most recent trades for a particular symbol
16885
+ * @see https://open.big.one/docs/spot_asset_pair_trade.html
16837
16886
  * @param {string} symbol unified symbol of the market to fetch trades for
16838
16887
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
16839
16888
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -16898,6 +16947,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16898
16947
  * @method
16899
16948
  * @name bigone#fetchOHLCV
16900
16949
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
16950
+ * @see https://open.big.one/docs/spot_asset_pair_candle.html
16901
16951
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
16902
16952
  * @param {string} timeframe the length of time each candle represents
16903
16953
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -16974,6 +17024,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16974
17024
  * @method
16975
17025
  * @name bigone#fetchBalance
16976
17026
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
17027
+ * @see https://open.big.one/docs/fund_accounts.html
17028
+ * @see https://open.big.one/docs/spot_accounts.html
16977
17029
  * @param {object} [params] extra parameters specific to the exchange API endpoint
16978
17030
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
16979
17031
  */
@@ -17219,6 +17271,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17219
17271
  * @method
17220
17272
  * @name bigone#cancelOrder
17221
17273
  * @description cancels an open order
17274
+ * @see https://open.big.one/docs/spot_orders.html#cancel-order
17222
17275
  * @param {string} id order id
17223
17276
  * @param {string} symbol Not used by bigone cancelOrder ()
17224
17277
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -17247,6 +17300,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17247
17300
  * @method
17248
17301
  * @name bigone#cancelAllOrders
17249
17302
  * @description cancel all open orders
17303
+ * @see https://open.big.one/docs/spot_orders.html#cancel-all-orders
17250
17304
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
17251
17305
  * @param {object} [params] extra parameters specific to the exchange API endpoint
17252
17306
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -17276,6 +17330,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17276
17330
  * @method
17277
17331
  * @name bigone#fetchOrder
17278
17332
  * @description fetches information on an order made by the user
17333
+ * @see https://open.big.one/docs/spot_orders.html#get-one-order
17279
17334
  * @param {string} symbol not used by bigone fetchOrder
17280
17335
  * @param {object} [params] extra parameters specific to the exchange API endpoint
17281
17336
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -17291,6 +17346,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17291
17346
  * @method
17292
17347
  * @name bigone#fetchOrders
17293
17348
  * @description fetches information on multiple orders made by the user
17349
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
17294
17350
  * @param {string} symbol unified market symbol of the market orders were made in
17295
17351
  * @param {int} [since] the earliest time in ms to fetch orders for
17296
17352
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -17341,6 +17397,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17341
17397
  * @method
17342
17398
  * @name bigone#fetchMyTrades
17343
17399
  * @description fetch all trades made by the user
17400
+ * @see https://open.big.one/docs/spot_trade.html#trades-of-user
17344
17401
  * @param {string} symbol unified market symbol
17345
17402
  * @param {int} [since] the earliest time in ms to fetch trades for
17346
17403
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -17410,6 +17467,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17410
17467
  * @method
17411
17468
  * @name bigone#fetchOpenOrders
17412
17469
  * @description fetch all unfilled currently open orders
17470
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
17413
17471
  * @param {string} symbol unified market symbol
17414
17472
  * @param {int} [since] the earliest time in ms to fetch open orders for
17415
17473
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -17426,6 +17484,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17426
17484
  * @method
17427
17485
  * @name bigone#fetchClosedOrders
17428
17486
  * @description fetches information on multiple closed orders made by the user
17487
+ * @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
17429
17488
  * @param {string} symbol unified market symbol of the market orders were made in
17430
17489
  * @param {int} [since] the earliest time in ms to fetch orders for
17431
17490
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -17480,6 +17539,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17480
17539
  * @method
17481
17540
  * @name bigone#fetchDepositAddress
17482
17541
  * @description fetch the deposit address for a currency associated with this account
17542
+ * @see https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
17483
17543
  * @param {string} code unified currency code
17484
17544
  * @param {object} [params] extra parameters specific to the exchange API endpoint
17485
17545
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -17630,6 +17690,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17630
17690
  * @method
17631
17691
  * @name bigone#fetchDeposits
17632
17692
  * @description fetch all deposits made to an account
17693
+ * @see https://open.big.one/docs/spot_deposit.html#deposit-of-user
17633
17694
  * @param {string} code unified currency code
17634
17695
  * @param {int} [since] the earliest time in ms to fetch deposits for
17635
17696
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -17681,6 +17742,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17681
17742
  * @method
17682
17743
  * @name bigone#fetchWithdrawals
17683
17744
  * @description fetch all withdrawals made from an account
17745
+ * @see https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
17684
17746
  * @param {string} code unified currency code
17685
17747
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
17686
17748
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -17786,7 +17848,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17786
17848
  'id': undefined,
17787
17849
  'timestamp': undefined,
17788
17850
  'datetime': undefined,
17789
- 'currency': code,
17851
+ 'currency': undefined,
17790
17852
  'amount': undefined,
17791
17853
  'fromAccount': undefined,
17792
17854
  'toAccount': undefined,
@@ -17804,6 +17866,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
17804
17866
  * @method
17805
17867
  * @name bigone#withdraw
17806
17868
  * @description make a withdrawal
17869
+ * @see https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
17807
17870
  * @param {string} code unified currency code
17808
17871
  * @param {float} amount the amount to withdraw
17809
17872
  * @param {string} address the address to withdraw to
@@ -21026,16 +21089,31 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21026
21089
  account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(debt, interest);
21027
21090
  return account;
21028
21091
  }
21029
- parseBalance(response, type = undefined, marginMode = undefined) {
21092
+ parseBalanceCustom(response, type = undefined, marginMode = undefined) {
21030
21093
  const result = {
21031
21094
  'info': response,
21032
21095
  };
21033
21096
  let timestamp = undefined;
21034
21097
  const isolated = marginMode === 'isolated';
21035
21098
  const cross = (type === 'margin') || (marginMode === 'cross');
21036
- if (!isolated && ((type === 'spot') || cross)) {
21099
+ if (type === 'papi') {
21100
+ for (let i = 0; i < response.length; i++) {
21101
+ const entry = response[i];
21102
+ const account = this.account();
21103
+ const currencyId = this.safeString(entry, 'asset');
21104
+ const code = this.safeCurrencyCode(currencyId);
21105
+ const borrowed = this.safeString(entry, 'crossMarginBorrowed');
21106
+ const interest = this.safeString(entry, 'crossMarginInterest');
21107
+ account['free'] = this.safeString(entry, 'crossMarginFree');
21108
+ account['used'] = this.safeString(entry, 'crossMarginLocked');
21109
+ account['total'] = this.safeString(entry, 'crossMarginAsset');
21110
+ account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(borrowed, interest);
21111
+ result[code] = account;
21112
+ }
21113
+ }
21114
+ else if (!isolated && ((type === 'spot') || cross)) {
21037
21115
  timestamp = this.safeInteger(response, 'updateTime');
21038
- const balances = this.safeValue2(response, 'balances', 'userAssets', []);
21116
+ const balances = this.safeList2(response, 'balances', 'userAssets', []);
21039
21117
  for (let i = 0; i < balances.length; i++) {
21040
21118
  const balance = balances[i];
21041
21119
  const currencyId = this.safeString(balance, 'asset');
@@ -21052,13 +21130,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21052
21130
  }
21053
21131
  }
21054
21132
  else if (isolated) {
21055
- const assets = this.safeValue(response, 'assets');
21133
+ const assets = this.safeList(response, 'assets');
21056
21134
  for (let i = 0; i < assets.length; i++) {
21057
21135
  const asset = assets[i];
21058
- const marketId = this.safeValue(asset, 'symbol');
21136
+ const marketId = this.safeString(asset, 'symbol');
21059
21137
  const symbol = this.safeSymbol(marketId, undefined, undefined, 'spot');
21060
- const base = this.safeValue(asset, 'baseAsset', {});
21061
- const quote = this.safeValue(asset, 'quoteAsset', {});
21138
+ const base = this.safeDict(asset, 'baseAsset', {});
21139
+ const quote = this.safeDict(asset, 'quoteAsset', {});
21062
21140
  const baseCode = this.safeCurrencyCode(this.safeString(base, 'asset'));
21063
21141
  const quoteCode = this.safeCurrencyCode(this.safeString(quote, 'asset'));
21064
21142
  const subResult = {};
@@ -21068,7 +21146,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21068
21146
  }
21069
21147
  }
21070
21148
  else if (type === 'savings') {
21071
- const positionAmountVos = this.safeValue(response, 'positionAmountVos', []);
21149
+ const positionAmountVos = this.safeList(response, 'positionAmountVos', []);
21072
21150
  for (let i = 0; i < positionAmountVos.length; i++) {
21073
21151
  const entry = positionAmountVos[i];
21074
21152
  const currencyId = this.safeString(entry, 'asset');
@@ -21097,7 +21175,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21097
21175
  else {
21098
21176
  let balances = response;
21099
21177
  if (!Array.isArray(response)) {
21100
- balances = this.safeValue(response, 'assets', []);
21178
+ balances = this.safeList(response, 'assets', []);
21101
21179
  }
21102
21180
  for (let i = 0; i < balances.length; i++) {
21103
21181
  const balance = balances[i];
@@ -21127,10 +21205,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21127
21205
  * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data // swap
21128
21206
  * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data // future
21129
21207
  * @see https://binance-docs.github.io/apidocs/voptions/en/#option-account-information-trade // option
21208
+ * @see https://binance-docs.github.io/apidocs/pm/en/#account-balance-user_data // portfolio margin
21130
21209
  * @param {object} [params] extra parameters specific to the exchange API endpoint
21131
- * @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
21210
+ * @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
21132
21211
  * @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
21133
21212
  * @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
21213
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
21134
21214
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
21135
21215
  */
21136
21216
  await this.loadMarkets();
@@ -21138,13 +21218,19 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21138
21218
  let type = this.safeString(params, 'type', defaultType);
21139
21219
  let subType = undefined;
21140
21220
  [subType, params] = this.handleSubTypeAndParams('fetchBalance', undefined, params);
21221
+ let isPortfolioMargin = undefined;
21222
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchBalance', 'papi', 'portfolioMargin', false);
21141
21223
  let marginMode = undefined;
21142
21224
  let query = undefined;
21143
21225
  [marginMode, query] = this.handleMarginModeAndParams('fetchBalance', params);
21144
21226
  query = this.omit(query, 'type');
21145
21227
  let response = undefined;
21146
21228
  const request = {};
21147
- if (this.isLinear(type, subType)) {
21229
+ if (isPortfolioMargin || (type === 'papi')) {
21230
+ type = 'papi';
21231
+ response = await this.papiGetBalance(this.extend(request, query));
21232
+ }
21233
+ else if (this.isLinear(type, subType)) {
21148
21234
  type = 'linear';
21149
21235
  response = await this.fapiPrivateV2GetAccount(this.extend(request, query));
21150
21236
  }
@@ -21153,7 +21239,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21153
21239
  response = await this.dapiPrivateGetAccount(this.extend(request, query));
21154
21240
  }
21155
21241
  else if (marginMode === 'isolated') {
21156
- const paramSymbols = this.safeValue(params, 'symbols');
21242
+ const paramSymbols = this.safeList(params, 'symbols');
21157
21243
  query = this.omit(query, 'symbols');
21158
21244
  if (paramSymbols !== undefined) {
21159
21245
  let symbols = '';
@@ -21369,7 +21455,27 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21369
21455
  // }
21370
21456
  // ]
21371
21457
  //
21372
- return this.parseBalance(response, type, marginMode);
21458
+ // portfolio margin
21459
+ //
21460
+ // [
21461
+ // {
21462
+ // "asset": "USDT",
21463
+ // "totalWalletBalance": "66.9923261",
21464
+ // "crossMarginAsset": "35.9697141",
21465
+ // "crossMarginBorrowed": "0.0",
21466
+ // "crossMarginFree": "35.9697141",
21467
+ // "crossMarginInterest": "0.0",
21468
+ // "crossMarginLocked": "0.0",
21469
+ // "umWalletBalance": "31.022612",
21470
+ // "umUnrealizedPNL": "0.0",
21471
+ // "cmWalletBalance": "0.0",
21472
+ // "cmUnrealizedPNL": "0.0",
21473
+ // "updateTime": 0,
21474
+ // "negativeBalance": "0.0"
21475
+ // },
21476
+ // ]
21477
+ //
21478
+ return this.parseBalanceCustom(response, type, marginMode);
21373
21479
  }
21374
21480
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
21375
21481
  /**
@@ -23141,7 +23247,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23141
23247
  const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
23142
23248
  const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
23143
23249
  const trailingDelta = this.safeValue(params, 'trailingDelta');
23144
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
23250
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
23145
23251
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
23146
23252
  const isTrailingPercentOrder = trailingPercent !== undefined;
23147
23253
  const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
@@ -27474,7 +27580,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27474
27580
  }
27475
27581
  return this.safeValue(config, 'cost', 1);
27476
27582
  }
27477
- async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}, context = {}) {
27583
+ async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
27478
27584
  const response = await this.fetch2(path, api, method, params, headers, body, config);
27479
27585
  // a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
27480
27586
  if (api === 'private') {
@@ -28107,6 +28213,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
28107
28213
  else {
28108
28214
  return this.parseOpenInterest(response, market);
28109
28215
  }
28216
+ return undefined;
28110
28217
  }
28111
28218
  parseOpenInterest(interest, market = undefined) {
28112
28219
  const timestamp = this.safeInteger2(interest, 'timestamp', 'time');
@@ -30660,6 +30767,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30660
30767
  }
30661
30768
  }
30662
30769
  if (isStopLoss || isTakeProfit) {
30770
+ const stringifiedAmount = this.numberToString(amount);
30663
30771
  if (isStopLoss) {
30664
30772
  const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
30665
30773
  const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
@@ -30673,7 +30781,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30673
30781
  if (slPrice !== undefined) {
30674
30782
  slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
30675
30783
  }
30676
- const slQuantity = this.safeString(stopLoss, 'quantity', amount);
30784
+ const slQuantity = this.safeString(stopLoss, 'quantity', stringifiedAmount);
30677
30785
  slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
30678
30786
  request['stopLoss'] = this.json(slRequest);
30679
30787
  }
@@ -30690,7 +30798,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30690
30798
  if (slPrice !== undefined) {
30691
30799
  tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
30692
30800
  }
30693
- const tkQuantity = this.safeString(takeProfit, 'quantity', amount);
30801
+ const tkQuantity = this.safeString(takeProfit, 'quantity', stringifiedAmount);
30694
30802
  tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
30695
30803
  request['takeProfit'] = this.json(tpRequest);
30696
30804
  }
@@ -32376,7 +32484,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
32376
32484
  // "id":"1197073063359000577"
32377
32485
  // }
32378
32486
  // }
32379
- this.parseTransaction(data);
32487
+ return this.parseTransaction(data);
32380
32488
  }
32381
32489
  parseParams(params) {
32382
32490
  const sortedParams = this.keysort(params);
@@ -32910,6 +33018,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
32910
33018
  * @method
32911
33019
  * @name bit2c#fetchBalance
32912
33020
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
33021
+ * @see https://bit2c.co.il/home/api#balance
32913
33022
  * @param {object} [params] extra parameters specific to the exchange API endpoint
32914
33023
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
32915
33024
  */
@@ -32964,6 +33073,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
32964
33073
  * @method
32965
33074
  * @name bit2c#fetchOrderBook
32966
33075
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
33076
+ * @see https://bit2c.co.il/home/api#orderb
32967
33077
  * @param {string} symbol unified symbol of the market to fetch the order book for
32968
33078
  * @param {int} [limit] the maximum amount of order book entries to return
32969
33079
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -33010,6 +33120,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33010
33120
  * @method
33011
33121
  * @name bit2c#fetchTicker
33012
33122
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
33123
+ * @see https://bit2c.co.il/home/api#ticker
33013
33124
  * @param {string} symbol unified symbol of the market to fetch the ticker for
33014
33125
  * @param {object} [params] extra parameters specific to the exchange API endpoint
33015
33126
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -33027,6 +33138,8 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33027
33138
  * @method
33028
33139
  * @name bit2c#fetchTrades
33029
33140
  * @description get the list of most recent trades for a particular symbol
33141
+ * @see https://bit2c.co.il/home/api#transactions
33142
+ * @see https://bit2c.co.il/home/api#trades
33030
33143
  * @param {string} symbol unified symbol of the market to fetch trades for
33031
33144
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
33032
33145
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -33069,6 +33182,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33069
33182
  * @method
33070
33183
  * @name bit2c#fetchTradingFees
33071
33184
  * @description fetch the trading fees for multiple markets
33185
+ * @see https://bit2c.co.il/home/api#balance
33072
33186
  * @param {object} [params] extra parameters specific to the exchange API endpoint
33073
33187
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
33074
33188
  */
@@ -33117,6 +33231,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33117
33231
  * @method
33118
33232
  * @name bit2c#createOrder
33119
33233
  * @description create a trade order
33234
+ * @see https://bit2c.co.il/home/api#addo
33120
33235
  * @param {string} symbol unified symbol of the market to create an order in
33121
33236
  * @param {string} type 'market' or 'limit'
33122
33237
  * @param {string} side 'buy' or 'sell'
@@ -33150,6 +33265,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33150
33265
  * @method
33151
33266
  * @name bit2c#cancelOrder
33152
33267
  * @description cancels an open order
33268
+ * @see https://bit2c.co.il/home/api#cancelo
33153
33269
  * @param {string} id order id
33154
33270
  * @param {string} symbol Not used by bit2c cancelOrder ()
33155
33271
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -33165,6 +33281,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33165
33281
  * @method
33166
33282
  * @name bit2c#fetchOpenOrders
33167
33283
  * @description fetch all unfilled currently open orders
33284
+ * @see https://bit2c.co.il/home/api#geto
33168
33285
  * @param {string} symbol unified market symbol
33169
33286
  * @param {int} [since] the earliest time in ms to fetch open orders for
33170
33287
  * @param {int} [limit] the maximum number of open order structures to retrieve
@@ -33190,6 +33307,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33190
33307
  * @method
33191
33308
  * @name bit2c#fetchOrder
33192
33309
  * @description fetches information on an order made by the user
33310
+ * @see https://bit2c.co.il/home/api#getoid
33193
33311
  * @param {string} symbol unified market symbol
33194
33312
  * @param {object} [params] extra parameters specific to the exchange API endpoint
33195
33313
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -33342,6 +33460,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33342
33460
  * @method
33343
33461
  * @name bit2c#fetchMyTrades
33344
33462
  * @description fetch all trades made by the user
33463
+ * @see https://bit2c.co.il/home/api#orderh
33345
33464
  * @param {string} symbol unified market symbol
33346
33465
  * @param {int} [since] the earliest time in ms to fetch trades for
33347
33466
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -33522,6 +33641,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33522
33641
  * @method
33523
33642
  * @name bit2c#fetchDepositAddress
33524
33643
  * @description fetch the deposit address for a currency associated with this account
33644
+ * @see https://bit2c.co.il/home/api#addc
33525
33645
  * @param {string} code unified currency code
33526
33646
  * @param {object} [params] extra parameters specific to the exchange API endpoint
33527
33647
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -37621,11 +37741,13 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
37621
37741
  'has': {
37622
37742
  'CORS': undefined,
37623
37743
  'spot': true,
37624
- 'margin': undefined,
37744
+ 'margin': true,
37625
37745
  'swap': true,
37626
37746
  'future': undefined,
37627
37747
  'option': undefined,
37628
37748
  'addMargin': false,
37749
+ 'borrowCrossMargin': false,
37750
+ 'borrowIsolatedMargin': false,
37629
37751
  'cancelAllOrders': true,
37630
37752
  'cancelOrder': true,
37631
37753
  'cancelOrders': true,
@@ -37642,8 +37764,13 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
37642
37764
  'createTriggerOrder': true,
37643
37765
  'editOrder': true,
37644
37766
  'fetchBalance': true,
37767
+ 'fetchBorrowInterest': false,
37768
+ 'fetchBorrowRateHistories': false,
37769
+ 'fetchBorrowRateHistory': false,
37645
37770
  'fetchClosedOrder': true,
37646
37771
  'fetchClosedOrders': true,
37772
+ 'fetchCrossBorrowRate': false,
37773
+ 'fetchCrossBorrowRates': false,
37647
37774
  'fetchCurrencies': true,
37648
37775
  'fetchDepositAddress': true,
37649
37776
  'fetchDepositsWithdrawals': true,
@@ -37652,6 +37779,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
37652
37779
  'fetchFundingRateHistory': true,
37653
37780
  'fetchFundingRates': true,
37654
37781
  'fetchIndexOHLCV': false,
37782
+ 'fetchIsolatedBorrowRate': false,
37783
+ 'fetchIsolatedBorrowRates': false,
37655
37784
  'fetchLedger': true,
37656
37785
  'fetchLeverage': false,
37657
37786
  'fetchLeverageTiers': false,
@@ -37679,6 +37808,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
37679
37808
  'fetchTransactionFees': undefined,
37680
37809
  'fetchTransactions': 'emulated',
37681
37810
  'reduceMargin': false,
37811
+ 'repayCrossMargin': false,
37812
+ 'repayIsolatedMargin': false,
37682
37813
  'setLeverage': false,
37683
37814
  'setMargin': true,
37684
37815
  'setMarginMode': false,
@@ -47369,7 +47500,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
47369
47500
  const isTakeProfit = takeProfit !== undefined;
47370
47501
  const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
47371
47502
  const isStopLossOrTakeProfit = isStopLoss || isTakeProfit;
47372
- const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
47503
+ const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
47373
47504
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
47374
47505
  const isTrailingPercentOrder = trailingPercent !== undefined;
47375
47506
  if (this.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1) {
@@ -50192,7 +50323,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
50192
50323
  * @name bitget#setLeverage
50193
50324
  * @description set the level of leverage for a market
50194
50325
  * @see https://www.bitget.com/api-doc/contract/account/Change-Leverage
50195
- * @param {float} leverage the rate of leverage
50326
+ * @param {int} leverage the rate of leverage
50196
50327
  * @param {string} symbol unified market symbol
50197
50328
  * @param {object} [params] extra parameters specific to the exchange API endpoint
50198
50329
  * @param {string} [params.holdSide] *isolated only* position direction, 'long' or 'short'
@@ -50216,7 +50347,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
50216
50347
  const request = {
50217
50348
  'symbol': market['id'],
50218
50349
  'marginCoin': market['settleId'],
50219
- 'leverage': leverage,
50350
+ 'leverage': this.numberToString(leverage),
50220
50351
  'productType': productType,
50221
50352
  // 'holdSide': 'long',
50222
50353
  };
@@ -55082,7 +55213,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55082
55213
  }
55083
55214
  const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
55084
55215
  const isTriggerOrder = triggerPrice !== undefined;
55085
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', price);
55216
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', this.numberToString(price));
55086
55217
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
55087
55218
  const isTrailingPercentOrder = trailingPercent !== undefined;
55088
55219
  if (isLimitOrder) {
@@ -63753,9 +63884,9 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
63753
63884
  const amountString = this.numberToString(amount);
63754
63885
  const priceString = this.numberToString(price);
63755
63886
  const quoteAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
63756
- amount = (cost !== undefined) ? cost : quoteAmount;
63757
- request['amount'] = this.costToPrecision(symbol, amount);
63758
- request['volume'] = this.costToPrecision(symbol, amount);
63887
+ const requestAmount = (cost !== undefined) ? cost : quoteAmount;
63888
+ request['amount'] = this.costToPrecision(symbol, requestAmount);
63889
+ request['volume'] = this.costToPrecision(symbol, requestAmount);
63759
63890
  }
63760
63891
  }
63761
63892
  else {
@@ -74388,7 +74519,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74388
74519
  'remaining': remaining,
74389
74520
  'cost': undefined,
74390
74521
  'trades': [],
74391
- 'fees': {},
74522
+ 'fees': [],
74392
74523
  'info': order,
74393
74524
  });
74394
74525
  return result;
@@ -82428,7 +82559,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82428
82559
  const takeProfitTriggerPrice = this.safeValue(params, 'takeProfitPrice');
82429
82560
  const stopLoss = this.safeValue(params, 'stopLoss');
82430
82561
  const takeProfit = this.safeValue(params, 'takeProfit');
82431
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', price);
82562
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', this.numberToString(price));
82432
82563
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
82433
82564
  const isTrailingAmountOrder = trailingAmount !== undefined;
82434
82565
  const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
@@ -89735,7 +89866,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
89735
89866
  'info': ticker,
89736
89867
  }, market);
89737
89868
  }
89738
- parseBalance(response, params = {}) {
89869
+ parseCustomBalance(response, params = {}) {
89739
89870
  const balances = this.safeValue2(response, 'data', 'accounts', []);
89740
89871
  const accounts = this.safeValue(params, 'type', this.options['accounts']);
89741
89872
  const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
@@ -89886,7 +90017,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
89886
90017
  // "size": 9
89887
90018
  // }
89888
90019
  //
89889
- return this.parseBalance(response, params);
90020
+ return this.parseCustomBalance(response, params);
89890
90021
  }
89891
90022
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
89892
90023
  /**
@@ -98670,7 +98801,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
98670
98801
  const request = {
98671
98802
  'coin_type': currency['id'],
98672
98803
  'coin_address': address,
98673
- 'actual_amount': parseFloat(amount),
98804
+ 'actual_amount': parseFloat(this.numberToString(amount)),
98674
98805
  'transfer_method': 'onchain', // onchain, local
98675
98806
  };
98676
98807
  if (networkCode !== undefined) {
@@ -109806,10 +109937,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
109806
109937
  const isTakeProfitTrigger = (takeProfitPrice !== undefined);
109807
109938
  if (isTrigger) {
109808
109939
  request['ref_price'] = this.priceToPrecision(symbol, triggerPrice);
109809
- price = price.toString();
109940
+ const priceString = this.numberToString(price);
109810
109941
  if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
109811
109942
  if (side === 'buy') {
109812
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
109943
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
109813
109944
  request['type'] = 'TAKE_PROFIT_LIMIT';
109814
109945
  }
109815
109946
  else {
@@ -109817,7 +109948,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
109817
109948
  }
109818
109949
  }
109819
109950
  else {
109820
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
109951
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
109821
109952
  request['type'] = 'STOP_LIMIT';
109822
109953
  }
109823
109954
  else {
@@ -109827,7 +109958,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
109827
109958
  }
109828
109959
  else {
109829
109960
  if (side === 'buy') {
109830
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
109961
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
109831
109962
  request['type'] = 'TAKE_PROFIT';
109832
109963
  }
109833
109964
  else {
@@ -109835,7 +109966,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
109835
109966
  }
109836
109967
  }
109837
109968
  else {
109838
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
109969
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
109839
109970
  request['type'] = 'STOP_LOSS';
109840
109971
  }
109841
109972
  else {
@@ -110026,10 +110157,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
110026
110157
  const isStopLossTrigger = (stopLossPrice !== undefined);
110027
110158
  const isTakeProfitTrigger = (takeProfitPrice !== undefined);
110028
110159
  if (isTrigger) {
110029
- price = price.toString();
110160
+ const priceString = this.numberToString(price);
110030
110161
  if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
110031
110162
  if (side === 'buy') {
110032
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
110163
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
110033
110164
  request['type'] = 'TAKE_PROFIT_LIMIT';
110034
110165
  }
110035
110166
  else {
@@ -110037,7 +110168,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
110037
110168
  }
110038
110169
  }
110039
110170
  else {
110040
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
110171
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
110041
110172
  request['type'] = 'STOP_LIMIT';
110042
110173
  }
110043
110174
  else {
@@ -110047,7 +110178,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
110047
110178
  }
110048
110179
  else {
110049
110180
  if (side === 'buy') {
110050
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
110181
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
110051
110182
  request['type'] = 'TAKE_PROFIT';
110052
110183
  }
110053
110184
  else {
@@ -110055,7 +110186,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
110055
110186
  }
110056
110187
  }
110057
110188
  else {
110058
- if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(price, triggerPrice)) {
110189
+ if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
110059
110190
  request['type'] = 'STOP_LOSS';
110060
110191
  }
110061
110192
  else {
@@ -129188,32 +129319,34 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129188
129319
  let withdrawAvailable = this.safeValue(result[code], 'withdraw');
129189
129320
  withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
129190
129321
  const networks = this.safeValue(result[code], 'networks', {});
129191
- networks[networkCode] = {
129192
- 'info': entry,
129193
- 'id': networkId,
129194
- 'network': networkCode,
129195
- 'currencyId': currencyId,
129196
- 'lowerCaseCurrencyId': currencyIdLower,
129197
- 'deposit': depositEnabled,
129198
- 'withdraw': withdrawEnabled,
129199
- 'active': active,
129200
- 'fee': undefined,
129201
- 'precision': this.parseNumber('1e-4'),
129202
- 'limits': {
129203
- 'amount': {
129204
- 'min': undefined,
129205
- 'max': undefined,
129206
- },
129207
- 'withdraw': {
129208
- 'min': undefined,
129209
- 'max': undefined,
129210
- },
129211
- 'deposit': {
129212
- 'min': undefined,
129213
- 'max': undefined,
129322
+ if (networkCode !== undefined) {
129323
+ networks[networkCode] = {
129324
+ 'info': entry,
129325
+ 'id': networkId,
129326
+ 'network': networkCode,
129327
+ 'currencyId': currencyId,
129328
+ 'lowerCaseCurrencyId': currencyIdLower,
129329
+ 'deposit': depositEnabled,
129330
+ 'withdraw': withdrawEnabled,
129331
+ 'active': active,
129332
+ 'fee': undefined,
129333
+ 'precision': this.parseNumber('1e-4'),
129334
+ 'limits': {
129335
+ 'amount': {
129336
+ 'min': undefined,
129337
+ 'max': undefined,
129338
+ },
129339
+ 'withdraw': {
129340
+ 'min': undefined,
129341
+ 'max': undefined,
129342
+ },
129343
+ 'deposit': {
129344
+ 'min': undefined,
129345
+ 'max': undefined,
129346
+ },
129214
129347
  },
129215
- },
129216
- };
129348
+ };
129349
+ }
129217
129350
  result[code]['networks'] = networks;
129218
129351
  const info = this.safeValue(result[code], 'info', []);
129219
129352
  info.push(entry);
@@ -130169,6 +130302,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
130169
130302
  const [type, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
130170
130303
  const [request, requestParams] = this.prepareRequest(undefined, type, query);
130171
130304
  let response = undefined;
130305
+ request['timezone'] = 'utc0'; // default to utc
130172
130306
  if (type === 'spot' || type === 'margin') {
130173
130307
  response = await this.publicSpotGetTickers(this.extend(request, requestParams));
130174
130308
  }
@@ -130186,7 +130320,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
130186
130320
  response = await this.publicOptionsGetTickers(this.extend(request, requestParams));
130187
130321
  }
130188
130322
  else {
130189
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTickers() not support this market type');
130323
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTickers() not support this market type, provide symbols or set params["defaultType"] to one from spot/margin/swap/future/option');
130190
130324
  }
130191
130325
  return this.parseTickers(response, symbols);
130192
130326
  }
@@ -132757,16 +132891,17 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132757
132891
  const defaultMarginMode = this.safeString2(this.options, 'marginMode', 'defaultMarginMode');
132758
132892
  const crossLeverageLimit = this.safeString(query, 'cross_leverage_limit');
132759
132893
  let marginMode = this.safeString(query, 'marginMode', defaultMarginMode);
132894
+ let stringifiedMargin = this.numberToString(leverage);
132760
132895
  if (crossLeverageLimit !== undefined) {
132761
132896
  marginMode = 'cross';
132762
- leverage = crossLeverageLimit;
132897
+ stringifiedMargin = crossLeverageLimit;
132763
132898
  }
132764
132899
  if (marginMode === 'cross' || marginMode === 'cross_margin') {
132765
- request['cross_leverage_limit'] = leverage.toString();
132900
+ request['cross_leverage_limit'] = stringifiedMargin;
132766
132901
  request['leverage'] = '0';
132767
132902
  }
132768
132903
  else {
132769
- request['leverage'] = leverage.toString();
132904
+ request['leverage'] = stringifiedMargin;
132770
132905
  }
132771
132906
  let response = undefined;
132772
132907
  if (market['swap']) {
@@ -134501,6 +134636,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
134501
134636
  return this.parseGreeks(entry, market);
134502
134637
  }
134503
134638
  }
134639
+ return undefined;
134504
134640
  }
134505
134641
  parseGreeks(greeks, market = undefined) {
134506
134642
  //
@@ -158295,6 +158431,41 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
158295
158431
  // "txid": "OTI672-HJFAO-XOIPPK"
158296
158432
  // }
158297
158433
  //
158434
+ // {
158435
+ // "error": [],
158436
+ // "result": {
158437
+ // "open": {
158438
+ // "OXVPSU-Q726F-L3SDEP": {
158439
+ // "refid": null,
158440
+ // "userref": 0,
158441
+ // "status": "open",
158442
+ // "opentm": 1706893367.4656649,
158443
+ // "starttm": 0,
158444
+ // "expiretm": 0,
158445
+ // "descr": {
158446
+ // "pair": "XRPEUR",
158447
+ // "type": "sell",
158448
+ // "ordertype": "trailing-stop",
158449
+ // "price": "+50.0000%",
158450
+ // "price2": "0",
158451
+ // "leverage": "none",
158452
+ // "order": "sell 10.00000000 XRPEUR @ trailing stop +50.0000%",
158453
+ // "close": ""
158454
+ // },
158455
+ // "vol": "10.00000000",
158456
+ // "vol_exec": "0.00000000",
158457
+ // "cost": "0.00000000",
158458
+ // "fee": "0.00000000",
158459
+ // "price": "0.00000000",
158460
+ // "stopprice": "0.23424000",
158461
+ // "limitprice": "0.46847000",
158462
+ // "misc": "",
158463
+ // "oflags": "fciq",
158464
+ // "trigger": "index"
158465
+ // }
158466
+ // }
158467
+ // }
158468
+ //
158298
158469
  const description = this.safeValue(order, 'descr', {});
158299
158470
  const orderDescription = this.safeString(description, 'order', description);
158300
158471
  let side = undefined;
@@ -158336,6 +158507,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
158336
158507
  // kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
158337
158508
  // const cost = this.safeString (order, 'cost');
158338
158509
  price = this.safeString(description, 'price', price);
158510
+ // when type = trailling stop returns price = '+50.0000%'
158511
+ if ((price !== undefined) && price.endsWith('%')) {
158512
+ price = undefined; // this is not the price we want
158513
+ }
158339
158514
  if ((price === undefined) || _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringEquals(price, '0')) {
158340
158515
  price = this.safeString(description, 'price2');
158341
158516
  }
@@ -159842,10 +160017,32 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
159842
160017
  },
159843
160018
  'fees': {
159844
160019
  'trading': {
159845
- 'tierBased': false,
160020
+ 'tierBased': true,
159846
160021
  'percentage': true,
159847
- 'maker': this.parseNumber('-0.0002'),
159848
- 'taker': this.parseNumber('0.00075'),
160022
+ 'taker': this.parseNumber('0.0005'),
160023
+ 'maker': this.parseNumber('0.0002'),
160024
+ 'tiers': {
160025
+ 'taker': [
160026
+ [this.parseNumber('0'), this.parseNumber('0.0005')],
160027
+ [this.parseNumber('100000'), this.parseNumber('0.0004')],
160028
+ [this.parseNumber('1000000'), this.parseNumber('0.0003')],
160029
+ [this.parseNumber('5000000'), this.parseNumber('0.00025')],
160030
+ [this.parseNumber('10000000'), this.parseNumber('0.0002')],
160031
+ [this.parseNumber('20000000'), this.parseNumber('0.00015')],
160032
+ [this.parseNumber('50000000'), this.parseNumber('0.000125')],
160033
+ [this.parseNumber('100000000'), this.parseNumber('0.0001')],
160034
+ ],
160035
+ 'maker': [
160036
+ [this.parseNumber('0'), this.parseNumber('0.0002')],
160037
+ [this.parseNumber('100000'), this.parseNumber('0.0015')],
160038
+ [this.parseNumber('1000000'), this.parseNumber('0.000125')],
160039
+ [this.parseNumber('5000000'), this.parseNumber('0.0001')],
160040
+ [this.parseNumber('10000000'), this.parseNumber('0.000075')],
160041
+ [this.parseNumber('20000000'), this.parseNumber('0.00005')],
160042
+ [this.parseNumber('50000000'), this.parseNumber('0.000025')],
160043
+ [this.parseNumber('100000000'), this.parseNumber('0')],
160044
+ ],
160045
+ },
159849
160046
  },
159850
160047
  },
159851
160048
  'exceptions': {
@@ -166533,7 +166730,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
166533
166730
  let endpart = '';
166534
166731
  headers = (headers !== undefined) ? headers : {};
166535
166732
  let url = this.urls['api'][api];
166536
- if (Object.keys(query).length) {
166733
+ if (!this.isEmpty(query)) {
166537
166734
  if ((method === 'GET') || (method === 'DELETE')) {
166538
166735
  endpoint += '?' + this.rawencode(query);
166539
166736
  }
@@ -180428,7 +180625,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
180428
180625
  }
180429
180626
  return orderbook;
180430
180627
  }
180431
- parseBidAsk(bidask, priceKey = 0, amountKey = 1, countKey = 2) {
180628
+ parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
180629
+ const countKey = 2;
180432
180630
  const price = this.safeNumber(bidask, priceKey);
180433
180631
  const amount = this.safeNumber(bidask, amountKey);
180434
180632
  const count = this.safeNumber(bidask, countKey);
@@ -194145,8 +194343,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
194145
194343
  // "msg": ""
194146
194344
  // }
194147
194345
  //
194148
- const data = this.safeValue(response, 'data', []);
194149
- return this.parseMarkets(data);
194346
+ const dataResponse = this.safeValue(response, 'data', []);
194347
+ return this.parseMarkets(dataResponse);
194150
194348
  }
194151
194349
  safeNetwork(networkId) {
194152
194350
  const networksById = {
@@ -195773,7 +195971,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
195773
195971
  * @param {string[]|string} ids order ids
195774
195972
  * @returns {string[]} list of order ids
195775
195973
  */
195776
- if (typeof ids === 'string') {
195974
+ if ((ids !== undefined) && typeof ids === 'string') {
195777
195975
  return ids.split(',');
195778
195976
  }
195779
195977
  else {
@@ -199852,6 +200050,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
199852
200050
  return this.parseGreeks(entry, market);
199853
200051
  }
199854
200052
  }
200053
+ return undefined;
199855
200054
  }
199856
200055
  parseGreeks(greeks, market = undefined) {
199857
200056
  //
@@ -205026,7 +205225,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
205026
205225
  return orderbook;
205027
205226
  }
205028
205227
  toEn(n, scale) {
205029
- const stringN = n.toString();
205228
+ const stringN = this.numberToString(n);
205030
205229
  const precise = new _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O(stringN);
205031
205230
  precise.decimals = precise.decimals - scale;
205032
205231
  precise.reduce();
@@ -206419,11 +206618,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
206419
206618
  }
206420
206619
  }
206421
206620
  cost = (cost === undefined) ? amount : cost;
206422
- const costString = cost.toString();
206621
+ const costString = this.numberToString(cost);
206423
206622
  request['quoteQtyEv'] = this.toEv(costString, market);
206424
206623
  }
206425
206624
  else {
206426
- const amountString = amount.toString();
206625
+ const amountString = this.numberToString(amount);
206427
206626
  request['baseQtyEv'] = this.toEv(amountString, market);
206428
206627
  }
206429
206628
  }
@@ -206441,7 +206640,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
206441
206640
  request['orderQtyRq'] = amount;
206442
206641
  }
206443
206642
  else {
206444
- request['orderQty'] = parseInt(amount);
206643
+ request['orderQty'] = this.parseToInt(amount);
206445
206644
  }
206446
206645
  if (stopPrice !== undefined) {
206447
206646
  const triggerType = this.safeString(params, 'triggerType', 'ByMarkPrice');
@@ -208238,10 +208437,10 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
208238
208437
  request['leverageRr'] = leverage;
208239
208438
  }
208240
208439
  else {
208241
- const long = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
208242
- const short = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
208243
- request['longLeverageRr'] = long;
208244
- request['shortLeverageRr'] = short;
208440
+ const longVar = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
208441
+ const shortVar = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
208442
+ request['longLeverageRr'] = longVar;
208443
+ request['shortLeverageRr'] = shortVar;
208245
208444
  }
208246
208445
  response = await this.privatePutGPositionsLeverage(this.extend(request, params));
208247
208446
  }
@@ -213429,13 +213628,16 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
213429
213628
  const T = this.safeString(data, 'T');
213430
213629
  const msg = this.safeValue(data, 'msg', {});
213431
213630
  if (T === 'subscription') {
213432
- return this.handleSubscription(client, data);
213631
+ this.handleSubscription(client, data);
213632
+ return;
213433
213633
  }
213434
213634
  if (T === 'success' && msg === 'connected') {
213435
- return this.handleConnected(client, data);
213635
+ this.handleConnected(client, data);
213636
+ return;
213436
213637
  }
213437
213638
  if (T === 'success' && msg === 'authenticated') {
213438
- return this.handleAuthenticate(client, data);
213639
+ this.handleAuthenticate(client, data);
213640
+ return;
213439
213641
  }
213440
213642
  const methods = {
213441
213643
  'error': this.handleErrorMessage,
@@ -213464,7 +213666,8 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
213464
213666
  }
213465
213667
  handleMessage(client, message) {
213466
213668
  if (Array.isArray(message)) {
213467
- return this.handleCryptoMessage(client, message);
213669
+ this.handleCryptoMessage(client, message);
213670
+ return;
213468
213671
  }
213469
213672
  this.handleTradingMessage(client, message);
213470
213673
  }
@@ -214426,7 +214629,6 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
214426
214629
  this.handleBalance(client, message);
214427
214630
  }
214428
214631
  }
214429
- return message;
214430
214632
  }
214431
214633
  handleSubscriptionStatus(client, message) {
214432
214634
  //
@@ -214466,7 +214668,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
214466
214668
  handlePing(client, message) {
214467
214669
  this.spawn(this.pong, client, message);
214468
214670
  }
214469
- authenticate(url, params = {}) {
214671
+ async authenticate(url, params = {}) {
214470
214672
  this.checkRequiredCredentials();
214471
214673
  const messageHash = 'authenticated';
214472
214674
  const client = this.client(url);
@@ -215092,7 +215294,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215092
215294
  */
215093
215295
  return await this.watchTradesForSymbols([symbol], since, limit, params);
215094
215296
  }
215095
- parseTrade(trade, market = undefined) {
215297
+ parseWsTrade(trade, market = undefined) {
215096
215298
  //
215097
215299
  // public watchTrades
215098
215300
  //
@@ -215200,7 +215402,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215200
215402
  const executionType = this.safeString(trade, 'x');
215201
215403
  const isTradeExecution = (executionType === 'TRADE');
215202
215404
  if (!isTradeExecution) {
215203
- return super.parseTrade(trade, market);
215405
+ return this.parseTrade(trade, market);
215204
215406
  }
215205
215407
  const id = this.safeString2(trade, 't', 'a');
215206
215408
  const timestamp = this.safeInteger(trade, 'T');
@@ -215265,7 +215467,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215265
215467
  const lowerCaseId = this.safeStringLower(message, 's');
215266
215468
  const event = this.safeString(message, 'e');
215267
215469
  const messageHash = lowerCaseId + '@' + event;
215268
- const trade = this.parseTrade(message, market);
215470
+ const trade = this.parseWsTrade(message, market);
215269
215471
  let tradesArray = this.safeValue(this.trades, symbol);
215270
215472
  if (tradesArray === undefined) {
215271
215473
  const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
@@ -215815,14 +216017,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215815
216017
  for (let j = 0; j < subscriptionKeys.length; j++) {
215816
216018
  const subscribeType = subscriptionKeys[j];
215817
216019
  if (subscribeType === type) {
215818
- return this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
216020
+ this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
216021
+ return;
215819
216022
  }
215820
216023
  }
215821
216024
  }
215822
216025
  }
215823
216026
  setBalanceCache(client, type) {
215824
216027
  if (type in client.subscriptions) {
215825
- return undefined;
216028
+ return;
215826
216029
  }
215827
216030
  const options = this.safeValue(this.options, 'watchBalance');
215828
216031
  const fetchBalanceSnapshot = this.safeBool(options, 'fetchBalanceSnapshot', false);
@@ -215923,7 +216126,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215923
216126
  //
215924
216127
  const messageHash = this.safeString(message, 'id');
215925
216128
  const result = this.safeValue(message, 'result', {});
215926
- const parsedBalances = this.parseBalance(result, 'spot');
216129
+ const parsedBalances = this.parseBalance(result);
215927
216130
  client.resolve(parsedBalances, messageHash);
215928
216131
  }
215929
216132
  async watchBalance(params = {}) {
@@ -216993,7 +217196,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
216993
217196
  return this.safePosition({
216994
217197
  'info': position,
216995
217198
  'id': undefined,
216996
- 'symbol': this.safeSymbol(marketId, undefined, undefined, 'future'),
217199
+ 'symbol': this.safeSymbol(marketId, undefined, undefined, 'contract'),
216997
217200
  'notional': undefined,
216998
217201
  'marginMode': this.safeString(position, 'mt'),
216999
217202
  'liquidationPrice': undefined,
@@ -217147,9 +217350,9 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
217147
217350
  const messageHash = 'myTrades';
217148
217351
  const executionType = this.safeString(message, 'x');
217149
217352
  if (executionType === 'TRADE') {
217150
- const trade = this.parseTrade(message);
217353
+ const trade = this.parseWsTrade(message);
217151
217354
  const orderId = this.safeString(trade, 'order');
217152
- let tradeFee = this.safeValue(trade, 'fee');
217355
+ let tradeFee = this.safeValue(trade, 'fee', {});
217153
217356
  tradeFee = this.extend({}, tradeFee);
217154
217357
  const symbol = this.safeString(trade, 'symbol');
217155
217358
  if (orderId !== undefined && tradeFee !== undefined && symbol !== undefined) {
@@ -217296,13 +217499,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
217296
217499
  const status = this.safeString(message, 'status');
217297
217500
  const error = this.safeValue(message, 'error');
217298
217501
  if ((error !== undefined) || (status !== undefined && status !== '200')) {
217299
- return this.handleWsError(client, message);
217502
+ this.handleWsError(client, message);
217503
+ return;
217300
217504
  }
217301
217505
  const id = this.safeString(message, 'id');
217302
217506
  const subscriptions = this.safeValue(client.subscriptions, id);
217303
217507
  let method = this.safeValue(subscriptions, 'method');
217304
217508
  if (method !== undefined) {
217305
- return method.call(this, client, message);
217509
+ method.call(this, client, message);
217510
+ return;
217306
217511
  }
217307
217512
  // handle other APIs
217308
217513
  const methods = {
@@ -217332,7 +217537,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
217332
217537
  if (method === undefined) {
217333
217538
  const requestId = this.safeString(message, 'id');
217334
217539
  if (requestId !== undefined) {
217335
- return this.handleSubscriptionStatus(client, message);
217540
+ this.handleSubscriptionStatus(client, message);
217541
+ return;
217336
217542
  }
217337
217543
  // special case for the real-time bookTicker, since it comes without an event identifier
217338
217544
  //
@@ -217351,7 +217557,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
217351
217557
  }
217352
217558
  }
217353
217559
  else {
217354
- return method.call(this, client, message);
217560
+ method.call(this, client, message);
217355
217561
  }
217356
217562
  }
217357
217563
  }
@@ -218222,7 +218428,7 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
218222
218428
  }
218223
218429
  setBalanceCache(client, type, subscriptionHash, params) {
218224
218430
  if (subscriptionHash in client.subscriptions) {
218225
- return undefined;
218431
+ return;
218226
218432
  }
218227
218433
  const fetchBalanceSnapshot = this.handleOptionAndParams(params, 'watchBalance', 'fetchBalanceSnapshot', true);
218228
218434
  if (fetchBalanceSnapshot) {
@@ -218786,7 +218992,6 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
218786
218992
  stored.append(trade);
218787
218993
  }
218788
218994
  client.resolve(stored, messageHash);
218789
- return message;
218790
218995
  }
218791
218996
  parseTrade(trade, market = undefined) {
218792
218997
  //
@@ -218976,8 +219181,9 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
218976
219181
  const delta = deltas[i];
218977
219182
  const id = this.safeString(delta, 0);
218978
219183
  const price = this.safeFloat(delta, 1);
218979
- const size = (delta[2] < 0) ? -delta[2] : delta[2];
218980
- const side = (delta[2] < 0) ? 'asks' : 'bids';
219184
+ const delta2Value = delta[2];
219185
+ const size = (delta2Value < 0) ? -delta2Value : delta2Value;
219186
+ const side = (delta2Value < 0) ? 'asks' : 'bids';
218981
219187
  const bookside = orderbook[side];
218982
219188
  bookside.store(price, size, id);
218983
219189
  }
@@ -218986,10 +219192,11 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
218986
219192
  const deltas = message[1];
218987
219193
  for (let i = 0; i < deltas.length; i++) {
218988
219194
  const delta = deltas[i];
218989
- const size = (delta[2] < 0) ? -delta[2] : delta[2];
218990
- const side = (delta[2] < 0) ? 'asks' : 'bids';
218991
- const bookside = orderbook[side];
218992
- bookside.store(delta[0], size, delta[1]);
219195
+ const delta2 = delta[2];
219196
+ const size = (delta2 < 0) ? -delta2 : delta2;
219197
+ const side = (delta2 < 0) ? 'asks' : 'bids';
219198
+ const countedBookSide = orderbook[side];
219199
+ countedBookSide.store(delta[0], size, delta[1]);
218993
219200
  }
218994
219201
  }
218995
219202
  client.resolve(orderbook, messageHash);
@@ -218999,18 +219206,20 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
218999
219206
  if (isRaw) {
219000
219207
  const id = this.safeString(message, 1);
219001
219208
  const price = this.safeString(message, 2);
219002
- const size = (message[3] < 0) ? -message[3] : message[3];
219003
- const side = (message[3] < 0) ? 'asks' : 'bids';
219209
+ const message3 = message[3];
219210
+ const size = (message3 < 0) ? -message3 : message3;
219211
+ const side = (message3 < 0) ? 'asks' : 'bids';
219004
219212
  const bookside = orderbook[side];
219005
219213
  // price = 0 means that you have to remove the order from your book
219006
219214
  const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
219007
219215
  bookside.store(this.parseNumber(price), this.parseNumber(amount), id);
219008
219216
  }
219009
219217
  else {
219010
- const size = (message[3] < 0) ? -message[3] : message[3];
219011
- const side = (message[3] < 0) ? 'asks' : 'bids';
219012
- const bookside = orderbook[side];
219013
- bookside.store(message[1], size, message[2]);
219218
+ const message3Value = message[3];
219219
+ const size = (message3Value < 0) ? -message3Value : message3Value;
219220
+ const side = (message3Value < 0) ? 'asks' : 'bids';
219221
+ const countedBookSide = orderbook[side];
219222
+ countedBookSide.store(message[1], size, message[2]);
219014
219223
  }
219015
219224
  client.resolve(orderbook, messageHash);
219016
219225
  }
@@ -219271,7 +219480,7 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219271
219480
  // ]
219272
219481
  //
219273
219482
  if (message[1] === 'hb') {
219274
- return message; // skip heartbeats within subscription channels for now
219483
+ return; // skip heartbeats within subscription channels for now
219275
219484
  }
219276
219485
  const subscription = this.safeValue(client.subscriptions, channelId, {});
219277
219486
  const channel = this.safeString(subscription, 'channel');
@@ -219286,11 +219495,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219286
219495
  'oc': this.handleOrders,
219287
219496
  };
219288
219497
  const method = this.safeValue2(methods, channel, name);
219289
- if (method === undefined) {
219290
- return message;
219291
- }
219292
- else {
219293
- return method.call(this, client, message, subscription);
219498
+ if (method !== undefined) {
219499
+ method.call(this, client, message, subscription);
219294
219500
  }
219295
219501
  }
219296
219502
  else {
@@ -219312,11 +219518,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219312
219518
  'auth': this.handleAuthenticationMessage,
219313
219519
  };
219314
219520
  const method = this.safeValue(methods, event);
219315
- if (method === undefined) {
219316
- return message;
219317
- }
219318
- else {
219319
- return method.call(this, client, message);
219521
+ if (method !== undefined) {
219522
+ method.call(this, client, message);
219320
219523
  }
219321
219524
  }
219322
219525
  }
@@ -219675,7 +219878,6 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
219675
219878
  stored.append(parsed);
219676
219879
  }
219677
219880
  client.resolve(stored, messageHash);
219678
- return message;
219679
219881
  }
219680
219882
  parseWsTrade(trade, market = undefined) {
219681
219883
  //
@@ -219927,8 +220129,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
219927
220129
  const deltas = message[1];
219928
220130
  for (let i = 0; i < deltas.length; i++) {
219929
220131
  const delta = deltas[i];
219930
- const size = (delta[2] < 0) ? -delta[2] : delta[2];
219931
- const side = (delta[2] < 0) ? 'asks' : 'bids';
220132
+ const delta2 = delta[2];
220133
+ const size = (delta2 < 0) ? -delta2 : delta2;
220134
+ const side = (delta2 < 0) ? 'asks' : 'bids';
219932
220135
  const bookside = orderbook[side];
219933
220136
  const idString = this.safeString(delta, 0);
219934
220137
  const price = this.safeFloat(delta, 1);
@@ -219956,8 +220159,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
219956
220159
  const orderbookItem = this.orderbooks[symbol];
219957
220160
  if (isRaw) {
219958
220161
  const price = this.safeString(deltas, 1);
219959
- const size = (deltas[2] < 0) ? -deltas[2] : deltas[2];
219960
- const side = (deltas[2] < 0) ? 'asks' : 'bids';
220162
+ const deltas2 = deltas[2];
220163
+ const size = (deltas2 < 0) ? -deltas2 : deltas2;
220164
+ const side = (deltas2 < 0) ? 'asks' : 'bids';
219961
220165
  const bookside = orderbookItem[side];
219962
220166
  // price = 0 means that you have to remove the order from your book
219963
220167
  const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
@@ -220005,7 +220209,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
220005
220209
  }
220006
220210
  if (ask !== undefined) {
220007
220211
  stringArray.push(this.numberToString(asks[i][idToCheck]));
220008
- stringArray.push(this.numberToString(-asks[i][1]));
220212
+ const aski1 = asks[i][1];
220213
+ stringArray.push(this.numberToString(-aski1));
220009
220214
  }
220010
220215
  }
220011
220216
  const payload = stringArray.join(':');
@@ -220437,7 +220642,7 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
220437
220642
  //
220438
220643
  if (Array.isArray(message)) {
220439
220644
  if (message[1] === 'hb') {
220440
- return message; // skip heartbeats within subscription channels for now
220645
+ return; // skip heartbeats within subscription channels for now
220441
220646
  }
220442
220647
  const subscription = this.safeValue(client.subscriptions, channelId, {});
220443
220648
  const channel = this.safeString(subscription, 'channel');
@@ -220465,11 +220670,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
220465
220670
  else {
220466
220671
  method = this.safeValue2(publicMethods, name, channel);
220467
220672
  }
220468
- if (method === undefined) {
220469
- return message;
220470
- }
220471
- else {
220472
- return method.call(this, client, message, subscription);
220673
+ if (method !== undefined) {
220674
+ method.call(this, client, message, subscription);
220473
220675
  }
220474
220676
  }
220475
220677
  else {
@@ -220481,11 +220683,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
220481
220683
  'auth': this.handleAuthenticationMessage,
220482
220684
  };
220483
220685
  const method = this.safeValue(methods, event);
220484
- if (method === undefined) {
220485
- return message;
220486
- }
220487
- else {
220488
- return method.call(this, client, message);
220686
+ if (method !== undefined) {
220687
+ method.call(this, client, message);
220489
220688
  }
220490
220689
  }
220491
220690
  }
@@ -220600,7 +220799,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
220600
220799
  else {
220601
220800
  instType = 'SPOT';
220602
220801
  }
220603
- [instType, params] = this.handleOptionAndParams(params, 'getInstType', 'instType', instType);
220802
+ let instypeAux = undefined;
220803
+ [instypeAux, params] = this.handleOptionAndParams(params, 'getInstType', 'instType', instType);
220804
+ instType = instypeAux;
220604
220805
  return [instType, params];
220605
220806
  }
220606
220807
  async watchTicker(symbol, params = {}) {
@@ -223064,7 +223265,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223064
223265
  messageHash += ':' + this.safeString(data[0], 'symbol');
223065
223266
  }
223066
223267
  client.resolve(stored, messageHash);
223067
- return message;
223068
223268
  }
223069
223269
  parseWsTrade(trade, market = undefined) {
223070
223270
  // spot
@@ -223166,7 +223366,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223166
223366
  client.resolve(ticker, 'tickers::swap');
223167
223367
  this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
223168
223368
  }
223169
- return message;
223170
223369
  }
223171
223370
  resolveMessageHashesForSymbol(client, symbol, result, prexif) {
223172
223371
  const prefixSeparator = '::';
@@ -223700,11 +223899,8 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223700
223899
  'subscribe': this.handleSubscriptionStatus,
223701
223900
  };
223702
223901
  const method = this.safeValue(methods, event);
223703
- if (method === undefined) {
223704
- return message;
223705
- }
223706
- else {
223707
- return method.call(this, client, message);
223902
+ if (method !== undefined) {
223903
+ method.call(this, client, message);
223708
223904
  }
223709
223905
  }
223710
223906
  }
@@ -223724,7 +223920,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223724
223920
  const key = keys[i];
223725
223921
  if (channel.indexOf(key) >= 0) {
223726
223922
  const method = this.safeValue(methods, key);
223727
- return method.call(this, client, message);
223923
+ method.call(this, client, message);
223728
223924
  }
223729
223925
  }
223730
223926
  }
@@ -225267,7 +225463,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
225267
225463
  //
225268
225464
  // { "error": "Rate limit exceeded, retry in 29 seconds." }
225269
225465
  //
225270
- const error = this.safeValue(message, 'error');
225466
+ const error = this.safeString(message, 'error');
225271
225467
  if (error !== undefined) {
225272
225468
  const request = this.safeValue(message, 'request', {});
225273
225469
  const args = this.safeValue(request, 'args', []);
@@ -225278,7 +225474,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
225278
225474
  const broadKey = this.findBroadlyMatchedKey(broad, error);
225279
225475
  let exception = undefined;
225280
225476
  if (broadKey === undefined) {
225281
- exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(error);
225477
+ exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(error); // c# requirement for now
225282
225478
  }
225283
225479
  else {
225284
225480
  exception = new broad[broadKey](error);
@@ -225346,14 +225542,11 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
225346
225542
  const request = this.safeValue(message, 'request', {});
225347
225543
  const op = this.safeValue(request, 'op');
225348
225544
  if (op === 'authKeyExpires') {
225349
- return this.handleAuthenticationMessage.call(this, client, message);
225350
- }
225351
- else {
225352
- return message;
225545
+ this.handleAuthenticationMessage(client, message);
225353
225546
  }
225354
225547
  }
225355
225548
  else {
225356
- return method.call(this, client, message);
225549
+ method.call(this, client, message);
225357
225550
  }
225358
225551
  }
225359
225552
  }
@@ -225835,11 +226028,8 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
225835
226028
  };
225836
226029
  const event = this.safeString(message, 'event');
225837
226030
  const method = this.safeValue(methods, event);
225838
- if (method === undefined) {
225839
- return message;
225840
- }
225841
- else {
225842
- return method.call(this, client, message);
226031
+ if (method !== undefined) {
226032
+ method.call(this, client, message);
225843
226033
  }
225844
226034
  }
225845
226035
  }
@@ -226295,7 +226485,7 @@ class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
226295
226485
  catch (error) {
226296
226486
  this.options['listenKey'] = undefined;
226297
226487
  this.options['listenKeyUrl'] = undefined;
226298
- return;
226488
+ return undefined;
226299
226489
  }
226300
226490
  //
226301
226491
  // {
@@ -226849,10 +227039,10 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
226849
227039
  //
226850
227040
  const event = this.safeString(message, 'event');
226851
227041
  if (event === 'bts:subscription_succeeded') {
226852
- return this.handleSubscriptionStatus(client, message);
227042
+ this.handleSubscriptionStatus(client, message);
226853
227043
  }
226854
227044
  else {
226855
- return this.handleSubject(client, message);
227045
+ this.handleSubject(client, message);
226856
227046
  }
226857
227047
  }
226858
227048
  async authenticate(params = {}) {
@@ -226875,7 +227065,6 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
226875
227065
  this.options['expiresIn'] = this.sum(time, validity);
226876
227066
  this.options['userId'] = userId;
226877
227067
  this.options['wsSessionToken'] = sessionToken;
226878
- return response;
226879
227068
  }
226880
227069
  }
226881
227070
  }
@@ -227319,7 +227508,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
227319
227508
  //
227320
227509
  const response = this.safeValue(message, 'response');
227321
227510
  if (response === undefined) {
227322
- return message;
227511
+ return;
227323
227512
  }
227324
227513
  const marketId = this.safeString(response, 'market');
227325
227514
  const symbol = this.safeSymbol(marketId, undefined, '-');
@@ -228101,7 +228290,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
228101
228290
  }
228102
228291
  return message;
228103
228292
  }
228104
- authenticate(params = {}) {
228293
+ async authenticate(params = {}) {
228105
228294
  const url = this.urls['api']['ws'];
228106
228295
  const client = this.client(url);
228107
228296
  const messageHash = 'authenticated';
@@ -228246,9 +228435,16 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
228246
228435
  'getCandles': this.handleFetchOHLCV,
228247
228436
  'getMarkets': this.handleMarkets,
228248
228437
  };
228249
- const event = this.safeString2(message, 'event', 'action');
228250
- const method = this.safeValue(methods, event);
228251
- if (method !== undefined) {
228438
+ const event = this.safeString(message, 'event');
228439
+ let method = this.safeValue(methods, event);
228440
+ if (method === undefined) {
228441
+ const action = this.safeString(message, 'action');
228442
+ method = this.safeValue(methods, action);
228443
+ if (method !== undefined) {
228444
+ method.call(this, client, message);
228445
+ }
228446
+ }
228447
+ else {
228252
228448
  method.call(this, client, message);
228253
228449
  }
228254
228450
  }
@@ -228364,7 +228560,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228364
228560
  //
228365
228561
  const event = this.safeString(message, 'event');
228366
228562
  if (event === 'subscribed') {
228367
- return message;
228563
+ return;
228368
228564
  }
228369
228565
  const result = { 'info': message };
228370
228566
  const balances = this.safeValue(message, 'balances', []);
@@ -228434,11 +228630,9 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228434
228630
  // }
228435
228631
  //
228436
228632
  const event = this.safeString(message, 'event');
228437
- if (event === 'subscribed') {
228438
- return message;
228439
- }
228440
- else if (event === 'rejected') {
228441
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + this.json(message));
228633
+ if (event === 'rejected') {
228634
+ const jsonMessage = this.json(message);
228635
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + jsonMessage);
228442
228636
  }
228443
228637
  else if (event === 'updated') {
228444
228638
  const marketId = this.safeString(message, 'symbol');
@@ -228458,7 +228652,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228458
228652
  stored.append(ohlcv);
228459
228653
  client.resolve(stored, messageHash);
228460
228654
  }
228461
- else {
228655
+ else if (event !== 'subscribed') {
228462
228656
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' ' + this.json(message));
228463
228657
  }
228464
228658
  }
@@ -228520,7 +228714,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228520
228714
  const symbol = market['symbol'];
228521
228715
  let ticker = undefined;
228522
228716
  if (event === 'subscribed') {
228523
- return message;
228717
+ return;
228524
228718
  }
228525
228719
  else if (event === 'snapshot') {
228526
228720
  ticker = this.parseTicker(message, market);
@@ -228619,7 +228813,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228619
228813
  //
228620
228814
  const event = this.safeString(message, 'event');
228621
228815
  if (event !== 'updated') {
228622
- return message;
228816
+ return;
228623
228817
  }
228624
228818
  const marketId = this.safeString(message, 'symbol');
228625
228819
  const symbol = this.safeSymbol(marketId);
@@ -228781,7 +228975,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228781
228975
  this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
228782
228976
  }
228783
228977
  if (event === 'subscribed') {
228784
- return message;
228978
+ return;
228785
228979
  }
228786
228980
  else if (event === 'rejected') {
228787
228981
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + this.json(message));
@@ -228951,30 +229145,30 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
228951
229145
  const messageHash = 'orderbook:' + symbol + ':' + type;
228952
229146
  const datetime = this.safeString(message, 'timestamp');
228953
229147
  const timestamp = this.parse8601(datetime);
228954
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
228955
- if (storedOrderBook === undefined) {
228956
- storedOrderBook = this.countedOrderBook({});
228957
- this.orderbooks[symbol] = storedOrderBook;
229148
+ let orderbook = this.safeValue(this.orderbooks, symbol);
229149
+ if (orderbook === undefined) {
229150
+ orderbook = this.countedOrderBook({});
229151
+ this.orderbooks[symbol] = orderbook;
228958
229152
  }
228959
229153
  if (event === 'subscribed') {
228960
- return message;
229154
+ return;
228961
229155
  }
228962
229156
  else if (event === 'snapshot') {
228963
229157
  const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'px', 'qty', 'num');
228964
- storedOrderBook.reset(snapshot);
229158
+ orderbook.reset(snapshot);
228965
229159
  }
228966
229160
  else if (event === 'updated') {
228967
229161
  const asks = this.safeValue(message, 'asks', []);
228968
229162
  const bids = this.safeValue(message, 'bids', []);
228969
- this.handleDeltas(storedOrderBook['asks'], asks);
228970
- this.handleDeltas(storedOrderBook['bids'], bids);
228971
- storedOrderBook['timestamp'] = timestamp;
228972
- storedOrderBook['datetime'] = datetime;
229163
+ this.handleDeltas(orderbook['asks'], asks);
229164
+ this.handleDeltas(orderbook['bids'], bids);
229165
+ orderbook['timestamp'] = timestamp;
229166
+ orderbook['datetime'] = datetime;
228973
229167
  }
228974
229168
  else {
228975
229169
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() does not support ' + event + ' yet');
228976
229170
  }
228977
- client.resolve(storedOrderBook, messageHash);
229171
+ client.resolve(orderbook, messageHash);
228978
229172
  }
228979
229173
  handleDelta(bookside, delta) {
228980
229174
  const bookArray = this.parseBidAsk(delta, 'px', 'qty', 'num');
@@ -229015,7 +229209,8 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
229015
229209
  };
229016
229210
  const handler = this.safeValue(handlers, channel);
229017
229211
  if (handler !== undefined) {
229018
- return handler.call(this, client, message);
229212
+ handler.call(this, client, message);
229213
+ return;
229019
229214
  }
229020
229215
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
229021
229216
  }
@@ -229037,7 +229232,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
229037
229232
  future.resolve(true);
229038
229233
  }
229039
229234
  }
229040
- authenticate(params = {}) {
229235
+ async authenticate(params = {}) {
229041
229236
  const url = this.urls['api']['ws'];
229042
229237
  const client = this.client(url);
229043
229238
  const messageHash = 'authenticated';
@@ -229974,7 +230169,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
229974
230169
  * @name bybit#watchPositions
229975
230170
  * @see https://bybit-exchange.github.io/docs/v5/websocket/private/position
229976
230171
  * @description watch all open positions
229977
- * @param {string[]|undefined} symbols list of unified market symbols
230172
+ * @param {string[]} [symbols] list of unified market symbols
229978
230173
  * @param {object} params extra parameters specific to the exchange API endpoint
229979
230174
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
229980
230175
  */
@@ -230007,7 +230202,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230007
230202
  }
230008
230203
  setPositionsCache(client, symbols = undefined) {
230009
230204
  if (this.positions !== undefined) {
230010
- return this.positions;
230205
+ return;
230011
230206
  }
230012
230207
  const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
230013
230208
  if (fetchPositionsSnapshot) {
@@ -230140,7 +230335,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230140
230335
  }
230141
230336
  return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
230142
230337
  }
230143
- handleOrder(client, message, subscription = undefined) {
230338
+ handleOrder(client, message) {
230144
230339
  //
230145
230340
  // spot
230146
230341
  // {
@@ -230706,7 +230901,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230706
230901
  const authenticated = this.safeValue(client.subscriptions, messageHash);
230707
230902
  if (authenticated === undefined) {
230708
230903
  const expiresInt = this.milliseconds() + 10000;
230709
- const expires = expiresInt.toString();
230904
+ const expires = this.numberToString(expiresInt);
230710
230905
  const path = 'GET/realtime';
230711
230906
  const auth = path + expires;
230712
230907
  const signature = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__/* .sha256 */ .J, 'hex');
@@ -230719,7 +230914,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230719
230914
  const message = this.extend(request, params);
230720
230915
  this.watch(url, messageHash, message, messageHash);
230721
230916
  }
230722
- return future;
230917
+ return await future;
230723
230918
  }
230724
230919
  handleErrorMessage(client, message) {
230725
230920
  //
@@ -231881,15 +232076,15 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
231881
232076
  const messageHash = 'orderbook:' + symbol;
231882
232077
  const timestamp = this.safeInteger2(data, 'timestamp_ms', 'timestamp');
231883
232078
  const incrementalId = this.safeNumber(data, 'id');
231884
- const storedOrderBook = this.orderBook({});
232079
+ const orderbook = this.orderBook({});
231885
232080
  const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks');
231886
232081
  snapshot['nonce'] = incrementalId;
231887
- storedOrderBook.reset(snapshot);
232082
+ orderbook.reset(snapshot);
231888
232083
  this.options['orderbook'][symbol] = {
231889
232084
  'incrementalId': incrementalId,
231890
232085
  };
231891
- this.orderbooks[symbol] = storedOrderBook;
231892
- client.resolve(storedOrderBook, messageHash);
232086
+ this.orderbooks[symbol] = orderbook;
232087
+ client.resolve(orderbook, messageHash);
231893
232088
  }
231894
232089
  pairToSymbol(pair) {
231895
232090
  const parts = pair.split(':');
@@ -232355,7 +232550,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
232355
232550
  handleMessage(client, message) {
232356
232551
  const ok = this.safeString(message, 'ok');
232357
232552
  if (ok === 'error') {
232358
- return this.handleErrorMessage(client, message);
232553
+ this.handleErrorMessage(client, message);
232554
+ return;
232359
232555
  }
232360
232556
  const event = this.safeString(message, 'e');
232361
232557
  const handlers = {
@@ -232383,9 +232579,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
232383
232579
  };
232384
232580
  const handler = this.safeValue(handlers, event);
232385
232581
  if (handler !== undefined) {
232386
- return handler.call(this, client, message);
232582
+ handler.call(this, client, message);
232387
232583
  }
232388
- return message;
232389
232584
  }
232390
232585
  handleAuthenticationMessage(client, message) {
232391
232586
  //
@@ -232901,7 +233096,8 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
232901
233096
  const side = this.safeString(this.options['sides'], sideId);
232902
233097
  const price = this.safeNumber(trade, 'price_level');
232903
233098
  const amount = this.safeNumber(trade, 'new_quantity');
232904
- orderbook[side].store(price, amount);
233099
+ const orderbookSide = orderbook[side];
233100
+ orderbookSide.store(price, amount);
232905
233101
  }
232906
233102
  }
232907
233103
  handleOrderBook(client, message) {
@@ -232994,7 +233190,7 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
232994
233190
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ExchangeError(errorMessage);
232995
233191
  }
232996
233192
  const method = this.safeValue(methods, channel);
232997
- return method.call(this, client, message);
233193
+ method.call(this, client, message);
232998
233194
  }
232999
233195
  }
233000
233196
 
@@ -233970,7 +234166,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
233970
234166
  }
233971
234167
  }
233972
234168
  else {
233973
- return method.call(this, client, message);
234169
+ method.call(this, client, message);
233974
234170
  }
233975
234171
  }
233976
234172
  }
@@ -234858,29 +235054,29 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
234858
235054
  //
234859
235055
  const params = this.safeValue(message, 'params', []);
234860
235056
  const fullOrderBook = this.safeValue(params, 0);
234861
- let orderBook = this.safeValue(params, 1);
235057
+ let orderbook = this.safeValue(params, 1);
234862
235058
  const marketId = this.safeString(params, 2);
234863
235059
  const defaultType = this.safeString(this.options, 'defaultType');
234864
235060
  const market = this.safeMarket(marketId, undefined, undefined, defaultType);
234865
235061
  const symbol = market['symbol'];
234866
235062
  const name = 'orderbook';
234867
235063
  const messageHash = name + ':' + symbol;
234868
- const timestamp = this.safeInteger(orderBook, 'time');
235064
+ const timestamp = this.safeInteger(orderbook, 'time');
234869
235065
  const currentOrderBook = this.safeValue(this.orderbooks, symbol);
234870
235066
  if (fullOrderBook) {
234871
- const snapshot = this.parseOrderBook(orderBook, symbol, timestamp);
235067
+ const snapshot = this.parseOrderBook(orderbook, symbol, timestamp);
234872
235068
  if (currentOrderBook === undefined) {
234873
- orderBook = this.orderBook(snapshot);
234874
- this.orderbooks[symbol] = orderBook;
235069
+ orderbook = this.orderBook(snapshot);
235070
+ this.orderbooks[symbol] = orderbook;
234875
235071
  }
234876
235072
  else {
234877
- orderBook = this.orderbooks[symbol];
234878
- orderBook.reset(snapshot);
235073
+ orderbook = this.orderbooks[symbol];
235074
+ orderbook.reset(snapshot);
234879
235075
  }
234880
235076
  }
234881
235077
  else {
234882
- const asks = this.safeValue(orderBook, 'asks', []);
234883
- const bids = this.safeValue(orderBook, 'bids', []);
235078
+ const asks = this.safeValue(orderbook, 'asks', []);
235079
+ const bids = this.safeValue(orderbook, 'bids', []);
234884
235080
  this.handleDeltas(currentOrderBook['asks'], asks);
234885
235081
  this.handleDeltas(currentOrderBook['bids'], bids);
234886
235082
  currentOrderBook['nonce'] = timestamp;
@@ -235201,9 +235397,10 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
235201
235397
  };
235202
235398
  const handler = this.safeValue(handlers, method);
235203
235399
  if (handler !== undefined) {
235204
- return handler.call(this, client, message);
235400
+ handler.call(this, client, message);
235401
+ return;
235205
235402
  }
235206
- return this.handleSubscriptionStatus(client, message);
235403
+ this.handleSubscriptionStatus(client, message);
235207
235404
  }
235208
235405
  handleAuthenticationMessage(client, message) {
235209
235406
  //
@@ -235227,7 +235424,8 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
235227
235424
  if (subscription !== undefined) {
235228
235425
  const futureIndex = this.safeString(subscription, 'future');
235229
235426
  if (futureIndex === 'ohlcv') {
235230
- return this.handleOHLCV(client, message);
235427
+ this.handleOHLCV(client, message);
235428
+ return;
235231
235429
  }
235232
235430
  const future = this.safeValue(client.futures, futureIndex);
235233
235431
  if (future !== undefined) {
@@ -235236,7 +235434,7 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
235236
235434
  delete client.subscriptions[id];
235237
235435
  }
235238
235436
  }
235239
- authenticate(params = {}) {
235437
+ async authenticate(params = {}) {
235240
235438
  let type = undefined;
235241
235439
  [type, params] = this.handleMarketTypeAndParams('authenticate', undefined, params);
235242
235440
  const url = this.urls['api']['ws'][type];
@@ -237289,10 +237487,11 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
237289
237487
  };
237290
237488
  const method = this.safeValue(methods, subscriptionDestination);
237291
237489
  if (method === undefined) {
237292
- return message;
237490
+ return;
237293
237491
  }
237294
237492
  else {
237295
- return method.call(this, client, message, subscription);
237493
+ method.call(this, client, message, subscription);
237494
+ return;
237296
237495
  }
237297
237496
  }
237298
237497
  }
@@ -237307,11 +237506,8 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
237307
237506
  'ping': this.handlePong,
237308
237507
  };
237309
237508
  const method = this.safeValue(methods, destination);
237310
- if (method === undefined) {
237311
- return message;
237312
- }
237313
- else {
237314
- return method.call(this, client, message);
237509
+ if (method !== undefined) {
237510
+ method.call(this, client, message);
237315
237511
  }
237316
237512
  }
237317
237513
  }
@@ -238088,16 +238284,16 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
238088
238284
  };
238089
238285
  const handler = this.safeValue(handlers, channelId);
238090
238286
  if (handler !== undefined) {
238091
- return handler.call(this, client, message);
238287
+ handler.call(this, client, message);
238288
+ return;
238092
238289
  }
238093
238290
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
238094
238291
  }
238095
238292
  const result = this.safeValue(message, 'result', {});
238096
238293
  const accessToken = this.safeString(result, 'access_token');
238097
238294
  if (accessToken !== undefined) {
238098
- return this.handleAuthenticationMessage(client, message);
238295
+ this.handleAuthenticationMessage(client, message);
238099
238296
  }
238100
- return message;
238101
238297
  }
238102
238298
  handleAuthenticationMessage(client, message) {
238103
238299
  //
@@ -238121,7 +238317,7 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
238121
238317
  client.resolve(message, messageHash);
238122
238318
  return message;
238123
238319
  }
238124
- authenticate(params = {}) {
238320
+ async authenticate(params = {}) {
238125
238321
  const url = this.urls['api']['ws'];
238126
238322
  const client = this.client(url);
238127
238323
  const time = this.milliseconds();
@@ -238677,25 +238873,25 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
238677
238873
  const orderBook = this.safeValue(message, 'data', {});
238678
238874
  const messageHash = 'orderbook:' + symbol;
238679
238875
  const timestamp = this.safeInteger(message, 'ts');
238680
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
238681
- if (storedOrderBook === undefined) {
238682
- storedOrderBook = this.orderBook({});
238683
- this.orderbooks[symbol] = storedOrderBook;
238876
+ let orderbook = this.safeValue(this.orderbooks, symbol);
238877
+ if (orderbook === undefined) {
238878
+ orderbook = this.orderBook({});
238879
+ this.orderbooks[symbol] = orderbook;
238684
238880
  }
238685
238881
  const event = this.safeString(message, 'event');
238686
238882
  if (event === 'snapshot') {
238687
238883
  const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bid', 'ask');
238688
- storedOrderBook.reset(snapshot);
238884
+ orderbook.reset(snapshot);
238689
238885
  }
238690
238886
  else {
238691
238887
  const asks = this.safeValue(orderBook, 'ask', []);
238692
238888
  const bids = this.safeValue(orderBook, 'bid', []);
238693
- this.handleDeltas(storedOrderBook['asks'], asks);
238694
- this.handleDeltas(storedOrderBook['bids'], bids);
238695
- storedOrderBook['timestamp'] = timestamp;
238696
- storedOrderBook['datetime'] = this.iso8601(timestamp);
238889
+ this.handleDeltas(orderbook['asks'], asks);
238890
+ this.handleDeltas(orderbook['bids'], bids);
238891
+ orderbook['timestamp'] = timestamp;
238892
+ orderbook['datetime'] = this.iso8601(timestamp);
238697
238893
  }
238698
- client.resolve(storedOrderBook, messageHash);
238894
+ client.resolve(orderbook, messageHash);
238699
238895
  }
238700
238896
  handleDelta(bookside, delta) {
238701
238897
  const bidAsk = this.parseBidAsk(delta, 0, 1);
@@ -238730,7 +238926,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
238730
238926
  };
238731
238927
  const eventHandler = this.safeValue(events, event);
238732
238928
  if (eventHandler !== undefined) {
238733
- return eventHandler.call(this, client, message);
238929
+ eventHandler.call(this, client, message);
238930
+ return;
238734
238931
  }
238735
238932
  if ((event === 'update') || (event === 'snapshot')) {
238736
238933
  const topic = this.safeString(message, 'topic');
@@ -238752,7 +238949,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
238752
238949
  };
238753
238950
  const handler = this.safeValue(handlers, channel);
238754
238951
  if (handler !== undefined) {
238755
- return handler.call(this, client, message);
238952
+ handler.call(this, client, message);
238953
+ return;
238756
238954
  }
238757
238955
  }
238758
238956
  }
@@ -238793,7 +238991,7 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
238793
238991
  const messageHash = 'authenticated';
238794
238992
  client.resolve(message, messageHash);
238795
238993
  }
238796
- authenticate(params = {}) {
238994
+ async authenticate(params = {}) {
238797
238995
  const messageHash = 'authenticated';
238798
238996
  const [type, query] = this.handleMarketTypeAndParams('authenticate', undefined, params);
238799
238997
  const url = this.urls['api']['ws'][type];
@@ -239039,7 +239237,7 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
239039
239237
  // max limit is 100
239040
239238
  const subscription = client.subscriptions[messageHash];
239041
239239
  const limit = this.safeInteger(subscription, 'limit');
239042
- this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
239240
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {}); // needed for c#, number of args needs to match
239043
239241
  }
239044
239242
  storedOrderBook.cache.push(delta);
239045
239243
  return;
@@ -240767,7 +240965,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
240767
240965
  //
240768
240966
  const isArray = Array.isArray(message);
240769
240967
  if (isArray) {
240770
- return this.handleOrder(client, message);
240968
+ this.handleOrder(client, message);
240969
+ return;
240771
240970
  }
240772
240971
  const reason = this.safeString(message, 'reason');
240773
240972
  if (reason === 'error') {
@@ -240781,7 +240980,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
240781
240980
  };
240782
240981
  const type = this.safeString(message, 'type', '');
240783
240982
  if (type.indexOf('candles') >= 0) {
240784
- return this.handleOHLCV(client, message);
240983
+ this.handleOHLCV(client, message);
240984
+ return;
240785
240985
  }
240786
240986
  const method = this.safeValue(methods, type);
240787
240987
  if (method !== undefined) {
@@ -240952,7 +241152,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
240952
241152
  }
240953
241153
  return future;
240954
241154
  }
240955
- async subscribePublic(name, symbols = undefined, params = {}) {
241155
+ async subscribePublic(name, messageHashPrefix, symbols = undefined, params = {}) {
240956
241156
  /**
240957
241157
  * @ignore
240958
241158
  * @method
@@ -240962,7 +241162,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
240962
241162
  */
240963
241163
  await this.loadMarkets();
240964
241164
  const url = this.urls['api']['ws']['public'];
240965
- let messageHash = name;
241165
+ let messageHash = messageHashPrefix;
240966
241166
  if (symbols !== undefined) {
240967
241167
  messageHash = messageHash + '::' + symbols.join(',');
240968
241168
  }
@@ -241057,7 +241257,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241057
241257
  'symbols': [market['id']],
241058
241258
  },
241059
241259
  };
241060
- const orderbook = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
241260
+ const orderbook = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
241061
241261
  return orderbook.limit();
241062
241262
  }
241063
241263
  handleOrderBook(client, message) {
@@ -241150,7 +241350,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241150
241350
  'symbols': [market['id']],
241151
241351
  },
241152
241352
  };
241153
- const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
241353
+ const result = await this.subscribePublic(name, 'ticker', [symbol], this.deepExtend(request, params));
241154
241354
  return this.safeValue(result, symbol);
241155
241355
  }
241156
241356
  async watchTickers(symbols = undefined, params = {}) {
@@ -241186,7 +241386,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241186
241386
  'symbols': marketIds,
241187
241387
  },
241188
241388
  };
241189
- const tickers = await this.subscribePublic(name, symbols, this.deepExtend(request, params));
241389
+ const tickers = await this.subscribePublic(name, 'tickers', symbols, this.deepExtend(request, params));
241190
241390
  if (this.newUpdates) {
241191
241391
  return tickers;
241192
241392
  }
@@ -241245,7 +241445,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241245
241445
  const messageHash = channel + '::' + symbol;
241246
241446
  client.resolve(newTickers, messageHash);
241247
241447
  }
241248
- const messageHashes = this.findMessageHashes(client, channel + '::');
241448
+ const messageHashes = this.findMessageHashes(client, 'tickers::');
241249
241449
  for (let i = 0; i < messageHashes.length; i++) {
241250
241450
  const messageHash = messageHashes[i];
241251
241451
  const parts = messageHash.split('::');
@@ -241338,7 +241538,8 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241338
241538
  if (limit !== undefined) {
241339
241539
  request['limit'] = limit;
241340
241540
  }
241341
- const trades = await this.subscribePublic('trades', [symbol], this.deepExtend(request, params));
241541
+ const name = 'trades';
241542
+ const trades = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
241342
241543
  if (this.newUpdates) {
241343
241544
  limit = trades.getLimit(symbol, limit);
241344
241545
  }
@@ -241467,7 +241668,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
241467
241668
  if (limit !== undefined) {
241468
241669
  request['params']['limit'] = limit;
241469
241670
  }
241470
- const ohlcv = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
241671
+ const ohlcv = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
241471
241672
  if (this.newUpdates) {
241472
241673
  limit = ohlcv.getLimit(symbol, limit);
241473
241674
  }
@@ -242364,7 +242565,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
242364
242565
  // when the user does not have any trades yet
242365
242566
  const dataLength = rawTrades.length;
242366
242567
  if (dataLength === 0) {
242367
- return 0;
242568
+ return;
242368
242569
  }
242369
242570
  if (this.myTrades === undefined) {
242370
242571
  const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
@@ -242478,7 +242679,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
242478
242679
  // usually the first message is an empty array
242479
242680
  const dataLength = data.length;
242480
242681
  if (dataLength === 0) {
242481
- return 0;
242682
+ return;
242482
242683
  }
242483
242684
  if (this.orders === undefined) {
242484
242685
  const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
@@ -243221,6 +243422,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
243221
243422
  delete client.subscriptions[messageHash];
243222
243423
  client.reject(e, messageHash);
243223
243424
  }
243425
+ return undefined;
243224
243426
  }
243225
243427
  handleDelta(bookside, delta) {
243226
243428
  const price = this.safeFloat(delta, 0);
@@ -244441,14 +244643,14 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
244441
244643
  if (subscription !== undefined) {
244442
244644
  const method = this.safeValue(subscription, 'method');
244443
244645
  if (method !== undefined) {
244444
- return method.call(this, client, message, subscription);
244646
+ method.call(this, client, message, subscription);
244647
+ return;
244445
244648
  }
244446
244649
  // clean up
244447
244650
  if (id in client.subscriptions) {
244448
244651
  delete client.subscriptions[id];
244449
244652
  }
244450
244653
  }
244451
- return message;
244452
244654
  }
244453
244655
  handleSystemStatus(client, message) {
244454
244656
  //
@@ -244557,11 +244759,9 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
244557
244759
  'kline': this.handleOHLCV,
244558
244760
  };
244559
244761
  const method = this.safeValue(methods, methodName);
244560
- if (method === undefined) {
244561
- return message;
244562
- }
244563
- else {
244564
- return method.call(this, client, message);
244762
+ if (method !== undefined) {
244763
+ method.call(this, client, message);
244764
+ return;
244565
244765
  }
244566
244766
  }
244567
244767
  // private spot subjects
@@ -245531,6 +245731,7 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
245531
245731
  delete client.subscriptions[messageHash];
245532
245732
  client.reject(e, messageHash);
245533
245733
  }
245734
+ return undefined;
245534
245735
  }
245535
245736
  handleDelta(bookside, delta) {
245536
245737
  const price = this.safeFloat(delta, 0);
@@ -245696,11 +245897,8 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
245696
245897
  // ...
245697
245898
  };
245698
245899
  const method = this.safeValue(methods, methodName);
245699
- if (method === undefined) {
245700
- return message;
245701
- }
245702
- else {
245703
- return method.call(this, client, message);
245900
+ if (method !== undefined) {
245901
+ method.call(this, client, message);
245704
245902
  }
245705
245903
  }
245706
245904
  }
@@ -246109,7 +246307,7 @@ class idex extends _idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
246109
246307
  const symbol = this.safeSymbol(marketId);
246110
246308
  if (!(symbol in this.orderbooks)) {
246111
246309
  const orderbook = this.countedOrderBook({});
246112
- orderbook.cache = [];
246310
+ // orderbook.cache = []; // cache is never used?
246113
246311
  this.orderbooks[symbol] = orderbook;
246114
246312
  }
246115
246313
  this.spawn(this.fetchOrderBookSnapshot, client, symbol);
@@ -246685,28 +246883,28 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
246685
246883
  const subscription = this.safeValue(client.subscriptions, messageHash, {});
246686
246884
  const receivedSnapshot = this.safeBool(subscription, 'receivedSnapshot', false);
246687
246885
  const timestamp = this.safeInteger(message, 'Time');
246688
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
246689
- if (storedOrderBook === undefined) {
246690
- storedOrderBook = this.orderBook({});
246691
- this.orderbooks[symbol] = storedOrderBook;
246886
+ let orderbook = this.safeValue(this.orderbooks, symbol);
246887
+ if (orderbook === undefined) {
246888
+ orderbook = this.orderBook({});
246889
+ this.orderbooks[symbol] = orderbook;
246692
246890
  }
246693
246891
  if (event === 'OrderBookSnapshot') {
246694
246892
  const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'Bids', 'Offers', 'Price', 'Volume');
246695
- storedOrderBook.reset(snapshot);
246893
+ orderbook.reset(snapshot);
246696
246894
  subscription['receivedSnapshot'] = true;
246697
246895
  }
246698
246896
  else {
246699
246897
  const asks = this.safeValue(orderBook, 'Offers', []);
246700
246898
  const bids = this.safeValue(orderBook, 'Bids', []);
246701
- this.handleDeltas(storedOrderBook['asks'], asks);
246702
- this.handleDeltas(storedOrderBook['bids'], bids);
246703
- storedOrderBook['timestamp'] = timestamp;
246704
- storedOrderBook['datetime'] = this.iso8601(timestamp);
246899
+ this.handleDeltas(orderbook['asks'], asks);
246900
+ this.handleDeltas(orderbook['bids'], bids);
246901
+ orderbook['timestamp'] = timestamp;
246902
+ orderbook['datetime'] = this.iso8601(timestamp);
246705
246903
  }
246706
246904
  const checksum = this.safeValue(this.options, 'checksum', true);
246707
246905
  if (checksum && receivedSnapshot) {
246708
- const storedAsks = storedOrderBook['asks'];
246709
- const storedBids = storedOrderBook['bids'];
246906
+ const storedAsks = orderbook['asks'];
246907
+ const storedBids = orderbook['bids'];
246710
246908
  const asksLength = storedAsks.length;
246711
246909
  const bidsLength = storedBids.length;
246712
246910
  let payload = '';
@@ -246728,7 +246926,7 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
246728
246926
  }
246729
246927
  }
246730
246928
  if (receivedSnapshot) {
246731
- client.resolve(storedOrderBook, messageHash);
246929
+ client.resolve(orderbook, messageHash);
246732
246930
  }
246733
246931
  }
246734
246932
  valueToChecksum(value) {
@@ -246778,7 +246976,8 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
246778
246976
  };
246779
246977
  const handler = this.safeValue(handlers, event);
246780
246978
  if (handler !== undefined) {
246781
- return handler.call(this, client, message);
246979
+ handler.call(this, client, message);
246980
+ return;
246782
246981
  }
246783
246982
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
246784
246983
  }
@@ -247452,7 +247651,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247452
247651
  const side = sides[key];
247453
247652
  const bookside = orderbook[side];
247454
247653
  const deltas = this.safeValue(message[1], key, []);
247455
- timestamp = this.handleDeltas(bookside, deltas, timestamp);
247654
+ timestamp = this.customHandleDeltas(bookside, deltas, timestamp);
247456
247655
  }
247457
247656
  orderbook['symbol'] = symbol;
247458
247657
  orderbook['timestamp'] = timestamp;
@@ -247484,11 +247683,11 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247484
247683
  const storedBids = orderbook['bids'];
247485
247684
  let example = undefined;
247486
247685
  if (a !== undefined) {
247487
- timestamp = this.handleDeltas(storedAsks, a, timestamp);
247686
+ timestamp = this.customHandleDeltas(storedAsks, a, timestamp);
247488
247687
  example = this.safeValue(a, 0);
247489
247688
  }
247490
247689
  if (b !== undefined) {
247491
- timestamp = this.handleDeltas(storedBids, b, timestamp);
247690
+ timestamp = this.customHandleDeltas(storedBids, b, timestamp);
247492
247691
  example = this.safeValue(b, 0);
247493
247692
  }
247494
247693
  // don't remove this line or I will poop on your face
@@ -247543,7 +247742,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247543
247742
  return joined;
247544
247743
  }
247545
247744
  }
247546
- handleDeltas(bookside, deltas, timestamp = undefined) {
247745
+ customHandleDeltas(bookside, deltas, timestamp = undefined) {
247547
247746
  for (let j = 0; j < deltas.length; j++) {
247548
247747
  const delta = deltas[j];
247549
247748
  const price = this.parseNumber(delta[0]);
@@ -248088,7 +248287,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
248088
248287
  // "subscription": { name: "ticker" }
248089
248288
  // }
248090
248289
  //
248091
- const errorMessage = this.safeValue(message, 'errorMessage');
248290
+ const errorMessage = this.safeString(message, 'errorMessage');
248092
248291
  if (errorMessage !== undefined) {
248093
248292
  const requestId = this.safeValue(message, 'reqid');
248094
248293
  if (requestId !== undefined) {
@@ -248096,7 +248295,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
248096
248295
  const broadKey = this.findBroadlyMatchedKey(broad, errorMessage);
248097
248296
  let exception = undefined;
248098
248297
  if (broadKey === undefined) {
248099
- exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(errorMessage);
248298
+ exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(errorMessage); // c# requirement to convert the errorMessage to string
248100
248299
  }
248101
248300
  else {
248102
248301
  exception = new broad[broadKey](errorMessage);
@@ -248126,11 +248325,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
248126
248325
  'ownTrades': this.handleMyTrades,
248127
248326
  };
248128
248327
  const method = this.safeValue2(methods, name, channelName);
248129
- if (method === undefined) {
248130
- return message;
248131
- }
248132
- else {
248133
- return method.call(this, client, message, subscription);
248328
+ if (method !== undefined) {
248329
+ method.call(this, client, message, subscription);
248134
248330
  }
248135
248331
  }
248136
248332
  else {
@@ -248146,11 +248342,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
248146
248342
  'cancelAllStatus': this.handleCancelAllOrders,
248147
248343
  };
248148
248344
  const method = this.safeValue(methods, event);
248149
- if (method === undefined) {
248150
- return message;
248151
- }
248152
- else {
248153
- return method.call(this, client, message);
248345
+ if (method !== undefined) {
248346
+ method.call(this, client, message);
248154
248347
  }
248155
248348
  }
248156
248349
  }
@@ -249235,13 +249428,15 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
249235
249428
  const bid = bids[i];
249236
249429
  const price = this.safeNumber(bid, 'price');
249237
249430
  const qty = this.safeNumber(bid, 'qty');
249238
- orderbook['bids'].store(price, qty);
249431
+ const bidsSide = orderbook['bids'];
249432
+ bidsSide.store(price, qty);
249239
249433
  }
249240
249434
  for (let i = 0; i < asks.length; i++) {
249241
249435
  const ask = asks[i];
249242
249436
  const price = this.safeNumber(ask, 'price');
249243
249437
  const qty = this.safeNumber(ask, 'qty');
249244
- orderbook['asks'].store(price, qty);
249438
+ const asksSide = orderbook['asks'];
249439
+ asksSide.store(price, qty);
249245
249440
  }
249246
249441
  orderbook['timestamp'] = timestamp;
249247
249442
  orderbook['datetime'] = this.iso8601(timestamp);
@@ -249270,10 +249465,12 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
249270
249465
  const qty = this.safeNumber(message, 'qty');
249271
249466
  const timestamp = this.safeInteger(message, 'timestamp');
249272
249467
  if (side === 'sell') {
249273
- orderbook['asks'].store(price, qty);
249468
+ const asks = orderbook['asks'];
249469
+ asks.store(price, qty);
249274
249470
  }
249275
249471
  else {
249276
- orderbook['bids'].store(price, qty);
249472
+ const bids = orderbook['bids'];
249473
+ bids.store(price, qty);
249277
249474
  }
249278
249475
  orderbook['timestamp'] = timestamp;
249279
249476
  orderbook['datetime'] = this.iso8601(timestamp);
@@ -249609,7 +249806,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
249609
249806
  this.handleAuthenticate(client, message);
249610
249807
  }
249611
249808
  else if (event === 'alert') {
249612
- return this.handleErrorMessage(client, message);
249809
+ this.handleErrorMessage(client, message);
249613
249810
  }
249614
249811
  else if (event === 'pong') {
249615
249812
  client.lastPong = this.milliseconds();
@@ -249636,7 +249833,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
249636
249833
  };
249637
249834
  const method = this.safeValue(methods, feed);
249638
249835
  if (method !== undefined) {
249639
- return method.call(this, client, message);
249836
+ method.call(this, client, message);
249640
249837
  }
249641
249838
  }
249642
249839
  }
@@ -249732,19 +249929,20 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
249732
249929
  },
249733
249930
  });
249734
249931
  }
249735
- negotiate(privateChannel, params = {}) {
249932
+ async negotiate(privateChannel, params = {}) {
249736
249933
  const connectId = privateChannel ? 'private' : 'public';
249737
249934
  const urls = this.safeValue(this.options, 'urls', {});
249738
249935
  const spawaned = this.safeValue(urls, connectId);
249739
249936
  if (spawaned !== undefined) {
249740
- return spawaned;
249937
+ return await spawaned;
249741
249938
  }
249742
249939
  // we store an awaitable to the url
249743
249940
  // so that multiple calls don't asynchronously
249744
249941
  // fetch different urls and overwrite each other
249745
249942
  urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
249746
249943
  this.options['urls'] = urls;
249747
- return urls[connectId];
249944
+ const future = urls[connectId];
249945
+ return await future;
249748
249946
  }
249749
249947
  async negotiateHelper(privateChannel, params = {}) {
249750
249948
  let response = undefined;
@@ -250230,7 +250428,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
250230
250428
  const limit = this.safeInteger(subscription, 'limit');
250231
250429
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
250232
250430
  if (cacheLength === snapshotDelay) {
250233
- this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
250431
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
250234
250432
  }
250235
250433
  storedOrderBook.cache.push(data);
250236
250434
  return;
@@ -250672,7 +250870,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
250672
250870
  //
250673
250871
  const topic = this.safeString(message, 'topic');
250674
250872
  if (topic === '/market/ticker:all') {
250675
- return this.handleTicker(client, message);
250873
+ this.handleTicker(client, message);
250874
+ return;
250676
250875
  }
250677
250876
  const subject = this.safeString(message, 'subject');
250678
250877
  const methods = {
@@ -250687,11 +250886,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
250687
250886
  'stopOrder': this.handleOrder,
250688
250887
  };
250689
250888
  const method = this.safeValue(methods, subject);
250690
- if (method === undefined) {
250691
- return message;
250692
- }
250693
- else {
250694
- return method.call(this, client, message);
250889
+ if (method !== undefined) {
250890
+ method.call(this, client, message);
250695
250891
  }
250696
250892
  }
250697
250893
  ping(client) {
@@ -250739,7 +250935,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
250739
250935
  };
250740
250936
  const method = this.safeValue(methods, type);
250741
250937
  if (method !== undefined) {
250742
- return method.call(this, client, message);
250938
+ method.call(this, client, message);
250743
250939
  }
250744
250940
  }
250745
250941
  }
@@ -250812,19 +251008,20 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
250812
251008
  },
250813
251009
  });
250814
251010
  }
250815
- negotiate(privateChannel, params = {}) {
251011
+ async negotiate(privateChannel, params = {}) {
250816
251012
  const connectId = privateChannel ? 'private' : 'public';
250817
251013
  const urls = this.safeValue(this.options, 'urls', {});
250818
251014
  const spawaned = this.safeValue(urls, connectId);
250819
251015
  if (spawaned !== undefined) {
250820
- return spawaned;
251016
+ return await spawaned;
250821
251017
  }
250822
251018
  // we store an awaitable to the url
250823
251019
  // so that multiple calls don't asynchronously
250824
251020
  // fetch different urls and overwrite each other
250825
- urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
251021
+ urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params); // we have to wait here otherwsie in c# will not work
250826
251022
  this.options['urls'] = urls;
250827
- return urls[connectId];
251023
+ const future = urls[connectId];
251024
+ return await future;
250828
251025
  }
250829
251026
  async negotiateHelper(privateChannel, params = {}) {
250830
251027
  let response = undefined;
@@ -251337,6 +251534,9 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
251337
251534
  const messageHash = 'orderbook:' + symbol;
251338
251535
  const storedOrderBook = this.safeValue(this.orderbooks, symbol);
251339
251536
  const nonce = this.safeInteger(storedOrderBook, 'nonce');
251537
+ if (storedOrderBook === undefined) {
251538
+ return; // this shouldn't be needed, but for some reason sometimes this runs before handleOrderBookSubscription in c#
251539
+ }
251340
251540
  const deltaEnd = this.safeInteger(data, 'sequence');
251341
251541
  if (nonce === undefined) {
251342
251542
  const cacheLength = storedOrderBook.cache.length;
@@ -251355,7 +251555,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
251355
251555
  const limit = this.safeInteger(subscription, 'limit');
251356
251556
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
251357
251557
  if (cacheLength === snapshotDelay) {
251358
- this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
251558
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
251359
251559
  }
251360
251560
  storedOrderBook.cache.push(data);
251361
251561
  return;
@@ -251683,11 +251883,8 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
251683
251883
  'position.adjustRiskLimit': this.handlePosition,
251684
251884
  };
251685
251885
  const method = this.safeValue(methods, subject);
251686
- if (method === undefined) {
251687
- return message;
251688
- }
251689
- else {
251690
- return method.call(this, client, message);
251886
+ if (method !== undefined) {
251887
+ method.call(this, client, message);
251691
251888
  }
251692
251889
  }
251693
251890
  ping(client) {
@@ -251736,7 +251933,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
251736
251933
  };
251737
251934
  const method = this.safeValue(methods, type);
251738
251935
  if (method !== undefined) {
251739
- return method.call(this, client, message);
251936
+ method.call(this, client, message);
251740
251937
  }
251741
251938
  }
251742
251939
  }
@@ -252528,17 +252725,17 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252528
252725
  const orderBook = this.safeValue(message, 'depth', message);
252529
252726
  const datetime = this.safeString(message, 'TS');
252530
252727
  const timestamp = this.parse8601(datetime);
252531
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
252532
- if (storedOrderBook === undefined) {
252533
- storedOrderBook = this.orderBook({});
252534
- this.orderbooks[symbol] = storedOrderBook;
252728
+ let orderbook = this.safeValue(this.orderbooks, symbol);
252729
+ if (orderbook === undefined) {
252730
+ orderbook = this.orderBook({});
252731
+ this.orderbooks[symbol] = orderbook;
252535
252732
  }
252536
252733
  const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks');
252537
- storedOrderBook.reset(snapshot);
252734
+ orderbook.reset(snapshot);
252538
252735
  let messageHash = 'orderbook:' + symbol;
252539
- client.resolve(storedOrderBook, messageHash);
252736
+ client.resolve(orderbook, messageHash);
252540
252737
  messageHash = 'fetchOrderbook:' + symbol;
252541
- client.resolve(storedOrderBook, messageHash);
252738
+ client.resolve(orderbook, messageHash);
252542
252739
  }
252543
252740
  handleErrorMessage(client, message) {
252544
252741
  //
@@ -252566,7 +252763,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252566
252763
  handleMessage(client, message) {
252567
252764
  const status = this.safeString(message, 'status');
252568
252765
  if (status === 'error') {
252569
- return this.handleErrorMessage(client, message);
252766
+ this.handleErrorMessage(client, message);
252767
+ return;
252570
252768
  }
252571
252769
  const type = this.safeString2(message, 'type', 'action');
252572
252770
  if (type === 'ping') {
@@ -252582,9 +252780,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252582
252780
  };
252583
252781
  const handler = this.safeValue(handlers, type);
252584
252782
  if (handler !== undefined) {
252585
- return handler.call(this, client, message);
252783
+ handler.call(this, client, message);
252586
252784
  }
252587
- return message;
252588
252785
  }
252589
252786
  async authenticate(params = {}) {
252590
252787
  // when we implement more private streams, we need to refactor the authentication
@@ -252831,24 +253028,24 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252831
253028
  const symbol = subscription['symbol'];
252832
253029
  const messageHash = 'orderbook:' + symbol;
252833
253030
  const timestamp = this.safeString(message, 'timestamp');
252834
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
252835
- if (storedOrderBook === undefined) {
252836
- storedOrderBook = this.indexedOrderBook({});
252837
- this.orderbooks[symbol] = storedOrderBook;
253031
+ let orderbook = this.safeValue(this.orderbooks, symbol);
253032
+ if (orderbook === undefined) {
253033
+ orderbook = this.indexedOrderBook({});
253034
+ this.orderbooks[symbol] = orderbook;
252838
253035
  }
252839
253036
  const asks = this.safeValue(message, 'asks');
252840
253037
  if (asks !== undefined) {
252841
253038
  const snapshot = this.customParseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'price', 'volume', 'id');
252842
- storedOrderBook.reset(snapshot);
253039
+ orderbook.reset(snapshot);
252843
253040
  }
252844
253041
  else {
252845
- this.handleDelta(storedOrderBook, message);
252846
- storedOrderBook['timestamp'] = timestamp;
252847
- storedOrderBook['datetime'] = this.iso8601(timestamp);
253042
+ this.handleDelta(orderbook, message);
253043
+ orderbook['timestamp'] = timestamp;
253044
+ orderbook['datetime'] = this.iso8601(timestamp);
252848
253045
  }
252849
253046
  const nonce = this.safeInteger(message, 'sequence');
252850
- storedOrderBook['nonce'] = nonce;
252851
- client.resolve(storedOrderBook, messageHash);
253047
+ orderbook['nonce'] = nonce;
253048
+ client.resolve(orderbook, messageHash);
252852
253049
  }
252853
253050
  customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
252854
253051
  const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
@@ -252940,10 +253137,9 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252940
253137
  const deleteUpdate = this.safeValue(message, 'delete_update');
252941
253138
  if (deleteUpdate !== undefined) {
252942
253139
  const orderId = this.safeString(deleteUpdate, 'order_id');
252943
- asksOrderSide.storeArray(0, 0, orderId);
252944
- bidsOrderSide.storeArray(0, 0, orderId);
253140
+ asksOrderSide.storeArray([0, 0, orderId]);
253141
+ bidsOrderSide.storeArray([0, 0, orderId]);
252945
253142
  }
252946
- return message;
252947
253143
  }
252948
253144
  handleMessage(client, message) {
252949
253145
  if (message === '') {
@@ -252955,7 +253151,6 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
252955
253151
  const handler = handlers[j];
252956
253152
  handler.call(this, client, message, subscriptions[0]);
252957
253153
  }
252958
- return message;
252959
253154
  }
252960
253155
  }
252961
253156
 
@@ -254077,7 +254272,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254077
254272
  //
254078
254273
  const msg = this.safeString(message, 'msg');
254079
254274
  if (msg === 'PONG') {
254080
- return this.handlePong(client, message);
254275
+ this.handlePong(client, message);
254081
254276
  }
254082
254277
  else if (msg.indexOf('@') > -1) {
254083
254278
  const parts = msg.split('@');
@@ -254100,7 +254295,8 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254100
254295
  return;
254101
254296
  }
254102
254297
  if ('msg' in message) {
254103
- return this.handleSubscriptionStatus(client, message);
254298
+ this.handleSubscriptionStatus(client, message);
254299
+ return;
254104
254300
  }
254105
254301
  const c = this.safeString(message, 'c');
254106
254302
  let channel = undefined;
@@ -254533,13 +254729,13 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254533
254729
  const firstBidAsk = this.safeValue(payload, 0, []);
254534
254730
  const marketId = this.safeString(firstBidAsk, 7);
254535
254731
  if (marketId === undefined) {
254536
- return message;
254732
+ return;
254537
254733
  }
254538
254734
  const market = this.safeMarket(marketId);
254539
254735
  const symbol = market['symbol'];
254540
254736
  const orderbook = this.safeValue(this.orderbooks, symbol);
254541
254737
  if (orderbook === undefined) {
254542
- return message;
254738
+ return;
254543
254739
  }
254544
254740
  let timestamp = undefined;
254545
254741
  let nonce = undefined;
@@ -254633,11 +254829,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254633
254829
  const subscription = this.safeValue(subscriptionsById, id);
254634
254830
  if (subscription !== undefined) {
254635
254831
  const method = this.safeValue(subscription, 'method');
254636
- if (method === undefined) {
254637
- return message;
254638
- }
254639
- else {
254640
- return method.call(this, client, message, subscription);
254832
+ if (method !== undefined) {
254833
+ method.call(this, client, message, subscription);
254641
254834
  }
254642
254835
  }
254643
254836
  }
@@ -254666,7 +254859,7 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254666
254859
  //
254667
254860
  const payload = this.safeString(message, 'o');
254668
254861
  if (payload === undefined) {
254669
- return message;
254862
+ return;
254670
254863
  }
254671
254864
  message['o'] = JSON.parse(payload);
254672
254865
  const methods = {
@@ -254681,11 +254874,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
254681
254874
  };
254682
254875
  const event = this.safeString(message, 'n');
254683
254876
  const method = this.safeValue(methods, event);
254684
- if (method === undefined) {
254685
- return message;
254686
- }
254687
- else {
254688
- return method.call(this, client, message);
254877
+ if (method !== undefined) {
254878
+ method.call(this, client, message);
254689
254879
  }
254690
254880
  }
254691
254881
  }
@@ -255177,7 +255367,7 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
255177
255367
  };
255178
255368
  this.spawn(this.watch, url, messageHash, request, messageHash, future);
255179
255369
  }
255180
- return await future;
255370
+ return future;
255181
255371
  }
255182
255372
  async watchBalance(params = {}) {
255183
255373
  /**
@@ -255410,7 +255600,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
255410
255600
  // }
255411
255601
  //
255412
255602
  if (message === 'pong') {
255413
- return this.handlePong(client, message);
255603
+ this.handlePong(client, message);
255604
+ return;
255414
255605
  }
255415
255606
  const table = this.safeString(message, 'table');
255416
255607
  if (table === undefined) {
@@ -255423,11 +255614,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
255423
255614
  'subscribe': this.handleSubscriptionStatus,
255424
255615
  };
255425
255616
  const method = this.safeValue(methods, event);
255426
- if (method === undefined) {
255427
- return message;
255428
- }
255429
- else {
255430
- return method.call(this, client, message);
255617
+ if (method !== undefined) {
255618
+ method.call(this, client, message);
255431
255619
  }
255432
255620
  }
255433
255621
  }
@@ -255449,11 +255637,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
255449
255637
  if (name.indexOf('candle') >= 0) {
255450
255638
  method = this.handleOHLCV;
255451
255639
  }
255452
- if (method === undefined) {
255453
- return message;
255454
- }
255455
- else {
255456
- return method.call(this, client, message);
255640
+ if (method !== undefined) {
255641
+ method.call(this, client, message);
255457
255642
  }
255458
255643
  }
255459
255644
  }
@@ -256226,7 +256411,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
256226
256411
  const message = this.extend(request, params);
256227
256412
  this.watch(url, messageHash, message, messageHash);
256228
256413
  }
256229
- return future;
256414
+ return await future;
256230
256415
  }
256231
256416
  async watchBalance(params = {}) {
256232
256417
  /**
@@ -257032,7 +257217,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
257032
257217
  //
257033
257218
  //
257034
257219
  if (message === 'pong') {
257035
- return this.handlePong(client, message);
257220
+ this.handlePong(client, message);
257221
+ return;
257036
257222
  }
257037
257223
  // const table = this.safeString (message, 'table');
257038
257224
  // if (table === undefined) {
@@ -257051,11 +257237,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
257051
257237
  'mass-cancel': this.handleCancelAllOrders,
257052
257238
  };
257053
257239
  const method = this.safeValue(methods, event);
257054
- if (method === undefined) {
257055
- return message;
257056
- }
257057
- else {
257058
- return method.call(this, client, message);
257240
+ if (method !== undefined) {
257241
+ method.call(this, client, message);
257059
257242
  }
257060
257243
  }
257061
257244
  else {
@@ -257083,12 +257266,9 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
257083
257266
  if (channel.indexOf('candle') === 0) {
257084
257267
  this.handleOHLCV(client, message);
257085
257268
  }
257086
- else {
257087
- return message;
257088
- }
257089
257269
  }
257090
257270
  else {
257091
- return method.call(this, client, message);
257271
+ method.call(this, client, message);
257092
257272
  }
257093
257273
  }
257094
257274
  }
@@ -257467,26 +257647,26 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
257467
257647
  const dateTime = this.safeString(message, 'time');
257468
257648
  const timestamp = this.parse8601(dateTime);
257469
257649
  const channel = 'book:' + symbol;
257470
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
257471
- if (storedOrderBook === undefined) {
257472
- storedOrderBook = this.orderBook({});
257650
+ let orderbook = this.safeValue(this.orderbooks, symbol);
257651
+ if (orderbook === undefined) {
257652
+ orderbook = this.orderBook({});
257473
257653
  }
257474
257654
  if (type === 'ORDER_BOOK_SNAPSHOT') {
257475
257655
  const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks');
257476
- storedOrderBook.reset(snapshot);
257656
+ orderbook.reset(snapshot);
257477
257657
  }
257478
257658
  else if (type === 'ORDER_BOOK_UPDATE') {
257479
257659
  const changes = this.safeValue(message, 'changes', []);
257480
- this.handleDeltas(storedOrderBook, changes);
257660
+ this.handleDeltas(orderbook, changes);
257481
257661
  }
257482
257662
  else {
257483
257663
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() did not recognize message type ' + type);
257484
257664
  }
257485
- storedOrderBook['nonce'] = timestamp;
257486
- storedOrderBook['timestamp'] = timestamp;
257487
- storedOrderBook['datetime'] = this.iso8601(timestamp);
257488
- this.orderbooks[symbol] = storedOrderBook;
257489
- client.resolve(storedOrderBook, channel);
257665
+ orderbook['nonce'] = timestamp;
257666
+ orderbook['timestamp'] = timestamp;
257667
+ orderbook['datetime'] = this.iso8601(timestamp);
257668
+ this.orderbooks[symbol] = orderbook;
257669
+ client.resolve(orderbook, channel);
257490
257670
  }
257491
257671
  handleDelta(orderbook, delta) {
257492
257672
  //
@@ -258072,13 +258252,14 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
258072
258252
  if (updateType === 'ORDER_CLOSED' && filled === 0) {
258073
258253
  status = 'canceled';
258074
258254
  }
258075
- orders.append({
258255
+ const orderObject = {
258076
258256
  'id': orderId,
258077
258257
  'symbol': symbol,
258078
258258
  'status': status,
258079
258259
  'timestamp': this.parse8601(datetime),
258080
258260
  'datetime': datetime,
258081
- });
258261
+ };
258262
+ orders.append(orderObject);
258082
258263
  }
258083
258264
  else {
258084
258265
  const parsed = this.parseOrder(update);
@@ -258315,7 +258496,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
258315
258496
  handleMessage(client, message) {
258316
258497
  const error = this.safeValue(message, 'error');
258317
258498
  if (error !== undefined) {
258318
- return this.handleErrorMessage(client, message);
258499
+ this.handleErrorMessage(client, message);
258500
+ return;
258319
258501
  }
258320
258502
  const type = this.safeValue(message, 'type');
258321
258503
  const handlers = {
@@ -258346,9 +258528,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
258346
258528
  };
258347
258529
  const handler = this.safeValue(handlers, type);
258348
258530
  if (handler !== undefined) {
258349
- return handler.call(this, client, message);
258531
+ handler.call(this, client, message);
258350
258532
  }
258351
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
258352
258533
  }
258353
258534
  handlePricePointUpdates(client, message) {
258354
258535
  //
@@ -258813,7 +258994,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
258813
258994
  const bid = this.safeValue(bids, i);
258814
258995
  const price = this.safeNumber(bid, 0);
258815
258996
  const amount = this.safeNumber(bid, 1);
258816
- orderbook['bids'].store(price, amount);
258997
+ const bookSide = orderbook['bids'];
258998
+ bookSide.store(price, amount);
258817
258999
  }
258818
259000
  }
258819
259001
  if (asks !== undefined) {
@@ -258821,7 +259003,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
258821
259003
  const ask = this.safeValue(asks, i);
258822
259004
  const price = this.safeNumber(ask, 0);
258823
259005
  const amount = this.safeNumber(ask, 1);
258824
- orderbook['asks'].store(price, amount);
259006
+ const bookside = orderbook['asks'];
259007
+ bookside.store(price, amount);
258825
259008
  }
258826
259009
  }
258827
259010
  orderbook['symbol'] = symbol;
@@ -258846,7 +259029,7 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
258846
259029
  };
258847
259030
  const endpoint = this.safeValue(methods, method);
258848
259031
  if (endpoint !== undefined) {
258849
- return endpoint.call(this, client, message);
259032
+ endpoint.call(this, client, message);
258850
259033
  }
258851
259034
  }
258852
259035
  handleErrorMessage(client, message) {
@@ -259523,13 +259706,13 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
259523
259706
  }
259524
259707
  return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
259525
259708
  }
259526
- handleDelta(bookside, delta, market = undefined) {
259709
+ customHandleDelta(bookside, delta, market = undefined) {
259527
259710
  const bidAsk = this.customParseBidAsk(delta, 0, 1, market);
259528
259711
  bookside.storeArray(bidAsk);
259529
259712
  }
259530
- handleDeltas(bookside, deltas, market = undefined) {
259713
+ customHandleDeltas(bookside, deltas, market = undefined) {
259531
259714
  for (let i = 0; i < deltas.length; i++) {
259532
- this.handleDelta(bookside, deltas[i], market);
259715
+ this.customHandleDelta(bookside, deltas[i], market);
259533
259716
  }
259534
259717
  }
259535
259718
  handleOrderBook(client, message) {
@@ -259599,8 +259782,8 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
259599
259782
  const changes = this.safeValue2(message, 'book', 'orderbook_p', {});
259600
259783
  const asks = this.safeValue(changes, 'asks', []);
259601
259784
  const bids = this.safeValue(changes, 'bids', []);
259602
- this.handleDeltas(orderbook['asks'], asks, market);
259603
- this.handleDeltas(orderbook['bids'], bids, market);
259785
+ this.customHandleDeltas(orderbook['asks'], asks, market);
259786
+ this.customHandleDeltas(orderbook['bids'], bids, market);
259604
259787
  orderbook['nonce'] = nonce;
259605
259788
  orderbook['timestamp'] = timestamp;
259606
259789
  orderbook['datetime'] = this.iso8601(timestamp);
@@ -260296,21 +260479,26 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
260296
260479
  const method = client.subscriptions[id];
260297
260480
  delete client.subscriptions[id];
260298
260481
  if (method !== true) {
260299
- return method.call(this, client, message);
260482
+ method.call(this, client, message);
260483
+ return;
260300
260484
  }
260301
260485
  }
260302
260486
  const methodName = this.safeString(message, 'method', '');
260303
260487
  if (('market24h' in message) || ('spot_market24h' in message) || (methodName.indexOf('perp_market24h_pack_p') >= 0)) {
260304
- return this.handleTicker(client, message);
260488
+ this.handleTicker(client, message);
260489
+ return;
260305
260490
  }
260306
260491
  else if (('trades' in message) || ('trades_p' in message)) {
260307
- return this.handleTrades(client, message);
260492
+ this.handleTrades(client, message);
260493
+ return;
260308
260494
  }
260309
260495
  else if (('kline' in message) || ('kline_p' in message)) {
260310
- return this.handleOHLCV(client, message);
260496
+ this.handleOHLCV(client, message);
260497
+ return;
260311
260498
  }
260312
260499
  else if (('book' in message) || ('orderbook_p' in message)) {
260313
- return this.handleOrderBook(client, message);
260500
+ this.handleOrderBook(client, message);
260501
+ return;
260314
260502
  }
260315
260503
  if (('orders' in message) || ('orders_p' in message)) {
260316
260504
  const orders = this.safeValue2(message, 'orders', 'orders_p', {});
@@ -260397,7 +260585,7 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
260397
260585
  future = this.watch(url, messageHash, message);
260398
260586
  client.subscriptions[messageHash] = future;
260399
260587
  }
260400
- return await future;
260588
+ return future;
260401
260589
  }
260402
260590
  }
260403
260591
 
@@ -261453,7 +261641,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
261453
261641
  const bid = this.safeValue(bids, j);
261454
261642
  const price = this.safeNumber(bid, 0);
261455
261643
  const amount = this.safeNumber(bid, 1);
261456
- orderbook['bids'].store(price, amount);
261644
+ const bidsSide = orderbook['bids'];
261645
+ bidsSide.store(price, amount);
261457
261646
  }
261458
261647
  }
261459
261648
  if (asks !== undefined) {
@@ -261461,7 +261650,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
261461
261650
  const ask = this.safeValue(asks, j);
261462
261651
  const price = this.safeNumber(ask, 0);
261463
261652
  const amount = this.safeNumber(ask, 1);
261464
- orderbook['asks'].store(price, amount);
261653
+ const asksSide = orderbook['asks'];
261654
+ asksSide.store(price, amount);
261465
261655
  }
261466
261656
  }
261467
261657
  orderbook['symbol'] = symbol;
@@ -261595,14 +261785,14 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
261595
261785
  this.handleErrorMessage(client, item);
261596
261786
  }
261597
261787
  else {
261598
- return this.handleOrderRequest(client, message);
261788
+ this.handleOrderRequest(client, message);
261599
261789
  }
261600
261790
  }
261601
261791
  else {
261602
261792
  const data = this.safeValue(message, 'data', []);
261603
261793
  const dataLength = data.length;
261604
261794
  if (dataLength > 0) {
261605
- return method.call(this, client, message);
261795
+ method.call(this, client, message);
261606
261796
  }
261607
261797
  }
261608
261798
  }
@@ -261676,7 +261866,6 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
261676
261866
  /* harmony import */ var _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6877);
261677
261867
  /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
261678
261868
  /* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
261679
-
261680
261869
  // ---------------------------------------------------------------------------
261681
261870
 
261682
261871
 
@@ -261736,18 +261925,21 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
261736
261925
  },
261737
261926
  });
261738
261927
  }
261739
- negotiate(privateChannel, params = {}) {
261928
+ async negotiate(privateChannel, params = {}) {
261740
261929
  const connectId = privateChannel ? 'private' : 'public';
261741
261930
  const urls = this.safeValue(this.options, 'urls', {});
261742
261931
  if (connectId in urls) {
261743
- return urls[connectId];
261932
+ // return urls[connectId];
261933
+ const storedFuture = urls[connectId];
261934
+ return await storedFuture;
261744
261935
  }
261745
261936
  // we store an awaitable to the url
261746
261937
  // so that multiple calls don't asynchronously
261747
261938
  // fetch different urls and overwrite each other
261748
261939
  urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
261749
261940
  this.options['urls'] = urls;
261750
- return urls[connectId];
261941
+ const future = urls[connectId];
261942
+ return await future;
261751
261943
  }
261752
261944
  async negotiateHelper(privateChannel, params = {}) {
261753
261945
  let response = undefined;
@@ -262385,7 +262577,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262385
262577
  const messageHash = this.safeString(message, 'topic');
262386
262578
  const subject = this.safeString(message, 'subject');
262387
262579
  if (subject === 'received') {
262388
- return message;
262580
+ return;
262389
262581
  }
262390
262582
  // At the time of writting this, there is no implementation to easily convert each order into the orderbook so raw messages are returned
262391
262583
  client.resolve(message, messageHash);
@@ -262404,9 +262596,10 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262404
262596
  const topic = this.safeString(message, 'topic');
262405
262597
  const isSnapshot = topic.indexOf('Depth') >= 0;
262406
262598
  if (isSnapshot) {
262407
- return this.handeL2Snapshot(client, message);
262599
+ this.handeL2Snapshot(client, message);
262600
+ return;
262408
262601
  }
262409
- return this.handleL2OrderBook(client, message);
262602
+ this.handleL2OrderBook(client, message);
262410
262603
  }
262411
262604
  handleL2OrderBook(client, message) {
262412
262605
  //
@@ -262443,7 +262636,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262443
262636
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
262444
262637
  if (cacheLength === snapshotDelay) {
262445
262638
  const limit = 0;
262446
- this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
262639
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
262447
262640
  }
262448
262641
  orderBook.cache.push(data);
262449
262642
  return;
@@ -262631,7 +262824,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262631
262824
  };
262632
262825
  const method = this.safeValue(methods, subject);
262633
262826
  if (method !== undefined) {
262634
- return method.call(this, client, message);
262827
+ method.call(this, client, message);
262635
262828
  }
262636
262829
  }
262637
262830
  ping(client) {
@@ -262667,7 +262860,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262667
262860
  };
262668
262861
  const method = this.safeValue(methods, type);
262669
262862
  if (method !== undefined) {
262670
- return method.call(this, client, message);
262863
+ method.call(this, client, message);
262671
262864
  }
262672
262865
  }
262673
262866
  handleAuthenticate(client, message) {
@@ -262708,7 +262901,6 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
262708
262901
  /* harmony import */ var _probit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3657);
262709
262902
  /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
262710
262903
  /* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
262711
-
262712
262904
  // ---------------------------------------------------------------------------
262713
262905
 
262714
262906
 
@@ -263158,20 +263350,20 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
263158
263350
  const symbol = this.safeSymbol(marketId);
263159
263351
  const dataBySide = this.groupBy(orderBook, 'side');
263160
263352
  const messageHash = 'orderbook:' + symbol;
263161
- let storedOrderBook = this.safeValue(this.orderbooks, symbol);
263162
- if (storedOrderBook === undefined) {
263163
- storedOrderBook = this.orderBook({});
263164
- this.orderbooks[symbol] = storedOrderBook;
263353
+ let orderbook = this.safeValue(this.orderbooks, symbol);
263354
+ if (orderbook === undefined) {
263355
+ orderbook = this.orderBook({});
263356
+ this.orderbooks[symbol] = orderbook;
263165
263357
  }
263166
263358
  const reset = this.safeBool(message, 'reset', false);
263167
263359
  if (reset) {
263168
263360
  const snapshot = this.parseOrderBook(dataBySide, symbol, undefined, 'buy', 'sell', 'price', 'quantity');
263169
- storedOrderBook.reset(snapshot);
263361
+ orderbook.reset(snapshot);
263170
263362
  }
263171
263363
  else {
263172
- this.handleDelta(storedOrderBook, dataBySide);
263364
+ this.handleDelta(orderbook, dataBySide);
263173
263365
  }
263174
- client.resolve(storedOrderBook, messageHash);
263366
+ client.resolve(orderbook, messageHash);
263175
263367
  }
263176
263368
  handleBidAsks(bookSide, bidAsks) {
263177
263369
  for (let i = 0; i < bidAsks.length; i++) {
@@ -263244,11 +263436,13 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
263244
263436
  //
263245
263437
  const errorCode = this.safeString(message, 'errorCode');
263246
263438
  if (errorCode !== undefined) {
263247
- return this.handleErrorMessage(client, message);
263439
+ this.handleErrorMessage(client, message);
263440
+ return;
263248
263441
  }
263249
263442
  const type = this.safeString(message, 'type');
263250
263443
  if (type === 'authorization') {
263251
- return this.handleAuthenticate(client, message);
263444
+ this.handleAuthenticate(client, message);
263445
+ return;
263252
263446
  }
263253
263447
  const handlers = {
263254
263448
  'marketdata': this.handleMarketData,
@@ -263260,7 +263454,8 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
263260
263454
  const channel = this.safeString(message, 'channel');
263261
263455
  const handler = this.safeValue(handlers, channel);
263262
263456
  if (handler !== undefined) {
263263
- return handler.call(this, client, message);
263457
+ handler.call(this, client, message);
263458
+ return;
263264
263459
  }
263265
263460
  const error = new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' handleMessage: unknown message: ' + this.json(message));
263266
263461
  client.reject(error);
@@ -263288,7 +263483,7 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
263288
263483
  future = this.watch(url, messageHash, this.extend(request, params));
263289
263484
  client.subscriptions[messageHash] = future;
263290
263485
  }
263291
- return await future;
263486
+ return future;
263292
263487
  }
263293
263488
  }
263294
263489
 
@@ -263465,15 +263660,15 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
263465
263660
  if (type === 'SNAPSHOT') {
263466
263661
  this.orderbooks[symbol] = this.orderBook({}, limit);
263467
263662
  }
263468
- const orderBook = this.orderbooks[symbol];
263663
+ const orderbook = this.orderbooks[symbol];
263469
263664
  // upbit always returns a snapshot of 15 topmost entries
263470
263665
  // the "REALTIME" deltas are not incremental
263471
263666
  // therefore we reset the orderbook on each update
263472
263667
  // and reinitialize it again with new bidasks
263473
- orderBook.reset({});
263474
- orderBook['symbol'] = symbol;
263475
- const bids = orderBook['bids'];
263476
- const asks = orderBook['asks'];
263668
+ orderbook.reset({});
263669
+ orderbook['symbol'] = symbol;
263670
+ const bids = orderbook['bids'];
263671
+ const asks = orderbook['asks'];
263477
263672
  const data = this.safeValue(message, 'orderbook_units', []);
263478
263673
  for (let i = 0; i < data.length; i++) {
263479
263674
  const entry = data[i];
@@ -263486,10 +263681,10 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
263486
263681
  }
263487
263682
  const timestamp = this.safeInteger(message, 'timestamp');
263488
263683
  const datetime = this.iso8601(timestamp);
263489
- orderBook['timestamp'] = timestamp;
263490
- orderBook['datetime'] = datetime;
263684
+ orderbook['timestamp'] = timestamp;
263685
+ orderbook['datetime'] = datetime;
263491
263686
  const messageHash = 'orderbook:' + marketId;
263492
- client.resolve(orderBook, messageHash);
263687
+ client.resolve(orderbook, messageHash);
263493
263688
  }
263494
263689
  handleTrades(client, message) {
263495
263690
  // { type: "trade",
@@ -264264,7 +264459,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
264264
264459
  handleMessage(client, message) {
264265
264460
  const status = this.safeString(message, 'status');
264266
264461
  if (status === 'error') {
264267
- return this.handleError(client, message);
264462
+ this.handleError(client, message);
264463
+ return;
264268
264464
  }
264269
264465
  const event = this.safeString(message, 'event');
264270
264466
  const eventHandlers = {
@@ -264274,7 +264470,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
264274
264470
  };
264275
264471
  const eventHandler = this.safeValue(eventHandlers, event);
264276
264472
  if (eventHandler !== undefined) {
264277
- return eventHandler.call(this, client, message);
264473
+ eventHandler.call(this, client, message);
264474
+ return;
264278
264475
  }
264279
264476
  const stream = this.safeString(message, 'stream', '');
264280
264477
  const streamHandlers = {
@@ -264290,7 +264487,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
264290
264487
  for (let i = 0; i < streams.length; i++) {
264291
264488
  if (this.inArray(streams[i], stream)) {
264292
264489
  const handler = streamHandlers[streams[i]];
264293
- return handler.call(this, client, message);
264490
+ handler.call(this, client, message);
264491
+ return;
264294
264492
  }
264295
264493
  }
264296
264494
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' this message type is not supported yet. Message: ' + this.json(message));
@@ -265676,7 +265874,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
265676
265874
  }
265677
265875
  return true;
265678
265876
  }
265679
- authenticate(params = {}) {
265877
+ async authenticate(params = {}) {
265680
265878
  this.checkRequiredCredentials();
265681
265879
  const url = this.urls['api']['ws']['private'] + '/' + this.uid;
265682
265880
  const client = this.client(url);
@@ -266082,13 +266280,15 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
266082
266280
  const event = this.safeString(message, 'event');
266083
266281
  let method = this.safeValue(methods, event);
266084
266282
  if (method !== undefined) {
266085
- return method.call(this, client, message);
266283
+ method.call(this, client, message);
266284
+ return;
266086
266285
  }
266087
266286
  const topic = this.safeString(message, 'topic');
266088
266287
  if (topic !== undefined) {
266089
266288
  method = this.safeValue(methods, topic);
266090
266289
  if (method !== undefined) {
266091
- return method.call(this, client, message);
266290
+ method.call(this, client, message);
266291
+ return;
266092
266292
  }
266093
266293
  const splitTopic = topic.split('@');
266094
266294
  const splitLength = splitTopic.length;
@@ -266096,19 +266296,19 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
266096
266296
  const name = this.safeString(splitTopic, 1);
266097
266297
  method = this.safeValue(methods, name);
266098
266298
  if (method !== undefined) {
266099
- return method.call(this, client, message);
266299
+ method.call(this, client, message);
266300
+ return;
266100
266301
  }
266101
266302
  const splitName = name.split('_');
266102
266303
  const splitNameLength = splitTopic.length;
266103
266304
  if (splitNameLength === 2) {
266104
266305
  method = this.safeValue(methods, this.safeString(splitName, 0));
266105
266306
  if (method !== undefined) {
266106
- return method.call(this, client, message);
266307
+ method.call(this, client, message);
266107
266308
  }
266108
266309
  }
266109
266310
  }
266110
266311
  }
266111
- return message;
266112
266312
  }
266113
266313
  ping(client) {
266114
266314
  return { 'event': 'ping' };
@@ -266592,8 +266792,8 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
266592
266792
  const networkList = {};
266593
266793
  for (let j = 0; j < platformsByPriority.length; j++) {
266594
266794
  const network = platformsByPriority[j];
266595
- const networkId = this.safeString(network, 'id');
266596
- const networkCode = this.networkIdToCode(networkId);
266795
+ const idInner = this.safeString(network, 'id');
266796
+ const networkCode = this.networkIdToCode(idInner);
266597
266797
  const currentDepositSuspended = this.safeValue(network, 'deposit_suspended');
266598
266798
  const currentWithdrawalSuspended = this.safeValue(network, 'withdrawal_suspended');
266599
266799
  const currentDeposit = !currentDepositSuspended;
@@ -266614,7 +266814,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
266614
266814
  }
266615
266815
  }
266616
266816
  networkList[networkCode] = {
266617
- 'id': networkId,
266817
+ 'id': idInner,
266618
266818
  'network': networkCode,
266619
266819
  'active': currentActive,
266620
266820
  'deposit': currentDeposit,
@@ -279911,9 +280111,9 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
279911
280111
  // "timestamp":1659666786943
279912
280112
  // }
279913
280113
  //
279914
- return this.parseBalance(response, type, marginMode);
280114
+ return this.parseBalanceCustom(response, type, marginMode);
279915
280115
  }
279916
- parseBalance(response, type = undefined, marginMode = undefined) {
280116
+ parseBalanceCustom(response, type = undefined, marginMode = undefined) {
279917
280117
  const timestamp = this.safeInteger(response, 'updateTime');
279918
280118
  const result = {
279919
280119
  'info': response,
@@ -284220,7 +284420,8 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
284220
284420
  // precise.decimals should be integer
284221
284421
  precise.decimals = this.parseToInt(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringSub(this.numberToString(precise.decimals), this.numberToString(scale)));
284222
284422
  precise.reduce();
284223
- return precise;
284423
+ const stringValue = precise.toString();
284424
+ return stringValue;
284224
284425
  }
284225
284426
  currencyFromPrecision(currency, amount) {
284226
284427
  const scale = this.currencies[currency]['precision'];
@@ -289723,7 +289924,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
289723
289924
  const stopLoss = this.safeValue(params, 'stopLoss');
289724
289925
  const takeProfit = this.safeValue(params, 'takeProfit');
289725
289926
  const algoType = this.safeString(params, 'algoType');
289726
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', price);
289927
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
289727
289928
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
289728
289929
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
289729
289930
  const isTrailingAmountOrder = trailingAmount !== undefined;
@@ -292823,11 +293024,29 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
292823
293024
  const address = this.safeString(response['return'], 'address');
292824
293025
  this.checkAddress(address);
292825
293026
  return {
293027
+ 'id': undefined,
292826
293028
  'currency': code,
292827
293029
  'address': address,
292828
293030
  'tag': undefined,
292829
293031
  'network': undefined,
292830
293032
  'info': response,
293033
+ 'txid': undefined,
293034
+ 'type': undefined,
293035
+ 'amount': undefined,
293036
+ 'status': undefined,
293037
+ 'timestamp': undefined,
293038
+ 'datetime': undefined,
293039
+ 'addressFrom': undefined,
293040
+ 'addressTo': undefined,
293041
+ 'tagFrom': undefined,
293042
+ 'tagTo': undefined,
293043
+ 'updated': undefined,
293044
+ 'comment': undefined,
293045
+ 'fee': {
293046
+ 'currency': undefined,
293047
+ 'cost': undefined,
293048
+ 'rate': undefined,
293049
+ },
292831
293050
  };
292832
293051
  }
292833
293052
  async withdraw(code, amount, address, tag = undefined, params = {}) {
@@ -292860,6 +293079,27 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
292860
293079
  return {
292861
293080
  'info': response,
292862
293081
  'id': undefined,
293082
+ 'txid': undefined,
293083
+ 'type': undefined,
293084
+ 'currency': undefined,
293085
+ 'network': undefined,
293086
+ 'amount': undefined,
293087
+ 'status': undefined,
293088
+ 'timestamp': undefined,
293089
+ 'datetime': undefined,
293090
+ 'address': undefined,
293091
+ 'addressFrom': undefined,
293092
+ 'addressTo': undefined,
293093
+ 'tag': undefined,
293094
+ 'tagFrom': undefined,
293095
+ 'tagTo': undefined,
293096
+ 'updated': undefined,
293097
+ 'comment': undefined,
293098
+ 'fee': {
293099
+ 'currency': undefined,
293100
+ 'cost': undefined,
293101
+ 'rate': undefined,
293102
+ },
292863
293103
  };
292864
293104
  }
292865
293105
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -301161,7 +301401,7 @@ SOFTWARE.
301161
301401
 
301162
301402
  //-----------------------------------------------------------------------------
301163
301403
  // this is updated by vss.js when building
301164
- const version = '4.2.31';
301404
+ const version = '4.2.35';
301165
301405
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
301166
301406
  //-----------------------------------------------------------------------------
301167
301407