ccxt 4.1.85 → 4.1.86

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 (295) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +724 -388
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +1 -1
  6. package/dist/cjs/src/alpaca.js +2 -2
  7. package/dist/cjs/src/ascendex.js +2 -2
  8. package/dist/cjs/src/base/Exchange.js +50 -20
  9. package/dist/cjs/src/bigone.js +1 -1
  10. package/dist/cjs/src/binance.js +2 -2
  11. package/dist/cjs/src/bingx.js +1 -1
  12. package/dist/cjs/src/bit2c.js +1 -1
  13. package/dist/cjs/src/bitbank.js +1 -1
  14. package/dist/cjs/src/bitbns.js +1 -1
  15. package/dist/cjs/src/bitfinex.js +1 -1
  16. package/dist/cjs/src/bitfinex2.js +1 -1
  17. package/dist/cjs/src/bitflyer.js +1 -1
  18. package/dist/cjs/src/bitforex.js +1 -1
  19. package/dist/cjs/src/bitget.js +2 -3
  20. package/dist/cjs/src/bithumb.js +1 -1
  21. package/dist/cjs/src/bitmart.js +1 -1
  22. package/dist/cjs/src/bitmex.js +2 -2
  23. package/dist/cjs/src/bitopro.js +1 -1
  24. package/dist/cjs/src/bitpanda.js +1 -1
  25. package/dist/cjs/src/bitrue.js +1 -1
  26. package/dist/cjs/src/bitso.js +1 -1
  27. package/dist/cjs/src/bitstamp.js +1 -1
  28. package/dist/cjs/src/bittrex.js +1 -1
  29. package/dist/cjs/src/bitvavo.js +1 -1
  30. package/dist/cjs/src/bl3p.js +1 -1
  31. package/dist/cjs/src/blockchaincom.js +1 -1
  32. package/dist/cjs/src/btcalpha.js +1 -1
  33. package/dist/cjs/src/btcbox.js +1 -1
  34. package/dist/cjs/src/btcmarkets.js +1 -1
  35. package/dist/cjs/src/btcturk.js +1 -1
  36. package/dist/cjs/src/bybit.js +3 -5
  37. package/dist/cjs/src/cex.js +1 -1
  38. package/dist/cjs/src/coinbase.js +1 -1
  39. package/dist/cjs/src/coinbasepro.js +1 -1
  40. package/dist/cjs/src/coincheck.js +1 -1
  41. package/dist/cjs/src/coinex.js +2 -2
  42. package/dist/cjs/src/coinlist.js +1 -1
  43. package/dist/cjs/src/coinmate.js +1 -1
  44. package/dist/cjs/src/coinone.js +1 -1
  45. package/dist/cjs/src/coinsph.js +1 -1
  46. package/dist/cjs/src/coinspot.js +1 -1
  47. package/dist/cjs/src/cryptocom.js +3 -3
  48. package/dist/cjs/src/currencycom.js +1 -1
  49. package/dist/cjs/src/delta.js +1 -1
  50. package/dist/cjs/src/deribit.js +1 -1
  51. package/dist/cjs/src/digifinex.js +160 -112
  52. package/dist/cjs/src/exmo.js +1 -1
  53. package/dist/cjs/src/gate.js +1 -1
  54. package/dist/cjs/src/gemini.js +1 -1
  55. package/dist/cjs/src/hitbtc.js +2 -2
  56. package/dist/cjs/src/hitbtc3.js +1 -1
  57. package/dist/cjs/src/hollaex.js +1 -1
  58. package/dist/cjs/src/htx.js +2 -2
  59. package/dist/cjs/src/huobijp.js +1 -1
  60. package/dist/cjs/src/idex.js +1 -1
  61. package/dist/cjs/src/independentreserve.js +1 -1
  62. package/dist/cjs/src/indodax.js +1 -1
  63. package/dist/cjs/src/kraken.js +2 -2
  64. package/dist/cjs/src/krakenfutures.js +3 -3
  65. package/dist/cjs/src/kucoin.js +2 -6
  66. package/dist/cjs/src/kuna.js +1 -1
  67. package/dist/cjs/src/latoken.js +2 -2
  68. package/dist/cjs/src/lbank.js +1 -1
  69. package/dist/cjs/src/luno.js +1 -1
  70. package/dist/cjs/src/lykke.js +1 -1
  71. package/dist/cjs/src/mercado.js +1 -1
  72. package/dist/cjs/src/mexc.js +102 -53
  73. package/dist/cjs/src/ndax.js +1 -1
  74. package/dist/cjs/src/novadax.js +1 -1
  75. package/dist/cjs/src/oceanex.js +1 -1
  76. package/dist/cjs/src/okcoin.js +1 -1
  77. package/dist/cjs/src/okx.js +4 -4
  78. package/dist/cjs/src/p2b.js +1 -3
  79. package/dist/cjs/src/paymium.js +1 -1
  80. package/dist/cjs/src/phemex.js +1 -1
  81. package/dist/cjs/src/poloniex.js +51 -51
  82. package/dist/cjs/src/poloniexfutures.js +1 -1
  83. package/dist/cjs/src/pro/bitget.js +1 -1
  84. package/dist/cjs/src/pro/bitmex.js +206 -0
  85. package/dist/cjs/src/pro/krakenfutures.js +6 -6
  86. package/dist/cjs/src/pro/mexc.js +1 -1
  87. package/dist/cjs/src/pro/poloniex.js +1 -1
  88. package/dist/cjs/src/pro/poloniexfutures.js +3 -3
  89. package/dist/cjs/src/probit.js +27 -19
  90. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
  91. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
  92. package/dist/cjs/src/timex.js +1 -1
  93. package/dist/cjs/src/tokocrypto.js +8 -4
  94. package/dist/cjs/src/upbit.js +1 -1
  95. package/dist/cjs/src/wavesexchange.js +1 -1
  96. package/dist/cjs/src/wazirx.js +1 -1
  97. package/dist/cjs/src/whitebit.js +1 -1
  98. package/dist/cjs/src/woo.js +1 -1
  99. package/dist/cjs/src/yobit.js +1 -1
  100. package/dist/cjs/src/zaif.js +1 -1
  101. package/dist/cjs/src/zonda.js +1 -1
  102. package/js/ccxt.d.ts +1 -1
  103. package/js/ccxt.js +1 -1
  104. package/js/src/ace.d.ts +1 -1
  105. package/js/src/ace.js +1 -1
  106. package/js/src/alpaca.d.ts +1 -1
  107. package/js/src/alpaca.js +2 -2
  108. package/js/src/ascendex.d.ts +1 -1
  109. package/js/src/ascendex.js +2 -2
  110. package/js/src/base/Exchange.d.ts +4 -0
  111. package/js/src/base/Exchange.js +50 -20
  112. package/js/src/base/types.d.ts +1 -0
  113. package/js/src/bigone.d.ts +1 -1
  114. package/js/src/bigone.js +1 -1
  115. package/js/src/binance.d.ts +1 -1
  116. package/js/src/binance.js +2 -2
  117. package/js/src/bingx.js +1 -1
  118. package/js/src/bit2c.d.ts +1 -1
  119. package/js/src/bit2c.js +1 -1
  120. package/js/src/bitbank.d.ts +1 -1
  121. package/js/src/bitbank.js +1 -1
  122. package/js/src/bitbns.d.ts +1 -1
  123. package/js/src/bitbns.js +1 -1
  124. package/js/src/bitfinex.d.ts +1 -1
  125. package/js/src/bitfinex.js +1 -1
  126. package/js/src/bitfinex2.d.ts +1 -1
  127. package/js/src/bitfinex2.js +1 -1
  128. package/js/src/bitflyer.d.ts +1 -1
  129. package/js/src/bitflyer.js +1 -1
  130. package/js/src/bitforex.d.ts +1 -1
  131. package/js/src/bitforex.js +1 -1
  132. package/js/src/bitget.d.ts +1 -1
  133. package/js/src/bitget.js +2 -3
  134. package/js/src/bithumb.d.ts +1 -1
  135. package/js/src/bithumb.js +1 -1
  136. package/js/src/bitmart.d.ts +1 -1
  137. package/js/src/bitmart.js +1 -1
  138. package/js/src/bitmex.d.ts +1 -1
  139. package/js/src/bitmex.js +2 -2
  140. package/js/src/bitopro.d.ts +1 -1
  141. package/js/src/bitopro.js +1 -1
  142. package/js/src/bitpanda.d.ts +1 -1
  143. package/js/src/bitpanda.js +1 -1
  144. package/js/src/bitrue.d.ts +1 -1
  145. package/js/src/bitrue.js +1 -1
  146. package/js/src/bitso.d.ts +1 -1
  147. package/js/src/bitso.js +1 -1
  148. package/js/src/bitstamp.d.ts +1 -1
  149. package/js/src/bitstamp.js +1 -1
  150. package/js/src/bittrex.d.ts +1 -1
  151. package/js/src/bittrex.js +1 -1
  152. package/js/src/bitvavo.d.ts +1 -1
  153. package/js/src/bitvavo.js +1 -1
  154. package/js/src/bl3p.d.ts +1 -1
  155. package/js/src/bl3p.js +1 -1
  156. package/js/src/blockchaincom.d.ts +1 -1
  157. package/js/src/blockchaincom.js +1 -1
  158. package/js/src/btcalpha.d.ts +1 -1
  159. package/js/src/btcalpha.js +1 -1
  160. package/js/src/btcbox.d.ts +1 -1
  161. package/js/src/btcbox.js +1 -1
  162. package/js/src/btcmarkets.d.ts +1 -1
  163. package/js/src/btcmarkets.js +1 -1
  164. package/js/src/btcturk.d.ts +1 -1
  165. package/js/src/btcturk.js +1 -1
  166. package/js/src/bybit.d.ts +1 -1
  167. package/js/src/bybit.js +3 -5
  168. package/js/src/cex.d.ts +1 -1
  169. package/js/src/cex.js +1 -1
  170. package/js/src/coinbase.d.ts +1 -1
  171. package/js/src/coinbase.js +1 -1
  172. package/js/src/coinbasepro.d.ts +1 -1
  173. package/js/src/coinbasepro.js +1 -1
  174. package/js/src/coincheck.d.ts +1 -1
  175. package/js/src/coincheck.js +1 -1
  176. package/js/src/coinex.d.ts +1 -1
  177. package/js/src/coinex.js +2 -2
  178. package/js/src/coinlist.d.ts +1 -1
  179. package/js/src/coinlist.js +1 -1
  180. package/js/src/coinmate.d.ts +1 -1
  181. package/js/src/coinmate.js +1 -1
  182. package/js/src/coinone.d.ts +1 -1
  183. package/js/src/coinone.js +1 -1
  184. package/js/src/coinsph.d.ts +1 -1
  185. package/js/src/coinsph.js +1 -1
  186. package/js/src/coinspot.d.ts +1 -1
  187. package/js/src/coinspot.js +1 -1
  188. package/js/src/cryptocom.d.ts +1 -1
  189. package/js/src/cryptocom.js +3 -3
  190. package/js/src/currencycom.d.ts +1 -1
  191. package/js/src/currencycom.js +1 -1
  192. package/js/src/delta.d.ts +1 -1
  193. package/js/src/delta.js +1 -1
  194. package/js/src/deribit.d.ts +1 -1
  195. package/js/src/deribit.js +1 -1
  196. package/js/src/digifinex.d.ts +1 -1
  197. package/js/src/digifinex.js +160 -112
  198. package/js/src/exmo.d.ts +1 -1
  199. package/js/src/exmo.js +1 -1
  200. package/js/src/gate.d.ts +1 -1
  201. package/js/src/gate.js +1 -1
  202. package/js/src/gemini.d.ts +1 -1
  203. package/js/src/gemini.js +1 -1
  204. package/js/src/hitbtc.d.ts +1 -1
  205. package/js/src/hitbtc.js +2 -2
  206. package/js/src/hitbtc3.d.ts +1 -1
  207. package/js/src/hitbtc3.js +1 -1
  208. package/js/src/hollaex.d.ts +1 -1
  209. package/js/src/hollaex.js +1 -1
  210. package/js/src/htx.d.ts +1 -1
  211. package/js/src/htx.js +2 -2
  212. package/js/src/huobijp.d.ts +1 -1
  213. package/js/src/huobijp.js +1 -1
  214. package/js/src/idex.d.ts +1 -1
  215. package/js/src/idex.js +1 -1
  216. package/js/src/independentreserve.d.ts +1 -1
  217. package/js/src/independentreserve.js +1 -1
  218. package/js/src/indodax.d.ts +1 -1
  219. package/js/src/indodax.js +1 -1
  220. package/js/src/kraken.d.ts +1 -1
  221. package/js/src/kraken.js +2 -2
  222. package/js/src/krakenfutures.d.ts +1 -1
  223. package/js/src/krakenfutures.js +3 -3
  224. package/js/src/kucoin.d.ts +1 -1
  225. package/js/src/kucoin.js +2 -6
  226. package/js/src/kuna.d.ts +1 -1
  227. package/js/src/kuna.js +1 -1
  228. package/js/src/latoken.d.ts +1 -1
  229. package/js/src/latoken.js +2 -2
  230. package/js/src/lbank.d.ts +1 -1
  231. package/js/src/lbank.js +1 -1
  232. package/js/src/luno.d.ts +1 -1
  233. package/js/src/luno.js +1 -1
  234. package/js/src/lykke.d.ts +1 -1
  235. package/js/src/lykke.js +1 -1
  236. package/js/src/mercado.d.ts +1 -1
  237. package/js/src/mercado.js +1 -1
  238. package/js/src/mexc.d.ts +1 -1
  239. package/js/src/mexc.js +102 -53
  240. package/js/src/ndax.d.ts +1 -1
  241. package/js/src/ndax.js +1 -1
  242. package/js/src/novadax.d.ts +1 -1
  243. package/js/src/novadax.js +1 -1
  244. package/js/src/oceanex.d.ts +1 -1
  245. package/js/src/oceanex.js +1 -1
  246. package/js/src/okcoin.d.ts +1 -1
  247. package/js/src/okcoin.js +1 -1
  248. package/js/src/okx.d.ts +1 -1
  249. package/js/src/okx.js +4 -4
  250. package/js/src/p2b.d.ts +1 -1
  251. package/js/src/p2b.js +1 -3
  252. package/js/src/paymium.d.ts +1 -1
  253. package/js/src/paymium.js +1 -1
  254. package/js/src/phemex.d.ts +1 -1
  255. package/js/src/phemex.js +1 -1
  256. package/js/src/poloniex.d.ts +1 -1
  257. package/js/src/poloniex.js +51 -51
  258. package/js/src/poloniexfutures.d.ts +1 -1
  259. package/js/src/poloniexfutures.js +1 -1
  260. package/js/src/pro/bitget.d.ts +1 -1
  261. package/js/src/pro/bitget.js +1 -1
  262. package/js/src/pro/bitmex.d.ts +3 -1
  263. package/js/src/pro/bitmex.js +207 -1
  264. package/js/src/pro/krakenfutures.js +6 -6
  265. package/js/src/pro/mexc.js +1 -1
  266. package/js/src/pro/poloniex.js +1 -1
  267. package/js/src/pro/poloniexfutures.js +3 -3
  268. package/js/src/probit.d.ts +1 -1
  269. package/js/src/probit.js +27 -19
  270. package/js/src/static_dependencies/jsencrypt/JSEncrypt.d.ts +1 -1
  271. package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
  272. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.d.ts +3 -3
  273. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
  274. package/js/src/timex.d.ts +1 -1
  275. package/js/src/timex.js +1 -1
  276. package/js/src/tokocrypto.d.ts +1 -1
  277. package/js/src/tokocrypto.js +8 -4
  278. package/js/src/upbit.d.ts +1 -1
  279. package/js/src/upbit.js +1 -1
  280. package/js/src/wavesexchange.d.ts +1 -1
  281. package/js/src/wavesexchange.js +1 -1
  282. package/js/src/wazirx.d.ts +1 -1
  283. package/js/src/wazirx.js +1 -1
  284. package/js/src/whitebit.d.ts +1 -1
  285. package/js/src/whitebit.js +1 -1
  286. package/js/src/woo.d.ts +1 -1
  287. package/js/src/woo.js +1 -1
  288. package/js/src/yobit.d.ts +1 -1
  289. package/js/src/yobit.js +1 -1
  290. package/js/src/zaif.d.ts +1 -1
  291. package/js/src/zaif.js +1 -1
  292. package/js/src/zonda.d.ts +1 -1
  293. package/js/src/zonda.js +1 -1
  294. package/package.json +4 -3
  295. package/skip-tests.json +4 -0
@@ -1430,7 +1430,7 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang
1430
1430
  // ---------------------------------------------------------------------------
1431
1431
  /**
1432
1432
  * @class ace
1433
- * @extends Exchange
1433
+ * @augments Exchange
1434
1434
  */
1435
1435
  class ace extends _abstract_ace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
1436
1436
  describe() {
@@ -2494,7 +2494,7 @@ class ace extends _abstract_ace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
2494
2494
  // ---------------------------------------------------------------------------xs
2495
2495
  /**
2496
2496
  * @class alpaca
2497
- * @extends Exchange
2497
+ * @augments Exchange
2498
2498
  */
2499
2499
  class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
2500
2500
  describe() {
@@ -2982,7 +2982,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
2982
2982
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2983
2983
  * @param {string} [params.loc] crypto location, default: us
2984
2984
  * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
2985
- */
2985
+ */
2986
2986
  await this.loadMarkets();
2987
2987
  const market = this.market(symbol);
2988
2988
  const id = market['id'];
@@ -3625,7 +3625,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
3625
3625
  // ---------------------------------------------------------------------------
3626
3626
  /**
3627
3627
  * @class ascendex
3628
- * @extends Exchange
3628
+ * @augments Exchange
3629
3629
  */
3630
3630
  class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
3631
3631
  describe() {
@@ -5276,7 +5276,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
5276
5276
  * @description create a list of trade orders
5277
5277
  * @see https://ascendex.github.io/ascendex-pro-api/#place-batch-orders
5278
5278
  * @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#place-batch-orders
5279
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
5279
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
5280
5280
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5281
5281
  * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
5282
5282
  * @param {bool} [params.postOnly] true or false
@@ -7686,6 +7686,26 @@ class Exchange {
7686
7686
  }
7687
7687
  return chosenAgent;
7688
7688
  }
7689
+ async loadHttpProxyAgent() {
7690
+ // for `http://` protocol proxy-urls, we need to load `http` module only on first call
7691
+ if (!this.httpAgent) {
7692
+ const httpModule = await import(/* webpackIgnore: true */ 'node:http');
7693
+ this.httpAgent = new httpModule.Agent();
7694
+ }
7695
+ return this.httpAgent;
7696
+ }
7697
+ getHttpAgentIfNeeded(url) {
7698
+ if (isNode) {
7699
+ // only for non-ssl proxy
7700
+ if (url.substring(0, 5) === 'ws://') {
7701
+ if (this.httpAgent === undefined) {
7702
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' to use proxy with non-ssl ws:// urls, at first run `await exchange.loadHttpProxyAgent()` method');
7703
+ }
7704
+ return this.httpAgent;
7705
+ }
7706
+ }
7707
+ return undefined;
7708
+ }
7689
7709
  async fetch(url, method = 'GET', headers = undefined, body = undefined) {
7690
7710
  // load node-http(s) modules only on first call
7691
7711
  if (isNode) {
@@ -7699,18 +7719,16 @@ class Exchange {
7699
7719
  headers = this.extend(this.headers, headers);
7700
7720
  // proxy-url
7701
7721
  const proxyUrl = this.checkProxyUrlSettings(url, method, headers, body);
7702
- let isHttpAgentNeeded = false;
7722
+ let httpProxyAgent = false;
7703
7723
  if (proxyUrl !== undefined) {
7704
- // in node we need to set header to *
7724
+ // part only for node-js
7705
7725
  if (isNode) {
7726
+ // in node we need to set header to *
7706
7727
  headers = this.extend({ 'Origin': this.origin }, headers);
7707
- if (proxyUrl.substring(0, 5) !== 'https') {
7708
- // for `http://` protocol proxy-urls, we need to load `http` module only on first call
7709
- if (!this.httpAgent) {
7710
- const httpModule = await import(/* webpackIgnore: true */ 'node:http');
7711
- this.httpAgent = new httpModule.Agent();
7712
- }
7713
- isHttpAgentNeeded = true;
7728
+ // only for http proxy
7729
+ if (proxyUrl.substring(0, 5) === 'http:') {
7730
+ await this.loadHttpProxyAgent();
7731
+ httpProxyAgent = this.httpAgent;
7714
7732
  }
7715
7733
  }
7716
7734
  url = proxyUrl + url;
@@ -7763,9 +7781,9 @@ class Exchange {
7763
7781
  params['agent'] = this.agent;
7764
7782
  }
7765
7783
  // override agent, if needed
7766
- if (isHttpAgentNeeded) {
7767
- // if proxyUrl is being used, so we don't overwrite `this.agent` itself
7768
- params['agent'] = this.httpAgent;
7784
+ if (httpProxyAgent) {
7785
+ // if proxyUrl is being used, then specifically in nodejs, we need http module, not https
7786
+ params['agent'] = httpProxyAgent;
7769
7787
  }
7770
7788
  else if (chosenAgent) {
7771
7789
  // if http(s)Proxy is being used
@@ -7974,7 +7992,9 @@ class Exchange {
7974
7992
  // proxy agents
7975
7993
  const [httpProxy, httpsProxy, socksProxy] = this.checkWsProxySettings();
7976
7994
  const chosenAgent = this.setProxyAgents(httpProxy, httpsProxy, socksProxy);
7977
- const finalAgent = chosenAgent ? chosenAgent : this.agent;
7995
+ // part only for node-js
7996
+ const httpProxyAgent = this.getHttpAgentIfNeeded(url);
7997
+ const finalAgent = chosenAgent ? chosenAgent : (httpProxyAgent ? httpProxyAgent : this.agent);
7978
7998
  //
7979
7999
  const options = this.deepExtend(this.streaming, {
7980
8000
  'log': this.log ? this.log.bind(this) : this.log,
@@ -8324,7 +8344,8 @@ class Exchange {
8324
8344
  const usedProxies = [];
8325
8345
  let wsProxy = undefined;
8326
8346
  let wssProxy = undefined;
8327
- // wsProxy
8347
+ let wsSocksProxy = undefined;
8348
+ // ws proxy
8328
8349
  if (this.wsProxy !== undefined) {
8329
8350
  usedProxies.push('wsProxy');
8330
8351
  wsProxy = this.wsProxy;
@@ -8333,7 +8354,7 @@ class Exchange {
8333
8354
  usedProxies.push('ws_proxy');
8334
8355
  wsProxy = this.ws_proxy;
8335
8356
  }
8336
- // wsProxy
8357
+ // wss proxy
8337
8358
  if (this.wssProxy !== undefined) {
8338
8359
  usedProxies.push('wssProxy');
8339
8360
  wssProxy = this.wssProxy;
@@ -8342,13 +8363,22 @@ class Exchange {
8342
8363
  usedProxies.push('wss_proxy');
8343
8364
  wssProxy = this.wss_proxy;
8344
8365
  }
8366
+ // ws socks proxy
8367
+ if (this.wsSocksProxy !== undefined) {
8368
+ usedProxies.push('wsSocksProxy');
8369
+ wsSocksProxy = this.wsSocksProxy;
8370
+ }
8371
+ if (this.ws_socks_proxy !== undefined) {
8372
+ usedProxies.push('ws_socks_proxy');
8373
+ wsSocksProxy = this.ws_socks_proxy;
8374
+ }
8345
8375
  // check
8346
8376
  const length = usedProxies.length;
8347
8377
  if (length > 1) {
8348
8378
  const joinedProxyNames = usedProxies.join(',');
8349
- throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.ExchangeError(this.id + ' you have multiple conflicting settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy');
8379
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.ExchangeError(this.id + ' you have multiple conflicting settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy, socksProxy');
8350
8380
  }
8351
- return [wsProxy, wssProxy];
8381
+ return [wsProxy, wssProxy, wsSocksProxy];
8352
8382
  }
8353
8383
  checkConflictingProxies(proxyAgentSet, proxyUrlSet) {
8354
8384
  if (proxyAgentSet && proxyUrlSet) {
@@ -11258,8 +11288,8 @@ class Exchange {
11258
11288
  /**
11259
11289
  * @ignore
11260
11290
  * @method
11261
- * * Must add timeInForce to this.options to use this method
11262
- * @return {string} returns the exchange specific value for timeInForce
11291
+ * Must add timeInForce to this.options to use this method
11292
+ * @returns {string} returns the exchange specific value for timeInForce
11263
11293
  */
11264
11294
  const timeInForce = this.safeStringUpper(params, 'timeInForce'); // supported values GTC, IOC, PO
11265
11295
  if (timeInForce !== undefined) {
@@ -11275,7 +11305,7 @@ class Exchange {
11275
11305
  /**
11276
11306
  * @ignore
11277
11307
  * @method
11278
- * * Must add accountsByType to this.options to use this method
11308
+ * Must add accountsByType to this.options to use this method
11279
11309
  * @param {string} account key for account name in this.options['accountsByType']
11280
11310
  * @returns the exchange specific account name or the isolated margin id for transfers
11281
11311
  */
@@ -15044,7 +15074,7 @@ class bequant extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
15044
15074
  // ---------------------------------------------------------------------------
15045
15075
  /**
15046
15076
  * @class bigone
15047
- * @extends Exchange
15077
+ * @augments Exchange
15048
15078
  */
15049
15079
  class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
15050
15080
  describe() {
@@ -16999,7 +17029,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
16999
17029
  // ---------------------------------------------------------------------------
17000
17030
  /**
17001
17031
  * @class binance
17002
- * @extends Exchange
17032
+ * @augments Exchange
17003
17033
  */
17004
17034
  class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
17005
17035
  describe() {
@@ -21379,7 +21409,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21379
21409
  * @name binance#createOrders
21380
21410
  * @description *contract only* create a list of trade orders
21381
21411
  * @see https://binance-docs.github.io/apidocs/futures/en/#place-multiple-orders-trade
21382
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
21412
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
21383
21413
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
21384
21414
  */
21385
21415
  await this.loadMarkets();
@@ -28728,7 +28758,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28728
28758
  * @description create a list of trade orders
28729
28759
  * @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Batch%20Placing%20Orders
28730
28760
  * @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
28731
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
28761
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
28732
28762
  * @param {object} [params] extra parameters specific to the exchange API endpoint
28733
28763
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
28734
28764
  */
@@ -30414,7 +30444,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30414
30444
  // ---------------------------------------------------------------------------
30415
30445
  /**
30416
30446
  * @class bit2c
30417
- * @extends Exchange
30447
+ * @augments Exchange
30418
30448
  */
30419
30449
  class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
30420
30450
  describe() {
@@ -31333,7 +31363,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
31333
31363
  // ---------------------------------------------------------------------------
31334
31364
  /**
31335
31365
  * @class bitbank
31336
- * @extends Exchange
31366
+ * @augments Exchange
31337
31367
  */
31338
31368
  class bitbank extends _abstract_bitbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
31339
31369
  describe() {
@@ -32367,7 +32397,7 @@ class bitbay extends _zonda_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
32367
32397
  // ---------------------------------------------------------------------------
32368
32398
  /**
32369
32399
  * @class bitbns
32370
- * @extends Exchange
32400
+ * @augments Exchange
32371
32401
  */
32372
32402
  class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
32373
32403
  describe() {
@@ -33620,7 +33650,7 @@ class bitcoincom extends _fmfwio_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
33620
33650
  // ---------------------------------------------------------------------------
33621
33651
  /**
33622
33652
  * @class bitfinex
33623
- * @extends Exchange
33653
+ * @augments Exchange
33624
33654
  */
33625
33655
  class bitfinex extends _abstract_bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
33626
33656
  describe() {
@@ -35301,7 +35331,7 @@ class bitfinex extends _abstract_bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
35301
35331
  // ---------------------------------------------------------------------------
35302
35332
  /**
35303
35333
  * @class bitfinex2
35304
- * @extends Exchange
35334
+ * @augments Exchange
35305
35335
  */
35306
35336
  class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
35307
35337
  describe() {
@@ -38302,7 +38332,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
38302
38332
  // ---------------------------------------------------------------------------
38303
38333
  /**
38304
38334
  * @class bitflyer
38305
- * @extends Exchange
38335
+ * @augments Exchange
38306
38336
  */
38307
38337
  class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
38308
38338
  describe() {
@@ -39355,7 +39385,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
39355
39385
  // ---------------------------------------------------------------------------
39356
39386
  /**
39357
39387
  * @class bitforex
39358
- * @extends Exchange
39388
+ * @augments Exchange
39359
39389
  */
39360
39390
  class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
39361
39391
  describe() {
@@ -40218,7 +40248,7 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
40218
40248
  // ---------------------------------------------------------------------------
40219
40249
  /**
40220
40250
  * @class bitget
40221
- * @extends Exchange
40251
+ * @augments Exchange
40222
40252
  */
40223
40253
  class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
40224
40254
  describe() {
@@ -43935,7 +43965,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
43935
43965
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#batch-order
43936
43966
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-order
43937
43967
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-order
43938
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
43968
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
43939
43969
  * @param {object} [params] extra parameters specific to the api endpoint
43940
43970
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
43941
43971
  */
@@ -46189,7 +46219,6 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46189
46219
  * @param {string} symbol not used by bitget setPositionMode ()
46190
46220
  * @param {object} [params] extra parameters specific to the exchange API endpoint
46191
46221
  * @returns {object} response from the exchange
46192
- *
46193
46222
  */
46194
46223
  await this.loadMarkets();
46195
46224
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
@@ -47395,7 +47424,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
47395
47424
  // ---------------------------------------------------------------------------
47396
47425
  /**
47397
47426
  * @class bithumb
47398
- * @extends Exchange
47427
+ * @augments Exchange
47399
47428
  */
47400
47429
  class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
47401
47430
  describe() {
@@ -48495,7 +48524,7 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48495
48524
  // ---------------------------------------------------------------------------
48496
48525
  /**
48497
48526
  * @class bitmart
48498
- * @extends Exchange
48527
+ * @augments Exchange
48499
48528
  */
48500
48529
  class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
48501
48530
  describe() {
@@ -52790,7 +52819,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
52790
52819
  // ---------------------------------------------------------------------------
52791
52820
  /**
52792
52821
  * @class bitmex
52793
- * @extends Exchange
52822
+ * @augments Exchange
52794
52823
  */
52795
52824
  class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
52796
52825
  describe() {
@@ -55025,7 +55054,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
55025
55054
  const datetime = this.safeString(position, 'timestamp');
55026
55055
  const crossMargin = this.safeValue(position, 'crossMargin');
55027
55056
  const marginMode = (crossMargin === true) ? 'cross' : 'isolated';
55028
- const notionalString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(this.safeString(position, 'foreignNotional', 'homeNotional'));
55057
+ const notionalString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(this.safeString2(position, 'foreignNotional', 'homeNotional'));
55029
55058
  const settleCurrencyCode = this.safeString(market, 'settle');
55030
55059
  const maintenanceMargin = this.convertToRealAmount(settleCurrencyCode, this.safeString(position, 'maintMargin'));
55031
55060
  const unrealisedPnl = this.convertToRealAmount(settleCurrencyCode, this.safeString(position, 'unrealisedPnl'));
@@ -55619,7 +55648,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
55619
55648
  // ---------------------------------------------------------------------------
55620
55649
  /**
55621
55650
  * @class bitopro
55622
- * @extends Exchange
55651
+ * @augments Exchange
55623
55652
  */
55624
55653
  class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
55625
55654
  describe() {
@@ -57351,7 +57380,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
57351
57380
  // ---------------------------------------------------------------------------
57352
57381
  /**
57353
57382
  * @class bitpanda
57354
- * @extends Exchange
57383
+ * @augments Exchange
57355
57384
  */
57356
57385
  class bitpanda extends _abstract_bitpanda_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
57357
57386
  describe() {
@@ -59364,7 +59393,7 @@ class bitpanda extends _abstract_bitpanda_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
59364
59393
  // ---------------------------------------------------------------------------
59365
59394
  /**
59366
59395
  * @class bitrue
59367
- * @extends Exchange
59396
+ * @augments Exchange
59368
59397
  */
59369
59398
  class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
59370
59399
  describe() {
@@ -62636,7 +62665,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
62636
62665
  // ---------------------------------------------------------------------------
62637
62666
  /**
62638
62667
  * @class bitso
62639
- * @extends Exchange
62668
+ * @augments Exchange
62640
62669
  */
62641
62670
  class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
62642
62671
  describe() {
@@ -64399,7 +64428,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
64399
64428
  // ---------------------------------------------------------------------------
64400
64429
  /**
64401
64430
  * @class bitstamp
64402
- * @extends Exchange
64431
+ * @augments Exchange
64403
64432
  */
64404
64433
  class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
64405
64434
  describe() {
@@ -66571,7 +66600,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
66571
66600
  // ---------------------------------------------------------------------------
66572
66601
  /**
66573
66602
  * @class bittrex
66574
- * @extends Exchange
66603
+ * @augments Exchange
66575
66604
  */
66576
66605
  class bittrex extends _abstract_bittrex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
66577
66606
  describe() {
@@ -68890,7 +68919,7 @@ class bittrex extends _abstract_bittrex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
68890
68919
  // ----------------------------------------------------------------------------
68891
68920
  /**
68892
68921
  * @class bitvavo
68893
- * @extends Exchange
68922
+ * @augments Exchange
68894
68923
  */
68895
68924
  class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
68896
68925
  describe() {
@@ -70828,7 +70857,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70828
70857
  // ---------------------------------------------------------------------------
70829
70858
  /**
70830
70859
  * @class bl3p
70831
- * @extends Exchange
70860
+ * @augments Exchange
70832
70861
  */
70833
70862
  class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
70834
70863
  describe() {
@@ -71284,7 +71313,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
71284
71313
  // ---------------------------------------------------------------------------
71285
71314
  /**
71286
71315
  * @class blockchaincom
71287
- * @extends Exchange
71316
+ * @augments Exchange
71288
71317
  */
71289
71318
  class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
71290
71319
  describe() {
@@ -72496,7 +72525,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
72496
72525
  // ---------------------------------------------------------------------------
72497
72526
  /**
72498
72527
  * @class btcalpha
72499
- * @extends Exchange
72528
+ * @augments Exchange
72500
72529
  */
72501
72530
  class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
72502
72531
  describe() {
@@ -73435,7 +73464,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
73435
73464
  // ---------------------------------------------------------------------------
73436
73465
  /**
73437
73466
  * @class btcbox
73438
- * @extends Exchange
73467
+ * @augments Exchange
73439
73468
  */
73440
73469
  class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
73441
73470
  describe() {
@@ -74011,7 +74040,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
74011
74040
  // ---------------------------------------------------------------------------
74012
74041
  /**
74013
74042
  * @class btcmarkets
74014
- * @extends Exchange
74043
+ * @augments Exchange
74015
74044
  */
74016
74045
  class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
74017
74046
  describe() {
@@ -75258,7 +75287,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
75258
75287
  // ---------------------------------------------------------------------------
75259
75288
  /**
75260
75289
  * @class btcturk
75261
- * @extends Exchange
75290
+ * @augments Exchange
75262
75291
  */
75263
75292
  class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
75264
75293
  describe() {
@@ -76199,7 +76228,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
76199
76228
  // ---------------------------------------------------------------------------
76200
76229
  /**
76201
76230
  * @class bybit
76202
- * @extends Exchange
76231
+ * @augments Exchange
76203
76232
  */
76204
76233
  class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
76205
76234
  describe() {
@@ -79878,7 +79907,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
79878
79907
  * @name bybit#createOrders
79879
79908
  * @description create a list of trade orders
79880
79909
  * @see https://bybit-exchange.github.io/docs/v5/order/batch-place
79881
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
79910
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
79882
79911
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
79883
79912
  */
79884
79913
  await this.loadMarkets();
@@ -80916,7 +80945,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
80916
80945
  * @param {int} [limit] the maximum number of trades to retrieve
80917
80946
  * @param {object} [params] extra parameters specific to the exchange API endpoint
80918
80947
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
80919
- *
80920
80948
  */
80921
80949
  const request = {};
80922
80950
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'orderLinkId');
@@ -81202,12 +81230,11 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
81202
81230
  * @param {int} [limit] the maximum number of deposits structures to retrieve, default = 50, max = 50
81203
81231
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81204
81232
  * @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
81205
- *
81206
81233
  * EXCHANGE SPECIFIC PARAMETERS
81207
81234
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
81208
81235
  * @param {string} [params.cursor] used for pagination
81209
81236
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
81210
- */
81237
+ */
81211
81238
  await this.loadMarkets();
81212
81239
  let paginate = false;
81213
81240
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
@@ -83818,7 +83845,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
83818
83845
  // ---------------------------------------------------------------------------
83819
83846
  /**
83820
83847
  * @class cex
83821
- * @extends Exchange
83848
+ * @augments Exchange
83822
83849
  */
83823
83850
  class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
83824
83851
  describe() {
@@ -85520,7 +85547,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
85520
85547
  // ----------------------------------------------------------------------------
85521
85548
  /**
85522
85549
  * @class coinbase
85523
- * @extends Exchange
85550
+ * @augments Exchange
85524
85551
  */
85525
85552
  class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
85526
85553
  describe() {
@@ -88791,7 +88818,7 @@ class coinbaseprime extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["def
88791
88818
  // ----------------------------------------------------------------------------
88792
88819
  /**
88793
88820
  * @class coinbasepro
88794
- * @extends Exchange
88821
+ * @augments Exchange
88795
88822
  */
88796
88823
  class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
88797
88824
  describe() {
@@ -90708,7 +90735,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
90708
90735
  // ---------------------------------------------------------------------------
90709
90736
  /**
90710
90737
  * @class coincheck
90711
- * @extends Exchange
90738
+ * @augments Exchange
90712
90739
  */
90713
90740
  class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
90714
90741
  describe() {
@@ -91564,7 +91591,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
91564
91591
  // ---------------------------------------------------------------------------
91565
91592
  /**
91566
91593
  * @class coinex
91567
- * @extends Exchange
91594
+ * @augments Exchange
91568
91595
  */
91569
91596
  class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
91570
91597
  describe() {
@@ -93824,7 +93851,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
93824
93851
  * @name coinex#createOrders
93825
93852
  * @description create a list of trade orders (all orders should be of the same symbol)
93826
93853
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade002_batch_limit_orders
93827
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
93854
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
93828
93855
  * @param {object} [params] extra parameters specific to the api endpoint
93829
93856
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
93830
93857
  */
@@ -96935,7 +96962,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
96935
96962
 
96936
96963
  /**
96937
96964
  * @class coinlist
96938
- * @extends Exchange
96965
+ * @augments Exchange
96939
96966
  */
96940
96967
  class coinlist extends _abstract_coinlist_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
96941
96968
  describe() {
@@ -99277,7 +99304,7 @@ class coinlist extends _abstract_coinlist_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
99277
99304
  // ---------------------------------------------------------------------------
99278
99305
  /**
99279
99306
  * @class coinmate
99280
- * @extends Exchange
99307
+ * @augments Exchange
99281
99308
  */
99282
99309
  class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
99283
99310
  describe() {
@@ -100276,7 +100303,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
100276
100303
  // ---------------------------------------------------------------------------
100277
100304
  /**
100278
100305
  * @class coinone
100279
- * @extends Exchange
100306
+ * @augments Exchange
100280
100307
  */
100281
100308
  class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
100282
100309
  describe() {
@@ -101218,7 +101245,7 @@ class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
101218
101245
 
101219
101246
  /**
101220
101247
  * @class coinsph
101221
- * @extends Exchange
101248
+ * @augments Exchange
101222
101249
  */
101223
101250
  class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
101224
101251
  describe() {
@@ -103175,7 +103202,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
103175
103202
  // ---------------------------------------------------------------------------
103176
103203
  /**
103177
103204
  * @class coinspot
103178
- * @extends Exchange
103205
+ * @augments Exchange
103179
103206
  */
103180
103207
  class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
103181
103208
  describe() {
@@ -103732,7 +103759,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
103732
103759
 
103733
103760
  /**
103734
103761
  * @class cryptocom
103735
- * @extends Exchange
103762
+ * @augments Exchange
103736
103763
  */
103737
103764
  class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
103738
103765
  describe() {
@@ -104889,7 +104916,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
104889
104916
  * @description create a list of trade orders
104890
104917
  * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-order-list-list
104891
104918
  * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-order-list-oco
104892
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
104919
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
104893
104920
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
104894
104921
  */
104895
104922
  await this.loadMarkets();
@@ -105951,7 +105978,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
105951
105978
  * @method
105952
105979
  * @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
105953
105980
  * @param {object} [params] extra parameters specific to the exchange API endpoint
105954
- * @returns {array} the marginMode in lowercase
105981
+ * @returns {Array} the marginMode in lowercase
105955
105982
  */
105956
105983
  const defaultType = this.safeString(this.options, 'defaultType');
105957
105984
  const isMargin = this.safeValue(params, 'margin', false);
@@ -106735,7 +106762,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
106735
106762
  // ---------------------------------------------------------------------------
106736
106763
  /**
106737
106764
  * @class currencycom
106738
- * @extends Exchange
106765
+ * @augments Exchange
106739
106766
  */
106740
106767
  class currencycom extends _abstract_currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
106741
106768
  describe() {
@@ -108760,7 +108787,7 @@ class currencycom extends _abstract_currencycom_js__WEBPACK_IMPORTED_MODULE_0__/
108760
108787
  // ---------------------------------------------------------------------------
108761
108788
  /**
108762
108789
  * @class delta
108763
- * @extends Exchange
108790
+ * @augments Exchange
108764
108791
  */
108765
108792
  class delta extends _abstract_delta_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
108766
108793
  describe() {
@@ -112003,7 +112030,7 @@ class delta extends _abstract_delta_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
112003
112030
  // ---------------------------------------------------------------------------
112004
112031
  /**
112005
112032
  * @class deribit
112006
- * @extends Exchange
112033
+ * @augments Exchange
112007
112034
  */
112008
112035
  class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
112009
112036
  describe() {
@@ -115288,7 +115315,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
115288
115315
  // ---------------------------------------------------------------------------
115289
115316
  /**
115290
115317
  * @class digifinex
115291
- * @extends Exchange
115318
+ * @augments Exchange
115292
115319
  */
115293
115320
  class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
115294
115321
  describe() {
@@ -115808,9 +115835,15 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
115808
115835
  async fetchMarketsV2(params = {}) {
115809
115836
  const defaultType = this.safeString(this.options, 'defaultType');
115810
115837
  const [marginMode, query] = this.handleMarginModeAndParams('fetchMarketsV2', params);
115811
- const method = (marginMode !== undefined) ? 'publicSpotGetMarginSymbols' : 'publicSpotGetTradesSymbols';
115812
- let promises = [this[method](query), this.publicSwapGetPublicInstruments(params)];
115813
- promises = await Promise.all(promises);
115838
+ const promisesRaw = [];
115839
+ if (marginMode !== undefined) {
115840
+ promisesRaw.push(this.publicSpotGetMarginSymbols(query));
115841
+ }
115842
+ else {
115843
+ promisesRaw.push(this.publicSpotGetTradesSymbols(query));
115844
+ }
115845
+ promisesRaw.push(this.publicSwapGetPublicInstruments(params));
115846
+ const promises = await Promise.all(promisesRaw);
115814
115847
  const spotMarkets = promises[0];
115815
115848
  const swapMarkets = promises[1];
115816
115849
  //
@@ -116088,17 +116121,21 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116088
116121
  await this.loadMarkets();
116089
116122
  let marketType = undefined;
116090
116123
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
116091
- let method = this.getSupportedMapping(marketType, {
116092
- 'spot': 'privateSpotGetSpotAssets',
116093
- 'margin': 'privateSpotGetMarginAssets',
116094
- 'swap': 'privateSwapGetAccountBalance',
116095
- });
116096
116124
  const [marginMode, query] = this.handleMarginModeAndParams('fetchBalance', params);
116097
- if (marginMode !== undefined) {
116098
- method = 'privateSpotGetMarginAssets';
116125
+ let response = undefined;
116126
+ if (marginMode !== undefined || marketType === 'margin') {
116099
116127
  marketType = 'margin';
116128
+ response = await this.privateSpotGetMarginAssets(query);
116129
+ }
116130
+ else if (marketType === 'spot') {
116131
+ response = await this.privateSpotGetSpotAssets(query);
116132
+ }
116133
+ else if (marketType === 'swap') {
116134
+ response = await this.privateSwapGetAccountBalance(query);
116135
+ }
116136
+ else {
116137
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchBalance() not support this market type');
116100
116138
  }
116101
- const response = await this[method](query);
116102
116139
  //
116103
116140
  // spot and margin
116104
116141
  //
@@ -116155,19 +116192,18 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116155
116192
  const market = this.market(symbol);
116156
116193
  const [marketType, query] = this.handleMarketTypeAndParams('fetchOrderBook', market, params);
116157
116194
  const request = {};
116158
- let method = undefined;
116195
+ if (limit !== undefined) {
116196
+ request['limit'] = limit;
116197
+ }
116198
+ let response = undefined;
116159
116199
  if (marketType === 'swap') {
116160
- method = 'publicSwapGetPublicDepth';
116161
116200
  request['instrument_id'] = market['id'];
116201
+ response = await this.publicSwapGetPublicDepth(this.extend(request, query));
116162
116202
  }
116163
116203
  else {
116164
- method = 'publicSpotGetOrderBook';
116165
116204
  request['symbol'] = market['id'];
116205
+ response = await this.publicSpotGetOrderBook(this.extend(request, query));
116166
116206
  }
116167
- if (limit !== undefined) {
116168
- request['limit'] = limit;
116169
- }
116170
- const response = await this[method](this.extend(request, query));
116171
116207
  //
116172
116208
  // spot
116173
116209
  //
@@ -116238,12 +116274,14 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116238
116274
  }
116239
116275
  let type = undefined;
116240
116276
  [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
116241
- let method = 'publicSpotGetTicker';
116242
116277
  const request = {};
116278
+ let response = undefined;
116243
116279
  if (type === 'swap') {
116244
- method = 'publicSwapGetPublicTickers';
116280
+ response = await this.publicSwapGetPublicTickers(this.extend(request, params));
116281
+ }
116282
+ else {
116283
+ response = await this.publicSpotGetTicker(this.extend(request, params));
116245
116284
  }
116246
- const response = await this[method](this.extend(request, params));
116247
116285
  //
116248
116286
  // spot
116249
116287
  //
@@ -116318,16 +116356,16 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116318
116356
  */
116319
116357
  await this.loadMarkets();
116320
116358
  const market = this.market(symbol);
116321
- let method = 'publicSpotGetTicker';
116322
116359
  const request = {};
116360
+ let response = undefined;
116323
116361
  if (market['swap']) {
116324
- method = 'publicSwapGetPublicTicker';
116325
116362
  request['instrument_id'] = market['id'];
116363
+ response = await this.publicSwapGetPublicTicker(this.extend(request, params));
116326
116364
  }
116327
116365
  else {
116328
116366
  request['symbol'] = market['id'];
116367
+ response = await this.publicSpotGetTicker(this.extend(request, params));
116329
116368
  }
116330
- const response = await this[method](this.extend(request, params));
116331
116369
  //
116332
116370
  // spot
116333
116371
  //
@@ -116656,19 +116694,19 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116656
116694
  */
116657
116695
  await this.loadMarkets();
116658
116696
  const market = this.market(symbol);
116659
- let method = 'publicSpotGetTrades';
116660
116697
  const request = {};
116698
+ if (limit !== undefined) {
116699
+ request['limit'] = market['swap'] ? Math.min(limit, 100) : limit;
116700
+ }
116701
+ let response = undefined;
116661
116702
  if (market['swap']) {
116662
- method = 'publicSwapGetPublicTrades';
116663
116703
  request['instrument_id'] = market['id'];
116704
+ response = await this.publicSwapGetPublicTrades(this.extend(request, params));
116664
116705
  }
116665
116706
  else {
116666
116707
  request['symbol'] = market['id'];
116708
+ response = await this.publicSpotGetTrades(this.extend(request, params));
116667
116709
  }
116668
- if (limit !== undefined) {
116669
- request['limit'] = market['swap'] ? Math.min(limit, 100) : limit;
116670
- }
116671
- const response = await this[method](this.extend(request, params));
116672
116710
  //
116673
116711
  // spot
116674
116712
  //
@@ -116761,15 +116799,15 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116761
116799
  */
116762
116800
  await this.loadMarkets();
116763
116801
  const market = this.market(symbol);
116764
- let method = 'publicSpotGetKline';
116765
116802
  const request = {};
116803
+ let response = undefined;
116766
116804
  if (market['swap']) {
116767
- method = 'publicSwapGetPublicCandles';
116768
116805
  request['instrument_id'] = market['id'];
116769
116806
  request['granularity'] = timeframe;
116770
116807
  if (limit !== undefined) {
116771
116808
  request['limit'] = limit;
116772
116809
  }
116810
+ response = await this.publicSwapGetPublicCandles(this.extend(request, params));
116773
116811
  }
116774
116812
  else {
116775
116813
  request['symbol'] = market['id'];
@@ -116787,8 +116825,8 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116787
116825
  const duration = this.parseTimeframe(timeframe);
116788
116826
  request['start_time'] = this.sum(endTime, -limit * duration);
116789
116827
  }
116828
+ response = await this.publicSpotGetKline(this.extend(request, params));
116790
116829
  }
116791
- const response = await this[method](this.extend(request, params));
116792
116830
  //
116793
116831
  // spot
116794
116832
  //
@@ -116893,7 +116931,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
116893
116931
  * @description create a list of trade orders (all orders should be of the same symbol)
116894
116932
  * @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-multiple-order
116895
116933
  * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#batchorder
116896
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
116934
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
116897
116935
  * @param {object} [params] extra parameters specific to the exchange API endpoint
116898
116936
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
116899
116937
  */
@@ -117136,19 +117174,9 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117136
117174
  if (symbol !== undefined) {
117137
117175
  market = this.market(symbol);
117138
117176
  }
117177
+ id = id.toString();
117139
117178
  let marketType = undefined;
117140
117179
  [marketType, params] = this.handleMarketTypeAndParams('cancelOrder', market, params);
117141
- let method = this.getSupportedMapping(marketType, {
117142
- 'spot': 'privateSpotPostSpotOrderCancel',
117143
- 'margin': 'privateSpotPostMarginOrderCancel',
117144
- 'swap': 'privateSwapPostTradeCancelOrder',
117145
- });
117146
- const [marginMode, query] = this.handleMarginModeAndParams('cancelOrder', params);
117147
- if (marginMode !== undefined) {
117148
- method = 'privateSpotPostMarginOrderCancel';
117149
- marketType = 'margin';
117150
- }
117151
- id = id.toString();
117152
117180
  const request = {
117153
117181
  'order_id': id,
117154
117182
  };
@@ -117161,7 +117189,21 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117161
117189
  else {
117162
117190
  request['market'] = marketType;
117163
117191
  }
117164
- const response = await this[method](this.extend(request, query));
117192
+ const [marginMode, query] = this.handleMarginModeAndParams('cancelOrder', params);
117193
+ let response = undefined;
117194
+ if (marginMode !== undefined || marketType === 'margin') {
117195
+ marketType = 'margin';
117196
+ response = await this.privateSpotPostMarginOrderCancel(this.extend(request, query));
117197
+ }
117198
+ else if (marketType === 'spot') {
117199
+ response = await this.privateSpotPostSpotOrderCancel(this.extend(request, query));
117200
+ }
117201
+ else if (marketType === 'swap') {
117202
+ response = await this.privateSwapPostTradeCancelOrder(this.extend(request, query));
117203
+ }
117204
+ else {
117205
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' cancelOrder() not support this market type');
117206
+ }
117165
117207
  //
117166
117208
  // spot and margin
117167
117209
  //
@@ -117408,16 +117450,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117408
117450
  }
117409
117451
  let marketType = undefined;
117410
117452
  [marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
117411
- let method = this.getSupportedMapping(marketType, {
117412
- 'spot': 'privateSpotGetSpotOrderCurrent',
117413
- 'margin': 'privateSpotGetMarginOrderCurrent',
117414
- 'swap': 'privateSwapGetTradeOpenOrders',
117415
- });
117416
117453
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOpenOrders', params);
117417
- if (marginMode !== undefined) {
117418
- method = 'privateSpotGetMarginOrderCurrent';
117419
- marketType = 'margin';
117420
- }
117421
117454
  const request = {};
117422
117455
  const swap = (marketType === 'swap');
117423
117456
  if (swap) {
@@ -117435,7 +117468,20 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117435
117468
  const marketIdRequest = swap ? 'instrument_id' : 'symbol';
117436
117469
  request[marketIdRequest] = market['id'];
117437
117470
  }
117438
- const response = await this[method](this.extend(request, query));
117471
+ let response = undefined;
117472
+ if (marginMode !== undefined || marketType === 'margin') {
117473
+ marketType = 'margin';
117474
+ response = await this.privateSpotGetMarginOrderCurrent(this.extend(request, query));
117475
+ }
117476
+ else if (marketType === 'spot') {
117477
+ response = await this.privateSpotGetSpotOrderCurrent(this.extend(request, query));
117478
+ }
117479
+ else if (marketType === 'swap') {
117480
+ response = await this.privateSwapGetTradeOpenOrders(this.extend(request, query));
117481
+ }
117482
+ else {
117483
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOpenOrders() not support this market type');
117484
+ }
117439
117485
  //
117440
117486
  // spot and margin
117441
117487
  //
@@ -117510,16 +117556,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117510
117556
  }
117511
117557
  let marketType = undefined;
117512
117558
  [marketType, params] = this.handleMarketTypeAndParams('fetchOrders', market, params);
117513
- let method = this.getSupportedMapping(marketType, {
117514
- 'spot': 'privateSpotGetSpotOrderHistory',
117515
- 'margin': 'privateSpotGetMarginOrderHistory',
117516
- 'swap': 'privateSwapGetTradeHistoryOrders',
117517
- });
117518
117559
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOrders', params);
117519
- if (marginMode !== undefined) {
117520
- method = 'privateSpotGetMarginOrderHistory';
117521
- marketType = 'margin';
117522
- }
117523
117560
  const request = {};
117524
117561
  if (marketType === 'swap') {
117525
117562
  if (since !== undefined) {
@@ -117539,7 +117576,20 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117539
117576
  if (limit !== undefined) {
117540
117577
  request['limit'] = limit;
117541
117578
  }
117542
- const response = await this[method](this.extend(request, query));
117579
+ let response = undefined;
117580
+ if (marginMode !== undefined || marketType === 'margin') {
117581
+ marketType = 'margin';
117582
+ response = await this.privateSpotGetMarginOrderHistory(this.extend(request, query));
117583
+ }
117584
+ else if (marketType === 'spot') {
117585
+ response = await this.privateSpotGetSpotOrderHistory(this.extend(request, query));
117586
+ }
117587
+ else if (marketType === 'swap') {
117588
+ response = await this.privateSwapGetTradeHistoryOrders(this.extend(request, query));
117589
+ }
117590
+ else {
117591
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOrders() not support this market type');
117592
+ }
117543
117593
  //
117544
117594
  // spot and margin
117545
117595
  //
@@ -117613,16 +117663,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117613
117663
  }
117614
117664
  let marketType = undefined;
117615
117665
  [marketType, params] = this.handleMarketTypeAndParams('fetchOrder', market, params);
117616
- let method = this.getSupportedMapping(marketType, {
117617
- 'spot': 'privateSpotGetSpotOrder',
117618
- 'margin': 'privateSpotGetMarginOrder',
117619
- 'swap': 'privateSwapGetTradeOrderInfo',
117620
- });
117621
117666
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOrder', params);
117622
- if (marginMode !== undefined) {
117623
- method = 'privateSpotGetMarginOrder';
117624
- marketType = 'margin';
117625
- }
117626
117667
  const request = {
117627
117668
  'order_id': id,
117628
117669
  };
@@ -117634,7 +117675,20 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117634
117675
  else {
117635
117676
  request['market'] = marketType;
117636
117677
  }
117637
- const response = await this[method](this.extend(request, query));
117678
+ let response = undefined;
117679
+ if ((marginMode !== undefined) || (marketType === 'margin')) {
117680
+ marketType = 'margin';
117681
+ response = await this.privateSpotGetMarginOrder(this.extend(request, query));
117682
+ }
117683
+ else if (marketType === 'spot') {
117684
+ response = await this.privateSpotGetSpotOrder(this.extend(request, query));
117685
+ }
117686
+ else if (marketType === 'swap') {
117687
+ response = await this.privateSwapGetTradeOrderInfo(this.extend(request, query));
117688
+ }
117689
+ else {
117690
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOrder() not support this market type');
117691
+ }
117638
117692
  //
117639
117693
  // spot and margin
117640
117694
  //
@@ -117711,16 +117765,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117711
117765
  }
117712
117766
  let marketType = undefined;
117713
117767
  [marketType, params] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
117714
- let method = this.getSupportedMapping(marketType, {
117715
- 'spot': 'privateSpotGetSpotMytrades',
117716
- 'margin': 'privateSpotGetMarginMytrades',
117717
- 'swap': 'privateSwapGetTradeHistoryTrades',
117718
- });
117719
117768
  const [marginMode, query] = this.handleMarginModeAndParams('fetchMyTrades', params);
117720
- if (marginMode !== undefined) {
117721
- method = 'privateSpotGetMarginMytrades';
117722
- marketType = 'margin';
117723
- }
117724
117769
  if (marketType === 'swap') {
117725
117770
  if (since !== undefined) {
117726
117771
  request['start_timestamp'] = since;
@@ -117739,7 +117784,20 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117739
117784
  if (limit !== undefined) {
117740
117785
  request['limit'] = limit;
117741
117786
  }
117742
- const response = await this[method](this.extend(request, query));
117787
+ let response = undefined;
117788
+ if (marginMode !== undefined || marketType === 'margin') {
117789
+ marketType = 'margin';
117790
+ response = await this.privateSpotGetMarginMytrades(this.extend(request, query));
117791
+ }
117792
+ else if (marketType === 'spot') {
117793
+ response = await this.privateSpotGetSpotMytrades(this.extend(request, query));
117794
+ }
117795
+ else if (marketType === 'swap') {
117796
+ response = await this.privateSwapGetTradeHistoryTrades(this.extend(request, query));
117797
+ }
117798
+ else {
117799
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchMyTrades() not support this market type');
117800
+ }
117743
117801
  //
117744
117802
  // spot and margin
117745
117803
  //
@@ -117857,16 +117915,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117857
117915
  const request = {};
117858
117916
  let marketType = undefined;
117859
117917
  [marketType, params] = this.handleMarketTypeAndParams('fetchLedger', undefined, params);
117860
- let method = this.getSupportedMapping(marketType, {
117861
- 'spot': 'privateSpotGetSpotFinancelog',
117862
- 'margin': 'privateSpotGetMarginFinancelog',
117863
- 'swap': 'privateSwapGetAccountFinanceRecord',
117864
- });
117865
117918
  const [marginMode, query] = this.handleMarginModeAndParams('fetchLedger', params);
117866
- if (marginMode !== undefined) {
117867
- method = 'privateSpotGetMarginFinancelog';
117868
- marketType = 'margin';
117869
- }
117870
117919
  if (marketType === 'swap') {
117871
117920
  if (since !== undefined) {
117872
117921
  request['start_timestamp'] = since;
@@ -117887,7 +117936,20 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
117887
117936
  if (limit !== undefined) {
117888
117937
  request['limit'] = limit;
117889
117938
  }
117890
- const response = await this[method](this.extend(request, query));
117939
+ let response = undefined;
117940
+ if (marginMode !== undefined || marketType === 'margin') {
117941
+ marketType = 'margin';
117942
+ response = await this.privateSpotGetMarginFinancelog(this.extend(request, query));
117943
+ }
117944
+ else if (marketType === 'spot') {
117945
+ response = await this.privateSpotGetSpotFinancelog(this.extend(request, query));
117946
+ }
117947
+ else if (marketType === 'swap') {
117948
+ response = await this.privateSwapGetAccountFinanceRecord(this.extend(request, query));
117949
+ }
117950
+ else {
117951
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchLedger() not support this market type');
117952
+ }
117891
117953
  //
117892
117954
  // spot and margin
117893
117955
  //
@@ -118004,8 +118066,13 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
118004
118066
  if (limit !== undefined) {
118005
118067
  request['size'] = Math.min(500, limit);
118006
118068
  }
118007
- const method = (type === 'deposit') ? 'privateSpotGetDepositHistory' : 'privateSpotGetWithdrawHistory';
118008
- const response = await this[method](this.extend(request, params));
118069
+ let response = undefined;
118070
+ if (type === 'deposit') {
118071
+ response = await this.privateSpotGetDepositHistory(this.extend(request, params));
118072
+ }
118073
+ else {
118074
+ response = await this.privateSpotGetWithdrawHistory(this.extend(request, params));
118075
+ }
118009
118076
  //
118010
118077
  // {
118011
118078
  // "code": 200,
@@ -118639,12 +118706,16 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
118639
118706
  const marketIdRequest = (marketType === 'swap') ? 'instrument_id' : 'symbol';
118640
118707
  request[marketIdRequest] = market['id'];
118641
118708
  }
118642
- const method = this.getSupportedMapping(marketType, {
118643
- 'spot': 'privateSpotGetMarginPositions',
118644
- 'margin': 'privateSpotGetMarginPositions',
118645
- 'swap': 'privateSwapGetAccountPositions',
118646
- });
118647
- const response = await this[method](this.extend(request, query));
118709
+ let response = undefined;
118710
+ if (marketType === 'spot' || marketType === 'margin') {
118711
+ response = await this.privateSpotGetMarginPositions(this.extend(request, query));
118712
+ }
118713
+ else if (marketType === 'swap') {
118714
+ response = await this.privateSwapGetAccountPositions(this.extend(request, query));
118715
+ }
118716
+ else {
118717
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchPositions() not support this market type');
118718
+ }
118648
118719
  //
118649
118720
  // swap
118650
118721
  //
@@ -118726,14 +118797,18 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
118726
118797
  if (marginMode !== undefined) {
118727
118798
  marketType = 'margin';
118728
118799
  }
118729
- const method = this.getSupportedMapping(marketType, {
118730
- 'spot': 'privateSpotGetMarginPositions',
118731
- 'margin': 'privateSpotGetMarginPositions',
118732
- 'swap': 'privateSwapGetAccountPositions',
118733
- });
118734
118800
  const marketIdRequest = (marketType === 'swap') ? 'instrument_id' : 'symbol';
118735
118801
  request[marketIdRequest] = market['id'];
118736
- const response = await this[method](this.extend(request, query));
118802
+ let response = undefined;
118803
+ if (marketType === 'spot' || marketType === 'margin') {
118804
+ response = await this.privateSpotGetMarginPositions(this.extend(request, query));
118805
+ }
118806
+ else if (marketType === 'swap') {
118807
+ response = await this.privateSwapGetAccountPositions(this.extend(request, query));
118808
+ }
118809
+ else {
118810
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchPosition() not support this market type');
118811
+ }
118737
118812
  //
118738
118813
  // swap
118739
118814
  //
@@ -119175,7 +119250,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
119175
119250
  * @method
119176
119251
  * @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
119177
119252
  * @param {object} [params] extra parameters specific to the exchange API endpoint
119178
- * @returns {array} the marginMode in lowercase
119253
+ * @returns {Array} the marginMode in lowercase
119179
119254
  */
119180
119255
  const defaultType = this.safeString(this.options, 'defaultType');
119181
119256
  const isMargin = this.safeValue(params, 'margin', false);
@@ -119584,7 +119659,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
119584
119659
  // ---------------------------------------------------------------------------
119585
119660
  /**
119586
119661
  * @class exmo
119587
- * @extends Exchange
119662
+ * @augments Exchange
119588
119663
  */
119589
119664
  class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
119590
119665
  describe() {
@@ -122278,7 +122353,7 @@ class fmfwio extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
122278
122353
 
122279
122354
  /**
122280
122355
  * @class gate
122281
- * @extends Exchange
122356
+ * @augments Exchange
122282
122357
  */
122283
122358
  class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
122284
122359
  describe() {
@@ -129293,7 +129368,7 @@ class gateio extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
129293
129368
  // ---------------------------------------------------------------------------
129294
129369
  /**
129295
129370
  * @class gemini
129296
- * @extends Exchange
129371
+ * @augments Exchange
129297
129372
  */
129298
129373
  class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
129299
129374
  describe() {
@@ -131101,7 +131176,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131101
131176
 
131102
131177
  /**
131103
131178
  * @class hitbtc
131104
- * @extends Exchange
131179
+ * @augments Exchange
131105
131180
  */
131106
131181
  class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
131107
131182
  describe() {
@@ -134627,7 +134702,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
134627
134702
  * @method
134628
134703
  * @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
134629
134704
  * @param {object} [params] extra parameters specific to the exchange API endpoint
134630
- * @returns {array} the marginMode in lowercase
134705
+ * @returns {Array} the marginMode in lowercase
134631
134706
  */
134632
134707
  const defaultType = this.safeString(this.options, 'defaultType');
134633
134708
  const isMargin = this.safeValue(params, 'margin', false);
@@ -134724,7 +134799,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
134724
134799
  // ---------------------------------------------------------------------------
134725
134800
  /**
134726
134801
  * @class hitbtc3
134727
- * @extends Exchange
134802
+ * @augments Exchange
134728
134803
  */
134729
134804
  class hitbtc3 extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
134730
134805
  describe() {
@@ -134758,7 +134833,7 @@ class hitbtc3 extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
134758
134833
  // ---------------------------------------------------------------------------
134759
134834
  /**
134760
134835
  * @class hollaex
134761
- * @extends Exchange
134836
+ * @augments Exchange
134762
134837
  */
134763
134838
  class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
134764
134839
  describe() {
@@ -136650,7 +136725,7 @@ class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
136650
136725
  // ---------------------------------------------------------------------------
136651
136726
  /**
136652
136727
  * @class huobi
136653
- * @extends Exchange
136728
+ * @augments Exchange
136654
136729
  */
136655
136730
  class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
136656
136731
  describe() {
@@ -141896,7 +141971,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
141896
141971
  * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
141897
141972
  * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
141898
141973
  * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-orders
141899
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
141974
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
141900
141975
  * @param {object} [params] extra parameters specific to the exchange API endpoint
141901
141976
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
141902
141977
  */
@@ -145445,7 +145520,7 @@ class huobi extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
145445
145520
  // ---------------------------------------------------------------------------
145446
145521
  /**
145447
145522
  * @class huobijp
145448
- * @extends Exchange
145523
+ * @augments Exchange
145449
145524
  */
145450
145525
  class huobijp extends _abstract_huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
145451
145526
  describe() {
@@ -147380,7 +147455,7 @@ class huobijp extends _abstract_huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
147380
147455
  // ---------------------------------------------------------------------------
147381
147456
  /**
147382
147457
  * @class idex
147383
- * @extends Exchange
147458
+ * @augments Exchange
147384
147459
  */
147385
147460
  class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
147386
147461
  describe() {
@@ -149155,7 +149230,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
149155
149230
  // ---------------------------------------------------------------------------
149156
149231
  /**
149157
149232
  * @class independentreserve
149158
- * @extends Exchange
149233
+ * @augments Exchange
149159
149234
  */
149160
149235
  class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
149161
149236
  describe() {
@@ -149923,7 +149998,7 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
149923
149998
  // ---------------------------------------------------------------------------
149924
149999
  /**
149925
150000
  * @class indodax
149926
- * @extends Exchange
150001
+ * @augments Exchange
149927
150002
  */
149928
150003
  class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
149929
150004
  describe() {
@@ -151005,7 +151080,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
151005
151080
  // ---------------------------------------------------------------------------
151006
151081
  /**
151007
151082
  * @class kraken
151008
- * @extends Exchange
151083
+ * @augments Exchange
151009
151084
  */
151010
151085
  class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
151011
151086
  describe() {
@@ -153349,7 +153424,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
153349
153424
  * @param {object} [params.end] End timestamp, withdrawals created strictly after will be not be included in the response
153350
153425
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
153351
153426
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
153352
- */
153427
+ */
153353
153428
  await this.loadMarkets();
153354
153429
  let paginate = false;
153355
153430
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
@@ -153870,7 +153945,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
153870
153945
  // ---------------------------------------------------------------------------
153871
153946
  /**
153872
153947
  * @class krakenfutures
153873
- * @extends Exchange
153948
+ * @augments Exchange
153874
153949
  */
153875
153950
  class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
153876
153951
  describe() {
@@ -154528,7 +154603,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
154528
154603
  * @method
154529
154604
  * @name krakenfutures#fetchTrades
154530
154605
  * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-trade-history
154531
- * @descriptions Fetch a history of filled trades that this account has made
154606
+ * @description Fetch a history of filled trades that this account has made
154532
154607
  * @param {string} symbol Unified CCXT market symbol
154533
154608
  * @param {int} [since] Timestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until
154534
154609
  * @param {int} [limit] Total number of trades, cannot exceed 100
@@ -154800,7 +154875,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
154800
154875
  * @name krakenfutures#createOrders
154801
154876
  * @description create a list of trade orders
154802
154877
  * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
154803
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
154878
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
154804
154879
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
154805
154880
  */
154806
154881
  await this.loadMarkets();
@@ -156259,7 +156334,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
156259
156334
  // ---------------------------------------------------------------------------
156260
156335
  /**
156261
156336
  * @class kucoin
156262
- * @extends Exchange
156337
+ * @augments Exchange
156263
156338
  */
156264
156339
  class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
156265
156340
  describe() {
@@ -156738,11 +156813,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
156738
156813
  },
156739
156814
  'commonCurrencies': {
156740
156815
  'BIFI': 'BIFIF',
156741
- 'EDGE': 'DADI',
156742
- 'HOT': 'HOTNOW',
156743
- 'TRY': 'Trias',
156744
156816
  'VAI': 'VAIOT',
156745
- 'WAX': 'WAXP',
156746
156817
  },
156747
156818
  'options': {
156748
156819
  'version': 'v1',
@@ -158186,7 +158257,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
158186
158257
  * @description create a list of trade orders
158187
158258
  * @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
158188
158259
  * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
158189
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
158260
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
158190
158261
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158191
158262
  * @param {bool} [params.hf] false, // true for hf orders
158192
158263
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -163095,7 +163166,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
163095
163166
  // ---------------------------------------------------------------------------
163096
163167
  /**
163097
163168
  * @class kuna
163098
- * @extends Exchange
163169
+ * @augments Exchange
163099
163170
  * @description Use the public-key as your apiKey
163100
163171
  */
163101
163172
  class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
@@ -165051,7 +165122,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
165051
165122
  // ---------------------------------------------------------------------------
165052
165123
  /**
165053
165124
  * @class latoken
165054
- * @extends Exchange
165125
+ * @augments Exchange
165055
165126
  */
165056
165127
  class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
165057
165128
  describe() {
@@ -166125,7 +166196,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
166125
166196
  * @param {object} [params] extra parameters specific to the exchange API endpoint
166126
166197
  * @param {boolean} [params.trigger] true if fetching trigger orders
166127
166198
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
166128
- */
166199
+ */
166129
166200
  if (symbol === undefined) {
166130
166201
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
166131
166202
  }
@@ -166795,7 +166866,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
166795
166866
  // ---------------------------------------------------------------------------
166796
166867
  /**
166797
166868
  * @class lbank2
166798
- * @extends Exchange
166869
+ * @augments Exchange
166799
166870
  */
166800
166871
  class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
166801
166872
  describe() {
@@ -169626,7 +169697,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
169626
169697
  // ---------------------------------------------------------------------------
169627
169698
  /**
169628
169699
  * @class luno
169629
- * @extends Exchange
169700
+ * @augments Exchange
169630
169701
  */
169631
169702
  class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
169632
169703
  describe() {
@@ -170679,7 +170750,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
170679
170750
  // ---------------------------------------------------------------------------
170680
170751
  /**
170681
170752
  * @class lykke
170682
- * @extends Exchange
170753
+ * @augments Exchange
170683
170754
  */
170684
170755
  class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
170685
170756
  describe() {
@@ -171980,7 +172051,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
171980
172051
  // ---------------------------------------------------------------------------
171981
172052
  /**
171982
172053
  * @class mercado
171983
- * @extends Exchange
172054
+ * @augments Exchange
171984
172055
  */
171985
172056
  class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
171986
172057
  describe() {
@@ -172888,7 +172959,7 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
172888
172959
  // ---------------------------------------------------------------------------
172889
172960
  /**
172890
172961
  * @class mexc
172891
- * @extends Exchange
172962
+ * @augments Exchange
172892
172963
  */
172893
172964
  class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
172894
172965
  describe() {
@@ -174282,7 +174353,19 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
174282
174353
  }
174283
174354
  let method = this.safeString(this.options, 'fetchTradesMethod', 'spotPublicGetAggTrades');
174284
174355
  method = this.safeString(params, 'method', method); // AggTrades, HistoricalTrades, Trades
174285
- trades = await this[method](this.extend(request, params));
174356
+ params = this.omit(params, ['method']);
174357
+ if (method === 'spotPublicGetAggTrades') {
174358
+ trades = await this.spotPublicGetAggTrades(this.extend(request, params));
174359
+ }
174360
+ else if (method === 'spotPublicGetHistoricalTrades') {
174361
+ trades = await this.spotPublicGetHistoricalTrades(this.extend(request, params));
174362
+ }
174363
+ else if (method === 'spotPublicGetTrades') {
174364
+ trades = await this.spotPublicGetTrades(this.extend(request, params));
174365
+ }
174366
+ else {
174367
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTrades() not support this method');
174368
+ }
174286
174369
  //
174287
174370
  // /trades, /historicalTrades
174288
174371
  //
@@ -174585,12 +174668,19 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
174585
174668
  }
174586
174669
  const priceType = this.safeString(params, 'price', 'default');
174587
174670
  params = this.omit(params, 'price');
174588
- const method = this.getSupportedMapping(priceType, {
174589
- 'default': 'contractPublicGetKlineSymbol',
174590
- 'index': 'contractPublicGetKlineIndexPriceSymbol',
174591
- 'mark': 'contractPublicGetKlineFairPriceSymbol',
174592
- });
174593
- const response = await this[method](this.extend(request, params));
174671
+ let response = undefined;
174672
+ if (priceType === 'default') {
174673
+ response = await this.contractPublicGetKlineSymbol(this.extend(request, params));
174674
+ }
174675
+ else if (priceType === 'index') {
174676
+ response = await this.contractPublicGetKlineIndexPriceSymbol(this.extend(request, params));
174677
+ }
174678
+ else if (priceType === 'mark') {
174679
+ response = await this.contractPublicGetKlineFairPriceSymbol(this.extend(request, params));
174680
+ }
174681
+ else {
174682
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOHLCV() not support this price type, [default, index, mark]');
174683
+ }
174594
174684
  //
174595
174685
  // {
174596
174686
  // "success":true,
@@ -174975,6 +175065,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
174975
175065
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
174976
175066
  * @param {object} [params] extra parameters specific to the exchange API endpoint
174977
175067
  * @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
175068
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
174978
175069
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
174979
175070
  */
174980
175071
  await this.loadMarkets();
@@ -175132,17 +175223,6 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175132
175223
  // 'trend': 1, // Required for trigger order 1: latest price, 2: fair price, 3: index price
175133
175224
  // 'orderType': 1, // Required for trigger order 1: limit order,2:Post Only Maker,3: close or cancel instantly ,4: close or cancel completely,5: Market order
175134
175225
  };
175135
- let method = 'contractPrivatePostOrderSubmit';
175136
- const stopPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
175137
- params = this.omit(params, ['stopPrice', 'triggerPrice']);
175138
- if (stopPrice) {
175139
- method = 'contractPrivatePostPlanorderPlace';
175140
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
175141
- request['triggerType'] = this.safeInteger(params, 'triggerType', 1);
175142
- request['executeCycle'] = this.safeInteger(params, 'executeCycle', 1);
175143
- request['trend'] = this.safeInteger(params, 'trend', 1);
175144
- request['orderType'] = this.safeInteger(params, 'orderType', 1);
175145
- }
175146
175226
  if ((type !== 5) && (type !== 6) && (type !== 'market')) {
175147
175227
  request['price'] = parseFloat(this.priceToPrecision(symbol, price));
175148
175228
  }
@@ -175163,8 +175243,20 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175163
175243
  if (clientOrderId !== undefined) {
175164
175244
  request['externalOid'] = clientOrderId;
175165
175245
  }
175166
- params = this.omit(params, ['clientOrderId', 'externalOid', 'postOnly']);
175167
- const response = await this[method](this.extend(request, params));
175246
+ const stopPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
175247
+ params = this.omit(params, ['clientOrderId', 'externalOid', 'postOnly', 'stopPrice', 'triggerPrice']);
175248
+ let response = undefined;
175249
+ if (stopPrice) {
175250
+ request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
175251
+ request['triggerType'] = this.safeInteger(params, 'triggerType', 1);
175252
+ request['executeCycle'] = this.safeInteger(params, 'executeCycle', 1);
175253
+ request['trend'] = this.safeInteger(params, 'trend', 1);
175254
+ request['orderType'] = this.safeInteger(params, 'orderType', 1);
175255
+ response = await this.contractPrivatePostPlanorderPlace(this.extend(request, params));
175256
+ }
175257
+ else {
175258
+ response = await this.contractPrivatePostOrderSubmit(this.extend(request, params));
175259
+ }
175168
175260
  //
175169
175261
  // Swap
175170
175262
  // {"code":200,"data":"2ff3163e8617443cb9c6fc19d42b1ca4"}
@@ -175181,7 +175273,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175181
175273
  * @name mexc#createOrders
175182
175274
  * @description *spot only* *all orders must have the same symbol* create a list of trade orders
175183
175275
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
175184
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
175276
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
175185
175277
  * @param {object} [params] extra parameters specific to api endpoint
175186
175278
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
175187
175279
  */
@@ -175268,14 +175360,15 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175268
175360
  request['orderId'] = id;
175269
175361
  }
175270
175362
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOrder', params);
175271
- let method = 'spotPrivateGetOrder';
175272
175363
  if (marginMode !== undefined) {
175273
175364
  if (marginMode !== 'isolated') {
175274
175365
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOrder() does not support marginMode ' + marginMode + ' for spot-margin trading');
175275
175366
  }
175276
- method = 'spotPrivateGetMarginOrder';
175367
+ data = await this.spotPrivateGetMarginOrder(this.extend(request, query));
175368
+ }
175369
+ else {
175370
+ data = await this.spotPrivateGetOrder(this.extend(request, query));
175277
175371
  }
175278
- data = await this[method](this.extend(request, query));
175279
175372
  //
175280
175373
  // spot
175281
175374
  //
@@ -175385,20 +175478,22 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175385
175478
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument for spot market');
175386
175479
  }
175387
175480
  const [marginMode, queryInner] = this.handleMarginModeAndParams('fetchOrders', params);
175388
- let method = 'spotPrivateGetAllOrders';
175389
- if (marginMode !== undefined) {
175390
- if (marginMode !== 'isolated') {
175391
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOrders() does not support marginMode ' + marginMode + ' for spot-margin trading');
175392
- }
175393
- method = 'spotPrivateGetMarginAllOrders';
175394
- }
175395
175481
  if (since !== undefined) {
175396
175482
  request['startTime'] = since;
175397
175483
  }
175398
175484
  if (limit !== undefined) {
175399
175485
  request['limit'] = limit;
175400
175486
  }
175401
- const response = await this[method](this.extend(request, queryInner));
175487
+ let response = undefined;
175488
+ if (marginMode !== undefined) {
175489
+ if (marginMode !== 'isolated') {
175490
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOrders() does not support marginMode ' + marginMode + ' for spot-margin trading');
175491
+ }
175492
+ response = await this.spotPrivateGetMarginAllOrders(this.extend(request, queryInner));
175493
+ }
175494
+ else {
175495
+ response = await this.spotPrivateGetAllOrders(this.extend(request, queryInner));
175496
+ }
175402
175497
  //
175403
175498
  // spot
175404
175499
  //
@@ -175615,15 +175710,17 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175615
175710
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument for spot market');
175616
175711
  }
175617
175712
  request['symbol'] = market['id'];
175618
- let method = 'spotPrivateGetOpenOrders';
175619
175713
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOpenOrders', params);
175714
+ let response = undefined;
175620
175715
  if (marginMode !== undefined) {
175621
175716
  if (marginMode !== 'isolated') {
175622
175717
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOpenOrders() does not support marginMode ' + marginMode + ' for spot-margin trading');
175623
175718
  }
175624
- method = 'spotPrivateGetMarginOpenOrders';
175719
+ response = await this.spotPrivateGetMarginOpenOrders(this.extend(request, query));
175720
+ }
175721
+ else {
175722
+ response = await this.spotPrivateGetOpenOrders(this.extend(request, query));
175625
175723
  }
175626
- const response = await this[method](this.extend(request, query));
175627
175724
  //
175628
175725
  // spot
175629
175726
  //
@@ -175758,14 +175855,15 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175758
175855
  else {
175759
175856
  requestInner['orderId'] = id;
175760
175857
  }
175761
- let method = 'spotPrivateDeleteOrder';
175762
175858
  if (marginMode !== undefined) {
175763
175859
  if (marginMode !== 'isolated') {
175764
175860
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' cancelOrder() does not support marginMode ' + marginMode + ' for spot-margin trading');
175765
175861
  }
175766
- method = 'spotPrivateDeleteMarginOrder';
175862
+ data = await this.spotPrivateDeleteMarginOrder(this.extend(requestInner, query));
175863
+ }
175864
+ else {
175865
+ data = await this.spotPrivateDeleteOrder(this.extend(requestInner, query));
175767
175866
  }
175768
- data = await this[method](this.extend(requestInner, query));
175769
175867
  //
175770
175868
  // spot
175771
175869
  //
@@ -175805,7 +175903,16 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175805
175903
  // TODO: PlanorderCancel endpoint has bug atm. waiting for fix.
175806
175904
  let method = this.safeString(this.options, 'cancelOrder', 'contractPrivatePostOrderCancel'); // contractPrivatePostOrderCancel, contractPrivatePostPlanorderCancel
175807
175905
  method = this.safeString(query, 'method', method);
175808
- const response = await this[method]([id]); // the request cannot be changed or extended. This is the only way to send.
175906
+ let response = undefined;
175907
+ if (method === 'contractPrivatePostOrderCancel') {
175908
+ response = await this.contractPrivatePostOrderCancel([id]); // the request cannot be changed or extended. This is the only way to send.
175909
+ }
175910
+ else if (method === 'contractPrivatePostPlanorderCancel') {
175911
+ response = await this.contractPrivatePostPlanorderCancel([id]); // the request cannot be changed or extended. This is the only way to send.
175912
+ }
175913
+ else {
175914
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' cancelOrder() not support this method');
175915
+ }
175809
175916
  //
175810
175917
  // {
175811
175918
  // "success": true,
@@ -175884,14 +175991,16 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175884
175991
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument on spot');
175885
175992
  }
175886
175993
  request['symbol'] = market['id'];
175887
- let method = 'spotPrivateDeleteOpenOrders';
175994
+ let response = undefined;
175888
175995
  if (marginMode !== undefined) {
175889
175996
  if (marginMode !== 'isolated') {
175890
175997
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' cancelAllOrders() does not support marginMode ' + marginMode + ' for spot-margin trading');
175891
175998
  }
175892
- method = 'spotPrivateDeleteMarginOpenOrders';
175999
+ response = await this.spotPrivateDeleteMarginOpenOrders(this.extend(request, query));
176000
+ }
176001
+ else {
176002
+ response = await this.spotPrivateDeleteOpenOrders(this.extend(request, query));
175893
176003
  }
175894
- const response = await this[method](this.extend(request, query));
175895
176004
  //
175896
176005
  // spot
175897
176006
  //
@@ -175938,7 +176047,13 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175938
176047
  // the Planorder endpoints work not only for stop-market orders but also for stop-limit orders that are supposed to have separate endpoint
175939
176048
  let method = this.safeString(this.options, 'cancelAllOrders', 'contractPrivatePostOrderCancelAll');
175940
176049
  method = this.safeString(query, 'method', method);
175941
- const response = await this[method](this.extend(request, query));
176050
+ let response = undefined;
176051
+ if (method === 'contractPrivatePostOrderCancelAll') {
176052
+ response = await this.contractPrivatePostOrderCancelAll(this.extend(request, query));
176053
+ }
176054
+ else if (method === 'contractPrivatePostPlanorderCancelAll') {
176055
+ response = await this.contractPrivatePostPlanorderCancelAll(this.extend(request, query));
176056
+ }
175942
176057
  //
175943
176058
  // {
175944
176059
  // "success": true,
@@ -176452,13 +176567,10 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
176452
176567
  let marketType = undefined;
176453
176568
  const request = {};
176454
176569
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
176455
- let method = this.getSupportedMapping(marketType, {
176456
- 'spot': 'spotPrivateGetAccount',
176457
- 'swap': 'contractPrivateGetAccountAssets',
176458
- 'margin': 'spotPrivateGetMarginIsolatedAccount',
176459
- });
176460
176570
  const marginMode = this.safeString(params, 'marginMode');
176461
176571
  const isMargin = this.safeValue(params, 'margin', false);
176572
+ params = this.omit(params, ['margin', 'marginMode']);
176573
+ let response = undefined;
176462
176574
  if ((marginMode !== undefined) || (isMargin) || (marketType === 'margin')) {
176463
176575
  let parsedSymbols = undefined;
176464
176576
  const symbol = this.safeString(params, 'symbol');
@@ -176473,12 +176585,20 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
176473
176585
  parsedSymbols = market['id'];
176474
176586
  }
176475
176587
  this.checkRequiredArgument('fetchBalance', parsedSymbols, 'symbol or symbols');
176476
- method = 'spotPrivateGetMarginIsolatedAccount';
176477
176588
  marketType = 'margin';
176478
176589
  request['symbols'] = parsedSymbols;
176590
+ params = this.omit(params, ['symbol', 'symbols']);
176591
+ response = await this.spotPrivateGetMarginIsolatedAccount(this.extend(request, params));
176592
+ }
176593
+ else if (marketType === 'spot') {
176594
+ response = await this.spotPrivateGetAccount(this.extend(request, params));
176595
+ }
176596
+ else if (marketType === 'swap') {
176597
+ response = await this.contractPrivateGetAccountAssets(this.extend(request, params));
176598
+ }
176599
+ else {
176600
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchBalance() not support this method');
176479
176601
  }
176480
- params = this.omit(params, ['margin', 'marginMode', 'symbol', 'symbols']);
176481
- const response = await this[method](this.extend(request, params));
176482
176602
  //
176483
176603
  // spot
176484
176604
  //
@@ -178123,7 +178243,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
178123
178243
  * @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
178124
178244
  * @param {object} [params] extra parameters specific to the exchange API endpoint
178125
178245
  * @param {bool} [params.margin] true for trading spot-margin
178126
- * @returns {array} the marginMode in lowercase
178246
+ * @returns {Array} the marginMode in lowercase
178127
178247
  */
178128
178248
  const defaultType = this.safeString(this.options, 'defaultType');
178129
178249
  const isMargin = this.safeValue(params, 'margin', false);
@@ -178258,7 +178378,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
178258
178378
  // ---------------------------------------------------------------------------
178259
178379
  /**
178260
178380
  * @class ndax
178261
- * @extends Exchange
178381
+ * @augments Exchange
178262
178382
  */
178263
178383
  class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
178264
178384
  describe() {
@@ -180717,7 +180837,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
180717
180837
  // ---------------------------------------------------------------------------
180718
180838
  /**
180719
180839
  * @class novadax
180720
- * @extends Exchange
180840
+ * @augments Exchange
180721
180841
  */
180722
180842
  class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
180723
180843
  describe() {
@@ -182271,7 +182391,7 @@ class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
182271
182391
  // ---------------------------------------------------------------------------
182272
182392
  /**
182273
182393
  * @class oceanex
182274
- * @extends Exchange
182394
+ * @augments Exchange
182275
182395
  */
182276
182396
  class oceanex extends _abstract_oceanex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
182277
182397
  describe() {
@@ -183245,7 +183365,7 @@ class oceanex extends _abstract_oceanex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
183245
183365
  // ---------------------------------------------------------------------------
183246
183366
  /**
183247
183367
  * @class okcoin
183248
- * @extends Exchange
183368
+ * @augments Exchange
183249
183369
  */
183250
183370
  class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
183251
183371
  describe() {
@@ -186308,7 +186428,7 @@ class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
186308
186428
  // ---------------------------------------------------------------------------
186309
186429
  /**
186310
186430
  * @class okx
186311
- * @extends Exchange
186431
+ * @augments Exchange
186312
186432
  */
186313
186433
  class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
186314
186434
  describe() {
@@ -189161,7 +189281,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
189161
189281
  * @name okx#createOrders
189162
189282
  * @description create a list of trade orders
189163
189283
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-multiple-orders
189164
- * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
189284
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
189165
189285
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
189166
189286
  */
189167
189287
  await this.loadMarkets();
@@ -189704,7 +189824,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
189704
189824
  * @param {string} symbol unified market symbol
189705
189825
  * @param {object} [params] extra and exchange specific parameters
189706
189826
  * @returns [an order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
189707
- */
189827
+ */
189708
189828
  if (symbol === undefined) {
189709
189829
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
189710
189830
  }
@@ -193480,7 +193600,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
193480
193600
  * EXCHANGE SPECIFIC PARAMETERS
193481
193601
  * @param {boolean} [params.autoCxl] whether any pending orders for closing out needs to be automatically canceled when close position via a market order. false or true, the default is false
193482
193602
  * @param {string} [params.tag] order tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters
193483
- * @returns {[object]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
193603
+ * @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
193484
193604
  */
193485
193605
  await this.loadMarkets();
193486
193606
  const market = this.market(symbol);
@@ -193595,7 +193715,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
193595
193715
  // ---------------------------------------------------------------------------
193596
193716
  /**
193597
193717
  * @class p2b
193598
- * @extends Exchange
193718
+ * @augments Exchange
193599
193719
  */
193600
193720
  class p2b extends _abstract_p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
193601
193721
  describe() {
@@ -194116,7 +194236,6 @@ class p2b extends _abstract_p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
194116
194236
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
194117
194237
  * @param {int} [limit] 1-100, default=50
194118
194238
  * @param {object} [params] extra parameters specific to the exchange API endpoint
194119
- *
194120
194239
  * @param {int} params.lastId order id
194121
194240
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
194122
194241
  */
@@ -194235,7 +194354,6 @@ class p2b extends _abstract_p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
194235
194354
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
194236
194355
  * @param {int} [limit] 1-500, default=50
194237
194356
  * @param {object} [params] extra parameters specific to the exchange API endpoint
194238
- *
194239
194357
  * @param {int} [params.offset] default=0, with this value the last candles are returned
194240
194358
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
194241
194359
  */
@@ -194851,7 +194969,7 @@ class p2b extends _abstract_p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
194851
194969
  // ---------------------------------------------------------------------------
194852
194970
  /**
194853
194971
  * @class paymium
194854
- * @extends Exchange
194972
+ * @augments Exchange
194855
194973
  */
194856
194974
  class paymium extends _abstract_paymium_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
194857
194975
  describe() {
@@ -195458,7 +195576,7 @@ class paymium extends _abstract_paymium_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
195458
195576
  // ----------------------------------------------------------------------------
195459
195577
  /**
195460
195578
  * @class phemex
195461
- * @extends Exchange
195579
+ * @augments Exchange
195462
195580
  */
195463
195581
  class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
195464
195582
  describe() {
@@ -199972,7 +200090,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
199972
200090
  // ---------------------------------------------------------------------------
199973
200091
  /**
199974
200092
  * @class poloniex
199975
- * @extends Exchange
200093
+ * @augments Exchange
199976
200094
  */
199977
200095
  class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
199978
200096
  describe() {
@@ -201198,20 +201316,20 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
201198
201316
  }
201199
201317
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
201200
201318
  /**
201201
- * @method
201202
- * @name poloniex#createOrder
201203
- * @description create a trade order
201204
- * @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
201205
- * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
201206
- * @param {string} symbol unified symbol of the market to create an order in
201207
- * @param {string} type 'market' or 'limit'
201208
- * @param {string} side 'buy' or 'sell'
201209
- * @param {float} amount how much of currency you want to trade in units of base currency
201210
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
201211
- * @param {object} [params] extra parameters specific to the exchange API endpoint
201212
- * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
201213
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201214
- */
201319
+ * @method
201320
+ * @name poloniex#createOrder
201321
+ * @description create a trade order
201322
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
201323
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
201324
+ * @param {string} symbol unified symbol of the market to create an order in
201325
+ * @param {string} type 'market' or 'limit'
201326
+ * @param {string} side 'buy' or 'sell'
201327
+ * @param {float} amount how much of currency you want to trade in units of base currency
201328
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
201329
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
201330
+ * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
201331
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201332
+ */
201215
201333
  await this.loadMarkets();
201216
201334
  const market = this.market(symbol);
201217
201335
  if (!market['spot']) {
@@ -201281,21 +201399,21 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
201281
201399
  }
201282
201400
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
201283
201401
  /**
201284
- * @method
201285
- * @name poloniex#editOrder
201286
- * @description edit a trade order
201287
- * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
201288
- * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
201289
- * @param {string} id order id
201290
- * @param {string} symbol unified symbol of the market to create an order in
201291
- * @param {string} type 'market' or 'limit'
201292
- * @param {string} side 'buy' or 'sell'
201293
- * @param {float} [amount] how much of the currency you want to trade in units of the base currency
201294
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
201295
- * @param {object} [params] extra parameters specific to the exchange API endpoint
201296
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
201297
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201298
- */
201402
+ * @method
201403
+ * @name poloniex#editOrder
201404
+ * @description edit a trade order
201405
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
201406
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
201407
+ * @param {string} id order id
201408
+ * @param {string} symbol unified symbol of the market to create an order in
201409
+ * @param {string} type 'market' or 'limit'
201410
+ * @param {string} side 'buy' or 'sell'
201411
+ * @param {float} [amount] how much of the currency you want to trade in units of the base currency
201412
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
201413
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
201414
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
201415
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201416
+ */
201299
201417
  await this.loadMarkets();
201300
201418
  const market = this.market(symbol);
201301
201419
  if (!market['spot']) {
@@ -201367,16 +201485,16 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
201367
201485
  }
201368
201486
  async cancelAllOrders(symbol = undefined, params = {}) {
201369
201487
  /**
201370
- * @method
201371
- * @name poloniex#cancelAllOrders
201372
- * @description cancel all open orders
201373
- * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
201374
- * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
201375
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
201376
- * @param {object} [params] extra parameters specific to the exchange API endpoint
201377
- * @param {boolean} [params.trigger] true if canceling trigger orders
201378
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
201379
- */
201488
+ * @method
201489
+ * @name poloniex#cancelAllOrders
201490
+ * @description cancel all open orders
201491
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
201492
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
201493
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
201494
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
201495
+ * @param {boolean} [params.trigger] true if canceling trigger orders
201496
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
201497
+ */
201380
201498
  await this.loadMarkets();
201381
201499
  const request = {
201382
201500
  // 'accountTypes': 'SPOT',
@@ -201419,17 +201537,17 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
201419
201537
  }
201420
201538
  async fetchOrder(id, symbol = undefined, params = {}) {
201421
201539
  /**
201422
- * @method
201423
- * @name poloniex#fetchOrder
201424
- * @description fetch an order by it's id
201425
- * @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
201426
- * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
201427
- * @param {string} id order id
201428
- * @param {string} symbol unified market symbol, default is undefined
201429
- * @param {object} [params] extra parameters specific to the exchange API endpoint
201430
- * @param {boolean} [params.trigger] true if fetching a trigger order
201431
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201432
- */
201540
+ * @method
201541
+ * @name poloniex#fetchOrder
201542
+ * @description fetch an order by it's id
201543
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
201544
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
201545
+ * @param {string} id order id
201546
+ * @param {string} symbol unified market symbol, default is undefined
201547
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
201548
+ * @param {boolean} [params.trigger] true if fetching a trigger order
201549
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201550
+ */
201433
201551
  await this.loadMarkets();
201434
201552
  id = id.toString();
201435
201553
  const request = {
@@ -202312,7 +202430,7 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
202312
202430
  // ---------------------------------------------------------------------------
202313
202431
  /**
202314
202432
  * @class poloniexfutures
202315
- * @extends Exchange
202433
+ * @augments Exchange
202316
202434
  */
202317
202435
  class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
202318
202436
  describe() {
@@ -211702,7 +211820,7 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
211702
211820
  // ---------------------------------------------------------------------------
211703
211821
  /**
211704
211822
  * @class bitget
211705
- * @extends Exchange
211823
+ * @augments Exchange
211706
211824
  * @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
211707
211825
  */
211708
211826
  class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
@@ -214831,6 +214949,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
214831
214949
  'watchOrderBook': true,
214832
214950
  'watchOrderBookForSymbols': true,
214833
214951
  'watchOrders': true,
214952
+ 'watchPostions': true,
214834
214953
  'watchTicker': true,
214835
214954
  'watchTickers': false,
214836
214955
  'watchTrades': true,
@@ -215404,6 +215523,210 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
215404
215523
  }
215405
215524
  }
215406
215525
  }
215526
+ async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
215527
+ /**
215528
+ * @method
215529
+ * @name bitmex#watchPositions
215530
+ * @see https://www.bitmex.com/app/wsAPI
215531
+ * @description watch all open positions
215532
+ * @param {string[]|undefined} symbols list of unified market symbols
215533
+ * @param {object} params extra parameters specific to the exchange API endpoint
215534
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
215535
+ */
215536
+ await this.loadMarkets();
215537
+ await this.authenticate();
215538
+ const subscriptionHash = 'position';
215539
+ let messageHash = 'positions';
215540
+ if (!this.isEmpty(symbols)) {
215541
+ messageHash = '::' + symbols.join(',');
215542
+ }
215543
+ const url = this.urls['api']['ws'];
215544
+ const request = {
215545
+ 'op': 'subscribe',
215546
+ 'args': [
215547
+ subscriptionHash,
215548
+ ],
215549
+ };
215550
+ const newPositions = await this.watch(url, messageHash, request, subscriptionHash);
215551
+ if (this.newUpdates) {
215552
+ return newPositions;
215553
+ }
215554
+ return this.filterBySymbolsSinceLimit(this.positions, symbols, since, limit, true);
215555
+ }
215556
+ handlePositions(client, message) {
215557
+ //
215558
+ // partial
215559
+ // {
215560
+ // table: 'position',
215561
+ // action: 'partial',
215562
+ // keys: [ 'account', 'symbol' ],
215563
+ // types: {
215564
+ // account: 'long',
215565
+ // symbol: 'symbol',
215566
+ // currency: 'symbol',
215567
+ // underlying: 'symbol',
215568
+ // quoteCurrency: 'symbol',
215569
+ // commission: 'float',
215570
+ // initMarginReq: 'float',
215571
+ // maintMarginReq: 'float',
215572
+ // riskLimit: 'long',
215573
+ // leverage: 'float',
215574
+ // crossMargin: 'boolean',
215575
+ // deleveragePercentile: 'float',
215576
+ // rebalancedPnl: 'long',
215577
+ // prevRealisedPnl: 'long',
215578
+ // prevUnrealisedPnl: 'long',
215579
+ // openingQty: 'long',
215580
+ // openOrderBuyQty: 'long',
215581
+ // openOrderBuyCost: 'long',
215582
+ // openOrderBuyPremium: 'long',
215583
+ // openOrderSellQty: 'long',
215584
+ // openOrderSellCost: 'long',
215585
+ // openOrderSellPremium: 'long',
215586
+ // currentQty: 'long',
215587
+ // currentCost: 'long',
215588
+ // currentComm: 'long',
215589
+ // realisedCost: 'long',
215590
+ // unrealisedCost: 'long',
215591
+ // grossOpenPremium: 'long',
215592
+ // isOpen: 'boolean',
215593
+ // markPrice: 'float',
215594
+ // markValue: 'long',
215595
+ // riskValue: 'long',
215596
+ // homeNotional: 'float',
215597
+ // foreignNotional: 'float',
215598
+ // posState: 'symbol',
215599
+ // posCost: 'long',
215600
+ // posCross: 'long',
215601
+ // posComm: 'long',
215602
+ // posLoss: 'long',
215603
+ // posMargin: 'long',
215604
+ // posMaint: 'long',
215605
+ // initMargin: 'long',
215606
+ // maintMargin: 'long',
215607
+ // realisedPnl: 'long',
215608
+ // unrealisedPnl: 'long',
215609
+ // unrealisedPnlPcnt: 'float',
215610
+ // unrealisedRoePcnt: 'float',
215611
+ // avgCostPrice: 'float',
215612
+ // avgEntryPrice: 'float',
215613
+ // breakEvenPrice: 'float',
215614
+ // marginCallPrice: 'float',
215615
+ // liquidationPrice: 'float',
215616
+ // bankruptPrice: 'float',
215617
+ // timestamp: 'timestamp'
215618
+ // },
215619
+ // filter: { account: 412475 },
215620
+ // data: [
215621
+ // {
215622
+ // account: 412475,
215623
+ // symbol: 'XBTUSD',
215624
+ // currency: 'XBt',
215625
+ // underlying: 'XBT',
215626
+ // quoteCurrency: 'USD',
215627
+ // commission: 0.00075,
215628
+ // initMarginReq: 0.01,
215629
+ // maintMarginReq: 0.0035,
215630
+ // riskLimit: 20000000000,
215631
+ // leverage: 100,
215632
+ // crossMargin: true,
215633
+ // deleveragePercentile: 1,
215634
+ // rebalancedPnl: 0,
215635
+ // prevRealisedPnl: 0,
215636
+ // prevUnrealisedPnl: 0,
215637
+ // openingQty: 400,
215638
+ // openOrderBuyQty: 0,
215639
+ // openOrderBuyCost: 0,
215640
+ // openOrderBuyPremium: 0,
215641
+ // openOrderSellQty: 0,
215642
+ // openOrderSellCost: 0,
215643
+ // openOrderSellPremium: 0,
215644
+ // currentQty: 400,
215645
+ // currentCost: -912269,
215646
+ // currentComm: 684,
215647
+ // realisedCost: 0,
215648
+ // unrealisedCost: -912269,
215649
+ // grossOpenPremium: 0,
215650
+ // isOpen: true,
215651
+ // markPrice: 43772,
215652
+ // markValue: -913828,
215653
+ // riskValue: 913828,
215654
+ // homeNotional: 0.00913828,
215655
+ // foreignNotional: -400,
215656
+ // posCost: -912269,
215657
+ // posCross: 1559,
215658
+ // posComm: 694,
215659
+ // posLoss: 0,
215660
+ // posMargin: 11376,
215661
+ // posMaint: 3887,
215662
+ // initMargin: 0,
215663
+ // maintMargin: 9817,
215664
+ // realisedPnl: -684,
215665
+ // unrealisedPnl: -1559,
215666
+ // unrealisedPnlPcnt: -0.0017,
215667
+ // unrealisedRoePcnt: -0.1709,
215668
+ // avgCostPrice: 43846.7643,
215669
+ // avgEntryPrice: 43846.7643,
215670
+ // breakEvenPrice: 43880,
215671
+ // marginCallPrice: 20976,
215672
+ // liquidationPrice: 20976,
215673
+ // bankruptPrice: 20941,
215674
+ // timestamp: '2023-12-07T00:09:00.709Z'
215675
+ // }
215676
+ // ]
215677
+ // }
215678
+ // update
215679
+ // {
215680
+ // table: 'position',
215681
+ // action: 'update',
215682
+ // data: [
215683
+ // {
215684
+ // account: 412475,
215685
+ // symbol: 'XBTUSD',
215686
+ // currency: 'XBt',
215687
+ // currentQty: 400,
215688
+ // markPrice: 43772.75,
215689
+ // markValue: -913812,
215690
+ // riskValue: 913812,
215691
+ // homeNotional: 0.00913812,
215692
+ // posCross: 1543,
215693
+ // posComm: 693,
215694
+ // posMargin: 11359,
215695
+ // posMaint: 3886,
215696
+ // maintMargin: 9816,
215697
+ // unrealisedPnl: -1543,
215698
+ // unrealisedRoePcnt: -0.1691,
215699
+ // liquidationPrice: 20976,
215700
+ // timestamp: '2023-12-07T00:09:10.760Z'
215701
+ // }
215702
+ // ]
215703
+ // }
215704
+ //
215705
+ if (this.positions === undefined) {
215706
+ this.positions = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolBySide */ .tU();
215707
+ }
215708
+ const cache = this.positions;
215709
+ const rawPositions = this.safeValue(message, 'data', []);
215710
+ const newPositions = [];
215711
+ for (let i = 0; i < rawPositions.length; i++) {
215712
+ const rawPosition = rawPositions[i];
215713
+ const position = this.parsePosition(rawPosition);
215714
+ newPositions.push(position);
215715
+ cache.append(position);
215716
+ }
215717
+ const messageHashes = this.findMessageHashes(client, 'positions::');
215718
+ for (let i = 0; i < messageHashes.length; i++) {
215719
+ const messageHash = messageHashes[i];
215720
+ const parts = messageHash.split('::');
215721
+ const symbolsString = parts[1];
215722
+ const symbols = symbolsString.split(',');
215723
+ const positions = this.filterByArray(newPositions, 'symbol', symbols, false);
215724
+ if (!this.isEmpty(positions)) {
215725
+ client.resolve(positions, messageHash);
215726
+ }
215727
+ }
215728
+ client.resolve(newPositions, 'positions');
215729
+ }
215407
215730
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
215408
215731
  /**
215409
215732
  * @method
@@ -216186,6 +216509,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
216186
216509
  'order': this.handleOrders,
216187
216510
  'execution': this.handleMyTrades,
216188
216511
  'margin': this.handleBalance,
216512
+ 'position': this.handlePositions,
216189
216513
  };
216190
216514
  const method = this.safeValue(methods, table);
216191
216515
  if (method === undefined) {
@@ -240039,10 +240363,10 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
240039
240363
  * @ignore
240040
240364
  * @method
240041
240365
  * @description Connects to a websocket channel
240042
- * @param {String} name name of the channel
240366
+ * @param {string} name name of the channel
240043
240367
  * @param {string[]} symbols CCXT market symbols
240044
- * @param {Object} [params] extra parameters specific to the krakenfutures api
240045
- * @returns {Object} data from the websocket stream
240368
+ * @param {object} [params] extra parameters specific to the krakenfutures api
240369
+ * @returns {object} data from the websocket stream
240046
240370
  */
240047
240371
  await this.loadMarkets();
240048
240372
  const url = this.urls['api']['ws'];
@@ -240073,10 +240397,10 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
240073
240397
  * @ignore
240074
240398
  * @method
240075
240399
  * @description Connects to a websocket channel
240076
- * @param {String} name name of the channel
240400
+ * @param {string} name name of the channel
240077
240401
  * @param {string[]} symbols CCXT market symbols
240078
- * @param {Object} [params] extra parameters specific to the krakenfutures api
240079
- * @returns {Object} data from the websocket stream
240402
+ * @param {object} [params] extra parameters specific to the krakenfutures api
240403
+ * @returns {object} data from the websocket stream
240080
240404
  */
240081
240405
  await this.loadMarkets();
240082
240406
  await this.authenticate();
@@ -244549,7 +244873,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
244549
244873
  * @param {int} [since] the earliest time in ms to fetch orders for
244550
244874
  * @param {int} [limit] the maximum number of orde structures to retrieve
244551
244875
  * @param {object} [params] extra parameters specific to the exchange API endpoint
244552
- * @params {string|undefined} params.type the type of orders to retrieve, can be 'spot' or 'margin'
244876
+ * @param {string|undefined} params.type the type of orders to retrieve, can be 'spot' or 'margin'
244553
244877
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
244554
244878
  */
244555
244879
  await this.loadMarkets();
@@ -249613,7 +249937,7 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
249613
249937
  * @param {string} [params.stpMode] self-trade prevention, defaults to expire_taker, none: enable self-trade; expire_taker: taker order will be canceled when self-trade happens
249614
249938
  * @param {string} [params.slippageTolerance] used to control the maximum slippage ratio, the value range is greater than 0 and less than 1
249615
249939
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
249616
- */
249940
+ */
249617
249941
  await this.loadMarkets();
249618
249942
  await this.authenticate();
249619
249943
  const market = this.market(symbol);
@@ -250795,9 +251119,9 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
250795
251119
  * @param {string} name name of the channel and suscriptionHash
250796
251120
  * @param {bool} isPrivate true for the authenticated url, false for the public url
250797
251121
  * @param {string} symbol is required for all public channels, not required for private channels (except position)
250798
- * @param {Object} subscription subscription parameters
250799
- * @param {Object} [params] extra parameters specific to the poloniex api
250800
- * @returns {Object} data from the websocket stream
251122
+ * @param {object} subscription subscription parameters
251123
+ * @param {object} [params] extra parameters specific to the poloniex api
251124
+ * @returns {object} data from the websocket stream
250801
251125
  */
250802
251126
  const url = await this.negotiate(isPrivate);
250803
251127
  if (symbol !== undefined) {
@@ -255038,7 +255362,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
255038
255362
  // ---------------------------------------------------------------------------
255039
255363
  /**
255040
255364
  * @class probit
255041
- * @extends Exchange
255365
+ * @augments Exchange
255042
255366
  */
255043
255367
  class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
255044
255368
  describe() {
@@ -255057,7 +255381,10 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
255057
255381
  'option': false,
255058
255382
  'addMargin': false,
255059
255383
  'cancelOrder': true,
255384
+ 'createMarketBuyOrderWithCost': true,
255060
255385
  'createMarketOrder': true,
255386
+ 'createMarketOrderWithCost': false,
255387
+ 'createMarketSellOrderWithCost': false,
255061
255388
  'createOrder': true,
255062
255389
  'createReduceOnlyOrder': false,
255063
255390
  'createStopLimitOrder': false,
@@ -255344,6 +255671,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
255344
255671
  'precision': {
255345
255672
  'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantity_precision'))),
255346
255673
  'price': this.safeNumber(market, 'price_increment'),
255674
+ 'cost': this.parseNumber(this.parsePrecision(this.safeString(market, 'cost_precision'))),
255347
255675
  },
255348
255676
  'limits': {
255349
255677
  'leverage': {
@@ -256216,14 +256544,15 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
256216
256544
  /**
256217
256545
  * @method
256218
256546
  * @name probit#createOrder
256219
- * @see https://docs-en.probit.com/reference/order-1
256220
256547
  * @description create a trade order
256548
+ * @see https://docs-en.probit.com/reference/order-1
256221
256549
  * @param {string} symbol unified symbol of the market to create an order in
256222
256550
  * @param {string} type 'market' or 'limit'
256223
256551
  * @param {string} side 'buy' or 'sell'
256224
- * @param {float} amount how much of currency you want to trade in units of base currency
256552
+ * @param {float} amount how much you want to trade in units of the base currency
256225
256553
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
256226
256554
  * @param {object} [params] extra parameters specific to the exchange API endpoint
256555
+ * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
256227
256556
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
256228
256557
  */
256229
256558
  await this.loadMarkets();
@@ -256241,7 +256570,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
256241
256570
  if (clientOrderId !== undefined) {
256242
256571
  request['client_order_id'] = clientOrderId;
256243
256572
  }
256244
- let costToPrecision = undefined;
256573
+ let quoteAmount = undefined;
256245
256574
  if (type === 'limit') {
256246
256575
  request['limit_price'] = this.priceToPrecision(symbol, price);
256247
256576
  request['quantity'] = this.amountToPrecision(symbol, amount);
@@ -256249,25 +256578,28 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
256249
256578
  else if (type === 'market') {
256250
256579
  // for market buy it requires the amount of quote currency to spend
256251
256580
  if (side === 'buy') {
256252
- let cost = this.safeNumber(params, 'cost');
256253
- const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
256254
- if (createMarketBuyOrderRequiresPrice) {
256255
- if (price !== undefined) {
256256
- if (cost === undefined) {
256257
- const amountString = this.numberToString(amount);
256258
- const priceString = this.numberToString(price);
256259
- cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString));
256260
- }
256581
+ let createMarketBuyOrderRequiresPrice = true;
256582
+ [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
256583
+ const cost = this.safeString(params, 'cost');
256584
+ params = this.omit(params, 'cost');
256585
+ if (cost !== undefined) {
256586
+ quoteAmount = this.costToPrecision(symbol, cost);
256587
+ }
256588
+ else if (createMarketBuyOrderRequiresPrice) {
256589
+ if (price === undefined) {
256590
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
256261
256591
  }
256262
- else if (cost === undefined) {
256263
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options["createMarketBuyOrderRequiresPrice"] = false and supply the total cost value in the "amount" argument or in the "cost" extra parameter (the exchange-specific behaviour)');
256592
+ else {
256593
+ const amountString = this.numberToString(amount);
256594
+ const priceString = this.numberToString(price);
256595
+ const costRequest = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
256596
+ quoteAmount = this.costToPrecision(symbol, costRequest);
256264
256597
  }
256265
256598
  }
256266
256599
  else {
256267
- cost = (cost === undefined) ? amount : cost;
256600
+ quoteAmount = this.costToPrecision(symbol, amount);
256268
256601
  }
256269
- costToPrecision = this.costToPrecision(symbol, cost);
256270
- request['cost'] = costToPrecision;
256602
+ request['cost'] = quoteAmount;
256271
256603
  }
256272
256604
  else {
256273
256605
  request['quantity'] = this.amountToPrecision(symbol, amount);
@@ -256302,7 +256634,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
256302
256634
  // returned by the exchange on market buys
256303
256635
  if ((type === 'market') && (side === 'buy')) {
256304
256636
  order['amount'] = undefined;
256305
- order['cost'] = this.parseNumber(costToPrecision);
256637
+ order['cost'] = this.parseNumber(quoteAmount);
256306
256638
  order['remaining'] = undefined;
256307
256639
  }
256308
256640
  return order;
@@ -256901,7 +257233,7 @@ const version = typeof process !== 'undefined'
256901
257233
  : undefined;
256902
257234
  /**
256903
257235
  *
256904
- * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
257236
+ * @param {object} [options = {}] - An object to customize JSEncrypt behaviour
256905
257237
  * possible parameters are:
256906
257238
  * - default_key_size {number} default: 1024 the key size in bit
256907
257239
  * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
@@ -257349,7 +257681,7 @@ class JSEncryptRSAKey extends _lib_jsbn_rsa_js__WEBPACK_IMPORTED_MODULE_1__/* .R
257349
257681
  /**
257350
257682
  * Check if the object contains the necessary parameters to populate the rsa modulus
257351
257683
  * and public exponent parameters.
257352
- * @param {Object} [obj={}] - An object that may contain the two public key
257684
+ * @param {object} [obj={}] - An object that may contain the two public key
257353
257685
  * parameters
257354
257686
  * @returns {boolean} true if the object contains both the modulus and the public exponent
257355
257687
  * properties (n and e)
@@ -257363,7 +257695,7 @@ class JSEncryptRSAKey extends _lib_jsbn_rsa_js__WEBPACK_IMPORTED_MODULE_1__/* .R
257363
257695
  }
257364
257696
  /**
257365
257697
  * Check if the object contains ALL the parameters of an RSA key.
257366
- * @param {Object} [obj={}] - An object that may contain nine rsa key
257698
+ * @param {object} [obj={}] - An object that may contain nine rsa key
257367
257699
  * parameters
257368
257700
  * @returns {boolean} true if the object contains all the parameters needed
257369
257701
  * @todo check for types of the parameters all the parameters but the public exponent
@@ -257384,7 +257716,7 @@ class JSEncryptRSAKey extends _lib_jsbn_rsa_js__WEBPACK_IMPORTED_MODULE_1__/* .R
257384
257716
  /**
257385
257717
  * Parse the properties of obj in the current rsa object. Obj should AT LEAST
257386
257718
  * include the modulus and public exponent (n, e) parameters.
257387
- * @param {Object} obj - the object containing rsa parameters
257719
+ * @param {object} obj - the object containing rsa parameters
257388
257720
  * @private
257389
257721
  */
257390
257722
  parsePropertiesFrom(obj) {
@@ -265833,7 +266165,7 @@ const bytes = (/* unused pure expression or super */ null && (stringToBytes));
265833
266165
 
265834
266166
  /**
265835
266167
  * @class timex
265836
- * @extends Exchange
266168
+ * @augments Exchange
265837
266169
  */
265838
266170
  class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
265839
266171
  describe() {
@@ -267408,7 +267740,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
267408
267740
  // ---------------------------------------------------------------------------
267409
267741
  /**
267410
267742
  * @class tokocrypto
267411
- * @extends Exchange
267743
+ * @augments Exchange
267412
267744
  */
267413
267745
  class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
267414
267746
  describe() {
@@ -268413,16 +268745,21 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
268413
268745
  const data = this.safeValue(responseInner, 'data', {});
268414
268746
  return this.parseTrades(data, market, since, limit);
268415
268747
  }
268748
+ if (limit !== undefined) {
268749
+ request['limit'] = limit; // default = 500, maximum = 1000
268750
+ }
268416
268751
  const defaultMethod = 'binanceGetTrades';
268417
268752
  const method = this.safeString(this.options, 'fetchTradesMethod', defaultMethod);
268753
+ let response = undefined;
268418
268754
  if ((method === 'binanceGetAggTrades') && (since !== undefined)) {
268419
268755
  request['startTime'] = since;
268420
268756
  // https://github.com/ccxt/ccxt/issues/6400
268421
268757
  // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list
268422
268758
  request['endTime'] = this.sum(since, 3600000);
268759
+ response = await this.binanceGetAggTrades(this.extend(request, params));
268423
268760
  }
268424
- if (limit !== undefined) {
268425
- request['limit'] = limit; // default = 500, maximum = 1000
268761
+ else {
268762
+ response = await this.binanceGetTrades(this.extend(request, params));
268426
268763
  }
268427
268764
  //
268428
268765
  // Caveats:
@@ -268433,7 +268770,6 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
268433
268770
  // - 'tradeId' accepted and returned by this method is "aggregate" trade id
268434
268771
  // which is different from actual trade id
268435
268772
  // - setting both fromId and time window results in error
268436
- const response = await this[method](this.extend(request, params));
268437
268773
  //
268438
268774
  // aggregate trades
268439
268775
  //
@@ -269945,7 +270281,7 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
269945
270281
  // ---------------------------------------------------------------------------
269946
270282
  /**
269947
270283
  * @class upbit
269948
- * @extends Exchange
270284
+ * @augments Exchange
269949
270285
  */
269950
270286
  class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
269951
270287
  describe() {
@@ -271787,7 +272123,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
271787
272123
  // ---------------------------------------------------------------------------
271788
272124
  /**
271789
272125
  * @class wavesexchange
271790
- * @extends Exchange
272126
+ * @augments Exchange
271791
272127
  */
271792
272128
  class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
271793
272129
  describe() {
@@ -274402,7 +274738,7 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
274402
274738
 
274403
274739
  /**
274404
274740
  * @class wazirx
274405
- * @extends Exchange
274741
+ * @augments Exchange
274406
274742
  */
274407
274743
  class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
274408
274744
  describe() {
@@ -275367,7 +275703,7 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
275367
275703
  // ---------------------------------------------------------------------------
275368
275704
  /**
275369
275705
  * @class whitebit
275370
- * @extends Exchange
275706
+ * @augments Exchange
275371
275707
  */
275372
275708
  class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
275373
275709
  describe() {
@@ -277686,7 +278022,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
277686
278022
  // ---------------------------------------------------------------------------
277687
278023
  /**
277688
278024
  * @class woo
277689
- * @extends Exchange
278025
+ * @augments Exchange
277690
278026
  */
277691
278027
  class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
277692
278028
  describe() {
@@ -280335,7 +280671,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
280335
280671
  // ---------------------------------------------------------------------------
280336
280672
  /**
280337
280673
  * @class yobit
280338
- * @extends Exchange
280674
+ * @augments Exchange
280339
280675
  */
280340
280676
  class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
280341
280677
  describe() {
@@ -281659,7 +281995,7 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
281659
281995
  // ---------------------------------------------------------------------------
281660
281996
  /**
281661
281997
  * @class zaif
281662
- * @extends Exchange
281998
+ * @augments Exchange
281663
281999
  */
281664
282000
  class zaif extends _abstract_zaif_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
281665
282001
  describe() {
@@ -282406,7 +282742,7 @@ class zaif extends _abstract_zaif_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
282406
282742
  // ---------------------------------------------------------------------------
282407
282743
  /**
282408
282744
  * @class zonda
282409
- * @extends Exchange
282745
+ * @augments Exchange
282410
282746
  */
282411
282747
  class zonda extends _abstract_zonda_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
282412
282748
  describe() {
@@ -289836,7 +290172,7 @@ SOFTWARE.
289836
290172
 
289837
290173
  //-----------------------------------------------------------------------------
289838
290174
  // this is updated by vss.js when building
289839
- const version = '4.1.85';
290175
+ const version = '4.1.86';
289840
290176
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
289841
290177
  //-----------------------------------------------------------------------------
289842
290178