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.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +2132 -768
- package/dist/ccxt.browser.min.js +9 -9
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -3
- package/dist/cjs/src/ascendex.js +1 -3
- package/dist/cjs/src/base/Exchange.js +11 -3
- package/dist/cjs/src/base/ws/Cache.js +50 -0
- package/dist/cjs/src/bigone.js +2 -6
- package/dist/cjs/src/binance.js +16 -12
- package/dist/cjs/src/bit2c.js +2 -4
- package/dist/cjs/src/bitbns.js +5 -15
- package/dist/cjs/src/bitfinex.js +1 -3
- package/dist/cjs/src/bitfinex2.js +1 -3
- package/dist/cjs/src/bitflyer.js +4 -12
- package/dist/cjs/src/bitforex.js +4 -8
- package/dist/cjs/src/bithumb.js +4 -10
- package/dist/cjs/src/bitmart.js +64 -59
- package/dist/cjs/src/bitmex.js +2 -6
- package/dist/cjs/src/bitopro.js +6 -16
- package/dist/cjs/src/bitrue.js +6 -14
- package/dist/cjs/src/bitvavo.js +9 -14
- package/dist/cjs/src/btctradeua.js +2 -4
- package/dist/cjs/src/bybit.js +88 -132
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbasepro.js +2 -2
- package/dist/cjs/src/coinex.js +7 -24
- package/dist/cjs/src/coinfalcon.js +1 -3
- package/dist/cjs/src/coinmate.js +2 -4
- package/dist/cjs/src/coinone.js +2 -6
- package/dist/cjs/src/coinsph.js +5 -13
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/currencycom.js +2 -6
- package/dist/cjs/src/gate.js +5 -7
- package/dist/cjs/src/gemini.js +1 -3
- package/dist/cjs/src/hitbtc.js +290 -100
- package/dist/cjs/src/hollaex.js +1 -3
- package/dist/cjs/src/huobi.js +4 -14
- package/dist/cjs/src/huobijp.js +1 -3
- package/dist/cjs/src/indodax.js +4 -10
- package/dist/cjs/src/kucoinfutures.js +2 -7
- package/dist/cjs/src/kuna.js +1 -0
- package/dist/cjs/src/luno.js +1 -3
- package/dist/cjs/src/mercado.js +7 -17
- package/dist/cjs/src/mexc.js +5 -15
- package/dist/cjs/src/oceanex.js +2 -4
- package/dist/cjs/src/okx.js +33 -21
- package/dist/cjs/src/phemex.js +12 -33
- package/dist/cjs/src/poloniexfutures.js +2 -6
- package/dist/cjs/src/pro/binance.js +203 -1
- package/dist/cjs/src/pro/bitget.js +181 -0
- package/dist/cjs/src/pro/bitmart.js +2 -4
- package/dist/cjs/src/pro/bitrue.js +0 -4
- package/dist/cjs/src/pro/bitstamp.js +2 -4
- package/dist/cjs/src/pro/bitvavo.js +3 -7
- package/dist/cjs/src/pro/bybit.js +154 -10
- package/dist/cjs/src/pro/cex.js +2 -6
- package/dist/cjs/src/pro/cryptocom.js +131 -1
- package/dist/cjs/src/pro/gate.js +161 -0
- package/dist/cjs/src/pro/huobi.js +128 -4
- package/dist/cjs/src/pro/krakenfutures.js +129 -0
- package/dist/cjs/src/pro/kucoinfutures.js +182 -0
- package/dist/cjs/src/pro/okx.js +121 -0
- package/dist/cjs/src/pro/whitebit.js +3 -7
- package/dist/cjs/src/probit.js +2 -6
- package/dist/cjs/src/tokocrypto.js +3 -7
- package/dist/cjs/src/wavesexchange.js +2 -4
- package/dist/cjs/src/wazirx.js +4 -10
- package/dist/cjs/src/whitebit.js +3 -7
- package/dist/cjs/src/woo.js +0 -3
- package/dist/cjs/src/yobit.js +3 -7
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bequant.d.ts +37 -7
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bitcoincom.d.ts +37 -7
- package/js/src/abstract/bybit.d.ts +3 -0
- package/js/src/abstract/fmfwio.d.ts +37 -7
- package/js/src/abstract/hitbtc.d.ts +37 -7
- package/js/src/abstract/hitbtc3.d.ts +37 -7
- package/js/src/abstract/okex.d.ts +6 -1
- package/js/src/abstract/okex5.d.ts +6 -1
- package/js/src/abstract/okx.d.ts +6 -1
- package/js/src/ace.d.ts +2 -2
- package/js/src/ace.js +2 -4
- package/js/src/alpaca.d.ts +2 -2
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +1 -3
- package/js/src/base/Exchange.d.ts +4 -1
- package/js/src/base/Exchange.js +11 -3
- package/js/src/base/ws/Cache.d.ts +5 -1
- package/js/src/base/ws/Cache.js +50 -1
- package/js/src/bigone.d.ts +2 -2
- package/js/src/bigone.js +3 -7
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +16 -12
- package/js/src/bingx.d.ts +2 -2
- package/js/src/bit2c.d.ts +2 -2
- package/js/src/bit2c.js +3 -5
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +2 -2
- package/js/src/bitbns.js +5 -15
- package/js/src/bitfinex.d.ts +2 -2
- package/js/src/bitfinex.js +1 -3
- package/js/src/bitfinex2.js +1 -3
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitflyer.js +4 -12
- package/js/src/bitforex.d.ts +2 -2
- package/js/src/bitforex.js +5 -9
- package/js/src/bitget.d.ts +2 -2
- package/js/src/bithumb.d.ts +2 -2
- package/js/src/bithumb.js +4 -10
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmart.js +64 -59
- package/js/src/bitmex.js +2 -6
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitopro.js +6 -16
- package/js/src/bitpanda.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/bitrue.js +6 -14
- package/js/src/bitso.d.ts +2 -2
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp1.d.ts +2 -2
- package/js/src/bittrex.d.ts +2 -2
- package/js/src/bitvavo.d.ts +2 -2
- package/js/src/bitvavo.js +9 -14
- package/js/src/bl3p.d.ts +2 -2
- package/js/src/blockchaincom.d.ts +4 -4
- package/js/src/btcalpha.d.ts +2 -2
- package/js/src/btcbox.d.ts +2 -2
- package/js/src/btcmarkets.d.ts +2 -2
- package/js/src/btctradeua.d.ts +2 -2
- package/js/src/btctradeua.js +3 -5
- package/js/src/btcturk.d.ts +2 -2
- package/js/src/bybit.d.ts +2 -4
- package/js/src/bybit.js +88 -132
- package/js/src/cex.d.ts +2 -2
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.d.ts +2 -2
- package/js/src/coinbasepro.d.ts +2 -2
- package/js/src/coinbasepro.js +2 -2
- package/js/src/coincheck.d.ts +2 -2
- package/js/src/coinex.js +7 -24
- package/js/src/coinfalcon.d.ts +2 -2
- package/js/src/coinfalcon.js +2 -4
- package/js/src/coinlist.d.ts +12 -12
- package/js/src/coinmate.d.ts +3 -3
- package/js/src/coinmate.js +3 -5
- package/js/src/coinone.d.ts +2 -2
- package/js/src/coinone.js +2 -6
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinsph.js +5 -13
- package/js/src/coinspot.d.ts +2 -2
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +1 -1
- package/js/src/currencycom.d.ts +2 -2
- package/js/src/currencycom.js +2 -6
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +3 -3
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +5 -7
- package/js/src/gemini.d.ts +3 -3
- package/js/src/gemini.js +1 -3
- package/js/src/hitbtc.d.ts +3 -0
- package/js/src/hitbtc.js +291 -101
- package/js/src/hollaex.js +1 -3
- package/js/src/huobi.d.ts +2 -2
- package/js/src/huobi.js +4 -14
- package/js/src/huobijp.d.ts +2 -2
- package/js/src/huobijp.js +2 -4
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/indodax.js +4 -10
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoin.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +2 -2
- package/js/src/kucoinfutures.js +2 -7
- package/js/src/kuna.d.ts +3 -3
- package/js/src/kuna.js +1 -0
- package/js/src/latoken.d.ts +2 -2
- package/js/src/lbank2.d.ts +2 -2
- package/js/src/luno.d.ts +2 -2
- package/js/src/luno.js +1 -3
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mercado.js +7 -17
- package/js/src/mexc.js +5 -15
- package/js/src/novadax.d.ts +2 -2
- package/js/src/oceanex.d.ts +4 -4
- package/js/src/oceanex.js +2 -4
- package/js/src/okcoin.d.ts +2 -2
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +33 -21
- package/js/src/paymium.d.ts +2 -2
- package/js/src/phemex.js +12 -33
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/poloniexfutures.js +2 -6
- package/js/src/pro/binance.d.ts +6 -0
- package/js/src/pro/binance.js +204 -2
- package/js/src/pro/bitget.d.ts +3 -0
- package/js/src/pro/bitget.js +182 -1
- package/js/src/pro/bitmart.js +2 -4
- package/js/src/pro/bitrue.js +0 -4
- package/js/src/pro/bitstamp.js +3 -5
- package/js/src/pro/bitvavo.js +4 -8
- package/js/src/pro/bybit.d.ts +5 -1
- package/js/src/pro/bybit.js +156 -12
- package/js/src/pro/cex.js +3 -7
- package/js/src/pro/cryptocom.d.ts +4 -0
- package/js/src/pro/cryptocom.js +132 -2
- package/js/src/pro/gate.d.ts +5 -0
- package/js/src/pro/gate.js +162 -1
- package/js/src/pro/huobi.d.ts +2 -0
- package/js/src/pro/huobi.js +129 -5
- package/js/src/pro/krakenfutures.d.ts +3 -0
- package/js/src/pro/krakenfutures.js +129 -0
- package/js/src/pro/kucoinfutures.d.ts +5 -0
- package/js/src/pro/kucoinfutures.js +182 -0
- package/js/src/pro/okx.d.ts +2 -0
- package/js/src/pro/okx.js +123 -2
- package/js/src/pro/whitebit.js +4 -8
- package/js/src/probit.d.ts +2 -2
- package/js/src/probit.js +3 -7
- package/js/src/timex.d.ts +2 -2
- package/js/src/tokocrypto.d.ts +2 -2
- package/js/src/tokocrypto.js +4 -8
- package/js/src/wavesexchange.js +3 -5
- package/js/src/wazirx.d.ts +2 -2
- package/js/src/wazirx.js +5 -11
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/whitebit.js +3 -7
- package/js/src/woo.d.ts +2 -2
- package/js/src/woo.js +1 -4
- package/js/src/yobit.js +3 -7
- package/js/src/zaif.d.ts +2 -2
- package/package.json +1 -1
- package/skip-tests.json +3 -1
package/dist/cjs/src/huobi.js
CHANGED
|
@@ -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
|
-
|
|
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 =
|
|
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,
|
|
8144
|
+
const response = await this[method](this.extend(request, params));
|
|
8155
8145
|
//
|
|
8156
8146
|
// linear swap, coin-m swap
|
|
8157
8147
|
//
|
package/dist/cjs/src/huobijp.js
CHANGED
|
@@ -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
|
-
|
|
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 = {}) {
|
package/dist/cjs/src/indodax.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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');
|
package/dist/cjs/src/kuna.js
CHANGED
package/dist/cjs/src/luno.js
CHANGED
|
@@ -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
|
-
|
|
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 = {
|
package/dist/cjs/src/mercado.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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 = {
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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');
|
package/dist/cjs/src/oceanex.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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']);
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -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
|
-
'
|
|
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
|
-
|
|
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]
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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();
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|