ccxt 4.1.44 → 4.1.46

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 (242) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +2132 -768
  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/base/Exchange.js +11 -3
  8. package/dist/cjs/src/base/ws/Cache.js +50 -0
  9. package/dist/cjs/src/bigone.js +2 -6
  10. package/dist/cjs/src/binance.js +16 -12
  11. package/dist/cjs/src/bit2c.js +2 -4
  12. package/dist/cjs/src/bitbns.js +5 -15
  13. package/dist/cjs/src/bitfinex.js +1 -3
  14. package/dist/cjs/src/bitfinex2.js +1 -3
  15. package/dist/cjs/src/bitflyer.js +4 -12
  16. package/dist/cjs/src/bitforex.js +4 -8
  17. package/dist/cjs/src/bithumb.js +4 -10
  18. package/dist/cjs/src/bitmart.js +64 -59
  19. package/dist/cjs/src/bitmex.js +2 -6
  20. package/dist/cjs/src/bitopro.js +6 -16
  21. package/dist/cjs/src/bitrue.js +6 -14
  22. package/dist/cjs/src/bitvavo.js +9 -14
  23. package/dist/cjs/src/btctradeua.js +2 -4
  24. package/dist/cjs/src/bybit.js +88 -132
  25. package/dist/cjs/src/cex.js +2 -4
  26. package/dist/cjs/src/coinbasepro.js +2 -2
  27. package/dist/cjs/src/coinex.js +7 -24
  28. package/dist/cjs/src/coinfalcon.js +1 -3
  29. package/dist/cjs/src/coinmate.js +2 -4
  30. package/dist/cjs/src/coinone.js +2 -6
  31. package/dist/cjs/src/coinsph.js +5 -13
  32. package/dist/cjs/src/cryptocom.js +1 -1
  33. package/dist/cjs/src/currencycom.js +2 -6
  34. package/dist/cjs/src/gate.js +5 -7
  35. package/dist/cjs/src/gemini.js +1 -3
  36. package/dist/cjs/src/hitbtc.js +290 -100
  37. package/dist/cjs/src/hollaex.js +1 -3
  38. package/dist/cjs/src/huobi.js +4 -14
  39. package/dist/cjs/src/huobijp.js +1 -3
  40. package/dist/cjs/src/indodax.js +4 -10
  41. package/dist/cjs/src/kucoinfutures.js +2 -7
  42. package/dist/cjs/src/kuna.js +1 -0
  43. package/dist/cjs/src/luno.js +1 -3
  44. package/dist/cjs/src/mercado.js +7 -17
  45. package/dist/cjs/src/mexc.js +5 -15
  46. package/dist/cjs/src/oceanex.js +2 -4
  47. package/dist/cjs/src/okx.js +33 -21
  48. package/dist/cjs/src/phemex.js +12 -33
  49. package/dist/cjs/src/poloniexfutures.js +2 -6
  50. package/dist/cjs/src/pro/binance.js +203 -1
  51. package/dist/cjs/src/pro/bitget.js +181 -0
  52. package/dist/cjs/src/pro/bitmart.js +2 -4
  53. package/dist/cjs/src/pro/bitrue.js +0 -4
  54. package/dist/cjs/src/pro/bitstamp.js +2 -4
  55. package/dist/cjs/src/pro/bitvavo.js +3 -7
  56. package/dist/cjs/src/pro/bybit.js +154 -10
  57. package/dist/cjs/src/pro/cex.js +2 -6
  58. package/dist/cjs/src/pro/cryptocom.js +131 -1
  59. package/dist/cjs/src/pro/gate.js +161 -0
  60. package/dist/cjs/src/pro/huobi.js +128 -4
  61. package/dist/cjs/src/pro/krakenfutures.js +129 -0
  62. package/dist/cjs/src/pro/kucoinfutures.js +182 -0
  63. package/dist/cjs/src/pro/okx.js +121 -0
  64. package/dist/cjs/src/pro/whitebit.js +3 -7
  65. package/dist/cjs/src/probit.js +2 -6
  66. package/dist/cjs/src/tokocrypto.js +3 -7
  67. package/dist/cjs/src/wavesexchange.js +2 -4
  68. package/dist/cjs/src/wazirx.js +4 -10
  69. package/dist/cjs/src/whitebit.js +3 -7
  70. package/dist/cjs/src/woo.js +0 -3
  71. package/dist/cjs/src/yobit.js +3 -7
  72. package/js/ccxt.d.ts +1 -1
  73. package/js/ccxt.js +1 -1
  74. package/js/src/abstract/bequant.d.ts +37 -7
  75. package/js/src/abstract/binance.d.ts +1 -0
  76. package/js/src/abstract/binancecoinm.d.ts +1 -0
  77. package/js/src/abstract/binanceus.d.ts +1 -0
  78. package/js/src/abstract/binanceusdm.d.ts +1 -0
  79. package/js/src/abstract/bitcoincom.d.ts +37 -7
  80. package/js/src/abstract/bybit.d.ts +3 -0
  81. package/js/src/abstract/fmfwio.d.ts +37 -7
  82. package/js/src/abstract/hitbtc.d.ts +37 -7
  83. package/js/src/abstract/hitbtc3.d.ts +37 -7
  84. package/js/src/abstract/okex.d.ts +6 -1
  85. package/js/src/abstract/okex5.d.ts +6 -1
  86. package/js/src/abstract/okx.d.ts +6 -1
  87. package/js/src/ace.d.ts +2 -2
  88. package/js/src/ace.js +2 -4
  89. package/js/src/alpaca.d.ts +2 -2
  90. package/js/src/ascendex.d.ts +2 -2
  91. package/js/src/ascendex.js +1 -3
  92. package/js/src/base/Exchange.d.ts +4 -1
  93. package/js/src/base/Exchange.js +11 -3
  94. package/js/src/base/ws/Cache.d.ts +5 -1
  95. package/js/src/base/ws/Cache.js +50 -1
  96. package/js/src/bigone.d.ts +2 -2
  97. package/js/src/bigone.js +3 -7
  98. package/js/src/binance.d.ts +2 -2
  99. package/js/src/binance.js +16 -12
  100. package/js/src/bingx.d.ts +2 -2
  101. package/js/src/bit2c.d.ts +2 -2
  102. package/js/src/bit2c.js +3 -5
  103. package/js/src/bitbank.d.ts +2 -2
  104. package/js/src/bitbns.d.ts +2 -2
  105. package/js/src/bitbns.js +5 -15
  106. package/js/src/bitfinex.d.ts +2 -2
  107. package/js/src/bitfinex.js +1 -3
  108. package/js/src/bitfinex2.js +1 -3
  109. package/js/src/bitflyer.d.ts +2 -2
  110. package/js/src/bitflyer.js +4 -12
  111. package/js/src/bitforex.d.ts +2 -2
  112. package/js/src/bitforex.js +5 -9
  113. package/js/src/bitget.d.ts +2 -2
  114. package/js/src/bithumb.d.ts +2 -2
  115. package/js/src/bithumb.js +4 -10
  116. package/js/src/bitmart.d.ts +2 -2
  117. package/js/src/bitmart.js +64 -59
  118. package/js/src/bitmex.js +2 -6
  119. package/js/src/bitopro.d.ts +2 -2
  120. package/js/src/bitopro.js +6 -16
  121. package/js/src/bitpanda.d.ts +2 -2
  122. package/js/src/bitrue.d.ts +2 -2
  123. package/js/src/bitrue.js +6 -14
  124. package/js/src/bitso.d.ts +2 -2
  125. package/js/src/bitstamp.d.ts +2 -2
  126. package/js/src/bitstamp1.d.ts +2 -2
  127. package/js/src/bittrex.d.ts +2 -2
  128. package/js/src/bitvavo.d.ts +2 -2
  129. package/js/src/bitvavo.js +9 -14
  130. package/js/src/bl3p.d.ts +2 -2
  131. package/js/src/blockchaincom.d.ts +4 -4
  132. package/js/src/btcalpha.d.ts +2 -2
  133. package/js/src/btcbox.d.ts +2 -2
  134. package/js/src/btcmarkets.d.ts +2 -2
  135. package/js/src/btctradeua.d.ts +2 -2
  136. package/js/src/btctradeua.js +3 -5
  137. package/js/src/btcturk.d.ts +2 -2
  138. package/js/src/bybit.d.ts +2 -4
  139. package/js/src/bybit.js +88 -132
  140. package/js/src/cex.d.ts +2 -2
  141. package/js/src/cex.js +2 -4
  142. package/js/src/coinbase.d.ts +2 -2
  143. package/js/src/coinbasepro.d.ts +2 -2
  144. package/js/src/coinbasepro.js +2 -2
  145. package/js/src/coincheck.d.ts +2 -2
  146. package/js/src/coinex.js +7 -24
  147. package/js/src/coinfalcon.d.ts +2 -2
  148. package/js/src/coinfalcon.js +2 -4
  149. package/js/src/coinlist.d.ts +12 -12
  150. package/js/src/coinmate.d.ts +3 -3
  151. package/js/src/coinmate.js +3 -5
  152. package/js/src/coinone.d.ts +2 -2
  153. package/js/src/coinone.js +2 -6
  154. package/js/src/coinsph.d.ts +2 -2
  155. package/js/src/coinsph.js +5 -13
  156. package/js/src/coinspot.d.ts +2 -2
  157. package/js/src/cryptocom.d.ts +2 -2
  158. package/js/src/cryptocom.js +1 -1
  159. package/js/src/currencycom.d.ts +2 -2
  160. package/js/src/currencycom.js +2 -6
  161. package/js/src/delta.d.ts +2 -2
  162. package/js/src/deribit.d.ts +3 -3
  163. package/js/src/digifinex.d.ts +2 -2
  164. package/js/src/gate.d.ts +2 -2
  165. package/js/src/gate.js +5 -7
  166. package/js/src/gemini.d.ts +3 -3
  167. package/js/src/gemini.js +1 -3
  168. package/js/src/hitbtc.d.ts +3 -0
  169. package/js/src/hitbtc.js +291 -101
  170. package/js/src/hollaex.js +1 -3
  171. package/js/src/huobi.d.ts +2 -2
  172. package/js/src/huobi.js +4 -14
  173. package/js/src/huobijp.d.ts +2 -2
  174. package/js/src/huobijp.js +2 -4
  175. package/js/src/independentreserve.d.ts +2 -2
  176. package/js/src/indodax.d.ts +2 -2
  177. package/js/src/indodax.js +4 -10
  178. package/js/src/kraken.d.ts +2 -2
  179. package/js/src/krakenfutures.d.ts +2 -2
  180. package/js/src/kucoin.d.ts +2 -2
  181. package/js/src/kucoinfutures.d.ts +2 -2
  182. package/js/src/kucoinfutures.js +2 -7
  183. package/js/src/kuna.d.ts +3 -3
  184. package/js/src/kuna.js +1 -0
  185. package/js/src/latoken.d.ts +2 -2
  186. package/js/src/lbank2.d.ts +2 -2
  187. package/js/src/luno.d.ts +2 -2
  188. package/js/src/luno.js +1 -3
  189. package/js/src/lykke.d.ts +2 -2
  190. package/js/src/mercado.d.ts +2 -2
  191. package/js/src/mercado.js +7 -17
  192. package/js/src/mexc.js +5 -15
  193. package/js/src/novadax.d.ts +2 -2
  194. package/js/src/oceanex.d.ts +4 -4
  195. package/js/src/oceanex.js +2 -4
  196. package/js/src/okcoin.d.ts +2 -2
  197. package/js/src/okx.d.ts +2 -2
  198. package/js/src/okx.js +33 -21
  199. package/js/src/paymium.d.ts +2 -2
  200. package/js/src/phemex.js +12 -33
  201. package/js/src/poloniexfutures.d.ts +2 -2
  202. package/js/src/poloniexfutures.js +2 -6
  203. package/js/src/pro/binance.d.ts +6 -0
  204. package/js/src/pro/binance.js +204 -2
  205. package/js/src/pro/bitget.d.ts +3 -0
  206. package/js/src/pro/bitget.js +182 -1
  207. package/js/src/pro/bitmart.js +2 -4
  208. package/js/src/pro/bitrue.js +0 -4
  209. package/js/src/pro/bitstamp.js +3 -5
  210. package/js/src/pro/bitvavo.js +4 -8
  211. package/js/src/pro/bybit.d.ts +5 -1
  212. package/js/src/pro/bybit.js +156 -12
  213. package/js/src/pro/cex.js +3 -7
  214. package/js/src/pro/cryptocom.d.ts +4 -0
  215. package/js/src/pro/cryptocom.js +132 -2
  216. package/js/src/pro/gate.d.ts +5 -0
  217. package/js/src/pro/gate.js +162 -1
  218. package/js/src/pro/huobi.d.ts +2 -0
  219. package/js/src/pro/huobi.js +129 -5
  220. package/js/src/pro/krakenfutures.d.ts +3 -0
  221. package/js/src/pro/krakenfutures.js +129 -0
  222. package/js/src/pro/kucoinfutures.d.ts +5 -0
  223. package/js/src/pro/kucoinfutures.js +182 -0
  224. package/js/src/pro/okx.d.ts +2 -0
  225. package/js/src/pro/okx.js +123 -2
  226. package/js/src/pro/whitebit.js +4 -8
  227. package/js/src/probit.d.ts +2 -2
  228. package/js/src/probit.js +3 -7
  229. package/js/src/timex.d.ts +2 -2
  230. package/js/src/tokocrypto.d.ts +2 -2
  231. package/js/src/tokocrypto.js +4 -8
  232. package/js/src/wavesexchange.js +3 -5
  233. package/js/src/wazirx.d.ts +2 -2
  234. package/js/src/wazirx.js +5 -11
  235. package/js/src/whitebit.d.ts +2 -2
  236. package/js/src/whitebit.js +3 -7
  237. package/js/src/woo.d.ts +2 -2
  238. package/js/src/woo.js +1 -4
  239. package/js/src/yobit.js +3 -7
  240. package/js/src/zaif.d.ts +2 -2
  241. package/package.json +1 -1
  242. package/skip-tests.json +3 -1
@@ -7044,8 +7044,7 @@ class huobi extends huobi$1 {
7044
7044
  market = this.market(first);
7045
7045
  }
7046
7046
  let marginMode = undefined;
7047
- [marginMode, params] = this.handleMarginModeAndParams('fetchPositions', params);
7048
- marginMode = (marginMode === undefined) ? 'cross' : marginMode;
7047
+ [marginMode, params] = this.handleMarginModeAndParams('fetchPositions', params, 'cross');
7049
7048
  let subType = undefined;
7050
7049
  [subType, params] = this.handleSubTypeAndParams('fetchPositions', market, params, 'linear');
7051
7050
  let marketType = undefined;
@@ -8113,19 +8112,10 @@ class huobi extends huobi$1 {
8113
8112
  * @param {int} [params.code] unified currency code, can be used when symbol is undefined
8114
8113
  * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
8115
8114
  */
8116
- const code = this.safeString(params, 'code');
8115
+ this.checkRequiredSymbol('fetchSettlementHistory', symbol);
8117
8116
  const until = this.safeInteger2(params, 'until', 'till');
8118
8117
  params = this.omit(params, ['until', 'till']);
8119
- const market = (symbol === undefined) ? undefined : this.market(symbol);
8120
- const [type, query] = this.handleMarketTypeAndParams('fetchSettlementHistory', market, params);
8121
- if (type === 'future') {
8122
- if (symbol === undefined && code === undefined) {
8123
- throw new errors.ArgumentsRequired(this.id + ' requires a symbol argument or params["code"] for fetchSettlementHistory future');
8124
- }
8125
- }
8126
- else if (symbol === undefined) {
8127
- throw new errors.ArgumentsRequired(this.id + ' requires a symbol argument for fetchSettlementHistory swap');
8128
- }
8118
+ const market = this.market(symbol);
8129
8119
  const request = {};
8130
8120
  if (market['future']) {
8131
8121
  request['symbol'] = market['baseId'];
@@ -8151,7 +8141,7 @@ class huobi extends huobi$1 {
8151
8141
  method = 'contractPublicGetSwapApiV1SwapSettlementRecords';
8152
8142
  }
8153
8143
  }
8154
- const response = await this[method](this.extend(request, query));
8144
+ const response = await this[method](this.extend(request, params));
8155
8145
  //
8156
8146
  // linear swap, coin-m swap
8157
8147
  //
@@ -1194,9 +1194,7 @@ class huobijp extends huobijp$1 {
1194
1194
  return await this[method](symbol, since, limit, params);
1195
1195
  }
1196
1196
  async fetchOpenOrdersV1(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1197
- if (symbol === undefined) {
1198
- throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrdersV1() requires a symbol argument');
1199
- }
1197
+ this.checkRequiredSymbol('fetchOpenOrdersV1', symbol);
1200
1198
  return await this.fetchOrdersByStates('pre-submitted,submitted,partial-filled', symbol, since, limit, params);
1201
1199
  }
1202
1200
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -602,9 +602,7 @@ class indodax extends indodax$1 {
602
602
  * @param {object} [params] extra parameters specific to the indodax api endpoint
603
603
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
604
604
  */
605
- if (symbol === undefined) {
606
- throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol');
607
- }
605
+ this.checkRequiredSymbol('fetchOrder', symbol);
608
606
  await this.loadMarkets();
609
607
  const market = this.market(symbol);
610
608
  const request = {
@@ -664,13 +662,11 @@ class indodax extends indodax$1 {
664
662
  * @description fetches information on multiple closed orders made by the user
665
663
  * @param {string} symbol unified market symbol of the market orders were made in
666
664
  * @param {int} [since] the earliest time in ms to fetch orders for
667
- * @param {int} [limit] the maximum number of orde structures to retrieve
665
+ * @param {int} [limit] the maximum number of order structures to retrieve
668
666
  * @param {object} [params] extra parameters specific to the indodax api endpoint
669
667
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
670
668
  */
671
- if (symbol === undefined) {
672
- throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
673
- }
669
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
674
670
  await this.loadMarkets();
675
671
  const request = {};
676
672
  let market = undefined;
@@ -733,9 +729,7 @@ class indodax extends indodax$1 {
733
729
  * @param {object} [params] extra parameters specific to the indodax api endpoint
734
730
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
735
731
  */
736
- if (symbol === undefined) {
737
- throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
738
- }
732
+ this.checkRequiredSymbol('cancelOrder', symbol);
739
733
  const side = this.safeValue(params, 'side');
740
734
  if (side === undefined) {
741
735
  throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires an extra "side" param');
@@ -798,10 +798,7 @@ class kucoinfutures extends kucoinfutures$1 {
798
798
  * @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
799
799
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
800
800
  */
801
- //
802
- if (symbol === undefined) {
803
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
804
- }
801
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
805
802
  await this.loadMarkets();
806
803
  const market = this.market(symbol);
807
804
  const request = {
@@ -2342,9 +2339,7 @@ class kucoinfutures extends kucoinfutures$1 {
2342
2339
  * @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)
2343
2340
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2344
2341
  */
2345
- if (symbol === undefined) {
2346
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
2347
- }
2342
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
2348
2343
  await this.loadMarkets();
2349
2344
  let paginate = false;
2350
2345
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -599,6 +599,7 @@ class kuna extends kuna$1 {
599
599
  'max': undefined,
600
600
  },
601
601
  },
602
+ 'created': undefined,
602
603
  'info': item,
603
604
  });
604
605
  }
@@ -729,9 +729,7 @@ class luno extends luno$1 {
729
729
  * @param {object} [params] extra parameters specific to the luno api endpoint
730
730
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
731
731
  */
732
- if (symbol === undefined) {
733
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
734
- }
732
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
735
733
  await this.loadMarkets();
736
734
  const market = this.market(symbol);
737
735
  const request = {
@@ -474,9 +474,7 @@ class mercado extends mercado$1 {
474
474
  * @param {object} [params] extra parameters specific to the mercado api endpoint
475
475
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
476
476
  */
477
- if (symbol === undefined) {
478
- throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
479
- }
477
+ this.checkRequiredSymbol('cancelOrder', symbol);
480
478
  await this.loadMarkets();
481
479
  const market = this.market(symbol);
482
480
  const request = {
@@ -600,9 +598,7 @@ class mercado extends mercado$1 {
600
598
  * @param {object} [params] extra parameters specific to the mercado api endpoint
601
599
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
602
600
  */
603
- if (symbol === undefined) {
604
- throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
605
- }
601
+ this.checkRequiredSymbol('fetchOrder', symbol);
606
602
  await this.loadMarkets();
607
603
  const market = this.market(symbol);
608
604
  const request = {
@@ -768,13 +764,11 @@ class mercado extends mercado$1 {
768
764
  * @description fetches information on multiple orders made by the user
769
765
  * @param {string} symbol unified market symbol of the market orders were made in
770
766
  * @param {int} [since] the earliest time in ms to fetch orders for
771
- * @param {int} [limit] the maximum number of orde structures to retrieve
767
+ * @param {int} [limit] the maximum number of order structures to retrieve
772
768
  * @param {object} [params] extra parameters specific to the mercado api endpoint
773
769
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
774
770
  */
775
- if (symbol === undefined) {
776
- throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
777
- }
771
+ this.checkRequiredSymbol('fetchOrders', symbol);
778
772
  await this.loadMarkets();
779
773
  const market = this.market(symbol);
780
774
  const request = {
@@ -792,13 +786,11 @@ class mercado extends mercado$1 {
792
786
  * @description fetch all unfilled currently open orders
793
787
  * @param {string} symbol unified market symbol
794
788
  * @param {int} [since] the earliest time in ms to fetch open orders for
795
- * @param {int} [limit] the maximum number of open orders structures to retrieve
789
+ * @param {int} [limit] the maximum number of open order structures to retrieve
796
790
  * @param {object} [params] extra parameters specific to the mercado api endpoint
797
791
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
798
792
  */
799
- if (symbol === undefined) {
800
- throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
801
- }
793
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
802
794
  await this.loadMarkets();
803
795
  const market = this.market(symbol);
804
796
  const request = {
@@ -821,9 +813,7 @@ class mercado extends mercado$1 {
821
813
  * @param {object} [params] extra parameters specific to the mercado api endpoint
822
814
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
823
815
  */
824
- if (symbol === undefined) {
825
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
826
- }
816
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
827
817
  await this.loadMarkets();
828
818
  const market = this.market(symbol);
829
819
  const request = {
@@ -2342,9 +2342,7 @@ class mexc extends mexc$1 {
2342
2342
  * @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
2343
2343
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2344
2344
  */
2345
- if (symbol === undefined) {
2346
- throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2347
- }
2345
+ this.checkRequiredSymbol('fetchOrder', symbol);
2348
2346
  await this.loadMarkets();
2349
2347
  const market = this.market(symbol);
2350
2348
  const request = {
@@ -3668,9 +3666,7 @@ class mexc extends mexc$1 {
3668
3666
  * @param {object} [params] extra parameters specific to the mexc3 api endpoint
3669
3667
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
3670
3668
  */
3671
- if (symbol === undefined) {
3672
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
3673
- }
3669
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
3674
3670
  await this.loadMarkets();
3675
3671
  const market = this.market(symbol);
3676
3672
  const [marketType, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
@@ -4061,9 +4057,7 @@ class mexc extends mexc$1 {
4061
4057
  * @param {object} [params] extra parameters specific to the mexc api endpoint
4062
4058
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
4063
4059
  */
4064
- if (symbol === undefined) {
4065
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
4066
- }
4060
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
4067
4061
  await this.loadMarkets();
4068
4062
  const market = this.market(symbol);
4069
4063
  const request = {
@@ -5031,10 +5025,8 @@ class mexc extends mexc$1 {
5031
5025
  * @param {object} [params] extra parameters specific to the mexc3 api endpoint
5032
5026
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
5033
5027
  */
5028
+ this.checkRequiredSymbol('borrowMargin', symbol);
5034
5029
  await this.loadMarkets();
5035
- if (symbol === undefined) {
5036
- throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument for isolated margin');
5037
- }
5038
5030
  const market = this.market(symbol);
5039
5031
  const currency = this.currency(code);
5040
5032
  const request = {
@@ -5067,10 +5059,8 @@ class mexc extends mexc$1 {
5067
5059
  * @param {string} [params.borrowId] transaction id '762407666453712896'
5068
5060
  * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
5069
5061
  */
5062
+ this.checkRequiredSymbol('repayMargin', symbol);
5070
5063
  await this.loadMarkets();
5071
- if (symbol === undefined) {
5072
- throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument for isolated margin');
5073
- }
5074
5064
  const id = this.safeString2(params, 'id', 'borrowId');
5075
5065
  if (id === undefined) {
5076
5066
  throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a borrowId argument in the params');
@@ -721,13 +721,11 @@ class oceanex extends oceanex$1 {
721
721
  * @see https://api.oceanex.pro/doc/v1/#order-status-with-filters-post
722
722
  * @param {string} symbol unified market symbol of the market orders were made in
723
723
  * @param {int} [since] the earliest time in ms to fetch orders for
724
- * @param {int} [limit] the maximum number of orde structures to retrieve
724
+ * @param {int} [limit] the maximum number of order structures to retrieve
725
725
  * @param {object} [params] extra parameters specific to the oceanex api endpoint
726
726
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
727
727
  */
728
- if (symbol === undefined) {
729
- throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a `symbol` argument');
730
- }
728
+ this.checkRequiredSymbol('fetchOrders', symbol);
731
729
  await this.loadMarkets();
732
730
  const market = this.market(symbol);
733
731
  const states = this.safeValue(params, 'states', ['wait', 'done', 'cancel']);
@@ -182,7 +182,7 @@ class okx extends okx$1 {
182
182
  'market/index-components': 1,
183
183
  'market/block-tickers': 1,
184
184
  'market/block-ticker': 1,
185
- 'market/block-trades': 1,
185
+ 'public/block-trades': 1,
186
186
  'public/instruments': 1,
187
187
  'public/delivery-exercise-history': 1 / 2,
188
188
  'public/open-interest': 1,
@@ -224,6 +224,7 @@ class okx extends okx$1 {
224
224
  'tradingBot/grid/min-investment': 1,
225
225
  'tradingBot/public/rsi-back-testing': 1,
226
226
  'asset/exchange-list': 5 / 3,
227
+ 'finance/staking-defi/eth/apy-history': 5 / 3,
227
228
  'finance/savings/lending-rate-summary': 5 / 3,
228
229
  'finance/savings/lending-rate-history': 5 / 3,
229
230
  // public broker
@@ -334,6 +335,9 @@ class okx extends okx$1 {
334
335
  'finance/staking-defi/offers': 10 / 3,
335
336
  'finance/staking-defi/orders-active': 10 / 3,
336
337
  'finance/staking-defi/orders-history': 10 / 3,
338
+ // eth staking
339
+ 'finance/staking-defi/eth/balance': 5 / 3,
340
+ 'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
337
341
  // copytrading
338
342
  'copytrading/current-subpositions': 4,
339
343
  'copytrading/subpositions-history': 10,
@@ -438,6 +442,9 @@ class okx extends okx$1 {
438
442
  'finance/staking-defi/purchase': 3,
439
443
  'finance/staking-defi/redeem': 3,
440
444
  'finance/staking-defi/cancel': 3,
445
+ // eth staking
446
+ 'finance/staking-defi/eth/purchase': 5,
447
+ 'finance/staking-defi/eth/redeem': 5,
441
448
  // copytrading
442
449
  'copytrading/algo-order': 20,
443
450
  'copytrading/close-subposition': 4,
@@ -2175,9 +2182,7 @@ class okx extends okx$1 {
2175
2182
  * @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)
2176
2183
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2177
2184
  */
2178
- if (symbol === undefined) {
2179
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
2180
- }
2185
+ this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
2181
2186
  await this.loadMarkets();
2182
2187
  let paginate = false;
2183
2188
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -2546,6 +2551,13 @@ class okx extends okx$1 {
2546
2551
  request['tdMode'] = tradeMode;
2547
2552
  }
2548
2553
  else if (contract) {
2554
+ if (market['swap'] || market['future']) {
2555
+ let positionSide = undefined;
2556
+ [positionSide, params] = this.handleOptionAndParams(params, 'createOrder', 'positionSide');
2557
+ if (positionSide !== undefined) {
2558
+ request['posSide'] = positionSide;
2559
+ }
2560
+ }
2549
2561
  request['tdMode'] = marginMode;
2550
2562
  }
2551
2563
  const isMarketOrder = type === 'market';
@@ -2742,7 +2754,7 @@ class okx extends okx$1 {
2742
2754
  * @param {float} amount how much of currency you want to trade in units of base currency
2743
2755
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2744
2756
  * @param {object} [params] extra parameters specific to the okx api endpoint
2745
- * @param {bool} [params.reduceOnly] MARGIN orders only, or swap/future orders in net mode
2757
+ * @param {bool} [params.reduceOnly] a mark to reduce the position size for margin, swap and future orders
2746
2758
  * @param {bool} [params.postOnly] true to place a post only order
2747
2759
  * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
2748
2760
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
@@ -2752,6 +2764,7 @@ class okx extends okx$1 {
2752
2764
  * @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
2753
2765
  * @param {float} [params.stopLoss.price] used for stop loss limit orders, not used for stop loss market price orders
2754
2766
  * @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
2767
+ * @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
2755
2768
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2756
2769
  */
2757
2770
  await this.loadMarkets();
@@ -2771,7 +2784,16 @@ class okx extends okx$1 {
2771
2784
  // because it has a lower ratelimit
2772
2785
  request = [request];
2773
2786
  }
2774
- const response = await this[method](request);
2787
+ let response = undefined;
2788
+ if (method === 'privatePostTradeOrder') {
2789
+ response = await this.privatePostTradeOrder(request);
2790
+ }
2791
+ else if (method === 'privatePostTradeOrderAlgo') {
2792
+ response = await this.privatePostTradeOrderAlgo(request);
2793
+ }
2794
+ else {
2795
+ response = await this.privatePostTradeBatchOrders(request);
2796
+ }
2775
2797
  const data = this.safeValue(response, 'data', []);
2776
2798
  const first = this.safeValue(data, 0);
2777
2799
  const order = this.parseOrder(first, market);
@@ -2952,14 +2974,12 @@ class okx extends okx$1 {
2952
2974
  * @param {object} [params] extra parameters specific to the okx api endpoint
2953
2975
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2954
2976
  */
2977
+ this.checkRequiredSymbol('cancelOrder', symbol);
2955
2978
  const stop = this.safeValue(params, 'stop');
2956
2979
  if (stop) {
2957
2980
  const orderInner = await this.cancelOrders([id], symbol, params);
2958
2981
  return this.safeValue(orderInner, 0);
2959
2982
  }
2960
- if (symbol === undefined) {
2961
- throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2962
- }
2963
2983
  await this.loadMarkets();
2964
2984
  const market = this.market(symbol);
2965
2985
  const request = {
@@ -3009,9 +3029,7 @@ class okx extends okx$1 {
3009
3029
  * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3010
3030
  */
3011
3031
  // 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.
3012
- if (symbol === undefined) {
3013
- throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
3014
- }
3032
+ this.checkRequiredSymbol('cancelOrders', symbol);
3015
3033
  await this.loadMarkets();
3016
3034
  const market = this.market(symbol);
3017
3035
  const request = [];
@@ -3322,9 +3340,7 @@ class okx extends okx$1 {
3322
3340
  * @param {object} [params] extra and exchange specific parameters
3323
3341
  * @returns [an order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3324
3342
  */
3325
- if (symbol === undefined) {
3326
- throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
3327
- }
3343
+ this.checkRequiredSymbol('fetchOrder', symbol);
3328
3344
  await this.loadMarkets();
3329
3345
  const market = this.market(symbol);
3330
3346
  const request = {
@@ -5781,9 +5797,7 @@ class okx extends okx$1 {
5781
5797
  * @param {string} [params.posSide] 'long' or 'short' for isolated margin long/short mode on futures and swap markets
5782
5798
  * @returns {object} response from the exchange
5783
5799
  */
5784
- if (symbol === undefined) {
5785
- throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
5786
- }
5800
+ this.checkRequiredSymbol('setLeverage', symbol);
5787
5801
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
5788
5802
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
5789
5803
  if ((leverage < 1) || (leverage > 125)) {
@@ -5877,9 +5891,7 @@ class okx extends okx$1 {
5877
5891
  * @param {int} [params.leverage] leverage
5878
5892
  * @returns {object} response from the exchange
5879
5893
  */
5880
- if (symbol === undefined) {
5881
- throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
5882
- }
5894
+ this.checkRequiredSymbol('setMarginMode', symbol);
5883
5895
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
5884
5896
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
5885
5897
  marginMode = marginMode.toLowerCase();
@@ -2623,9 +2623,6 @@ class phemex extends phemex$1 {
2623
2623
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
2624
2624
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2625
2625
  */
2626
- if (symbol === undefined) {
2627
- throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
2628
- }
2629
2626
  await this.loadMarkets();
2630
2627
  const market = this.market(symbol);
2631
2628
  const request = {
@@ -2699,9 +2696,7 @@ class phemex extends phemex$1 {
2699
2696
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
2700
2697
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2701
2698
  */
2702
- if (symbol === undefined) {
2703
- throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2704
- }
2699
+ this.checkRequiredSymbol('cancelOrder', symbol);
2705
2700
  await this.loadMarkets();
2706
2701
  const market = this.market(symbol);
2707
2702
  const request = {
@@ -2740,9 +2735,7 @@ class phemex extends phemex$1 {
2740
2735
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2741
2736
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2742
2737
  */
2743
- if (symbol === undefined) {
2744
- throw new errors.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
2745
- }
2738
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
2746
2739
  await this.loadMarkets();
2747
2740
  const request = {
2748
2741
  // 'symbol': market['id'],
@@ -2769,9 +2762,7 @@ class phemex extends phemex$1 {
2769
2762
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2770
2763
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2771
2764
  */
2772
- if (symbol === undefined) {
2773
- throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2774
- }
2765
+ this.checkRequiredSymbol('fetchOrder', symbol);
2775
2766
  await this.loadMarkets();
2776
2767
  const market = this.market(symbol);
2777
2768
  if (market['settle'] === 'USDT') {
@@ -2814,13 +2805,11 @@ class phemex extends phemex$1 {
2814
2805
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
2815
2806
  * @param {string} symbol unified market symbol of the market orders were made in
2816
2807
  * @param {int} [since] the earliest time in ms to fetch orders for
2817
- * @param {int} [limit] the maximum number of orde structures to retrieve
2808
+ * @param {int} [limit] the maximum number of order structures to retrieve
2818
2809
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2819
2810
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2820
2811
  */
2821
- if (symbol === undefined) {
2822
- throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
2823
- }
2812
+ this.checkRequiredSymbol('fetchOrders', symbol);
2824
2813
  await this.loadMarkets();
2825
2814
  const market = this.market(symbol);
2826
2815
  const request = {
@@ -2854,13 +2843,11 @@ class phemex extends phemex$1 {
2854
2843
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md
2855
2844
  * @param {string} symbol unified market symbol
2856
2845
  * @param {int} [since] the earliest time in ms to fetch open orders for
2857
- * @param {int} [limit] the maximum number of open orders structures to retrieve
2846
+ * @param {int} [limit] the maximum number of open order structures to retrieve
2858
2847
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2859
2848
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2860
2849
  */
2861
- if (symbol === undefined) {
2862
- throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
2863
- }
2850
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
2864
2851
  await this.loadMarkets();
2865
2852
  const market = this.market(symbol);
2866
2853
  let method = 'privateGetSpotOrders';
@@ -2900,13 +2887,11 @@ class phemex extends phemex$1 {
2900
2887
  * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
2901
2888
  * @param {string} symbol unified market symbol of the market orders were made in
2902
2889
  * @param {int} [since] the earliest time in ms to fetch orders for
2903
- * @param {int} [limit] the maximum number of orde structures to retrieve
2890
+ * @param {int} [limit] the maximum number of order structures to retrieve
2904
2891
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2905
2892
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2906
2893
  */
2907
- if (symbol === undefined) {
2908
- throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
2909
- }
2894
+ this.checkRequiredSymbol('fetchClosedOrders', symbol);
2910
2895
  await this.loadMarkets();
2911
2896
  const market = this.market(symbol);
2912
2897
  const request = {
@@ -2985,9 +2970,7 @@ class phemex extends phemex$1 {
2985
2970
  * @param {object} [params] extra parameters specific to the phemex api endpoint
2986
2971
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
2987
2972
  */
2988
- if (symbol === undefined) {
2989
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
2990
- }
2973
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
2991
2974
  await this.loadMarkets();
2992
2975
  const market = this.market(symbol);
2993
2976
  let method = 'privateGetExchangeSpotOrderTrades';
@@ -3627,10 +3610,8 @@ class phemex extends phemex$1 {
3627
3610
  * @param {object} [params] extra parameters specific to the phemex api endpoint
3628
3611
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
3629
3612
  */
3613
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
3630
3614
  await this.loadMarkets();
3631
- if (symbol === undefined) {
3632
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
3633
- }
3634
3615
  const market = this.market(symbol);
3635
3616
  const request = {
3636
3617
  'symbol': market['id'],
@@ -4103,9 +4084,7 @@ class phemex extends phemex$1 {
4103
4084
  */
4104
4085
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
4105
4086
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
4106
- if (symbol === undefined) {
4107
- throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
4108
- }
4087
+ this.checkRequiredSymbol('setLeverage', symbol);
4109
4088
  if ((leverage < 1) || (leverage > 100)) {
4110
4089
  throw new errors.BadRequest(this.id + ' setLeverage() leverage should be between 1 and 100');
4111
4090
  }
@@ -1116,9 +1116,7 @@ class poloniexfutures extends poloniexfutures$1 {
1116
1116
  * @param {object} [params] extra parameters specific to the poloniexfutures api endpoint
1117
1117
  * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
1118
1118
  */
1119
- if (symbol === undefined) {
1120
- throw new errors.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
1121
- }
1119
+ this.checkRequiredSymbol('fetchFundingHistory', symbol);
1122
1120
  await this.loadMarkets();
1123
1121
  const market = this.market(symbol);
1124
1122
  const request = {
@@ -1701,9 +1699,7 @@ class poloniexfutures extends poloniexfutures$1 {
1701
1699
  * @param {object} [params] extra parameters specific to the poloniexfutures api endpoint
1702
1700
  * @returns {object} response from the exchange
1703
1701
  */
1704
- if (symbol === undefined) {
1705
- throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
1706
- }
1702
+ this.checkRequiredSymbol('setMarginMode', symbol);
1707
1703
  if ((marginMode !== 0) && (marginMode !== 1)) {
1708
1704
  throw new errors.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0 (isolated) or 1 (cross)');
1709
1705
  }