ccxt 4.4.38 → 4.4.40
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +73 -2
- package/dist/cjs/src/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +38 -27
- package/dist/cjs/src/binance.js +13 -19
- package/dist/cjs/src/bingx.js +1 -2
- package/dist/cjs/src/bit2c.js +0 -1
- package/dist/cjs/src/bitbank.js +0 -1
- package/dist/cjs/src/bitbns.js +0 -1
- package/dist/cjs/src/bitfinex.js +17 -18
- package/dist/cjs/src/bitfinex1.js +0 -1
- package/dist/cjs/src/bitflyer.js +0 -1
- package/dist/cjs/src/bitget.js +1 -2
- package/dist/cjs/src/bithumb.js +0 -1
- package/dist/cjs/src/bitmart.js +3 -4
- package/dist/cjs/src/bitmex.js +5 -6
- package/dist/cjs/src/bitopro.js +4 -5
- package/dist/cjs/src/bitrue.js +5 -7
- package/dist/cjs/src/bitso.js +1 -2
- package/dist/cjs/src/bitstamp.js +1 -2
- package/dist/cjs/src/bitteam.js +1 -3
- package/dist/cjs/src/bitvavo.js +2 -4
- package/dist/cjs/src/blockchaincom.js +5 -5
- package/dist/cjs/src/blofin.js +10 -10
- package/dist/cjs/src/btcalpha.js +0 -1
- package/dist/cjs/src/btcbox.js +0 -1
- package/dist/cjs/src/btcmarkets.js +1 -3
- package/dist/cjs/src/bybit.js +2 -3
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +77 -1
- package/dist/cjs/src/coinbaseexchange.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +62 -0
- package/dist/cjs/src/coincatch.js +1 -1
- package/dist/cjs/src/coinex.js +9 -9
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/cryptocom.js +91 -2
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/defx.js +1 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/digifinex.js +59 -19
- package/dist/cjs/src/exmo.js +2 -2
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/hashkey.js +3 -5
- package/dist/cjs/src/htx.js +155 -33
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/kucoin.js +25 -24
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +174 -27
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +22 -21
- package/dist/cjs/src/phemex.js +12 -8
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bybit.js +13 -1
- package/dist/cjs/src/pro/coinex.js +2 -2
- package/dist/cjs/src/pro/gate.js +6 -6
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/pro/okx.js +11 -11
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/vertex.js +11 -11
- package/dist/cjs/src/woo.js +37 -37
- package/dist/cjs/src/woofipro.js +24 -24
- package/dist/cjs/src/xt.js +26 -26
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/digifinex.d.ts +1 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/alpaca.d.ts +11 -1
- package/js/src/alpaca.js +73 -2
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.js +38 -27
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +13 -19
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +1 -2
- package/js/src/bit2c.js +0 -1
- package/js/src/bitbank.js +0 -1
- package/js/src/bitbns.js +0 -1
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +17 -18
- package/js/src/bitfinex1.js +0 -1
- package/js/src/bitflyer.js +0 -1
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +1 -2
- package/js/src/bithumb.js +0 -1
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +3 -4
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +5 -6
- package/js/src/bitopro.js +4 -5
- package/js/src/bitrue.js +5 -7
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +1 -2
- package/js/src/bitteam.js +1 -3
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +2 -4
- package/js/src/blockchaincom.js +5 -5
- package/js/src/blofin.d.ts +3 -3
- package/js/src/blofin.js +10 -10
- package/js/src/btcalpha.js +0 -1
- package/js/src/btcbox.js +0 -1
- package/js/src/btcmarkets.js +1 -3
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +2 -3
- package/js/src/cex.d.ts +1 -1
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +77 -1
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coinbaseexchange.js +1 -1
- package/js/src/coinbaseinternational.js +62 -0
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +1 -1
- package/js/src/coinex.js +9 -9
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +91 -2
- package/js/src/currencycom.d.ts +1 -1
- package/js/src/currencycom.js +1 -1
- package/js/src/defx.d.ts +1 -2
- package/js/src/defx.js +1 -2
- package/js/src/delta.d.ts +1 -1
- package/js/src/delta.js +1 -1
- package/js/src/digifinex.d.ts +5 -3
- package/js/src/digifinex.js +59 -19
- package/js/src/exmo.js +2 -2
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -1
- package/js/src/hashkey.d.ts +1 -1
- package/js/src/hashkey.js +3 -5
- package/js/src/htx.d.ts +6 -6
- package/js/src/htx.js +155 -33
- package/js/src/hyperliquid.d.ts +1 -1
- package/js/src/hyperliquid.js +1 -1
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +1 -1
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +25 -24
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +8 -9
- package/js/src/mexc.js +174 -27
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +1 -1
- package/js/src/okcoin.d.ts +4 -4
- package/js/src/okcoin.js +18 -18
- package/js/src/okx.d.ts +4 -3
- package/js/src/okx.js +22 -21
- package/js/src/phemex.js +12 -8
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +13 -1
- package/js/src/pro/coinex.js +2 -2
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +6 -6
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/pro/okx.d.ts +2 -2
- package/js/src/pro/okx.js +11 -11
- package/js/src/pro/upbit.d.ts +3 -3
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/woo.js +1 -1
- package/js/src/vertex.d.ts +3 -3
- package/js/src/vertex.js +11 -11
- package/js/src/woo.d.ts +7 -7
- package/js/src/woo.js +37 -37
- package/js/src/woofipro.d.ts +1 -1
- package/js/src/woofipro.js +24 -24
- package/js/src/xt.d.ts +7 -7
- package/js/src/xt.js +26 -26
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +1 -1
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -118,8 +118,8 @@ class mexc extends mexc$1 {
|
|
|
118
118
|
'fetchTickers': true,
|
|
119
119
|
'fetchTime': true,
|
|
120
120
|
'fetchTrades': true,
|
|
121
|
-
'fetchTradingFee':
|
|
122
|
-
'fetchTradingFees':
|
|
121
|
+
'fetchTradingFee': true,
|
|
122
|
+
'fetchTradingFees': false,
|
|
123
123
|
'fetchTradingLimits': undefined,
|
|
124
124
|
'fetchTransactionFee': 'emulated',
|
|
125
125
|
'fetchTransactionFees': true,
|
|
@@ -192,6 +192,7 @@ class mexc extends mexc$1 {
|
|
|
192
192
|
'allOrders': 10,
|
|
193
193
|
'account': 10,
|
|
194
194
|
'myTrades': 10,
|
|
195
|
+
'tradeFee': 10,
|
|
195
196
|
'sub-account/list': 1,
|
|
196
197
|
'sub-account/apiKey': 1,
|
|
197
198
|
'capital/config/getall': 10,
|
|
@@ -673,6 +674,143 @@ class mexc extends mexc$1 {
|
|
|
673
674
|
'maxTimeTillEnd': 90 * 86400 * 1000 - 1,
|
|
674
675
|
'broker': 'CCXT',
|
|
675
676
|
},
|
|
677
|
+
'features': {
|
|
678
|
+
'def': {
|
|
679
|
+
'sandbox': false,
|
|
680
|
+
'createOrder': {
|
|
681
|
+
'marginMode': true,
|
|
682
|
+
'triggerPrice': false,
|
|
683
|
+
'triggerDirection': false,
|
|
684
|
+
'triggerPriceType': {
|
|
685
|
+
'last': false,
|
|
686
|
+
'mark': false,
|
|
687
|
+
'index': false,
|
|
688
|
+
},
|
|
689
|
+
'stopLossPrice': false,
|
|
690
|
+
'takeProfitPrice': false,
|
|
691
|
+
'attachedStopLossTakeProfit': undefined,
|
|
692
|
+
'timeInForce': {
|
|
693
|
+
'IOC': true,
|
|
694
|
+
'FOK': true,
|
|
695
|
+
'PO': true,
|
|
696
|
+
'GTD': false,
|
|
697
|
+
},
|
|
698
|
+
'hedged': false,
|
|
699
|
+
// exchange-supported features
|
|
700
|
+
'selfTradePrevention': false,
|
|
701
|
+
'trailing': false,
|
|
702
|
+
'iceberg': false,
|
|
703
|
+
},
|
|
704
|
+
'createOrders': {
|
|
705
|
+
'max': 20,
|
|
706
|
+
},
|
|
707
|
+
'fetchMyTrades': {
|
|
708
|
+
'marginMode': false,
|
|
709
|
+
'limit': 100,
|
|
710
|
+
'daysBack': 30,
|
|
711
|
+
'untilDays': undefined,
|
|
712
|
+
},
|
|
713
|
+
'fetchOrder': {
|
|
714
|
+
'marginMode': false,
|
|
715
|
+
'trigger': false,
|
|
716
|
+
'trailing': false,
|
|
717
|
+
},
|
|
718
|
+
'fetchOpenOrders': {
|
|
719
|
+
'marginMode': true,
|
|
720
|
+
'limit': undefined,
|
|
721
|
+
'trigger': false,
|
|
722
|
+
'trailing': false,
|
|
723
|
+
},
|
|
724
|
+
'fetchOrders': {
|
|
725
|
+
'marginMode': true,
|
|
726
|
+
'limit': 1000,
|
|
727
|
+
'daysBack': 7,
|
|
728
|
+
'untilDays': 7,
|
|
729
|
+
'trigger': false,
|
|
730
|
+
'trailing': false,
|
|
731
|
+
},
|
|
732
|
+
'fetchClosedOrders': {
|
|
733
|
+
'marginMode': true,
|
|
734
|
+
'limit': 1000,
|
|
735
|
+
'daysBackClosed': 7,
|
|
736
|
+
'daysBackCanceled': 7,
|
|
737
|
+
'untilDays': 7,
|
|
738
|
+
'trigger': false,
|
|
739
|
+
'trailing': false,
|
|
740
|
+
},
|
|
741
|
+
'fetchOHLCV': {
|
|
742
|
+
'limit': 1000,
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
'spot': {
|
|
746
|
+
'extends': 'def',
|
|
747
|
+
},
|
|
748
|
+
'forDerivs': {
|
|
749
|
+
'extends': 'def',
|
|
750
|
+
'createOrder': {
|
|
751
|
+
'triggerPrice': true,
|
|
752
|
+
'triggerPriceType': {
|
|
753
|
+
'last': true,
|
|
754
|
+
'mark': true,
|
|
755
|
+
'index': true,
|
|
756
|
+
},
|
|
757
|
+
'triggerDirection': true,
|
|
758
|
+
'stopLossPrice': false,
|
|
759
|
+
'takeProfitPrice': false,
|
|
760
|
+
'hedged': true,
|
|
761
|
+
},
|
|
762
|
+
'createOrders': {
|
|
763
|
+
'max': 50,
|
|
764
|
+
},
|
|
765
|
+
'fetchMyTrades': {
|
|
766
|
+
'marginMode': false,
|
|
767
|
+
'limit': 100,
|
|
768
|
+
'daysBack': 90,
|
|
769
|
+
'untilDays': 90,
|
|
770
|
+
},
|
|
771
|
+
'fetchOrder': {
|
|
772
|
+
'marginMode': false,
|
|
773
|
+
},
|
|
774
|
+
'fetchOpenOrders': {
|
|
775
|
+
'marginMode': false,
|
|
776
|
+
'limit': 100,
|
|
777
|
+
'trigger': true,
|
|
778
|
+
'trailing': false,
|
|
779
|
+
},
|
|
780
|
+
'fetchOrders': {
|
|
781
|
+
'marginMode': false,
|
|
782
|
+
'limit': 100,
|
|
783
|
+
'daysBack': 90,
|
|
784
|
+
'untilDays': 90,
|
|
785
|
+
'trigger': true,
|
|
786
|
+
'trailing': false,
|
|
787
|
+
},
|
|
788
|
+
'fetchClosedOrders': {
|
|
789
|
+
'marginMode': false,
|
|
790
|
+
'limit': 100,
|
|
791
|
+
'daysBackClosed': 90,
|
|
792
|
+
'daysBackCanceled': undefined,
|
|
793
|
+
'untilDays': 90,
|
|
794
|
+
'trigger': true,
|
|
795
|
+
'trailing': false,
|
|
796
|
+
},
|
|
797
|
+
'fetchOHLCV': {
|
|
798
|
+
'limit': 2000,
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
'swap': {
|
|
802
|
+
'linear': {
|
|
803
|
+
'extends': 'forDerivs',
|
|
804
|
+
},
|
|
805
|
+
'inverse': {
|
|
806
|
+
'extends': 'forDerivs',
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
|
+
'future': {
|
|
810
|
+
'linear': undefined,
|
|
811
|
+
'inverse': undefined,
|
|
812
|
+
},
|
|
813
|
+
},
|
|
676
814
|
'commonCurrencies': {
|
|
677
815
|
'BEYONDPROTOCOL': 'BEYOND',
|
|
678
816
|
'BIFI': 'BIFIF',
|
|
@@ -2234,7 +2372,6 @@ class mexc extends mexc$1 {
|
|
|
2234
2372
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2235
2373
|
* @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
|
|
2236
2374
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2237
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2238
2375
|
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2239
2376
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2240
2377
|
*/
|
|
@@ -2283,7 +2420,7 @@ class mexc extends mexc$1 {
|
|
|
2283
2420
|
/**
|
|
2284
2421
|
* @ignore
|
|
2285
2422
|
* @method
|
|
2286
|
-
* @name mexc#
|
|
2423
|
+
* @name mexc#createSwapOrder
|
|
2287
2424
|
* @description create a trade order
|
|
2288
2425
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2289
2426
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
@@ -3603,33 +3740,43 @@ class mexc extends mexc$1 {
|
|
|
3603
3740
|
}
|
|
3604
3741
|
/**
|
|
3605
3742
|
* @method
|
|
3606
|
-
* @name mexc#
|
|
3607
|
-
* @description fetch the trading fees for
|
|
3608
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#
|
|
3609
|
-
* @
|
|
3743
|
+
* @name mexc#fetchTradingFee
|
|
3744
|
+
* @description fetch the trading fees for a market
|
|
3745
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
|
|
3746
|
+
* @param {string} symbol unified market symbol
|
|
3610
3747
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3611
|
-
* @returns {object} a
|
|
3748
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3612
3749
|
*/
|
|
3613
|
-
async
|
|
3750
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
3614
3751
|
await this.loadMarkets();
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
makerFee = Precise["default"].stringDiv(makerFee, '1000');
|
|
3619
|
-
takerFee = Precise["default"].stringDiv(takerFee, '1000');
|
|
3620
|
-
const result = {};
|
|
3621
|
-
for (let i = 0; i < this.symbols.length; i++) {
|
|
3622
|
-
const symbol = this.symbols[i];
|
|
3623
|
-
result[symbol] = {
|
|
3624
|
-
'symbol': symbol,
|
|
3625
|
-
'maker': this.parseNumber(makerFee),
|
|
3626
|
-
'taker': this.parseNumber(takerFee),
|
|
3627
|
-
'percentage': true,
|
|
3628
|
-
'tierBased': false,
|
|
3629
|
-
'info': response,
|
|
3630
|
-
};
|
|
3752
|
+
const market = this.market(symbol);
|
|
3753
|
+
if (!market['spot']) {
|
|
3754
|
+
throw new errors.BadRequest(this.id + ' fetchTradingFee() supports spot markets only');
|
|
3631
3755
|
}
|
|
3632
|
-
|
|
3756
|
+
const request = {
|
|
3757
|
+
'symbol': market['id'],
|
|
3758
|
+
};
|
|
3759
|
+
const response = await this.spotPrivateGetTradeFee(this.extend(request, params));
|
|
3760
|
+
//
|
|
3761
|
+
// {
|
|
3762
|
+
// "data":{
|
|
3763
|
+
// "makerCommission":0.003000000000000000,
|
|
3764
|
+
// "takerCommission":0.003000000000000000
|
|
3765
|
+
// },
|
|
3766
|
+
// "code":0,
|
|
3767
|
+
// "msg":"success",
|
|
3768
|
+
// "timestamp":1669109672717
|
|
3769
|
+
// }
|
|
3770
|
+
//
|
|
3771
|
+
const data = this.safeDict(response, 'data', {});
|
|
3772
|
+
return {
|
|
3773
|
+
'info': data,
|
|
3774
|
+
'symbol': symbol,
|
|
3775
|
+
'maker': this.safeNumber(data, 'makerCommission'),
|
|
3776
|
+
'taker': this.safeNumber(data, 'takerCommission'),
|
|
3777
|
+
'percentage': undefined,
|
|
3778
|
+
'tierBased': undefined,
|
|
3779
|
+
};
|
|
3633
3780
|
}
|
|
3634
3781
|
customParseBalance(response, marketType) {
|
|
3635
3782
|
//
|
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -1218,7 +1218,7 @@ class ndax extends ndax$1 {
|
|
|
1218
1218
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1219
1219
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1220
1220
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1221
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1221
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1222
1222
|
*/
|
|
1223
1223
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1224
1224
|
const omsId = this.safeInteger(this.options, 'omsId', 1);
|
package/dist/cjs/src/okcoin.js
CHANGED
|
@@ -1635,7 +1635,7 @@ class okcoin extends okcoin$1 {
|
|
|
1635
1635
|
* @param {string} id order id
|
|
1636
1636
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1637
1637
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1638
|
-
* @param {bool} [params.
|
|
1638
|
+
* @param {bool} [params.trigger] True if cancel trigger or conditional orders
|
|
1639
1639
|
* @param {bool} [params.advanced] True if canceling advanced orders only
|
|
1640
1640
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1641
1641
|
*/
|
|
@@ -1644,9 +1644,9 @@ class okcoin extends okcoin$1 {
|
|
|
1644
1644
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
1645
1645
|
}
|
|
1646
1646
|
await this.loadMarkets();
|
|
1647
|
-
const
|
|
1647
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
1648
1648
|
const advanced = this.safeValue(params, 'advanced');
|
|
1649
|
-
if (
|
|
1649
|
+
if (trigger || advanced) {
|
|
1650
1650
|
const orderInner = await this.cancelOrders([id], symbol, params);
|
|
1651
1651
|
return this.safeValue(orderInner, 0);
|
|
1652
1652
|
}
|
|
@@ -1702,7 +1702,7 @@ class okcoin extends okcoin$1 {
|
|
|
1702
1702
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
1703
1703
|
}
|
|
1704
1704
|
await this.loadMarkets();
|
|
1705
|
-
const
|
|
1705
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
1706
1706
|
const advanced = this.safeValue(params, 'advanced');
|
|
1707
1707
|
params = this.omit(params, ['stop', 'trigger', 'advanced']);
|
|
1708
1708
|
const market = this.market(symbol);
|
|
@@ -1720,7 +1720,7 @@ class okcoin extends okcoin$1 {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
for (let i = 0; i < ids.length; i++) {
|
|
1723
|
-
if (
|
|
1723
|
+
if (trigger || advanced) {
|
|
1724
1724
|
request.push({
|
|
1725
1725
|
'algoId': ids[i],
|
|
1726
1726
|
'instId': market['id'],
|
|
@@ -1743,7 +1743,7 @@ class okcoin extends okcoin$1 {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
1745
|
let response = undefined;
|
|
1746
|
-
if (
|
|
1746
|
+
if (trigger) {
|
|
1747
1747
|
response = await this.privatePostTradeCancelAlgos(request);
|
|
1748
1748
|
}
|
|
1749
1749
|
else if (advanced) {
|
|
@@ -2003,8 +2003,8 @@ class okcoin extends okcoin$1 {
|
|
|
2003
2003
|
// 'ordId': id,
|
|
2004
2004
|
};
|
|
2005
2005
|
const clientOrderId = this.safeString2(params, 'clOrdId', 'clientOrderId');
|
|
2006
|
-
const
|
|
2007
|
-
if (
|
|
2006
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
2007
|
+
if (trigger) {
|
|
2008
2008
|
if (clientOrderId !== undefined) {
|
|
2009
2009
|
request['algoClOrdId'] = clientOrderId;
|
|
2010
2010
|
}
|
|
@@ -2022,7 +2022,7 @@ class okcoin extends okcoin$1 {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
const query = this.omit(params, ['clientOrderId', 'stop', 'trigger']);
|
|
2024
2024
|
let response = undefined;
|
|
2025
|
-
if (
|
|
2025
|
+
if (trigger) {
|
|
2026
2026
|
response = await this.privateGetTradeOrderAlgo(this.extend(request, query));
|
|
2027
2027
|
}
|
|
2028
2028
|
else {
|
|
@@ -2042,7 +2042,7 @@ class okcoin extends okcoin$1 {
|
|
|
2042
2042
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2043
2043
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2044
2044
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2045
|
-
* @param {bool} [params.
|
|
2045
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
2046
2046
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
2047
2047
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2048
2048
|
*/
|
|
@@ -2065,13 +2065,13 @@ class okcoin extends okcoin$1 {
|
|
|
2065
2065
|
request['limit'] = limit; // default 100, max 100
|
|
2066
2066
|
}
|
|
2067
2067
|
const ordType = this.safeString(params, 'ordType');
|
|
2068
|
-
const
|
|
2069
|
-
if (
|
|
2068
|
+
const trigger = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
|
|
2069
|
+
if (trigger && (ordType === undefined)) {
|
|
2070
2070
|
request['ordType'] = 'trigger'; // default to trigger
|
|
2071
2071
|
}
|
|
2072
2072
|
params = this.omit(params, ['stop']);
|
|
2073
2073
|
let response = undefined;
|
|
2074
|
-
if (
|
|
2074
|
+
if (trigger) {
|
|
2075
2075
|
response = await this.privateGetTradeOrdersAlgoPending(this.extend(request, params));
|
|
2076
2076
|
}
|
|
2077
2077
|
else {
|
|
@@ -2091,7 +2091,7 @@ class okcoin extends okcoin$1 {
|
|
|
2091
2091
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2092
2092
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2093
2093
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2094
|
-
* @param {bool} [params.
|
|
2094
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
2095
2095
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
2096
2096
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2097
2097
|
*/
|
|
@@ -2106,13 +2106,13 @@ class okcoin extends okcoin$1 {
|
|
|
2106
2106
|
request['instId'] = market['id'];
|
|
2107
2107
|
}
|
|
2108
2108
|
const ordType = this.safeString(params, 'ordType');
|
|
2109
|
-
const
|
|
2110
|
-
if (
|
|
2109
|
+
const trigger = this.safeValue(params, 'stop') || (this.safeString(params, 'ordType') !== undefined);
|
|
2110
|
+
if (trigger && (ordType === undefined)) {
|
|
2111
2111
|
request['ordType'] = 'trigger'; // default to trigger
|
|
2112
2112
|
}
|
|
2113
2113
|
params = this.omit(params, ['stop']);
|
|
2114
2114
|
let response = undefined;
|
|
2115
|
-
if (
|
|
2115
|
+
if (trigger) {
|
|
2116
2116
|
response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, params));
|
|
2117
2117
|
}
|
|
2118
2118
|
else {
|
|
@@ -2871,7 +2871,7 @@ class okcoin extends okcoin$1 {
|
|
|
2871
2871
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2872
2872
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2873
2873
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2874
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2874
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2875
2875
|
*/
|
|
2876
2876
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2877
2877
|
await this.loadMarkets();
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -2254,6 +2254,7 @@ class okx extends okx$1 {
|
|
|
2254
2254
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2255
2255
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2256
2256
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2257
|
+
* @param {string} [params.method] 'publicGetMarketTrades' or 'publicGetMarketHistoryTrades' default is 'publicGetMarketTrades'
|
|
2257
2258
|
* @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
|
|
2258
2259
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2259
2260
|
*/
|
|
@@ -3398,9 +3399,9 @@ class okx extends okx$1 {
|
|
|
3398
3399
|
if (symbol === undefined) {
|
|
3399
3400
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
3400
3401
|
}
|
|
3401
|
-
const
|
|
3402
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3402
3403
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3403
|
-
if (
|
|
3404
|
+
if (trigger || trailing) {
|
|
3404
3405
|
const orderInner = await this.cancelOrders([id], symbol, params);
|
|
3405
3406
|
return this.safeValue(orderInner, 0);
|
|
3406
3407
|
}
|
|
@@ -3466,9 +3467,9 @@ class okx extends okx$1 {
|
|
|
3466
3467
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3467
3468
|
const clientOrderIds = this.parseIds(this.safeValue2(params, 'clOrdId', 'clientOrderId'));
|
|
3468
3469
|
const algoIds = this.parseIds(this.safeValue(params, 'algoId'));
|
|
3469
|
-
const
|
|
3470
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3470
3471
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3471
|
-
if (
|
|
3472
|
+
if (trigger || trailing) {
|
|
3472
3473
|
method = 'privatePostTradeCancelAlgos';
|
|
3473
3474
|
}
|
|
3474
3475
|
if (clientOrderIds === undefined) {
|
|
@@ -3482,7 +3483,7 @@ class okx extends okx$1 {
|
|
|
3482
3483
|
}
|
|
3483
3484
|
}
|
|
3484
3485
|
for (let i = 0; i < ids.length; i++) {
|
|
3485
|
-
if (trailing ||
|
|
3486
|
+
if (trailing || trigger) {
|
|
3486
3487
|
request.push({
|
|
3487
3488
|
'algoId': ids[i],
|
|
3488
3489
|
'instId': market['id'],
|
|
@@ -3561,9 +3562,9 @@ class okx extends okx$1 {
|
|
|
3561
3562
|
const options = this.safeDict(this.options, 'cancelOrders', {});
|
|
3562
3563
|
const defaultMethod = this.safeString(options, 'method', 'privatePostTradeCancelBatchOrders');
|
|
3563
3564
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3564
|
-
const
|
|
3565
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3565
3566
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3566
|
-
const isStopOrTrailing =
|
|
3567
|
+
const isStopOrTrailing = trigger || trailing;
|
|
3567
3568
|
if (isStopOrTrailing) {
|
|
3568
3569
|
method = 'privatePostTradeCancelAlgos';
|
|
3569
3570
|
}
|
|
@@ -3902,8 +3903,8 @@ class okx extends okx$1 {
|
|
|
3902
3903
|
const options = this.safeValue(this.options, 'fetchOrder', {});
|
|
3903
3904
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrder');
|
|
3904
3905
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3905
|
-
const
|
|
3906
|
-
if (
|
|
3906
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3907
|
+
if (trigger) {
|
|
3907
3908
|
method = 'privateGetTradeOrderAlgo';
|
|
3908
3909
|
if (clientOrderId !== undefined) {
|
|
3909
3910
|
request['algoClOrdId'] = clientOrderId;
|
|
@@ -4038,7 +4039,7 @@ class okx extends okx$1 {
|
|
|
4038
4039
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4039
4040
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
4040
4041
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4041
|
-
* @param {bool} [params.
|
|
4042
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
4042
4043
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
4043
4044
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
4044
4045
|
* @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)
|
|
@@ -4075,15 +4076,15 @@ class okx extends okx$1 {
|
|
|
4075
4076
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersPending');
|
|
4076
4077
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4077
4078
|
const ordType = this.safeString(params, 'ordType');
|
|
4078
|
-
const
|
|
4079
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4079
4080
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4080
|
-
if (trailing ||
|
|
4081
|
+
if (trailing || trigger || (ordType in algoOrderTypes)) {
|
|
4081
4082
|
method = 'privateGetTradeOrdersAlgoPending';
|
|
4082
4083
|
}
|
|
4083
4084
|
if (trailing) {
|
|
4084
4085
|
request['ordType'] = 'move_order_stop';
|
|
4085
4086
|
}
|
|
4086
|
-
else if (
|
|
4087
|
+
else if (trigger && (ordType === undefined)) {
|
|
4087
4088
|
request['ordType'] = 'trigger';
|
|
4088
4089
|
}
|
|
4089
4090
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
|
|
@@ -4202,7 +4203,7 @@ class okx extends okx$1 {
|
|
|
4202
4203
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4203
4204
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4204
4205
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4205
|
-
* @param {bool} [params.
|
|
4206
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
4206
4207
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
4207
4208
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
4208
4209
|
* @param {int} [params.until] timestamp in ms to fetch orders for
|
|
@@ -4240,20 +4241,20 @@ class okx extends okx$1 {
|
|
|
4240
4241
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4241
4242
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4242
4243
|
const ordType = this.safeString(params, 'ordType');
|
|
4243
|
-
const
|
|
4244
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4244
4245
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4245
4246
|
if (trailing) {
|
|
4246
4247
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4247
4248
|
request['ordType'] = 'move_order_stop';
|
|
4248
4249
|
}
|
|
4249
|
-
else if (
|
|
4250
|
+
else if (trigger || (ordType in algoOrderTypes)) {
|
|
4250
4251
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4251
4252
|
const algoId = this.safeString(params, 'algoId');
|
|
4252
4253
|
if (algoId !== undefined) {
|
|
4253
4254
|
request['algoId'] = algoId;
|
|
4254
4255
|
params = this.omit(params, 'algoId');
|
|
4255
4256
|
}
|
|
4256
|
-
if (
|
|
4257
|
+
if (trigger) {
|
|
4257
4258
|
if (ordType === undefined) {
|
|
4258
4259
|
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
|
|
4259
4260
|
}
|
|
@@ -4434,16 +4435,16 @@ class okx extends okx$1 {
|
|
|
4434
4435
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4435
4436
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4436
4437
|
const ordType = this.safeString(params, 'ordType');
|
|
4437
|
-
const
|
|
4438
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4438
4439
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4439
|
-
if (trailing ||
|
|
4440
|
+
if (trailing || trigger || (ordType in algoOrderTypes)) {
|
|
4440
4441
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4441
4442
|
request['state'] = 'effective';
|
|
4442
4443
|
}
|
|
4443
4444
|
if (trailing) {
|
|
4444
4445
|
request['ordType'] = 'move_order_stop';
|
|
4445
4446
|
}
|
|
4446
|
-
else if (
|
|
4447
|
+
else if (trigger) {
|
|
4447
4448
|
if (ordType === undefined) {
|
|
4448
4449
|
request['ordType'] = 'trigger';
|
|
4449
4450
|
}
|
|
@@ -4676,7 +4677,7 @@ class okx extends okx$1 {
|
|
|
4676
4677
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
4677
4678
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4678
4679
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4679
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
4680
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
4680
4681
|
*/
|
|
4681
4682
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4682
4683
|
await this.loadMarkets();
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -2962,15 +2962,15 @@ class phemex extends phemex$1 {
|
|
|
2962
2962
|
}
|
|
2963
2963
|
await this.loadMarkets();
|
|
2964
2964
|
const market = this.market(symbol);
|
|
2965
|
-
const
|
|
2966
|
-
params = this.omit(params, 'stop', 'trigger');
|
|
2965
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger', false);
|
|
2966
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
2967
2967
|
const request = {
|
|
2968
2968
|
'symbol': market['id'],
|
|
2969
2969
|
// 'untriggerred': false, // false to cancel non-conditional orders, true to cancel conditional orders
|
|
2970
2970
|
// 'text': 'up to 40 characters max',
|
|
2971
2971
|
};
|
|
2972
|
-
if (
|
|
2973
|
-
request['untriggerred'] =
|
|
2972
|
+
if (trigger) {
|
|
2973
|
+
request['untriggerred'] = trigger;
|
|
2974
2974
|
}
|
|
2975
2975
|
let response = undefined;
|
|
2976
2976
|
if (market['settle'] === 'USDT') {
|
|
@@ -4144,19 +4144,23 @@ class phemex extends phemex$1 {
|
|
|
4144
4144
|
const marketId = this.safeString(contract, 'symbol');
|
|
4145
4145
|
const symbol = this.safeSymbol(marketId, market);
|
|
4146
4146
|
const timestamp = this.safeIntegerProduct(contract, 'timestamp', 0.000001);
|
|
4147
|
+
const markEp = this.fromEp(this.safeString(contract, 'markEp'), market);
|
|
4148
|
+
const indexEp = this.fromEp(this.safeString(contract, 'indexEp'), market);
|
|
4149
|
+
const fundingRateEr = this.fromEr(this.safeString(contract, 'fundingRateEr'), market);
|
|
4150
|
+
const nextFundingRateEr = this.fromEr(this.safeString(contract, 'predFundingRateEr'), market);
|
|
4147
4151
|
return {
|
|
4148
4152
|
'info': contract,
|
|
4149
4153
|
'symbol': symbol,
|
|
4150
|
-
'markPrice': this.
|
|
4151
|
-
'indexPrice': this.
|
|
4154
|
+
'markPrice': this.safeNumber(contract, 'markPriceRp', markEp),
|
|
4155
|
+
'indexPrice': this.safeNumber(contract, 'indexPriceRp', indexEp),
|
|
4152
4156
|
'interestRate': undefined,
|
|
4153
4157
|
'estimatedSettlePrice': undefined,
|
|
4154
4158
|
'timestamp': timestamp,
|
|
4155
4159
|
'datetime': this.iso8601(timestamp),
|
|
4156
|
-
'fundingRate': this.
|
|
4160
|
+
'fundingRate': this.safeNumber(contract, 'fundingRateRr', fundingRateEr),
|
|
4157
4161
|
'fundingTimestamp': undefined,
|
|
4158
4162
|
'fundingDatetime': undefined,
|
|
4159
|
-
'nextFundingRate': this.
|
|
4163
|
+
'nextFundingRate': this.safeNumber(contract, 'predFundingRateRr', nextFundingRateEr),
|
|
4160
4164
|
'nextFundingTimestamp': undefined,
|
|
4161
4165
|
'nextFundingDatetime': undefined,
|
|
4162
4166
|
'previousFundingRate': undefined,
|
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -1207,7 +1207,7 @@ class poloniex extends poloniex$1 {
|
|
|
1207
1207
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1208
1208
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1209
1209
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1210
|
-
* @param {boolean} [params.
|
|
1210
|
+
* @param {boolean} [params.trigger] set true to fetch trigger orders instead of regular orders
|
|
1211
1211
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1212
1212
|
*/
|
|
1213
1213
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1206,7 +1206,7 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1206
1206
|
* @description cancel all open orders
|
|
1207
1207
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1208
1208
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1209
|
-
* @param {object} [params.
|
|
1209
|
+
* @param {object} [params.trigger] When true, all the trigger orders will be cancelled
|
|
1210
1210
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1211
1211
|
*/
|
|
1212
1212
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -1215,10 +1215,10 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1215
1215
|
if (symbol !== undefined) {
|
|
1216
1216
|
request['symbol'] = this.marketId(symbol);
|
|
1217
1217
|
}
|
|
1218
|
-
const
|
|
1218
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
1219
1219
|
params = this.omit(params, ['stop', 'trigger']);
|
|
1220
1220
|
let response = undefined;
|
|
1221
|
-
if (
|
|
1221
|
+
if (trigger) {
|
|
1222
1222
|
response = await this.privateDeleteStopOrders(this.extend(request, params));
|
|
1223
1223
|
}
|
|
1224
1224
|
else {
|
|
@@ -1285,14 +1285,14 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1285
1285
|
*/
|
|
1286
1286
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1287
1287
|
await this.loadMarkets();
|
|
1288
|
-
const
|
|
1288
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
1289
1289
|
const until = this.safeInteger(params, 'until');
|
|
1290
1290
|
params = this.omit(params, ['trigger', 'stop', 'until']);
|
|
1291
1291
|
if (status === 'closed') {
|
|
1292
1292
|
status = 'done';
|
|
1293
1293
|
}
|
|
1294
1294
|
const request = {};
|
|
1295
|
-
if (!
|
|
1295
|
+
if (!trigger) {
|
|
1296
1296
|
request['status'] = (status === 'open') ? 'active' : 'done';
|
|
1297
1297
|
}
|
|
1298
1298
|
else if (status !== 'open') {
|
|
@@ -1310,7 +1310,7 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1310
1310
|
request['endAt'] = until;
|
|
1311
1311
|
}
|
|
1312
1312
|
let response = undefined;
|
|
1313
|
-
if (
|
|
1313
|
+
if (trigger) {
|
|
1314
1314
|
response = await this.privateGetStopOrders(this.extend(request, params));
|
|
1315
1315
|
}
|
|
1316
1316
|
else {
|
|
@@ -1121,7 +1121,7 @@ class bitget extends bitget$1 {
|
|
|
1121
1121
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1122
1122
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1123
1123
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1124
|
-
* @param {boolean} [params.
|
|
1124
|
+
* @param {boolean} [params.trigger] *contract only* set to true for watching trigger orders
|
|
1125
1125
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
|
|
1126
1126
|
* @param {string} [params.type] 'spot', 'swap'
|
|
1127
1127
|
* @param {string} [params.subType] 'linear', 'inverse'
|