ccxt 4.1.44 → 4.1.45

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 (206) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +542 -581
  3. package/dist/ccxt.browser.min.js +9 -9
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +1 -3
  6. package/dist/cjs/src/ascendex.js +1 -3
  7. package/dist/cjs/src/bigone.js +2 -6
  8. package/dist/cjs/src/binance.js +16 -12
  9. package/dist/cjs/src/bit2c.js +2 -4
  10. package/dist/cjs/src/bitbns.js +5 -15
  11. package/dist/cjs/src/bitfinex.js +1 -3
  12. package/dist/cjs/src/bitfinex2.js +1 -3
  13. package/dist/cjs/src/bitflyer.js +4 -12
  14. package/dist/cjs/src/bitforex.js +4 -8
  15. package/dist/cjs/src/bithumb.js +4 -10
  16. package/dist/cjs/src/bitmart.js +64 -59
  17. package/dist/cjs/src/bitmex.js +2 -6
  18. package/dist/cjs/src/bitopro.js +6 -16
  19. package/dist/cjs/src/bitrue.js +6 -14
  20. package/dist/cjs/src/bitvavo.js +3 -9
  21. package/dist/cjs/src/btctradeua.js +2 -4
  22. package/dist/cjs/src/bybit.js +4 -0
  23. package/dist/cjs/src/cex.js +2 -4
  24. package/dist/cjs/src/coinbasepro.js +2 -2
  25. package/dist/cjs/src/coinex.js +7 -24
  26. package/dist/cjs/src/coinfalcon.js +1 -3
  27. package/dist/cjs/src/coinmate.js +2 -4
  28. package/dist/cjs/src/coinone.js +2 -6
  29. package/dist/cjs/src/coinsph.js +5 -13
  30. package/dist/cjs/src/currencycom.js +2 -6
  31. package/dist/cjs/src/gate.js +2 -6
  32. package/dist/cjs/src/gemini.js +1 -3
  33. package/dist/cjs/src/hitbtc.js +290 -100
  34. package/dist/cjs/src/hollaex.js +1 -3
  35. package/dist/cjs/src/huobi.js +3 -12
  36. package/dist/cjs/src/huobijp.js +1 -3
  37. package/dist/cjs/src/indodax.js +4 -10
  38. package/dist/cjs/src/kucoinfutures.js +2 -7
  39. package/dist/cjs/src/kuna.js +1 -0
  40. package/dist/cjs/src/luno.js +1 -3
  41. package/dist/cjs/src/mercado.js +7 -17
  42. package/dist/cjs/src/mexc.js +5 -15
  43. package/dist/cjs/src/oceanex.js +2 -4
  44. package/dist/cjs/src/okx.js +14 -19
  45. package/dist/cjs/src/phemex.js +12 -33
  46. package/dist/cjs/src/poloniexfutures.js +2 -6
  47. package/dist/cjs/src/pro/bitmart.js +2 -4
  48. package/dist/cjs/src/pro/bitrue.js +0 -4
  49. package/dist/cjs/src/pro/bitstamp.js +2 -4
  50. package/dist/cjs/src/pro/bitvavo.js +3 -7
  51. package/dist/cjs/src/pro/cex.js +2 -6
  52. package/dist/cjs/src/pro/whitebit.js +3 -7
  53. package/dist/cjs/src/probit.js +2 -6
  54. package/dist/cjs/src/tokocrypto.js +3 -7
  55. package/dist/cjs/src/wavesexchange.js +2 -4
  56. package/dist/cjs/src/wazirx.js +4 -10
  57. package/dist/cjs/src/whitebit.js +3 -7
  58. package/dist/cjs/src/woo.js +0 -3
  59. package/dist/cjs/src/yobit.js +3 -7
  60. package/js/ccxt.d.ts +1 -1
  61. package/js/ccxt.js +1 -1
  62. package/js/src/abstract/bequant.d.ts +37 -7
  63. package/js/src/abstract/binance.d.ts +1 -0
  64. package/js/src/abstract/binancecoinm.d.ts +1 -0
  65. package/js/src/abstract/binanceus.d.ts +1 -0
  66. package/js/src/abstract/binanceusdm.d.ts +1 -0
  67. package/js/src/abstract/bitcoincom.d.ts +37 -7
  68. package/js/src/abstract/bybit.d.ts +3 -0
  69. package/js/src/abstract/fmfwio.d.ts +37 -7
  70. package/js/src/abstract/hitbtc.d.ts +37 -7
  71. package/js/src/abstract/hitbtc3.d.ts +37 -7
  72. package/js/src/abstract/okex.d.ts +6 -1
  73. package/js/src/abstract/okex5.d.ts +6 -1
  74. package/js/src/abstract/okx.d.ts +6 -1
  75. package/js/src/ace.d.ts +2 -2
  76. package/js/src/ace.js +2 -4
  77. package/js/src/alpaca.d.ts +2 -2
  78. package/js/src/ascendex.d.ts +2 -2
  79. package/js/src/ascendex.js +1 -3
  80. package/js/src/bigone.d.ts +2 -2
  81. package/js/src/bigone.js +3 -7
  82. package/js/src/binance.d.ts +2 -2
  83. package/js/src/binance.js +16 -12
  84. package/js/src/bingx.d.ts +2 -2
  85. package/js/src/bit2c.d.ts +2 -2
  86. package/js/src/bit2c.js +3 -5
  87. package/js/src/bitbank.d.ts +2 -2
  88. package/js/src/bitbns.d.ts +2 -2
  89. package/js/src/bitbns.js +5 -15
  90. package/js/src/bitfinex.d.ts +2 -2
  91. package/js/src/bitfinex.js +1 -3
  92. package/js/src/bitfinex2.js +1 -3
  93. package/js/src/bitflyer.d.ts +2 -2
  94. package/js/src/bitflyer.js +4 -12
  95. package/js/src/bitforex.d.ts +2 -2
  96. package/js/src/bitforex.js +5 -9
  97. package/js/src/bitget.d.ts +2 -2
  98. package/js/src/bithumb.d.ts +2 -2
  99. package/js/src/bithumb.js +4 -10
  100. package/js/src/bitmart.d.ts +2 -2
  101. package/js/src/bitmart.js +64 -59
  102. package/js/src/bitmex.js +2 -6
  103. package/js/src/bitopro.d.ts +2 -2
  104. package/js/src/bitopro.js +6 -16
  105. package/js/src/bitpanda.d.ts +2 -2
  106. package/js/src/bitrue.d.ts +2 -2
  107. package/js/src/bitrue.js +6 -14
  108. package/js/src/bitso.d.ts +2 -2
  109. package/js/src/bitstamp.d.ts +2 -2
  110. package/js/src/bitstamp1.d.ts +2 -2
  111. package/js/src/bittrex.d.ts +2 -2
  112. package/js/src/bitvavo.d.ts +2 -2
  113. package/js/src/bitvavo.js +3 -9
  114. package/js/src/bl3p.d.ts +2 -2
  115. package/js/src/blockchaincom.d.ts +4 -4
  116. package/js/src/btcalpha.d.ts +2 -2
  117. package/js/src/btcbox.d.ts +2 -2
  118. package/js/src/btcmarkets.d.ts +2 -2
  119. package/js/src/btctradeua.d.ts +2 -2
  120. package/js/src/btctradeua.js +3 -5
  121. package/js/src/btcturk.d.ts +2 -2
  122. package/js/src/bybit.d.ts +2 -2
  123. package/js/src/bybit.js +4 -0
  124. package/js/src/cex.d.ts +2 -2
  125. package/js/src/cex.js +2 -4
  126. package/js/src/coinbase.d.ts +2 -2
  127. package/js/src/coinbasepro.d.ts +2 -2
  128. package/js/src/coinbasepro.js +2 -2
  129. package/js/src/coincheck.d.ts +2 -2
  130. package/js/src/coinex.js +7 -24
  131. package/js/src/coinfalcon.d.ts +2 -2
  132. package/js/src/coinfalcon.js +2 -4
  133. package/js/src/coinlist.d.ts +12 -12
  134. package/js/src/coinmate.d.ts +3 -3
  135. package/js/src/coinmate.js +3 -5
  136. package/js/src/coinone.d.ts +2 -2
  137. package/js/src/coinone.js +2 -6
  138. package/js/src/coinsph.d.ts +2 -2
  139. package/js/src/coinsph.js +5 -13
  140. package/js/src/coinspot.d.ts +2 -2
  141. package/js/src/cryptocom.d.ts +2 -2
  142. package/js/src/currencycom.d.ts +2 -2
  143. package/js/src/currencycom.js +2 -6
  144. package/js/src/delta.d.ts +2 -2
  145. package/js/src/deribit.d.ts +3 -3
  146. package/js/src/digifinex.d.ts +2 -2
  147. package/js/src/gate.d.ts +2 -2
  148. package/js/src/gate.js +2 -6
  149. package/js/src/gemini.d.ts +3 -3
  150. package/js/src/gemini.js +1 -3
  151. package/js/src/hitbtc.d.ts +3 -0
  152. package/js/src/hitbtc.js +291 -101
  153. package/js/src/hollaex.js +1 -3
  154. package/js/src/huobi.d.ts +2 -2
  155. package/js/src/huobi.js +3 -12
  156. package/js/src/huobijp.d.ts +2 -2
  157. package/js/src/huobijp.js +2 -4
  158. package/js/src/independentreserve.d.ts +2 -2
  159. package/js/src/indodax.d.ts +2 -2
  160. package/js/src/indodax.js +4 -10
  161. package/js/src/kraken.d.ts +2 -2
  162. package/js/src/krakenfutures.d.ts +2 -2
  163. package/js/src/kucoin.d.ts +2 -2
  164. package/js/src/kucoinfutures.d.ts +2 -2
  165. package/js/src/kucoinfutures.js +2 -7
  166. package/js/src/kuna.d.ts +3 -3
  167. package/js/src/kuna.js +1 -0
  168. package/js/src/latoken.d.ts +2 -2
  169. package/js/src/lbank2.d.ts +2 -2
  170. package/js/src/luno.d.ts +2 -2
  171. package/js/src/luno.js +1 -3
  172. package/js/src/lykke.d.ts +2 -2
  173. package/js/src/mercado.d.ts +2 -2
  174. package/js/src/mercado.js +7 -17
  175. package/js/src/mexc.js +5 -15
  176. package/js/src/novadax.d.ts +2 -2
  177. package/js/src/oceanex.d.ts +4 -4
  178. package/js/src/oceanex.js +2 -4
  179. package/js/src/okcoin.d.ts +2 -2
  180. package/js/src/okx.d.ts +2 -2
  181. package/js/src/okx.js +14 -19
  182. package/js/src/paymium.d.ts +2 -2
  183. package/js/src/phemex.js +12 -33
  184. package/js/src/poloniexfutures.d.ts +2 -2
  185. package/js/src/poloniexfutures.js +2 -6
  186. package/js/src/pro/bitmart.js +2 -4
  187. package/js/src/pro/bitrue.js +0 -4
  188. package/js/src/pro/bitstamp.js +3 -5
  189. package/js/src/pro/bitvavo.js +4 -8
  190. package/js/src/pro/cex.js +3 -7
  191. package/js/src/pro/whitebit.js +4 -8
  192. package/js/src/probit.d.ts +2 -2
  193. package/js/src/probit.js +3 -7
  194. package/js/src/timex.d.ts +2 -2
  195. package/js/src/tokocrypto.d.ts +2 -2
  196. package/js/src/tokocrypto.js +4 -8
  197. package/js/src/wavesexchange.js +3 -5
  198. package/js/src/wazirx.d.ts +2 -2
  199. package/js/src/wazirx.js +5 -11
  200. package/js/src/whitebit.d.ts +2 -2
  201. package/js/src/whitebit.js +3 -7
  202. package/js/src/woo.d.ts +2 -2
  203. package/js/src/woo.js +1 -4
  204. package/js/src/yobit.js +3 -7
  205. package/js/src/zaif.d.ts +2 -2
  206. package/package.json +1 -1
@@ -2184,9 +2184,7 @@ class ace extends _abstract_ace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
2184
2184
  * @param {object} [params] extra parameters specific to the ace api endpoint
2185
2185
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2186
2186
  */
2187
- if (symbol === undefined) {
2188
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires the symbol argument');
2189
- }
2187
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
2190
2188
  await this.loadMarkets();
2191
2189
  const market = this.market(symbol);
2192
2190
  const request = {
@@ -5550,9 +5548,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
5550
5548
  * @param {object} [params] extra parameters specific to the ascendex api endpoint
5551
5549
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
5552
5550
  */
5553
- if (symbol === undefined) {
5554
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
5555
- }
5551
+ this.checkRequiredSymbol('cancelOrder', symbol);
5556
5552
  await this.loadMarkets();
5557
5553
  await this.loadAccounts();
5558
5554
  const market = this.market(symbol);
@@ -15868,9 +15864,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
15868
15864
  * @param {object} [params] extra parameters specific to the bigone api endpoint
15869
15865
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
15870
15866
  */
15871
- if (symbol === undefined) {
15872
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
15873
- }
15867
+ this.checkRequiredSymbol('fetchOrders', symbol);
15874
15868
  await this.loadMarkets();
15875
15869
  const market = this.market(symbol);
15876
15870
  const request = {
@@ -15918,10 +15912,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
15918
15912
  * @param {object} [params] extra parameters specific to the bigone api endpoint
15919
15913
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
15920
15914
  */
15915
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
15921
15916
  await this.loadMarkets();
15922
- if (symbol === undefined) {
15923
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
15924
- }
15925
15917
  const market = this.market(symbol);
15926
15918
  const request = {
15927
15919
  'asset_pair_name': market['id'],
@@ -17317,6 +17309,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
17317
17309
  'klines': 0.4,
17318
17310
  'uiKlines': 0.4,
17319
17311
  'ticker/24hr': { 'cost': 0.4, 'noSymbol': 16 },
17312
+ 'ticker': { 'cost': 0.4, 'noSymbol': 16 },
17320
17313
  'ticker/price': { 'cost': 0.4, 'noSymbol': 0.8 },
17321
17314
  'ticker/bookTicker': { 'cost': 0.4, 'noSymbol': 0.8 },
17322
17315
  'exchangeInfo': 4,
@@ -19484,11 +19477,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
19484
19477
  * @name binance#fetchTicker
19485
19478
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
19486
19479
  * @see https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics // spot
19480
+ * @see https://binance-docs.github.io/apidocs/spot/en/#rolling-window-price-change-statistics // spot
19487
19481
  * @see https://binance-docs.github.io/apidocs/futures/en/#24hr-ticker-price-change-statistics // swap
19488
19482
  * @see https://binance-docs.github.io/apidocs/delivery/en/#24hr-ticker-price-change-statistics // future
19489
19483
  * @see https://binance-docs.github.io/apidocs/voptions/en/#24hr-ticker-price-change-statistics // option
19490
19484
  * @param {string} symbol unified symbol of the market to fetch the ticker for
19491
19485
  * @param {object} [params] extra parameters specific to the binance api endpoint
19486
+ * @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
19492
19487
  * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
19493
19488
  */
19494
19489
  await this.loadMarkets();
@@ -19507,7 +19502,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
19507
19502
  response = await this.dapiPublicGetTicker24hr(this.extend(request, params));
19508
19503
  }
19509
19504
  else {
19510
- response = await this.publicGetTicker24hr(this.extend(request, params));
19505
+ const rolling = this.safeValue(params, 'rolling', false);
19506
+ params = this.omit(params, 'rolling');
19507
+ if (rolling) {
19508
+ response = await this.publicGetTicker(this.extend(request, params));
19509
+ }
19510
+ else {
19511
+ response = await this.publicGetTicker24hr(this.extend(request, params));
19512
+ }
19511
19513
  }
19512
19514
  if (Array.isArray(response)) {
19513
19515
  const firstTicker = this.safeValue(response, 0, {});
@@ -21689,9 +21691,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21689
21691
  * @param {object} [params] extra parameters specific to the binance api endpoint
21690
21692
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
21691
21693
  */
21692
- if (symbol === undefined) {
21693
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
21694
- }
21694
+ this.checkRequiredSymbol('fetchOrderTrades', symbol);
21695
21695
  await this.loadMarkets();
21696
21696
  const market = this.market(symbol);
21697
21697
  const type = this.safeString(params, 'type', market['type']);
@@ -24452,9 +24452,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24452
24452
  * @param {object} [params] extra parameters specific to the binance api endpoint
24453
24453
  * @returns {object} response from the exchange
24454
24454
  */
24455
- if (symbol === undefined) {
24456
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
24457
- }
24455
+ this.checkRequiredSymbol('setLeverage', symbol);
24458
24456
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
24459
24457
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
24460
24458
  if ((leverage < 1) || (leverage > 125)) {
@@ -24490,9 +24488,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24490
24488
  * @param {object} [params] extra parameters specific to the binance api endpoint
24491
24489
  * @returns {object} response from the exchange
24492
24490
  */
24493
- if (symbol === undefined) {
24494
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
24495
- }
24491
+ this.checkRequiredSymbol('setMarginMode', symbol);
24496
24492
  //
24497
24493
  // { "code": -4048 , "msg": "Margin type cannot be changed if there exists position." }
24498
24494
  //
@@ -25015,10 +25011,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
25015
25011
  const orderidlistLength = orderidlist.length;
25016
25012
  const origclientorderidlistLength = orderidlist.length;
25017
25013
  if (orderidlistLength > 0) {
25018
- query = query + '&orderidlist=[' + orderidlist.join(',') + ']';
25014
+ query = query + '&' + 'orderidlist=[' + orderidlist.join(',') + ']';
25019
25015
  }
25020
25016
  if (origclientorderidlistLength > 0) {
25021
- query = query + '&origclientorderidlist=[' + origclientorderidlist.join(',') + ']';
25017
+ query = query + '&' + 'origclientorderidlist=[' + origclientorderidlist.join(',') + ']';
25022
25018
  }
25023
25019
  }
25024
25020
  else {
@@ -30023,13 +30019,11 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30023
30019
  * @description fetch all unfilled currently open orders
30024
30020
  * @param {string} symbol unified market symbol
30025
30021
  * @param {int} [since] the earliest time in ms to fetch open orders for
30026
- * @param {int} [limit] the maximum number of open orders structures to retrieve
30022
+ * @param {int} [limit] the maximum number of open order structures to retrieve
30027
30023
  * @param {object} [params] extra parameters specific to the bit2c api endpoint
30028
30024
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
30029
30025
  */
30030
- if (symbol === undefined) {
30031
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
30032
- }
30026
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
30033
30027
  await this.loadMarkets();
30034
30028
  const market = this.market(symbol);
30035
30029
  const request = {
@@ -32165,9 +32159,7 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
32165
32159
  * @param {boolean} [params.trigger] true if cancelling a trigger order
32166
32160
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
32167
32161
  */
32168
- if (symbol === undefined) {
32169
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
32170
- }
32162
+ this.checkRequiredSymbol('cancelOrder', symbol);
32171
32163
  await this.loadMarkets();
32172
32164
  const market = this.market(symbol);
32173
32165
  const isTrigger = this.safeValue2(params, 'trigger', 'stop');
@@ -32195,9 +32187,7 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
32195
32187
  * @param {object} [params] extra parameters specific to the bitbns api endpoint
32196
32188
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
32197
32189
  */
32198
- if (symbol === undefined) {
32199
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
32200
- }
32190
+ this.checkRequiredSymbol('fetchOrder', symbol);
32201
32191
  await this.loadMarkets();
32202
32192
  const market = this.market(symbol);
32203
32193
  const request = {
@@ -32252,9 +32242,7 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
32252
32242
  * @param {boolean} [params.trigger] true if fetching trigger orders
32253
32243
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
32254
32244
  */
32255
- if (symbol === undefined) {
32256
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
32257
- }
32245
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
32258
32246
  await this.loadMarkets();
32259
32247
  const market = this.market(symbol);
32260
32248
  const isTrigger = this.safeValue2(params, 'trigger', 'stop');
@@ -32382,9 +32370,7 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
32382
32370
  * @param {object} [params] extra parameters specific to the bitbns api endpoint
32383
32371
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
32384
32372
  */
32385
- if (symbol === undefined) {
32386
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
32387
- }
32373
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
32388
32374
  await this.loadMarkets();
32389
32375
  const market = this.market(symbol);
32390
32376
  const request = {
@@ -32450,9 +32436,7 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
32450
32436
  * @param {object} [params] extra parameters specific to the bitbns api endpoint
32451
32437
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
32452
32438
  */
32453
- if (symbol === undefined) {
32454
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
32455
- }
32439
+ this.checkRequiredSymbol('fetchTrades', symbol);
32456
32440
  await this.loadMarkets();
32457
32441
  const market = this.market(symbol);
32458
32442
  const request = {
@@ -33789,9 +33773,7 @@ class bitfinex extends _abstract_bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
33789
33773
  * @param {object} [params] extra parameters specific to the bitfinex api endpoint
33790
33774
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
33791
33775
  */
33792
- if (symbol === undefined) {
33793
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a `symbol` argument');
33794
- }
33776
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
33795
33777
  await this.loadMarkets();
33796
33778
  const market = this.market(symbol);
33797
33779
  const request = {
@@ -36344,9 +36326,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
36344
36326
  * @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
36345
36327
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
36346
36328
  */
36347
- if (symbol === undefined) {
36348
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
36349
- }
36329
+ this.checkRequiredSymbol('fetchOrderTrades', symbol);
36350
36330
  await this.loadMarkets();
36351
36331
  const market = this.market(symbol);
36352
36332
  const orderId = parseInt(id);
@@ -38021,9 +38001,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
38021
38001
  * @param {object} [params] extra parameters specific to the bitflyer api endpoint
38022
38002
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
38023
38003
  */
38024
- if (symbol === undefined) {
38025
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a `symbol` argument');
38026
- }
38004
+ this.checkRequiredSymbol('cancelOrder', symbol);
38027
38005
  await this.loadMarkets();
38028
38006
  const request = {
38029
38007
  'product_code': this.marketId(symbol),
@@ -38099,9 +38077,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
38099
38077
  * @param {object} [params] extra parameters specific to the bitflyer api endpoint
38100
38078
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
38101
38079
  */
38102
- if (symbol === undefined) {
38103
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a `symbol` argument');
38104
- }
38080
+ this.checkRequiredSymbol('fetchOrders', symbol);
38105
38081
  await this.loadMarkets();
38106
38082
  const market = this.market(symbol);
38107
38083
  const request = {
@@ -38159,9 +38135,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
38159
38135
  * @param {object} [params] extra parameters specific to the bitflyer api endpoint
38160
38136
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
38161
38137
  */
38162
- if (symbol === undefined) {
38163
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a `symbol` argument');
38164
- }
38138
+ this.checkRequiredSymbol('fetchOrder', symbol);
38165
38139
  const orders = await this.fetchOrders(symbol);
38166
38140
  const ordersById = this.indexBy(orders, 'id');
38167
38141
  if (id in ordersById) {
@@ -38181,9 +38155,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
38181
38155
  * @param {object} [params] extra parameters specific to the bitflyer api endpoint
38182
38156
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
38183
38157
  */
38184
- if (symbol === undefined) {
38185
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a `symbol` argument');
38186
- }
38158
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
38187
38159
  await this.loadMarkets();
38188
38160
  const market = this.market(symbol);
38189
38161
  const request = {
@@ -39201,13 +39173,11 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
39201
39173
  * @description fetch all unfilled currently open orders
39202
39174
  * @param {string} symbol unified market symbol
39203
39175
  * @param {int} [since] the earliest time in ms to fetch open orders for
39204
- * @param {int} [limit] the maximum number of open orders structures to retrieve
39176
+ * @param {int} [limit] the maximum number of open order structures to retrieve
39205
39177
  * @param {object} [params] extra parameters specific to the bitforex api endpoint
39206
39178
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
39207
39179
  */
39208
- if (symbol === undefined) {
39209
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
39210
- }
39180
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
39211
39181
  await this.loadMarkets();
39212
39182
  const market = this.market(symbol);
39213
39183
  const request = {
@@ -39224,13 +39194,11 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
39224
39194
  * @description fetches information on multiple closed orders made by the user
39225
39195
  * @param {string} symbol unified market symbol of the market orders were made in
39226
39196
  * @param {int} [since] the earliest time in ms to fetch orders for
39227
- * @param {int} [limit] the maximum number of orde structures to retrieve
39197
+ * @param {int} [limit] the maximum number of order structures to retrieve
39228
39198
  * @param {object} [params] extra parameters specific to the bitforex api endpoint
39229
39199
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
39230
39200
  */
39231
- if (symbol === undefined) {
39232
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
39233
- }
39201
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
39234
39202
  await this.loadMarkets();
39235
39203
  const market = this.market(symbol);
39236
39204
  const request = {
@@ -46855,9 +46823,7 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
46855
46823
  * @param {object} [params] extra parameters specific to the bithumb api endpoint
46856
46824
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
46857
46825
  */
46858
- if (symbol === undefined) {
46859
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
46860
- }
46826
+ this.checkRequiredSymbol('fetchOrder', symbol);
46861
46827
  await this.loadMarkets();
46862
46828
  const market = this.market(symbol);
46863
46829
  const request = {
@@ -47011,13 +46977,11 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
47011
46977
  * @description fetch all unfilled currently open orders
47012
46978
  * @param {string} symbol unified market symbol
47013
46979
  * @param {int} [since] the earliest time in ms to fetch open orders for
47014
- * @param {int} [limit] the maximum number of open orders structures to retrieve
46980
+ * @param {int} [limit] the maximum number of open order structures to retrieve
47015
46981
  * @param {object} [params] extra parameters specific to the bithumb api endpoint
47016
46982
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
47017
46983
  */
47018
- if (symbol === undefined) {
47019
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
47020
- }
46984
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
47021
46985
  await this.loadMarkets();
47022
46986
  const market = this.market(symbol);
47023
46987
  if (limit === undefined) {
@@ -47062,13 +47026,11 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
47062
47026
  * @param {object} [params] extra parameters specific to the bithumb api endpoint
47063
47027
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
47064
47028
  */
47029
+ this.checkRequiredSymbol('cancelOrder', symbol);
47065
47030
  const side_in_params = ('side' in params);
47066
47031
  if (!side_in_params) {
47067
47032
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a `side` parameter (sell or buy)');
47068
47033
  }
47069
- if (symbol === undefined) {
47070
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a `symbol` argument');
47071
- }
47072
47034
  const market = this.market(symbol);
47073
47035
  const side = (params['side'] === 'buy') ? 'bid' : 'ask';
47074
47036
  params = this.omit(params, ['side', 'currency']);
@@ -48686,15 +48648,15 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48686
48648
  //
48687
48649
  // spot
48688
48650
  //
48689
- // {
48690
- // "last_price":"0.034987",
48691
- // "timestamp":1598787420,
48692
- // "volume":"1.0198",
48693
- // "open":"0.035007",
48694
- // "close":"0.034987",
48695
- // "high":"0.035007",
48696
- // "low":"0.034986"
48697
- // }
48651
+ // [
48652
+ // "1699512060", // timestamp
48653
+ // "36746.49", // open
48654
+ // "36758.71", // high
48655
+ // "36736.13", // low
48656
+ // "36755.99", // close
48657
+ // "2.83965", // base volume
48658
+ // "104353.57" // quote volume
48659
+ // ]
48698
48660
  //
48699
48661
  // swap
48700
48662
  //
@@ -48711,7 +48673,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48711
48673
  //
48712
48674
  // [
48713
48675
  // 1631056350, // timestamp
48714
- // "46532.83", // oopen
48676
+ // "46532.83", // open
48715
48677
  // "46555.71", // high
48716
48678
  // "46511.41", // low
48717
48679
  // "46555.71", // close
@@ -48731,10 +48693,10 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48731
48693
  else {
48732
48694
  return [
48733
48695
  this.safeTimestamp(ohlcv, 'timestamp'),
48734
- this.safeNumber2(ohlcv, 'open', 'open_price'),
48735
- this.safeNumber2(ohlcv, 'high', 'high_price'),
48736
- this.safeNumber2(ohlcv, 'low', 'low_price'),
48737
- this.safeNumber2(ohlcv, 'close', 'close_price'),
48696
+ this.safeNumber(ohlcv, 'open_price'),
48697
+ this.safeNumber(ohlcv, 'high_price'),
48698
+ this.safeNumber(ohlcv, 'low_price'),
48699
+ this.safeNumber(ohlcv, 'close_price'),
48738
48700
  this.safeNumber(ohlcv, 'volume'),
48739
48701
  ];
48740
48702
  }
@@ -48744,21 +48706,27 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48744
48706
  * @method
48745
48707
  * @name bitmart#fetchOHLCV
48746
48708
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
48747
- * @see https://developer-pro.bitmart.com/en/spot/#get-k-line
48709
+ * @see https://developer-pro.bitmart.com/en/spot/#get-latest-k-line-v3
48748
48710
  * @see https://developer-pro.bitmart.com/en/futures/#get-k-line
48749
48711
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
48750
48712
  * @param {string} timeframe the length of time each candle represents
48751
48713
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
48752
48714
  * @param {int} [limit] the maximum amount of candles to fetch
48753
48715
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
48716
+ * @param {int} [params.until] timestamp of the latest candle in ms
48717
+ * @param {boolean} [params.paginate] *spot only* 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)
48754
48718
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
48755
48719
  */
48756
48720
  await this.loadMarkets();
48721
+ let paginate = false;
48722
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
48723
+ if (paginate) {
48724
+ return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 200);
48725
+ }
48757
48726
  const market = this.market(symbol);
48758
- const type = market['type'];
48759
48727
  const duration = this.parseTimeframe(timeframe);
48760
48728
  const parsedTimeframe = this.safeInteger(this.timeframes, timeframe);
48761
- const request = {
48729
+ let request = {
48762
48730
  'symbol': market['id'],
48763
48731
  };
48764
48732
  if (parsedTimeframe !== undefined) {
@@ -48767,46 +48735,54 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48767
48735
  else {
48768
48736
  request['step'] = timeframe;
48769
48737
  }
48770
- const maxLimit = 500;
48771
- if (limit === undefined) {
48772
- limit = maxLimit;
48773
- }
48774
- limit = Math.min(maxLimit, limit);
48775
- const now = this.parseToInt(this.milliseconds() / 1000);
48776
- const fromRequest = (type === 'spot') ? 'from' : 'start_time';
48777
- const toRequest = (type === 'spot') ? 'to' : 'end_time';
48778
- if (since === undefined) {
48779
- const start = now - limit * duration;
48780
- request[fromRequest] = start;
48781
- request[toRequest] = now;
48738
+ if (market['spot']) {
48739
+ [request, params] = this.handleUntilOption('before', request, params, 0.001);
48740
+ if (limit !== undefined) {
48741
+ request['limit'] = limit;
48742
+ }
48743
+ if (since !== undefined) {
48744
+ request['after'] = this.parseToInt((since / 1000)) - 1;
48745
+ }
48782
48746
  }
48783
48747
  else {
48784
- const start = this.parseToInt((since / 1000)) - 1;
48785
- const end = this.sum(start, limit * duration);
48786
- request[fromRequest] = start;
48787
- request[toRequest] = Math.min(end, now);
48748
+ const maxLimit = 1200;
48749
+ if (limit === undefined) {
48750
+ limit = maxLimit;
48751
+ }
48752
+ limit = Math.min(maxLimit, limit);
48753
+ const now = this.parseToInt(this.milliseconds() / 1000);
48754
+ if (since === undefined) {
48755
+ const start = now - limit * duration;
48756
+ request['start_time'] = start;
48757
+ request['end_time'] = now;
48758
+ }
48759
+ else {
48760
+ const start = this.parseToInt((since / 1000)) - 1;
48761
+ const end = this.sum(start, limit * duration);
48762
+ request['start_time'] = start;
48763
+ request['end_time'] = Math.min(end, now);
48764
+ }
48765
+ [request, params] = this.handleUntilOption('end_time', request, params, 0.001);
48788
48766
  }
48789
48767
  let response = undefined;
48790
- if (type === 'swap') {
48768
+ if (market['swap']) {
48791
48769
  response = await this.publicGetContractPublicKline(this.extend(request, params));
48792
48770
  }
48793
48771
  else {
48794
- response = await this.publicGetSpotQuotationV3Klines(this.extend(request, params));
48772
+ response = await this.publicGetSpotQuotationV3LiteKlines(this.extend(request, params));
48795
48773
  }
48796
48774
  //
48797
48775
  // spot
48798
48776
  //
48799
48777
  // {
48800
- // "message":"OK",
48801
- // "code":1000,
48802
- // "trace":"80d86378-ab4e-4c70-819e-b42146cf87ad",
48803
- // "data":{
48804
- // "klines":[
48805
- // {"last_price":"0.034987","timestamp":1598787420,"volume":"1.0198","open":"0.035007","close":"0.034987","high":"0.035007","low":"0.034986"},
48806
- // {"last_price":"0.034986","timestamp":1598787480,"volume":"0.3959","open":"0.034982","close":"0.034986","high":"0.034986","low":"0.034980"},
48807
- // {"last_price":"0.034978","timestamp":1598787540,"volume":"0.3259","open":"0.034987","close":"0.034978","high":"0.034987","low":"0.034977"},
48808
- // ]
48809
- // }
48778
+ // "code": 1000,
48779
+ // "message": "success",
48780
+ // "data": [
48781
+ // ["1699512060","36746.49","36758.71","36736.13","36755.99","2.83965","104353.57"],
48782
+ // ["1699512120","36756.00","36758.70","36737.14","36737.63","1.96070","72047.10"],
48783
+ // ["1699512180","36737.63","36740.45","36737.62","36740.44","0.63194","23217.62"]
48784
+ // ],
48785
+ // "trace": "6591fc7b508845359d5fa442e3b3a4fb.72.16995122398750695"
48810
48786
  // }
48811
48787
  //
48812
48788
  // swap
@@ -48828,8 +48804,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
48828
48804
  // "trace": "96c989db-e0f5-46f5-bba6-60cfcbde699b"
48829
48805
  // }
48830
48806
  //
48831
- const data = this.safeValue(response, 'data', {});
48832
- const ohlcv = this.safeValue(data, 'klines', data);
48807
+ const ohlcv = this.safeValue(response, 'data', []);
48833
48808
  return this.parseOHLCVs(ohlcv, market, timeframe, since, limit);
48834
48809
  }
48835
48810
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -49588,9 +49563,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
49588
49563
  return response;
49589
49564
  }
49590
49565
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
49591
- if (symbol === undefined) {
49592
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol argument');
49593
- }
49566
+ this.checkRequiredSymbol('fetchOrdersByStatus', symbol);
49594
49567
  await this.loadMarkets();
49595
49568
  const market = this.market(symbol);
49596
49569
  if (!market['spot']) {
@@ -50278,10 +50251,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
50278
50251
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
50279
50252
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
50280
50253
  */
50254
+ this.checkRequiredSymbol('repayMargin', symbol);
50281
50255
  await this.loadMarkets();
50282
- if (symbol === undefined) {
50283
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
50284
- }
50285
50256
  const market = this.market(symbol);
50286
50257
  const currency = this.currency(code);
50287
50258
  const request = {
@@ -50321,10 +50292,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
50321
50292
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
50322
50293
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
50323
50294
  */
50295
+ this.checkRequiredSymbol('borrowMargin', symbol);
50324
50296
  await this.loadMarkets();
50325
- if (symbol === undefined) {
50326
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
50327
- }
50328
50297
  const market = this.market(symbol);
50329
50298
  const currency = this.currency(code);
50330
50299
  const request = {
@@ -50780,9 +50749,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
50780
50749
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
50781
50750
  * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
50782
50751
  */
50783
- if (symbol === undefined) {
50784
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
50785
- }
50752
+ this.checkRequiredSymbol('fetchBorrowInterest', symbol);
50786
50753
  await this.loadMarkets();
50787
50754
  const market = this.market(symbol);
50788
50755
  const request = {
@@ -53795,9 +53762,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
53795
53762
  * @param {object} [params] extra parameters specific to the bitmex api endpoint
53796
53763
  * @returns {object} response from the exchange
53797
53764
  */
53798
- if (symbol === undefined) {
53799
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
53800
- }
53765
+ this.checkRequiredSymbol('setLeverage', symbol);
53801
53766
  if ((leverage < 0.01) || (leverage > 100)) {
53802
53767
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' leverage should be between 0.01 and 100');
53803
53768
  }
@@ -53822,9 +53787,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
53822
53787
  * @param {object} [params] extra parameters specific to the bitmex api endpoint
53823
53788
  * @returns {object} response from the exchange
53824
53789
  */
53825
- if (symbol === undefined) {
53826
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
53827
- }
53790
+ this.checkRequiredSymbol('setMarginMode', symbol);
53828
53791
  marginMode = marginMode.toLowerCase();
53829
53792
  if (marginMode !== 'isolated' && marginMode !== 'cross') {
53830
53793
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
@@ -55197,9 +55160,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55197
55160
  * @param {object} [params] extra parameters specific to the bitopro api endpoint
55198
55161
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
55199
55162
  */
55200
- if (symbol === undefined) {
55201
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires the symbol argument');
55202
- }
55163
+ this.checkRequiredSymbol('cancelOrder', symbol);
55203
55164
  await this.loadMarkets();
55204
55165
  const market = this.market(symbol);
55205
55166
  const request = {
@@ -55229,9 +55190,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55229
55190
  * @param {object} [params] extra parameters specific to the bitopro api endpoint
55230
55191
  * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
55231
55192
  */
55232
- if (symbol === undefined) {
55233
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
55234
- }
55193
+ this.checkRequiredSymbol('cancelOrders', symbol);
55235
55194
  await this.loadMarkets();
55236
55195
  const market = this.market(symbol);
55237
55196
  const id = market['uppercaseId'];
@@ -55296,9 +55255,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55296
55255
  * @param {object} [params] extra parameters specific to the bitopro api endpoint
55297
55256
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
55298
55257
  */
55299
- if (symbol === undefined) {
55300
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires the symbol argument');
55301
- }
55258
+ this.checkRequiredSymbol('fetchOrder', symbol);
55302
55259
  await this.loadMarkets();
55303
55260
  const market = this.market(symbol);
55304
55261
  const request = {
@@ -55339,13 +55296,11 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55339
55296
  * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
55340
55297
  * @param {string} symbol unified market symbol of the market orders were made in
55341
55298
  * @param {int} [since] the earliest time in ms to fetch orders for
55342
- * @param {int} [limit] the maximum number of orde structures to retrieve
55299
+ * @param {int} [limit] the maximum number of order structures to retrieve
55343
55300
  * @param {object} [params] extra parameters specific to the bitopro api endpoint
55344
55301
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
55345
55302
  */
55346
- if (symbol === undefined) {
55347
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires the symbol argument');
55348
- }
55303
+ this.checkRequiredSymbol('fetchOrders', symbol);
55349
55304
  await this.loadMarkets();
55350
55305
  const market = this.market(symbol);
55351
55306
  const request = {
@@ -55429,9 +55384,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55429
55384
  * @param {object} [params] extra parameters specific to the bitopro api endpoint
55430
55385
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
55431
55386
  */
55432
- if (symbol === undefined) {
55433
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires the symbol argument');
55434
- }
55387
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
55435
55388
  await this.loadMarkets();
55436
55389
  const market = this.market(symbol);
55437
55390
  const request = {
@@ -59251,9 +59204,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
59251
59204
  * @param {object} [params] extra parameters specific to the bitrue api endpoint
59252
59205
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
59253
59206
  */
59254
- if (symbol === undefined) {
59255
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
59256
- }
59207
+ this.checkRequiredSymbol('fetchOrder', symbol);
59257
59208
  await this.loadMarkets();
59258
59209
  const market = this.market(symbol);
59259
59210
  const request = {
@@ -59277,13 +59228,11 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
59277
59228
  * @description fetches information on multiple closed orders made by the user
59278
59229
  * @param {string} symbol unified market symbol of the market orders were made in
59279
59230
  * @param {int} [since] the earliest time in ms to fetch orders for
59280
- * @param {int} [limit] the maximum number of orde structures to retrieve
59231
+ * @param {int} [limit] the maximum number of order structures to retrieve
59281
59232
  * @param {object} [params] extra parameters specific to the bitrue api endpoint
59282
59233
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
59283
59234
  */
59284
- if (symbol === undefined) {
59285
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
59286
- }
59235
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
59287
59236
  await this.loadMarkets();
59288
59237
  const market = this.market(symbol);
59289
59238
  const request = {
@@ -59331,13 +59280,11 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
59331
59280
  * @description fetch all unfilled currently open orders
59332
59281
  * @param {string} symbol unified market symbol
59333
59282
  * @param {int} [since] the earliest time in ms to fetch open orders for
59334
- * @param {int} [limit] the maximum number of open orders structures to retrieve
59283
+ * @param {int} [limit] the maximum number of open order structures to retrieve
59335
59284
  * @param {object} [params] extra parameters specific to the bitrue api endpoint
59336
59285
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
59337
59286
  */
59338
- if (symbol === undefined) {
59339
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
59340
- }
59287
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
59341
59288
  await this.loadMarkets();
59342
59289
  const market = this.market(symbol);
59343
59290
  const request = {
@@ -59378,9 +59325,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
59378
59325
  * @param {object} [params] extra parameters specific to the bitrue api endpoint
59379
59326
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
59380
59327
  */
59381
- if (symbol === undefined) {
59382
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
59383
- }
59328
+ this.checkRequiredSymbol('cancelOrder', symbol);
59384
59329
  await this.loadMarkets();
59385
59330
  const market = this.market(symbol);
59386
59331
  const origClientOrderId = this.safeValue2(params, 'origClientOrderId', 'clientOrderId');
@@ -67796,9 +67741,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
67796
67741
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
67797
67742
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
67798
67743
  */
67799
- if (symbol === undefined) {
67800
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
67801
- }
67744
+ this.checkRequiredSymbol('cancelOrder', symbol);
67802
67745
  await this.loadMarkets();
67803
67746
  const market = this.market(symbol);
67804
67747
  const request = {
@@ -67848,9 +67791,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
67848
67791
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
67849
67792
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
67850
67793
  */
67851
- if (symbol === undefined) {
67852
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
67853
- }
67794
+ this.checkRequiredSymbol('fetchOrder', symbol);
67854
67795
  await this.loadMarkets();
67855
67796
  const market = this.market(symbol);
67856
67797
  const request = {
@@ -68165,9 +68106,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
68165
68106
  * @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)
68166
68107
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
68167
68108
  */
68168
- if (symbol === undefined) {
68169
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
68170
- }
68109
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
68171
68110
  await this.loadMarkets();
68172
68111
  let paginate = false;
68173
68112
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
@@ -73523,13 +73462,11 @@ class btctradeua extends _abstract_btctradeua_js__WEBPACK_IMPORTED_MODULE_0__/*
73523
73462
  * @description fetch all unfilled currently open orders
73524
73463
  * @param {string} symbol unified market symbol
73525
73464
  * @param {int} [since] the earliest time in ms to fetch open orders for
73526
- * @param {int} [limit] the maximum number of open orders structures to retrieve
73465
+ * @param {int} [limit] the maximum number of open order structures to retrieve
73527
73466
  * @param {object} [params] extra parameters specific to the btctradeua api endpoint
73528
73467
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
73529
73468
  */
73530
- if (symbol === undefined) {
73531
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
73532
- }
73469
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
73533
73470
  await this.loadMarkets();
73534
73471
  const market = this.market(symbol);
73535
73472
  const request = {
@@ -74843,6 +74780,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74843
74780
  'v5/spot-cross-margin-trade/orders': 1,
74844
74781
  'v5/spot-cross-margin-trade/repay-history': 1,
74845
74782
  // institutional lending
74783
+ 'v5/ins-loan/product-infos': 5,
74784
+ 'v5/ins-loan/ensure-tokens-convert': 5,
74846
74785
  'v5/ins-loan/loan-order': 5,
74847
74786
  'v5/ins-loan/repaid-history': 5,
74848
74787
  'v5/ins-loan/ltv-convert': 5,
@@ -74979,6 +74918,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74979
74918
  'v5/spot-cross-margin-trade/loan': 2.5,
74980
74919
  'v5/spot-cross-margin-trade/repay': 2.5,
74981
74920
  'v5/spot-cross-margin-trade/switch': 2.5,
74921
+ // institutional lending
74922
+ 'v5/ins-loan/association-uid': 5,
74982
74923
  // c2c lending
74983
74924
  'v5/lending/purchase': 5,
74984
74925
  'v5/lending/redeem': 5,
@@ -83134,15 +83075,13 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
83134
83075
  * @description fetches information on multiple closed orders made by the user
83135
83076
  * @param {string} symbol unified market symbol of the market orders were made in
83136
83077
  * @param {int} [since] the earliest time in ms to fetch orders for
83137
- * @param {int} [limit] the maximum number of orde structures to retrieve
83078
+ * @param {int} [limit] the maximum number of order structures to retrieve
83138
83079
  * @param {object} [params] extra parameters specific to the cex api endpoint
83139
83080
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
83140
83081
  */
83082
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
83141
83083
  await this.loadMarkets();
83142
83084
  const method = 'privatePostArchivedOrdersPair';
83143
- if (symbol === undefined) {
83144
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
83145
- }
83146
83085
  const market = this.market(symbol);
83147
83086
  const request = { 'pair': market['id'] };
83148
83087
  const response = await this[method](this.extend(request, params));
@@ -87941,7 +87880,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
87941
87880
  if (clientOrderId !== undefined) {
87942
87881
  request['client_oid'] = clientOrderId;
87943
87882
  }
87944
- const stopPrice = this.safeNumber2(params, 'stopPrice', 'stop_price');
87883
+ const stopPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
87945
87884
  if (stopPrice !== undefined) {
87946
87885
  request['stop_price'] = this.priceToPrecision(symbol, stopPrice);
87947
87886
  }
@@ -87953,7 +87892,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
87953
87892
  if (postOnly) {
87954
87893
  request['post_only'] = true;
87955
87894
  }
87956
- params = this.omit(params, ['timeInForce', 'time_in_force', 'stopPrice', 'stop_price', 'clientOrderId', 'client_oid', 'postOnly', 'post_only']);
87895
+ params = this.omit(params, ['timeInForce', 'time_in_force', 'stopPrice', 'stop_price', 'clientOrderId', 'client_oid', 'postOnly', 'post_only', 'triggerPrice']);
87957
87896
  if (type === 'limit') {
87958
87897
  request['price'] = this.priceToPrecision(symbol, price);
87959
87898
  request['size'] = this.amountToPrecision(symbol, amount);
@@ -90359,9 +90298,6 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
90359
90298
  * @param {object} [params] extra parameters specific to the coinex api endpoint
90360
90299
  * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
90361
90300
  */
90362
- if (symbol === undefined) {
90363
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
90364
- }
90365
90301
  await this.loadMarkets();
90366
90302
  const market = this.market(symbol);
90367
90303
  if (limit === undefined) {
@@ -91760,9 +91696,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
91760
91696
  * @param {object} [params] extra parameters specific to the coinex api endpoint
91761
91697
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
91762
91698
  */
91763
- if (symbol === undefined) {
91764
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' cancellAllOrders() requires a symbol argument');
91765
- }
91699
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
91766
91700
  await this.loadMarkets();
91767
91701
  const market = this.market(symbol);
91768
91702
  const marketId = market['id'];
@@ -91810,9 +91744,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
91810
91744
  * @param {object} [params] extra parameters specific to the coinex api endpoint
91811
91745
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
91812
91746
  */
91813
- if (symbol === undefined) {
91814
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
91815
- }
91747
+ this.checkRequiredSymbol('fetchOrder', symbol);
91816
91748
  await this.loadMarkets();
91817
91749
  const market = this.market(symbol);
91818
91750
  const swap = market['swap'];
@@ -92715,9 +92647,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
92715
92647
  * @param {object} [params] extra parameters specific to the coinex api endpoint
92716
92648
  * @returns {object} response from the exchange
92717
92649
  */
92718
- if (symbol === undefined) {
92719
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
92720
- }
92650
+ this.checkRequiredSymbol('setMarginMode', symbol);
92721
92651
  marginMode = marginMode.toLowerCase();
92722
92652
  if (marginMode !== 'isolated' && marginMode !== 'cross') {
92723
92653
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
@@ -92991,9 +92921,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
92991
92921
  * @param {object} [params] extra parameters specific to the coinex api endpoint
92992
92922
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
92993
92923
  */
92994
- if (symbol === undefined) {
92995
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
92996
- }
92924
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
92997
92925
  limit = (limit === undefined) ? 100 : limit;
92998
92926
  await this.loadMarkets();
92999
92927
  const market = this.market(symbol);
@@ -93313,9 +93241,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
93313
93241
  * @param {int} [params.until] timestamp in ms of the latest funding rate
93314
93242
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
93315
93243
  */
93316
- if (symbol === undefined) {
93317
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
93318
- }
93244
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
93319
93245
  await this.loadMarkets();
93320
93246
  let paginate = false;
93321
93247
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -94037,9 +93963,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
94037
93963
  * @param {object} [params] extra parameters specific to the coinex api endpoint
94038
93964
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
94039
93965
  */
94040
- if (symbol === undefined) {
94041
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
94042
- }
93966
+ this.checkRequiredSymbol('borrowMargin', symbol);
94043
93967
  await this.loadMarkets();
94044
93968
  const market = this.market(symbol);
94045
93969
  const currency = this.currency(code);
@@ -94078,9 +94002,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
94078
94002
  * @param {string} [params.loan_id] extra parameter that is not required
94079
94003
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
94080
94004
  */
94081
- if (symbol === undefined) {
94082
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
94083
- }
94005
+ this.checkRequiredSymbol('repayMargin', symbol);
94084
94006
  await this.loadMarkets();
94085
94007
  const market = this.market(symbol);
94086
94008
  const currency = this.currency(code);
@@ -94325,10 +94247,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
94325
94247
  /* harmony export */ "Z": () => (/* binding */ coinfalcon)
94326
94248
  /* harmony export */ });
94327
94249
  /* harmony import */ var _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4507);
94328
- /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
94329
- /* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
94250
+ /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
94251
+ /* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2194);
94330
94252
  /* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
94331
- /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
94253
+ /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1372);
94332
94254
  // ---------------------------------------------------------------------------
94333
94255
 
94334
94256
 
@@ -94733,9 +94655,7 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
94733
94655
  * @param {object} [params] extra parameters specific to the coinfalcon api endpoint
94734
94656
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
94735
94657
  */
94736
- if (symbol === undefined) {
94737
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
94738
- }
94658
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
94739
94659
  await this.loadMarkets();
94740
94660
  const market = this.market(symbol);
94741
94661
  const request = {
@@ -94827,8 +94747,8 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
94827
94747
  const data = this.safeValue(response, 'data', {});
94828
94748
  const makerString = this.safeString(data, 'maker_fee');
94829
94749
  const takerString = this.safeString(data, 'taker_fee');
94830
- const maker = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringDiv */ .O.stringDiv(makerString, '100'));
94831
- const taker = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringDiv */ .O.stringDiv(takerString, '100'));
94750
+ const maker = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise.stringDiv */ .O.stringDiv(makerString, '100'));
94751
+ const taker = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise.stringDiv */ .O.stringDiv(takerString, '100'));
94832
94752
  const result = {};
94833
94753
  for (let i = 0; i < this.symbols.length; i++) {
94834
94754
  const symbol = this.symbols[i];
@@ -95316,7 +95236,7 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
95316
95236
  if (body) {
95317
95237
  payload += '|' + body;
95318
95238
  }
95319
- const signature = this.hmac(this.encode(payload), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
95239
+ const signature = this.hmac(this.encode(payload), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__/* .sha256 */ .J);
95320
95240
  headers = {
95321
95241
  'CF-API-KEY': this.apiKey,
95322
95242
  'CF-API-TIMESTAMP': seconds,
@@ -95332,9 +95252,9 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
95332
95252
  return undefined;
95333
95253
  }
95334
95254
  const ErrorClass = this.safeValue({
95335
- '401': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
95336
- '429': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.RateLimitExceeded,
95337
- }, code, _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError);
95255
+ '401': _base_errors_js__WEBPACK_IMPORTED_MODULE_4__.AuthenticationError,
95256
+ '429': _base_errors_js__WEBPACK_IMPORTED_MODULE_4__.RateLimitExceeded,
95257
+ }, code, _base_errors_js__WEBPACK_IMPORTED_MODULE_4__.ExchangeError);
95338
95258
  throw new ErrorClass(body);
95339
95259
  }
95340
95260
  }
@@ -98424,13 +98344,11 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
98424
98344
  * @description fetches information on multiple orders made by the user
98425
98345
  * @param {string} symbol unified market symbol of the market orders were made in
98426
98346
  * @param {int} [since] the earliest time in ms to fetch orders for
98427
- * @param {int} [limit] the maximum number of orde structures to retrieve
98347
+ * @param {int} [limit] the maximum number of order structures to retrieve
98428
98348
  * @param {object} [params] extra parameters specific to the coinmate api endpoint
98429
98349
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
98430
98350
  */
98431
- if (symbol === undefined) {
98432
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
98433
- }
98351
+ this.checkRequiredSymbol('fetchOrders', symbol);
98434
98352
  await this.loadMarkets();
98435
98353
  const market = this.market(symbol);
98436
98354
  const request = {
@@ -99218,9 +99136,7 @@ class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
99218
99136
  * @param {object} [params] extra parameters specific to the coinone api endpoint
99219
99137
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
99220
99138
  */
99221
- if (symbol === undefined) {
99222
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
99223
- }
99139
+ this.checkRequiredSymbol('fetchOrder', symbol);
99224
99140
  await this.loadMarkets();
99225
99141
  const market = this.market(symbol);
99226
99142
  const request = {
@@ -99430,9 +99346,7 @@ class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
99430
99346
  * @param {object} [params] extra parameters specific to the coinone api endpoint
99431
99347
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
99432
99348
  */
99433
- if (symbol === undefined) {
99434
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
99435
- }
99349
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
99436
99350
  await this.loadMarkets();
99437
99351
  const market = this.market(symbol);
99438
99352
  const request = {
@@ -100502,9 +100416,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
100502
100416
  * @param {object} [params] extra parameters specific to the coinsph api endpoint
100503
100417
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
100504
100418
  */
100505
- if (symbol === undefined) {
100506
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
100507
- }
100419
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
100508
100420
  await this.loadMarkets();
100509
100421
  const market = this.market(symbol);
100510
100422
  const request = {
@@ -100533,9 +100445,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
100533
100445
  * @param {object} [params] extra parameters specific to the coinsph api endpoint
100534
100446
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
100535
100447
  */
100536
- if (symbol === undefined) {
100537
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
100538
- }
100448
+ this.checkRequiredSymbol('fetchOrderTrades', symbol);
100539
100449
  const request = {
100540
100450
  'orderId': id,
100541
100451
  };
@@ -100835,13 +100745,11 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
100835
100745
  * @description fetches information on multiple closed orders made by the user
100836
100746
  * @param {string} symbol unified market symbol of the market orders were made in
100837
100747
  * @param {int} [since] the earliest time in ms to fetch orders for
100838
- * @param {int} [limit] the maximum number of orde structures to retrieve (default 500, max 1000)
100748
+ * @param {int} [limit] the maximum number of order structures to retrieve (default 500, max 1000)
100839
100749
  * @param {object} [params] extra parameters specific to the coinsph api endpoint
100840
100750
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
100841
100751
  */
100842
- if (symbol === undefined) {
100843
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
100844
- }
100752
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
100845
100753
  await this.loadMarkets();
100846
100754
  const market = this.market(symbol);
100847
100755
  const request = {
@@ -100890,9 +100798,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
100890
100798
  * @param {object} [params] extra parameters specific to the coinsph api endpoint
100891
100799
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
100892
100800
  */
100893
- if (symbol === undefined) {
100894
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
100895
- }
100801
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
100896
100802
  await this.loadMarkets();
100897
100803
  let market = undefined;
100898
100804
  const request = {};
@@ -106858,9 +106764,7 @@ class currencycom extends _abstract_currencycom_js__WEBPACK_IMPORTED_MODULE_0__/
106858
106764
  * @param {object} [params] extra parameters specific to the currencycom api endpoint
106859
106765
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
106860
106766
  */
106861
- if (symbol === undefined) {
106862
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
106863
- }
106767
+ this.checkRequiredSymbol('cancelOrder', symbol);
106864
106768
  await this.loadMarkets();
106865
106769
  const market = this.market(symbol);
106866
106770
  const origClientOrderId = this.safeValue(params, 'origClientOrderId');
@@ -106902,9 +106806,7 @@ class currencycom extends _abstract_currencycom_js__WEBPACK_IMPORTED_MODULE_0__/
106902
106806
  * @param {object} [params] extra parameters specific to the currencycom api endpoint
106903
106807
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
106904
106808
  */
106905
- if (symbol === undefined) {
106906
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
106907
- }
106809
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
106908
106810
  await this.loadMarkets();
106909
106811
  const market = this.market(symbol);
106910
106812
  const request = {
@@ -123501,9 +123403,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
123501
123403
  * @param {object} [params] extra parameters specific to the gate api endpoint
123502
123404
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
123503
123405
  */
123504
- if (symbol === undefined) {
123505
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
123506
- }
123406
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
123507
123407
  await this.loadMarkets();
123508
123408
  const market = this.market(symbol);
123509
123409
  if (!market['swap']) {
@@ -125546,9 +125446,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
125546
125446
  * @param {object} [params] extra parameters specific to the gate api endpoint
125547
125447
  * @returns {object} response from the exchange
125548
125448
  */
125549
- if (symbol === undefined) {
125550
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
125551
- }
125449
+ this.checkRequiredSymbol('setLeverage', symbol);
125552
125450
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
125553
125451
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
125554
125452
  if ((leverage < 0) || (leverage > 100)) {
@@ -128764,9 +128662,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
128764
128662
  * @param {object} [params] extra parameters specific to the gemini api endpoint
128765
128663
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
128766
128664
  */
128767
- if (symbol === undefined) {
128768
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
128769
- }
128665
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
128770
128666
  await this.loadMarkets();
128771
128667
  const market = this.market(symbol);
128772
128668
  const request = {
@@ -129155,6 +129051,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129155
129051
  'createStopMarketOrder': true,
129156
129052
  'createStopOrder': true,
129157
129053
  'editOrder': true,
129054
+ 'fetchAccounts': false,
129158
129055
  'fetchBalance': true,
129159
129056
  'fetchBorrowRate': undefined,
129160
129057
  'fetchBorrowRateHistories': undefined,
@@ -129170,15 +129067,20 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129170
129067
  'fetchFundingHistory': undefined,
129171
129068
  'fetchFundingRate': true,
129172
129069
  'fetchFundingRateHistory': true,
129173
- 'fetchFundingRates': false,
129070
+ 'fetchFundingRates': true,
129174
129071
  'fetchIndexOHLCV': true,
129175
129072
  'fetchLeverage': true,
129176
129073
  'fetchLeverageTiers': undefined,
129177
- 'fetchMarketLeverageTiers': undefined,
129074
+ 'fetchLiquidations': false,
129075
+ 'fetchMarginMode': false,
129076
+ 'fetchMarketLeverageTiers': false,
129178
129077
  'fetchMarkets': true,
129179
129078
  'fetchMarkOHLCV': true,
129079
+ 'fetchMyLiquidations': false,
129180
129080
  'fetchMyTrades': true,
129181
129081
  'fetchOHLCV': true,
129082
+ 'fetchOpenInterest': true,
129083
+ 'fetchOpenInterestHistory': false,
129182
129084
  'fetchOpenOrder': true,
129183
129085
  'fetchOpenOrders': true,
129184
129086
  'fetchOrder': true,
@@ -129198,6 +129100,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129198
129100
  'fetchWithdrawals': true,
129199
129101
  'reduceMargin': true,
129200
129102
  'setLeverage': true,
129103
+ 'setMargin': false,
129201
129104
  'setMarginMode': false,
129202
129105
  'setPositionMode': false,
129203
129106
  'transfer': true,
@@ -129229,56 +129132,79 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129229
129132
  'public': {
129230
129133
  'get': {
129231
129134
  'public/currency': 10,
129135
+ 'public/currency/{currency}': 10,
129232
129136
  'public/symbol': 10,
129137
+ 'public/symbol/{symbol}': 10,
129233
129138
  'public/ticker': 10,
129139
+ 'public/ticker/{symbol}': 10,
129234
129140
  'public/price/rate': 10,
129141
+ 'public/price/history': 10,
129142
+ 'public/price/ticker': 10,
129143
+ 'public/price/ticker/{symbol}': 10,
129235
129144
  'public/trades': 10,
129145
+ 'public/trades/{symbol}': 10,
129236
129146
  'public/orderbook': 10,
129147
+ 'public/orderbook/{symbol}': 10,
129237
129148
  'public/candles': 10,
129149
+ 'public/candles/{symbol}': 10,
129238
129150
  'public/futures/info': 10,
129151
+ 'public/futures/info/{symbol}': 10,
129239
129152
  'public/futures/history/funding': 10,
129153
+ 'public/futures/history/funding/{symbol}': 10,
129240
129154
  'public/futures/candles/index_price': 10,
129155
+ 'public/futures/candles/index_price/{symbol}': 10,
129241
129156
  'public/futures/candles/mark_price': 10,
129157
+ 'public/futures/candles/mark_price/{symbol}': 10,
129242
129158
  'public/futures/candles/premium_index': 10,
129159
+ 'public/futures/candles/premium_index/{symbol}': 10,
129243
129160
  'public/futures/candles/open_interest': 10,
129161
+ 'public/futures/candles/open_interest/{symbol}': 10,
129244
129162
  },
129245
129163
  },
129246
129164
  'private': {
129247
129165
  'get': {
129248
129166
  'spot/balance': 15,
129249
- 'spot/order': 15,
129250
- 'spot/order/{client_order_id}': 15,
129167
+ 'spot/balance/{currency}': 15,
129168
+ 'spot/order': 1,
129169
+ 'spot/order/{client_order_id}': 1,
129251
129170
  'spot/fee': 15,
129252
129171
  'spot/fee/{symbol}': 15,
129253
129172
  'spot/history/order': 15,
129254
129173
  'spot/history/trade': 15,
129255
- 'margin/account': 15,
129256
- 'margin/account/isolated/{symbol}': 15,
129257
- 'margin/order': 15,
129258
- 'margin/order/{client_order_id}': 15,
129259
- 'margin/history/clearing': 15,
129174
+ 'margin/account': 1,
129175
+ 'margin/account/isolated/{symbol}': 1,
129176
+ 'margin/account/cross/{currency}': 1,
129177
+ 'margin/order': 1,
129178
+ 'margin/order/{client_order_id}': 1,
129179
+ 'margin/config': 15,
129260
129180
  'margin/history/order': 15,
129261
- 'margin/history/positions': 15,
129262
129181
  'margin/history/trade': 15,
129182
+ 'margin/history/positions': 15,
129183
+ 'margin/history/clearing': 15,
129263
129184
  'futures/balance': 15,
129264
- 'futures/account': 15,
129265
- 'futures/account/isolated/{symbol}': 15,
129266
- 'futures/order': 15,
129267
- 'futures/order/{client_order_id}': 15,
129185
+ 'futures/balance/{currency}': 15,
129186
+ 'futures/account': 1,
129187
+ 'futures/account/isolated/{symbol}': 1,
129188
+ 'futures/order': 1,
129189
+ 'futures/order/{client_order_id}': 1,
129190
+ 'futures/config': 15,
129268
129191
  'futures/fee': 15,
129269
129192
  'futures/fee/{symbol}': 15,
129270
- 'futures/history/clearing': 15,
129271
129193
  'futures/history/order': 15,
129272
- 'futures/history/positions': 15,
129273
129194
  'futures/history/trade': 15,
129274
- 'wallet/balance': 15,
129275
- 'wallet/crypto/address': 15,
129276
- 'wallet/crypto/address/recent-deposit': 15,
129277
- 'wallet/crypto/address/recent-withdraw': 15,
129278
- 'wallet/crypto/address/check-mine': 15,
129279
- 'wallet/transactions': 15,
129280
- 'wallet/crypto/check-offchain-available': 15,
129281
- 'wallet/crypto/fee/estimate': 15,
129195
+ 'futures/history/positions': 15,
129196
+ 'futures/history/clearing': 15,
129197
+ 'wallet/balance': 30,
129198
+ 'wallet/balance/{currency}': 30,
129199
+ 'wallet/crypto/address': 30,
129200
+ 'wallet/crypto/address/recent-deposit': 30,
129201
+ 'wallet/crypto/address/recent-withdraw': 30,
129202
+ 'wallet/crypto/address/check-mine': 30,
129203
+ 'wallet/transactions': 30,
129204
+ 'wallet/transactions/{tx_id}': 30,
129205
+ 'wallet/crypto/fee/estimate': 30,
129206
+ 'wallet/airdrops': 30,
129207
+ 'wallet/amount-locks': 30,
129282
129208
  'sub-account': 15,
129283
129209
  'sub-account/acl': 15,
129284
129210
  'sub-account/balance/{subAccID}': 15,
@@ -129286,12 +129212,19 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129286
129212
  },
129287
129213
  'post': {
129288
129214
  'spot/order': 1,
129215
+ 'spot/order/list': 1,
129289
129216
  'margin/order': 1,
129217
+ 'margin/order/list': 1,
129290
129218
  'futures/order': 1,
129291
- 'wallet/convert': 15,
129292
- 'wallet/crypto/address': 15,
129293
- 'wallet/crypto/withdraw': 15,
129294
- 'wallet/transfer': 15,
129219
+ 'futures/order/list': 1,
129220
+ 'wallet/crypto/address': 30,
129221
+ 'wallet/crypto/withdraw': 30,
129222
+ 'wallet/convert': 30,
129223
+ 'wallet/transfer': 30,
129224
+ 'wallet/internal/withdraw': 30,
129225
+ 'wallet/crypto/check-offchain-available': 30,
129226
+ 'wallet/crypto/fees/estimate': 30,
129227
+ 'wallet/airdrops/{id}/claim': 30,
129295
129228
  'sub-account/freeze': 15,
129296
129229
  'sub-account/activate': 15,
129297
129230
  'sub-account/transfer': 15,
@@ -129310,15 +129243,15 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
129310
129243
  'margin/order': 1,
129311
129244
  'margin/order/{client_order_id}': 1,
129312
129245
  'futures/position': 1,
129313
- 'futures/position/isolated/{symbol}': 1,
129246
+ 'futures/position/{margin_mode}/{symbol}': 1,
129314
129247
  'futures/order': 1,
129315
129248
  'futures/order/{client_order_id}': 1,
129316
- 'wallet/crypto/withdraw/{id}': 1,
129249
+ 'wallet/crypto/withdraw/{id}': 30,
129317
129250
  },
129318
129251
  'put': {
129319
129252
  'margin/account/isolated/{symbol}': 1,
129320
129253
  'futures/account/isolated/{symbol}': 1,
129321
- 'wallet/crypto/withdraw/{id}': 1,
129254
+ 'wallet/crypto/withdraw/{id}': 30,
129322
129255
  },
129323
129256
  },
129324
129257
  },
@@ -130111,18 +130044,38 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130111
130044
  * @method
130112
130045
  * @name hitbtc#fetchTicker
130113
130046
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
130047
+ * @see https://api.hitbtc.com/#tickers
130114
130048
  * @param {string} symbol unified symbol of the market to fetch the ticker for
130115
130049
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
130116
130050
  * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
130117
130051
  */
130118
- const response = await this.fetchTickers([symbol], params);
130119
- return this.safeValue(response, symbol);
130052
+ await this.loadMarkets();
130053
+ const market = this.market(symbol);
130054
+ const request = {
130055
+ 'symbol': market['id'],
130056
+ };
130057
+ const response = await this.publicGetPublicTickerSymbol(this.extend(request, params));
130058
+ //
130059
+ // {
130060
+ // "ask": "0.020572",
130061
+ // "bid": "0.020566",
130062
+ // "last": "0.020574",
130063
+ // "low": "0.020388",
130064
+ // "high": "0.021084",
130065
+ // "open": "0.020913",
130066
+ // "volume": "138444.3666",
130067
+ // "volume_quote": "2853.6874972480",
130068
+ // "timestamp": "2021-06-02T17:52:36.731Z"
130069
+ // }
130070
+ //
130071
+ return this.parseTicker(response, market);
130120
130072
  }
130121
130073
  async fetchTickers(symbols = undefined, params = {}) {
130122
130074
  /**
130123
130075
  * @method
130124
130076
  * @name hitbtc#fetchTickers
130125
130077
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
130078
+ * @see https://api.hitbtc.com/#tickers
130126
130079
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
130127
130080
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
130128
130081
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -130210,6 +130163,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130210
130163
  * @method
130211
130164
  * @name hitbtc#fetchTrades
130212
130165
  * @description get the list of most recent trades for a particular symbol
130166
+ * @see https://api.hitbtc.com/#trades
130213
130167
  * @param {string} symbol unified symbol of the market to fetch trades for
130214
130168
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
130215
130169
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -130219,20 +130173,26 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130219
130173
  await this.loadMarkets();
130220
130174
  let market = undefined;
130221
130175
  const request = {};
130222
- if (symbol !== undefined) {
130223
- market = this.market(symbol);
130224
- // symbol is optional for hitbtc fetchTrades
130225
- request['symbols'] = market['id'];
130226
- }
130227
130176
  if (limit !== undefined) {
130228
130177
  request['limit'] = Math.min(limit, 1000);
130229
130178
  }
130230
130179
  if (since !== undefined) {
130231
130180
  request['from'] = since;
130232
130181
  }
130233
- const response = await this.publicGetPublicTrades(this.extend(request, params));
130234
- const marketIds = Object.keys(response);
130182
+ let response = undefined;
130183
+ if (symbol !== undefined) {
130184
+ market = this.market(symbol);
130185
+ request['symbol'] = market['id'];
130186
+ response = await this.publicGetPublicTradesSymbol(this.extend(request, params));
130187
+ }
130188
+ else {
130189
+ response = await this.publicGetPublicTrades(this.extend(request, params));
130190
+ }
130191
+ if (symbol !== undefined) {
130192
+ return this.parseTrades(response, market);
130193
+ }
130235
130194
  let trades = [];
130195
+ const marketIds = Object.keys(response);
130236
130196
  for (let i = 0; i < marketIds.length; i++) {
130237
130197
  const marketId = marketIds[i];
130238
130198
  const marketInner = this.market(marketId);
@@ -130568,6 +130528,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130568
130528
  * @method
130569
130529
  * @name hitbtc#fetchOrderBooks
130570
130530
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
130531
+ * @see https://api.hitbtc.com/#order-books
130571
130532
  * @param {string[]|undefined} symbols list of unified market symbols, all symbols fetched if undefined, default is undefined
130572
130533
  * @param {int} [limit] max number of entries per orderbook to return, default is undefined
130573
130534
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
@@ -130599,13 +130560,23 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130599
130560
  * @method
130600
130561
  * @name hitbtc#fetchOrderBook
130601
130562
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
130563
+ * @see https://api.hitbtc.com/#order-books
130602
130564
  * @param {string} symbol unified symbol of the market to fetch the order book for
130603
130565
  * @param {int} [limit] the maximum amount of order book entries to return
130604
130566
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
130605
130567
  * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
130606
130568
  */
130607
- const result = await this.fetchOrderBooks([symbol], limit, params);
130608
- return result[symbol];
130569
+ await this.loadMarkets();
130570
+ const market = this.market(symbol);
130571
+ const request = {
130572
+ 'symbol': market['id'],
130573
+ };
130574
+ if (limit !== undefined) {
130575
+ request['depth'] = limit;
130576
+ }
130577
+ const response = await this.publicGetPublicOrderbookSymbol(this.extend(request, params));
130578
+ const timestamp = this.parse8601(this.safeString(response, 'timestamp'));
130579
+ return this.parseOrderBook(response, symbol, timestamp, 'bid', 'ask');
130609
130580
  }
130610
130581
  parseTradingFee(fee, market = undefined) {
130611
130582
  //
@@ -130691,6 +130662,9 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130691
130662
  * @name hitbtc#fetchOHLCV
130692
130663
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
130693
130664
  * @see https://api.hitbtc.com/#candles
130665
+ * @see https://api.hitbtc.com/#futures-index-price-candles
130666
+ * @see https://api.hitbtc.com/#futures-mark-price-candles
130667
+ * @see https://api.hitbtc.com/#futures-premium-index-candles
130694
130668
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
130695
130669
  * @param {string} timeframe the length of time each candle represents
130696
130670
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -130708,7 +130682,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130708
130682
  }
130709
130683
  const market = this.market(symbol);
130710
130684
  let request = {
130711
- 'symbols': market['id'],
130685
+ 'symbol': market['id'],
130712
130686
  'period': this.safeString(this.timeframes, timeframe, timeframe),
130713
130687
  };
130714
130688
  [request, params] = this.handleUntilOption('till', request, params);
@@ -130720,50 +130694,47 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
130720
130694
  }
130721
130695
  const price = this.safeString(params, 'price');
130722
130696
  params = this.omit(params, 'price');
130723
- let method = 'publicGetPublicCandles';
130697
+ let response = undefined;
130724
130698
  if (price === 'mark') {
130725
- method = 'publicGetPublicFuturesCandlesMarkPrice';
130699
+ response = await this.publicGetPublicFuturesCandlesMarkPriceSymbol(this.extend(request, params));
130726
130700
  }
130727
130701
  else if (price === 'index') {
130728
- method = 'publicGetPublicFuturesCandlesIndexPrice';
130702
+ response = await this.publicGetPublicFuturesCandlesIndexPriceSymbol(this.extend(request, params));
130729
130703
  }
130730
130704
  else if (price === 'premiumIndex') {
130731
- method = 'publicGetPublicFuturesCandlesPremiumIndex';
130705
+ response = await this.publicGetPublicFuturesCandlesPremiumIndexSymbol(this.extend(request, params));
130706
+ }
130707
+ else {
130708
+ response = await this.publicGetPublicCandlesSymbol(this.extend(request, params));
130732
130709
  }
130733
- const response = await this[method](this.extend(request, params));
130734
130710
  //
130735
130711
  // Spot and Swap
130736
130712
  //
130737
- // {
130738
- // "ETHUSDT": [
130739
- // {
130740
- // "timestamp": "2021-10-25T07:38:00.000Z",
130741
- // "open": "4173.391",
130742
- // "close": "4170.923",
130743
- // "min": "4170.923",
130744
- // "max": "4173.986",
130745
- // "volume": "0.1879",
130746
- // "volume_quote": "784.2517846"
130747
- // }
130748
- // ]
130749
- // }
130713
+ // [
130714
+ // {
130715
+ // "timestamp": "2021-10-25T07:38:00.000Z",
130716
+ // "open": "4173.391",
130717
+ // "close": "4170.923",
130718
+ // "min": "4170.923",
130719
+ // "max": "4173.986",
130720
+ // "volume": "0.1879",
130721
+ // "volume_quote": "784.2517846"
130722
+ // }
130723
+ // ]
130750
130724
  //
130751
130725
  // Mark, Index and Premium Index
130752
130726
  //
130753
- // {
130754
- // "BTCUSDT_PERP": [
130755
- // {
130756
- // "timestamp": "2022-04-01T01:28:00.000Z",
130757
- // "open": "45146.39",
130758
- // "close": "45219.43",
130759
- // "min": "45146.39",
130760
- // "max": "45219.43"
130761
- // },
130762
- // ]
130763
- // }
130727
+ // [
130728
+ // {
130729
+ // "timestamp": "2022-04-01T01:28:00.000Z",
130730
+ // "open": "45146.39",
130731
+ // "close": "45219.43",
130732
+ // "min": "45146.39",
130733
+ // "max": "45219.43"
130734
+ // },
130735
+ // ]
130764
130736
  //
130765
- const ohlcvs = this.safeValue(response, market['id']);
130766
- return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit);
130737
+ return this.parseOHLCVs(response, market, timeframe, since, limit);
130767
130738
  }
130768
130739
  parseOHLCV(ohlcv, market = undefined) {
130769
130740
  //
@@ -131163,7 +131134,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131163
131134
  * @param {float} amount how much of currency you want to trade in units of base currency
131164
131135
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
131165
131136
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
131166
- * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both
131137
+ * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both, default is 'cross'
131167
131138
  * @param {bool} [params.margin] true for creating a margin order
131168
131139
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
131169
131140
  * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
@@ -131237,7 +131208,11 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131237
131208
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' createOrder() requires a stopPrice parameter for stop-loss and take-profit orders');
131238
131209
  }
131239
131210
  params = this.omit(params, ['triggerPrice', 'timeInForce', 'stopPrice', 'stop_price', 'reduceOnly', 'postOnly']);
131240
- if ((marketType === 'swap') && (marginMode !== undefined)) {
131211
+ if (marketType === 'swap') {
131212
+ // set default margin mode to cross
131213
+ if (marginMode === undefined) {
131214
+ marginMode = 'cross';
131215
+ }
131241
131216
  request['margin_mode'] = marginMode;
131242
131217
  }
131243
131218
  let response = undefined;
@@ -131516,6 +131491,60 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131516
131491
  //
131517
131492
  return this.parseTransaction(response, currency);
131518
131493
  }
131494
+ async fetchFundingRates(symbols = undefined, params = {}) {
131495
+ /**
131496
+ * @method
131497
+ * @name hitbtc#fetchFundingRates
131498
+ * @description fetches funding rates for multiple markets
131499
+ * @see https://api.hitbtc.com/#futures-info
131500
+ * @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
131501
+ * @param {object} [params] extra parameters specific to the hitbtc api endpoint
131502
+ * @returns {object} an array of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
131503
+ */
131504
+ await this.loadMarkets();
131505
+ let market = undefined;
131506
+ const request = {};
131507
+ if (symbols !== undefined) {
131508
+ symbols = this.marketSymbols(symbols);
131509
+ market = this.market(symbols[0]);
131510
+ const queryMarketIds = this.marketIds(symbols);
131511
+ request['symbols'] = queryMarketIds.join(',');
131512
+ }
131513
+ let type = undefined;
131514
+ [type, params] = this.handleMarketTypeAndParams('fetchFundingRates', market, params);
131515
+ if (type !== 'swap') {
131516
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchFundingRates() does not support ' + type + ' markets');
131517
+ }
131518
+ const response = await this.publicGetPublicFuturesInfo(this.extend(request, params));
131519
+ //
131520
+ // {
131521
+ // "BTCUSDT_PERP": {
131522
+ // "contract_type": "perpetual",
131523
+ // "mark_price": "30897.68",
131524
+ // "index_price": "30895.29",
131525
+ // "funding_rate": "0.0001",
131526
+ // "open_interest": "93.7128",
131527
+ // "next_funding_time": "2021-07-21T16:00:00.000Z",
131528
+ // "indicative_funding_rate": "0.0001",
131529
+ // "premium_index": "0.000047541807127312",
131530
+ // "avg_premium_index": "0.000087063368020112",
131531
+ // "interest_rate": "0.0001",
131532
+ // "timestamp": "2021-07-21T09:48:37.235Z"
131533
+ // }
131534
+ // }
131535
+ //
131536
+ const marketIds = Object.keys(response);
131537
+ const fundingRates = {};
131538
+ for (let i = 0; i < marketIds.length; i++) {
131539
+ const marketId = this.safeString(marketIds, i);
131540
+ const rawFundingRate = this.safeValue(response, marketId);
131541
+ const marketInner = this.market(marketId);
131542
+ const symbol = marketInner['symbol'];
131543
+ const fundingRate = this.parseFundingRate(rawFundingRate, marketInner);
131544
+ fundingRates[symbol] = fundingRate;
131545
+ }
131546
+ return this.filterByArray(fundingRates, 'symbol', symbols);
131547
+ }
131519
131548
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
131520
131549
  /**
131521
131550
  * @method
@@ -131806,11 +131835,75 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131806
131835
  'takeProfitPrice': undefined,
131807
131836
  });
131808
131837
  }
131838
+ parseOpenInterest(interest, market = undefined) {
131839
+ //
131840
+ // {
131841
+ // "contract_type": "perpetual",
131842
+ // "mark_price": "42307.43",
131843
+ // "index_price": "42303.27",
131844
+ // "funding_rate": "0.0001",
131845
+ // "open_interest": "30.9826",
131846
+ // "next_funding_time": "2022-03-22T16:00:00.000Z",
131847
+ // "indicative_funding_rate": "0.0001",
131848
+ // "premium_index": "0",
131849
+ // "avg_premium_index": "0.000029587712038098",
131850
+ // "interest_rate": "0.0001",
131851
+ // "timestamp": "2022-03-22T08:08:26.687Z"
131852
+ // }
131853
+ //
131854
+ const datetime = this.safeString(interest, 'timestamp');
131855
+ const value = this.safeNumber(interest, 'open_interest');
131856
+ return this.safeOpenInterest({
131857
+ 'symbol': market['symbol'],
131858
+ 'openInterestAmount': undefined,
131859
+ 'openInterestValue': value,
131860
+ 'timestamp': this.parse8601(datetime),
131861
+ 'datetime': datetime,
131862
+ 'info': interest,
131863
+ }, market);
131864
+ }
131865
+ async fetchOpenInterest(symbol, params = {}) {
131866
+ /**
131867
+ * @method
131868
+ * @name hitbtc#fetchOpenInterest
131869
+ * @description Retrieves the open interest of a derivative trading pair
131870
+ * @see https://api.hitbtc.com/#futures-info
131871
+ * @param {string} symbol Unified CCXT market symbol
131872
+ * @param {object} [params] exchange specific parameters
131873
+ * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#interest-history-structure}
131874
+ */
131875
+ await this.loadMarkets();
131876
+ const market = this.market(symbol);
131877
+ if (!market['swap']) {
131878
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' fetchOpenInterest() supports swap contracts only');
131879
+ }
131880
+ const request = {
131881
+ 'symbol': market['id'],
131882
+ };
131883
+ const response = await this.publicGetPublicFuturesInfoSymbol(this.extend(request, params));
131884
+ //
131885
+ // {
131886
+ // "contract_type": "perpetual",
131887
+ // "mark_price": "42307.43",
131888
+ // "index_price": "42303.27",
131889
+ // "funding_rate": "0.0001",
131890
+ // "open_interest": "30.9826",
131891
+ // "next_funding_time": "2022-03-22T16:00:00.000Z",
131892
+ // "indicative_funding_rate": "0.0001",
131893
+ // "premium_index": "0",
131894
+ // "avg_premium_index": "0.000029587712038098",
131895
+ // "interest_rate": "0.0001",
131896
+ // "timestamp": "2022-03-22T08:08:26.687Z"
131897
+ // }
131898
+ //
131899
+ return this.parseOpenInterest(response, market);
131900
+ }
131809
131901
  async fetchFundingRate(symbol, params = {}) {
131810
131902
  /**
131811
131903
  * @method
131812
131904
  * @name hitbtc#fetchFundingRate
131813
131905
  * @description fetch the current funding rate
131906
+ * @see https://api.hitbtc.com/#futures-info
131814
131907
  * @param {string} symbol unified market symbol
131815
131908
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
131816
131909
  * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
@@ -131820,31 +131913,26 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
131820
131913
  if (!market['swap']) {
131821
131914
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
131822
131915
  }
131823
- const request = {};
131824
- if (symbol !== undefined) {
131825
- symbol = market['symbol'];
131826
- request['symbols'] = market['id'];
131827
- }
131828
- const response = await this.publicGetPublicFuturesInfo(this.extend(request, params));
131916
+ const request = {
131917
+ 'symbol': market['id'],
131918
+ };
131919
+ const response = await this.publicGetPublicFuturesInfoSymbol(this.extend(request, params));
131829
131920
  //
131830
131921
  // {
131831
- // "BTCUSDT_PERP": {
131832
- // "contract_type": "perpetual",
131833
- // "mark_price": "42307.43",
131834
- // "index_price": "42303.27",
131835
- // "funding_rate": "0.0001",
131836
- // "open_interest": "30.9826",
131837
- // "next_funding_time": "2022-03-22T16:00:00.000Z",
131838
- // "indicative_funding_rate": "0.0001",
131839
- // "premium_index": "0",
131840
- // "avg_premium_index": "0.000029587712038098",
131841
- // "interest_rate": "0.0001",
131842
- // "timestamp": "2022-03-22T08:08:26.687Z"
131843
- // }
131922
+ // "contract_type": "perpetual",
131923
+ // "mark_price": "42307.43",
131924
+ // "index_price": "42303.27",
131925
+ // "funding_rate": "0.0001",
131926
+ // "open_interest": "30.9826",
131927
+ // "next_funding_time": "2022-03-22T16:00:00.000Z",
131928
+ // "indicative_funding_rate": "0.0001",
131929
+ // "premium_index": "0",
131930
+ // "avg_premium_index": "0.000029587712038098",
131931
+ // "interest_rate": "0.0001",
131932
+ // "timestamp": "2022-03-22T08:08:26.687Z"
131844
131933
  // }
131845
131934
  //
131846
- const data = this.safeValue(response, market['id'], {});
131847
- return this.parseFundingRate(data, market);
131935
+ return this.parseFundingRate(response, market);
131848
131936
  }
131849
131937
  parseFundingRate(contract, market = undefined) {
131850
131938
  //
@@ -132048,10 +132136,8 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
132048
132136
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
132049
132137
  * @returns {object} response from the exchange
132050
132138
  */
132139
+ this.checkRequiredSymbol('setLeverage', symbol);
132051
132140
  await this.loadMarkets();
132052
- if (symbol === undefined) {
132053
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
132054
- }
132055
132141
  if (params['margin_balance'] === undefined) {
132056
132142
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setLeverage() requires a margin_balance parameter that will transfer margin to the specified trading pair');
132057
132143
  }
@@ -133510,9 +133596,7 @@ class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
133510
133596
  * @param {object} [params] extra parameters specific to the hollaex api endpoint
133511
133597
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
133512
133598
  */
133513
- if (symbol === undefined) {
133514
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + " cancelAllOrders() requires a 'symbol' argument");
133515
- }
133599
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
133516
133600
  await this.loadMarkets();
133517
133601
  const request = {};
133518
133602
  let market = undefined;
@@ -142289,19 +142373,10 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
142289
142373
  * @param {int} [params.code] unified currency code, can be used when symbol is undefined
142290
142374
  * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
142291
142375
  */
142292
- const code = this.safeString(params, 'code');
142376
+ this.checkRequiredSymbol('fetchSettlementHistory', symbol);
142293
142377
  const until = this.safeInteger2(params, 'until', 'till');
142294
142378
  params = this.omit(params, ['until', 'till']);
142295
- const market = (symbol === undefined) ? undefined : this.market(symbol);
142296
- const [type, query] = this.handleMarketTypeAndParams('fetchSettlementHistory', market, params);
142297
- if (type === 'future') {
142298
- if (symbol === undefined && code === undefined) {
142299
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' requires a symbol argument or params["code"] for fetchSettlementHistory future');
142300
- }
142301
- }
142302
- else if (symbol === undefined) {
142303
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' requires a symbol argument for fetchSettlementHistory swap');
142304
- }
142379
+ const market = this.market(symbol);
142305
142380
  const request = {};
142306
142381
  if (market['future']) {
142307
142382
  request['symbol'] = market['baseId'];
@@ -142327,7 +142402,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
142327
142402
  method = 'contractPublicGetSwapApiV1SwapSettlementRecords';
142328
142403
  }
142329
142404
  }
142330
- const response = await this[method](this.extend(request, query));
142405
+ const response = await this[method](this.extend(request, params));
142331
142406
  //
142332
142407
  // linear swap, coin-m swap
142333
142408
  //
@@ -143904,9 +143979,7 @@ class huobijp extends _abstract_huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
143904
143979
  return await this[method](symbol, since, limit, params);
143905
143980
  }
143906
143981
  async fetchOpenOrdersV1(symbol = undefined, since = undefined, limit = undefined, params = {}) {
143907
- if (symbol === undefined) {
143908
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrdersV1() requires a symbol argument');
143909
- }
143982
+ this.checkRequiredSymbol('fetchOpenOrdersV1', symbol);
143910
143983
  return await this.fetchOrdersByStates('pre-submitted,submitted,partial-filled', symbol, since, limit, params);
143911
143984
  }
143912
143985
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -147768,9 +147841,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
147768
147841
  * @param {object} [params] extra parameters specific to the indodax api endpoint
147769
147842
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
147770
147843
  */
147771
- if (symbol === undefined) {
147772
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol');
147773
- }
147844
+ this.checkRequiredSymbol('fetchOrder', symbol);
147774
147845
  await this.loadMarkets();
147775
147846
  const market = this.market(symbol);
147776
147847
  const request = {
@@ -147830,13 +147901,11 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
147830
147901
  * @description fetches information on multiple closed orders made by the user
147831
147902
  * @param {string} symbol unified market symbol of the market orders were made in
147832
147903
  * @param {int} [since] the earliest time in ms to fetch orders for
147833
- * @param {int} [limit] the maximum number of orde structures to retrieve
147904
+ * @param {int} [limit] the maximum number of order structures to retrieve
147834
147905
  * @param {object} [params] extra parameters specific to the indodax api endpoint
147835
147906
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
147836
147907
  */
147837
- if (symbol === undefined) {
147838
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
147839
- }
147908
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
147840
147909
  await this.loadMarkets();
147841
147910
  const request = {};
147842
147911
  let market = undefined;
@@ -147899,9 +147968,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
147899
147968
  * @param {object} [params] extra parameters specific to the indodax api endpoint
147900
147969
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
147901
147970
  */
147902
- if (symbol === undefined) {
147903
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
147904
- }
147971
+ this.checkRequiredSymbol('cancelOrder', symbol);
147905
147972
  const side = this.safeValue(params, 'side');
147906
147973
  if (side === undefined) {
147907
147974
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires an extra "side" param');
@@ -158476,10 +158543,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
158476
158543
  * @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
158477
158544
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
158478
158545
  */
158479
- //
158480
- if (symbol === undefined) {
158481
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
158482
- }
158546
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
158483
158547
  await this.loadMarkets();
158484
158548
  const market = this.market(symbol);
158485
158549
  const request = {
@@ -160020,9 +160084,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
160020
160084
  * @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)
160021
160085
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
160022
160086
  */
160023
- if (symbol === undefined) {
160024
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
160025
- }
160087
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
160026
160088
  await this.loadMarkets();
160027
160089
  let paginate = false;
160028
160090
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -160687,6 +160749,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
160687
160749
  'max': undefined,
160688
160750
  },
160689
160751
  },
160752
+ 'created': undefined,
160690
160753
  'info': item,
160691
160754
  });
160692
160755
  }
@@ -168183,9 +168246,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
168183
168246
  * @param {object} [params] extra parameters specific to the luno api endpoint
168184
168247
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
168185
168248
  */
168186
- if (symbol === undefined) {
168187
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
168188
- }
168249
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
168189
168250
  await this.loadMarkets();
168190
168251
  const market = this.market(symbol);
168191
168252
  const request = {
@@ -170276,9 +170337,7 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
170276
170337
  * @param {object} [params] extra parameters specific to the mercado api endpoint
170277
170338
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
170278
170339
  */
170279
- if (symbol === undefined) {
170280
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
170281
- }
170340
+ this.checkRequiredSymbol('cancelOrder', symbol);
170282
170341
  await this.loadMarkets();
170283
170342
  const market = this.market(symbol);
170284
170343
  const request = {
@@ -170402,9 +170461,7 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
170402
170461
  * @param {object} [params] extra parameters specific to the mercado api endpoint
170403
170462
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
170404
170463
  */
170405
- if (symbol === undefined) {
170406
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
170407
- }
170464
+ this.checkRequiredSymbol('fetchOrder', symbol);
170408
170465
  await this.loadMarkets();
170409
170466
  const market = this.market(symbol);
170410
170467
  const request = {
@@ -170570,13 +170627,11 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
170570
170627
  * @description fetches information on multiple orders made by the user
170571
170628
  * @param {string} symbol unified market symbol of the market orders were made in
170572
170629
  * @param {int} [since] the earliest time in ms to fetch orders for
170573
- * @param {int} [limit] the maximum number of orde structures to retrieve
170630
+ * @param {int} [limit] the maximum number of order structures to retrieve
170574
170631
  * @param {object} [params] extra parameters specific to the mercado api endpoint
170575
170632
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
170576
170633
  */
170577
- if (symbol === undefined) {
170578
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
170579
- }
170634
+ this.checkRequiredSymbol('fetchOrders', symbol);
170580
170635
  await this.loadMarkets();
170581
170636
  const market = this.market(symbol);
170582
170637
  const request = {
@@ -170594,13 +170649,11 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
170594
170649
  * @description fetch all unfilled currently open orders
170595
170650
  * @param {string} symbol unified market symbol
170596
170651
  * @param {int} [since] the earliest time in ms to fetch open orders for
170597
- * @param {int} [limit] the maximum number of open orders structures to retrieve
170652
+ * @param {int} [limit] the maximum number of open order structures to retrieve
170598
170653
  * @param {object} [params] extra parameters specific to the mercado api endpoint
170599
170654
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
170600
170655
  */
170601
- if (symbol === undefined) {
170602
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
170603
- }
170656
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
170604
170657
  await this.loadMarkets();
170605
170658
  const market = this.market(symbol);
170606
170659
  const request = {
@@ -170623,9 +170676,7 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
170623
170676
  * @param {object} [params] extra parameters specific to the mercado api endpoint
170624
170677
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
170625
170678
  */
170626
- if (symbol === undefined) {
170627
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
170628
- }
170679
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
170629
170680
  await this.loadMarkets();
170630
170681
  const market = this.market(symbol);
170631
170682
  const request = {
@@ -173047,9 +173098,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
173047
173098
  * @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
173048
173099
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
173049
173100
  */
173050
- if (symbol === undefined) {
173051
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
173052
- }
173101
+ this.checkRequiredSymbol('fetchOrder', symbol);
173053
173102
  await this.loadMarkets();
173054
173103
  const market = this.market(symbol);
173055
173104
  const request = {
@@ -174374,9 +174423,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
174374
174423
  * @param {object} [params] extra parameters specific to the mexc3 api endpoint
174375
174424
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
174376
174425
  */
174377
- if (symbol === undefined) {
174378
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
174379
- }
174426
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
174380
174427
  await this.loadMarkets();
174381
174428
  const market = this.market(symbol);
174382
174429
  const [marketType, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
@@ -174767,9 +174814,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
174767
174814
  * @param {object} [params] extra parameters specific to the mexc api endpoint
174768
174815
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
174769
174816
  */
174770
- if (symbol === undefined) {
174771
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
174772
- }
174817
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
174773
174818
  await this.loadMarkets();
174774
174819
  const market = this.market(symbol);
174775
174820
  const request = {
@@ -175737,10 +175782,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175737
175782
  * @param {object} [params] extra parameters specific to the mexc3 api endpoint
175738
175783
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
175739
175784
  */
175785
+ this.checkRequiredSymbol('borrowMargin', symbol);
175740
175786
  await this.loadMarkets();
175741
- if (symbol === undefined) {
175742
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument for isolated margin');
175743
- }
175744
175787
  const market = this.market(symbol);
175745
175788
  const currency = this.currency(code);
175746
175789
  const request = {
@@ -175773,10 +175816,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
175773
175816
  * @param {string} [params.borrowId] transaction id '762407666453712896'
175774
175817
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
175775
175818
  */
175819
+ this.checkRequiredSymbol('repayMargin', symbol);
175776
175820
  await this.loadMarkets();
175777
- if (symbol === undefined) {
175778
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument for isolated margin');
175779
- }
175780
175821
  const id = this.safeString2(params, 'id', 'borrowId');
175781
175822
  if (id === undefined) {
175782
175823
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' repayMargin() requires a borrowId argument in the params');
@@ -180887,13 +180928,11 @@ class oceanex extends _abstract_oceanex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
180887
180928
  * @see https://api.oceanex.pro/doc/v1/#order-status-with-filters-post
180888
180929
  * @param {string} symbol unified market symbol of the market orders were made in
180889
180930
  * @param {int} [since] the earliest time in ms to fetch orders for
180890
- * @param {int} [limit] the maximum number of orde structures to retrieve
180931
+ * @param {int} [limit] the maximum number of order structures to retrieve
180891
180932
  * @param {object} [params] extra parameters specific to the oceanex api endpoint
180892
180933
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
180893
180934
  */
180894
- if (symbol === undefined) {
180895
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a `symbol` argument');
180896
- }
180935
+ this.checkRequiredSymbol('fetchOrders', symbol);
180897
180936
  await this.loadMarkets();
180898
180937
  const market = this.market(symbol);
180899
180938
  const states = this.safeValue(params, 'states', ['wait', 'done', 'cancel']);
@@ -184430,7 +184469,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
184430
184469
  'market/index-components': 1,
184431
184470
  'market/block-tickers': 1,
184432
184471
  'market/block-ticker': 1,
184433
- 'market/block-trades': 1,
184472
+ 'public/block-trades': 1,
184434
184473
  'public/instruments': 1,
184435
184474
  'public/delivery-exercise-history': 1 / 2,
184436
184475
  'public/open-interest': 1,
@@ -184472,6 +184511,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
184472
184511
  'tradingBot/grid/min-investment': 1,
184473
184512
  'tradingBot/public/rsi-back-testing': 1,
184474
184513
  'asset/exchange-list': 5 / 3,
184514
+ 'finance/staking-defi/eth/apy-history': 5 / 3,
184475
184515
  'finance/savings/lending-rate-summary': 5 / 3,
184476
184516
  'finance/savings/lending-rate-history': 5 / 3,
184477
184517
  // public broker
@@ -184582,6 +184622,9 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
184582
184622
  'finance/staking-defi/offers': 10 / 3,
184583
184623
  'finance/staking-defi/orders-active': 10 / 3,
184584
184624
  'finance/staking-defi/orders-history': 10 / 3,
184625
+ // eth staking
184626
+ 'finance/staking-defi/eth/balance': 5 / 3,
184627
+ 'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
184585
184628
  // copytrading
184586
184629
  'copytrading/current-subpositions': 4,
184587
184630
  'copytrading/subpositions-history': 10,
@@ -184686,6 +184729,9 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
184686
184729
  'finance/staking-defi/purchase': 3,
184687
184730
  'finance/staking-defi/redeem': 3,
184688
184731
  'finance/staking-defi/cancel': 3,
184732
+ // eth staking
184733
+ 'finance/staking-defi/eth/purchase': 5,
184734
+ 'finance/staking-defi/eth/redeem': 5,
184689
184735
  // copytrading
184690
184736
  'copytrading/algo-order': 20,
184691
184737
  'copytrading/close-subposition': 4,
@@ -186423,9 +186469,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
186423
186469
  * @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)
186424
186470
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
186425
186471
  */
186426
- if (symbol === undefined) {
186427
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
186428
- }
186472
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
186429
186473
  await this.loadMarkets();
186430
186474
  let paginate = false;
186431
186475
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -187200,14 +187244,12 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
187200
187244
  * @param {object} [params] extra parameters specific to the okx api endpoint
187201
187245
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
187202
187246
  */
187247
+ this.checkRequiredSymbol('cancelOrder', symbol);
187203
187248
  const stop = this.safeValue(params, 'stop');
187204
187249
  if (stop) {
187205
187250
  const orderInner = await this.cancelOrders([id], symbol, params);
187206
187251
  return this.safeValue(orderInner, 0);
187207
187252
  }
187208
- if (symbol === undefined) {
187209
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
187210
- }
187211
187253
  await this.loadMarkets();
187212
187254
  const market = this.market(symbol);
187213
187255
  const request = {
@@ -187257,9 +187299,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
187257
187299
  * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
187258
187300
  */
187259
187301
  // TODO : the original endpoint signature differs, according to that you can skip individual symbol and assign ids in batch. At this moment, `params` is not being used too.
187260
- if (symbol === undefined) {
187261
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
187262
- }
187302
+ this.checkRequiredSymbol('cancelOrders', symbol);
187263
187303
  await this.loadMarkets();
187264
187304
  const market = this.market(symbol);
187265
187305
  const request = [];
@@ -187570,9 +187610,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
187570
187610
  * @param {object} [params] extra and exchange specific parameters
187571
187611
  * @returns [an order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
187572
187612
  */
187573
- if (symbol === undefined) {
187574
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
187575
- }
187613
+ this.checkRequiredSymbol('fetchOrder', symbol);
187576
187614
  await this.loadMarkets();
187577
187615
  const market = this.market(symbol);
187578
187616
  const request = {
@@ -190029,9 +190067,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
190029
190067
  * @param {string} [params.posSide] 'long' or 'short' for isolated margin long/short mode on futures and swap markets
190030
190068
  * @returns {object} response from the exchange
190031
190069
  */
190032
- if (symbol === undefined) {
190033
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
190034
- }
190070
+ this.checkRequiredSymbol('setLeverage', symbol);
190035
190071
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
190036
190072
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
190037
190073
  if ((leverage < 1) || (leverage > 125)) {
@@ -190125,9 +190161,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
190125
190161
  * @param {int} [params.leverage] leverage
190126
190162
  * @returns {object} response from the exchange
190127
190163
  */
190128
- if (symbol === undefined) {
190129
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
190130
- }
190164
+ this.checkRequiredSymbol('setMarginMode', symbol);
190131
190165
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
190132
190166
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
190133
190167
  marginMode = marginMode.toLowerCase();
@@ -194466,9 +194500,6 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194466
194500
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
194467
194501
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194468
194502
  */
194469
- if (symbol === undefined) {
194470
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
194471
- }
194472
194503
  await this.loadMarkets();
194473
194504
  const market = this.market(symbol);
194474
194505
  const request = {
@@ -194542,9 +194573,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194542
194573
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
194543
194574
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194544
194575
  */
194545
- if (symbol === undefined) {
194546
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
194547
- }
194576
+ this.checkRequiredSymbol('cancelOrder', symbol);
194548
194577
  await this.loadMarkets();
194549
194578
  const market = this.market(symbol);
194550
194579
  const request = {
@@ -194583,9 +194612,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194583
194612
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194584
194613
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194585
194614
  */
194586
- if (symbol === undefined) {
194587
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
194588
- }
194615
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
194589
194616
  await this.loadMarkets();
194590
194617
  const request = {
194591
194618
  // 'symbol': market['id'],
@@ -194612,9 +194639,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194612
194639
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194613
194640
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194614
194641
  */
194615
- if (symbol === undefined) {
194616
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
194617
- }
194642
+ this.checkRequiredSymbol('fetchOrder', symbol);
194618
194643
  await this.loadMarkets();
194619
194644
  const market = this.market(symbol);
194620
194645
  if (market['settle'] === 'USDT') {
@@ -194657,13 +194682,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194657
194682
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
194658
194683
  * @param {string} symbol unified market symbol of the market orders were made in
194659
194684
  * @param {int} [since] the earliest time in ms to fetch orders for
194660
- * @param {int} [limit] the maximum number of orde structures to retrieve
194685
+ * @param {int} [limit] the maximum number of order structures to retrieve
194661
194686
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194662
194687
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194663
194688
  */
194664
- if (symbol === undefined) {
194665
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
194666
- }
194689
+ this.checkRequiredSymbol('fetchOrders', symbol);
194667
194690
  await this.loadMarkets();
194668
194691
  const market = this.market(symbol);
194669
194692
  const request = {
@@ -194697,13 +194720,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194697
194720
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md
194698
194721
  * @param {string} symbol unified market symbol
194699
194722
  * @param {int} [since] the earliest time in ms to fetch open orders for
194700
- * @param {int} [limit] the maximum number of open orders structures to retrieve
194723
+ * @param {int} [limit] the maximum number of open order structures to retrieve
194701
194724
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194702
194725
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194703
194726
  */
194704
- if (symbol === undefined) {
194705
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
194706
- }
194727
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
194707
194728
  await this.loadMarkets();
194708
194729
  const market = this.market(symbol);
194709
194730
  let method = 'privateGetSpotOrders';
@@ -194743,13 +194764,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194743
194764
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
194744
194765
  * @param {string} symbol unified market symbol of the market orders were made in
194745
194766
  * @param {int} [since] the earliest time in ms to fetch orders for
194746
- * @param {int} [limit] the maximum number of orde structures to retrieve
194767
+ * @param {int} [limit] the maximum number of order structures to retrieve
194747
194768
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194748
194769
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
194749
194770
  */
194750
- if (symbol === undefined) {
194751
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
194752
- }
194771
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
194753
194772
  await this.loadMarkets();
194754
194773
  const market = this.market(symbol);
194755
194774
  const request = {
@@ -194828,9 +194847,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
194828
194847
  * @param {object} [params] extra parameters specific to the phemex api endpoint
194829
194848
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
194830
194849
  */
194831
- if (symbol === undefined) {
194832
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
194833
- }
194850
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
194834
194851
  await this.loadMarkets();
194835
194852
  const market = this.market(symbol);
194836
194853
  let method = 'privateGetExchangeSpotOrderTrades';
@@ -195470,10 +195487,8 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
195470
195487
  * @param {object} [params] extra parameters specific to the phemex api endpoint
195471
195488
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
195472
195489
  */
195490
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
195473
195491
  await this.loadMarkets();
195474
- if (symbol === undefined) {
195475
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
195476
- }
195477
195492
  const market = this.market(symbol);
195478
195493
  const request = {
195479
195494
  'symbol': market['id'],
@@ -195946,9 +195961,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
195946
195961
  */
195947
195962
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
195948
195963
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
195949
- if (symbol === undefined) {
195950
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
195951
- }
195964
+ this.checkRequiredSymbol('setLeverage', symbol);
195952
195965
  if ((leverage < 1) || (leverage > 100)) {
195953
195966
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' setLeverage() leverage should be between 1 and 100');
195954
195967
  }
@@ -199754,9 +199767,7 @@ class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MOD
199754
199767
  * @param {object} [params] extra parameters specific to the poloniexfutures api endpoint
199755
199768
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
199756
199769
  */
199757
- if (symbol === undefined) {
199758
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
199759
- }
199770
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
199760
199771
  await this.loadMarkets();
199761
199772
  const market = this.market(symbol);
199762
199773
  const request = {
@@ -200339,9 +200350,7 @@ class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MOD
200339
200350
  * @param {object} [params] extra parameters specific to the poloniexfutures api endpoint
200340
200351
  * @returns {object} response from the exchange
200341
200352
  */
200342
- if (symbol === undefined) {
200343
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
200344
- }
200353
+ this.checkRequiredSymbol('setMarginMode', symbol);
200345
200354
  if ((marginMode !== 0) && (marginMode !== 1)) {
200346
200355
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0 (isolated) or 1 (cross)');
200347
200356
  }
@@ -209376,13 +209385,11 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
209376
209385
  * @description watches information on multiple orders made by the user
209377
209386
  * @param {string} symbol unified market symbol of the market orders were made in
209378
209387
  * @param {int} [since] the earliest time in ms to fetch orders for
209379
- * @param {int} [limit] the maximum number of orde structures to retrieve
209388
+ * @param {int} [limit] the maximum number of order structures to retrieve
209380
209389
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
209381
209390
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
209382
209391
  */
209383
- if (symbol === undefined) {
209384
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
209385
- }
209392
+ this.checkRequiredSymbol('watchOrders', symbol);
209386
209393
  await this.loadMarkets();
209387
209394
  const market = this.market(symbol);
209388
209395
  symbol = market['symbol'];
@@ -212990,11 +212997,9 @@ class bitpanda extends _bitpanda_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
212990
212997
  /* harmony export */ });
212991
212998
  /* harmony import */ var _bitrue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(854);
212992
212999
  /* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
212993
- /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
212994
213000
  // ---------------------------------------------------------------------------
212995
213001
 
212996
213002
 
212997
-
212998
213003
  // ---------------------------------------------------------------------------
212999
213004
  class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
213000
213005
  describe() {
@@ -213280,9 +213285,6 @@ class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
213280
213285
  }, market);
213281
213286
  }
213282
213287
  async watchOrderBook(symbol, limit = undefined, params = {}) {
213283
- if (symbol === undefined) {
213284
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' watchOrderBook() requires a symbol argument');
213285
- }
213286
213288
  await this.loadMarkets();
213287
213289
  const market = this.market(symbol);
213288
213290
  symbol = market['symbol'];
@@ -213730,13 +213732,11 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
213730
213732
  * @description watches information on multiple orders made by the user
213731
213733
  * @param {string} symbol unified market symbol of the market orders were made in
213732
213734
  * @param {int} [since] the earliest time in ms to fetch orders for
213733
- * @param {int} [limit] the maximum number of orde structures to retrieve
213735
+ * @param {int} [limit] the maximum number of order structures to retrieve
213734
213736
  * @param {object} [params] extra parameters specific to the bitstamp api endpoint
213735
213737
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
213736
213738
  */
213737
- if (symbol === undefined) {
213738
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
213739
- }
213739
+ this.checkRequiredSymbol('watchOrders', symbol);
213740
213740
  await this.loadMarkets();
213741
213741
  const market = this.market(symbol);
213742
213742
  symbol = market['symbol'];
@@ -214978,9 +214978,9 @@ class bittrex extends _bittrex_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */
214978
214978
  /* harmony export */ "Z": () => (/* binding */ bitvavo)
214979
214979
  /* harmony export */ });
214980
214980
  /* harmony import */ var _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9943);
214981
- /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
214981
+ /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
214982
214982
  /* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
214983
- /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1372);
214983
+ /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1372);
214984
214984
  // ---------------------------------------------------------------------------
214985
214985
 
214986
214986
 
@@ -215398,13 +215398,11 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215398
215398
  * @description watches information on multiple orders made by the user
215399
215399
  * @param {string} symbol unified market symbol of the market orders were made in
215400
215400
  * @param {int} [since] the earliest time in ms to fetch orders for
215401
- * @param {int} [limit] the maximum number of orde structures to retrieve
215401
+ * @param {int} [limit] the maximum number of order structures to retrieve
215402
215402
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
215403
215403
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
215404
215404
  */
215405
- if (symbol === undefined) {
215406
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
215407
- }
215405
+ this.checkRequiredSymbol('watchOrders', symbol);
215408
215406
  await this.loadMarkets();
215409
215407
  await this.authenticate();
215410
215408
  const market = this.market(symbol);
@@ -215439,9 +215437,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215439
215437
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
215440
215438
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ortradeder-structure
215441
215439
  */
215442
- if (symbol === undefined) {
215443
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' watchMyTrades requires a symbol argument');
215444
- }
215440
+ this.checkRequiredSymbol('watchMyTrades', symbol);
215445
215441
  await this.loadMarkets();
215446
215442
  await this.authenticate();
215447
215443
  const market = this.market(symbol);
@@ -215562,7 +215558,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215562
215558
  const timestamp = this.milliseconds();
215563
215559
  const stringTimestamp = timestamp.toString();
215564
215560
  const auth = stringTimestamp + 'GET/' + this.version + '/websocket';
215565
- const signature = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__/* .sha256 */ .J);
215561
+ const signature = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_2__/* .sha256 */ .J);
215566
215562
  const action = 'authenticate';
215567
215563
  const request = {
215568
215564
  'action': action,
@@ -215590,7 +215586,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
215590
215586
  client.resolve(message, messageHash);
215591
215587
  }
215592
215588
  else {
215593
- const error = new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError(this.json(message));
215589
+ const error = new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.AuthenticationError(this.json(message));
215594
215590
  client.reject(error, messageHash);
215595
215591
  // allows further authentication attempts
215596
215592
  if (messageHash in client.subscriptions) {
@@ -218674,9 +218670,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
218674
218670
  * @param {object} [params] extra parameters specific to the cex api endpoint
218675
218671
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
218676
218672
  */
218677
- if (symbol === undefined) {
218678
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
218679
- }
218673
+ this.checkRequiredSymbol('watchOrders', symbol);
218680
218674
  await this.loadMarkets();
218681
218675
  await this.authenticate(params);
218682
218676
  const url = this.urls['api']['ws'];
@@ -218712,9 +218706,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
218712
218706
  * @param {object} [params] extra parameters specific to the cex api endpoint
218713
218707
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
218714
218708
  */
218715
- if (symbol === undefined) {
218716
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
218717
- }
218709
+ this.checkRequiredSymbol('watchMyTrades', symbol);
218718
218710
  await this.loadMarkets();
218719
218711
  await this.authenticate(params);
218720
218712
  const url = this.urls['api']['ws'];
@@ -246929,9 +246921,7 @@ class whitebit extends _whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
246929
246921
  * @param {object} [params] extra parameters specific to the whitebit api endpoint
246930
246922
  * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
246931
246923
  */
246932
- if (symbol === undefined) {
246933
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchMyTrades requires a symbol argument');
246934
- }
246924
+ this.checkRequiredSymbol('watchMyTrades', symbol);
246935
246925
  await this.loadMarkets();
246936
246926
  await this.authenticate();
246937
246927
  const market = this.market(symbol);
@@ -247024,13 +247014,11 @@ class whitebit extends _whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
247024
247014
  * @description watches information on multiple orders made by the user
247025
247015
  * @param {string} symbol unified market symbol of the market orders were made in
247026
247016
  * @param {int} [since] the earliest time in ms to fetch orders for
247027
- * @param {int} [limit] the maximum number of orde structures to retrieve
247017
+ * @param {int} [limit] the maximum number of order structures to retrieve
247028
247018
  * @param {object} [params] extra parameters specific to the whitebit api endpoint
247029
247019
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure
247030
247020
  */
247031
- if (symbol === undefined) {
247032
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchOrders requires a symbol argument');
247033
- }
247021
+ this.checkRequiredSymbol('watchOrders', symbol);
247034
247022
  await this.loadMarkets();
247035
247023
  await this.authenticate();
247036
247024
  const market = this.market(symbol);
@@ -249352,9 +249340,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
249352
249340
  * @param {object} [params] extra parameters specific to the probit api endpoint
249353
249341
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
249354
249342
  */
249355
- if (symbol === undefined) {
249356
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
249357
- }
249343
+ this.checkRequiredSymbol('fetchOrder', symbol);
249358
249344
  await this.loadMarkets();
249359
249345
  const market = this.market(symbol);
249360
249346
  const request = {
@@ -249555,9 +249541,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
249555
249541
  * @param {object} [params] extra parameters specific to the probit api endpoint
249556
249542
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
249557
249543
  */
249558
- if (symbol === undefined) {
249559
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
249560
- }
249544
+ this.checkRequiredSymbol('cancelOrder', symbol);
249561
249545
  await this.loadMarkets();
249562
249546
  const market = this.market(symbol);
249563
249547
  const request = {
@@ -263514,13 +263498,11 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
263514
263498
  * @description fetches information on multiple orders made by the user
263515
263499
  * @param {string} symbol unified market symbol of the market orders were made in
263516
263500
  * @param {int} [since] the earliest time in ms to fetch orders for
263517
- * @param {int} [limit] the maximum number of orde structures to retrieve
263501
+ * @param {int} [limit] the maximum number of order structures to retrieve
263518
263502
  * @param {object} [params] extra parameters specific to the tokocrypto api endpoint
263519
263503
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
263520
263504
  */
263521
- if (symbol === undefined) {
263522
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
263523
- }
263505
+ this.checkRequiredSymbol('fetchOrders', symbol);
263524
263506
  await this.loadMarkets();
263525
263507
  const market = this.market(symbol);
263526
263508
  const request = {
@@ -263664,9 +263646,7 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
263664
263646
  * @param {object} [params] extra parameters specific to the tokocrypto api endpoint
263665
263647
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
263666
263648
  */
263667
- if (symbol === undefined) {
263668
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
263669
- }
263649
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
263670
263650
  await this.loadMarkets();
263671
263651
  const market = this.market(symbol);
263672
263652
  const request = {
@@ -267647,15 +267627,13 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
267647
267627
  * @description fetches information on multiple orders made by the user
267648
267628
  * @param {string} symbol unified market symbol of the market orders were made in
267649
267629
  * @param {int} [since] the earliest time in ms to fetch orders for
267650
- * @param {int} [limit] the maximum number of orde structures to retrieve
267630
+ * @param {int} [limit] the maximum number of order structures to retrieve
267651
267631
  * @param {object} [params] extra parameters specific to the wavesexchange api endpoint
267652
267632
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
267653
267633
  */
267654
267634
  this.checkRequiredDependencies();
267655
267635
  this.checkRequiredKeys();
267656
- if (symbol === undefined) {
267657
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires symbol argument');
267658
- }
267636
+ this.checkRequiredSymbol('fetchOrders', symbol);
267659
267637
  await this.loadMarkets();
267660
267638
  const market = this.market(symbol);
267661
267639
  const timestamp = this.milliseconds();
@@ -269362,13 +269340,11 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
269362
269340
  * @description fetches information on multiple orders made by the user
269363
269341
  * @param {string} symbol unified market symbol of the market orders were made in
269364
269342
  * @param {int} [since] the earliest time in ms to fetch orders for
269365
- * @param {int} [limit] the maximum number of orde structures to retrieve
269343
+ * @param {int} [limit] the maximum number of order structures to retrieve
269366
269344
  * @param {object} [params] extra parameters specific to the wazirx api endpoint
269367
269345
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
269368
269346
  */
269369
- if (symbol === undefined) {
269370
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrders() requires a `symbol` argument');
269371
- }
269347
+ this.checkRequiredSymbol('fetchOrders', symbol);
269372
269348
  await this.loadMarkets();
269373
269349
  const market = this.market(symbol);
269374
269350
  const request = {
@@ -269474,9 +269450,7 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
269474
269450
  * @param {object} [params] extra parameters specific to the wazirx api endpoint
269475
269451
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
269476
269452
  */
269477
- if (symbol === undefined) {
269478
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelAllOrders() requires a `symbol` argument');
269479
- }
269453
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
269480
269454
  await this.loadMarkets();
269481
269455
  const market = this.market(symbol);
269482
269456
  const request = {
@@ -269495,9 +269469,7 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
269495
269469
  * @param {object} [params] extra parameters specific to the wazirx api endpoint
269496
269470
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
269497
269471
  */
269498
- if (symbol === undefined) {
269499
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a `symbol` argument');
269500
- }
269472
+ this.checkRequiredSymbol('cancelOrder', symbol);
269501
269473
  await this.loadMarkets();
269502
269474
  const market = this.market(symbol);
269503
269475
  const request = {
@@ -270909,9 +270881,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
270909
270881
  * @param {object} [params] extra parameters specific to the whitebit api endpoint
270910
270882
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
270911
270883
  */
270912
- if (symbol === undefined) {
270913
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
270914
- }
270884
+ this.checkRequiredSymbol('cancelOrder', symbol);
270915
270885
  await this.loadMarkets();
270916
270886
  const market = this.market(symbol);
270917
270887
  const request = {
@@ -271000,13 +270970,11 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
271000
270970
  * @description fetch all unfilled currently open orders
271001
270971
  * @param {string} symbol unified market symbol
271002
270972
  * @param {int} [since] the earliest time in ms to fetch open orders for
271003
- * @param {int} [limit] the maximum number of open orders structures to retrieve
270973
+ * @param {int} [limit] the maximum number of open order structures to retrieve
271004
270974
  * @param {object} [params] extra parameters specific to the whitebit api endpoint
271005
270975
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
271006
270976
  */
271007
- if (symbol === undefined) {
271008
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
271009
- }
270977
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
271010
270978
  await this.loadMarkets();
271011
270979
  const market = this.market(symbol);
271012
270980
  const request = {
@@ -272369,9 +272337,6 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272369
272337
  * @param {object} [params] extra parameters specific to the woo api endpoint
272370
272338
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
272371
272339
  */
272372
- if (symbol === undefined) {
272373
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
272374
- }
272375
272340
  await this.loadMarkets();
272376
272341
  const market = this.market(symbol);
272377
272342
  const request = {
@@ -275601,13 +275566,11 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
275601
275566
  * @description fetch all unfilled currently open orders
275602
275567
  * @param {string} symbol unified market symbol
275603
275568
  * @param {int} [since] the earliest time in ms to fetch open orders for
275604
- * @param {int} [limit] the maximum number of open orders structures to retrieve
275569
+ * @param {int} [limit] the maximum number of open order structures to retrieve
275605
275570
  * @param {object} [params] extra parameters specific to the yobit api endpoint
275606
275571
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
275607
275572
  */
275608
- if (symbol === undefined) {
275609
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
275610
- }
275573
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
275611
275574
  await this.loadMarkets();
275612
275575
  const request = {};
275613
275576
  const market = undefined;
@@ -275654,9 +275617,7 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
275654
275617
  * @param {object} [params] extra parameters specific to the yobit api endpoint
275655
275618
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
275656
275619
  */
275657
- if (symbol === undefined) {
275658
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a `symbol` argument');
275659
- }
275620
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
275660
275621
  await this.loadMarkets();
275661
275622
  const market = this.market(symbol);
275662
275623
  // some derived classes use camelcase notation for request fields
@@ -284120,7 +284081,7 @@ SOFTWARE.
284120
284081
 
284121
284082
  //-----------------------------------------------------------------------------
284122
284083
  // this is updated by vss.js when building
284123
- const version = '4.1.44';
284084
+ const version = '4.1.45';
284124
284085
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
284125
284086
  //-----------------------------------------------------------------------------
284126
284087