ccxt 4.4.39 → 4.4.41
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/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +32 -21
- package/dist/cjs/src/binance.js +37 -43
- package/dist/cjs/src/bingx.js +4 -3
- 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 +18 -19
- package/dist/cjs/src/bitfinex1.js +0 -1
- package/dist/cjs/src/bitflyer.js +0 -1
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bithumb.js +0 -1
- package/dist/cjs/src/bitmart.js +257 -5
- 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 +10 -11
- 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 +1 -1
- package/dist/cjs/src/exmo.js +64 -6
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hashkey.js +3 -5
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +66 -2
- package/dist/cjs/src/kraken.js +130 -27
- package/dist/cjs/src/kucoin.js +30 -25
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +138 -2
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +27 -22
- 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/vertex.js +11 -11
- package/dist/cjs/src/woo.js +33 -33
- package/dist/cjs/src/woofipro.js +24 -24
- package/dist/cjs/src/xt.js +31 -28
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +5 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +32 -21
- package/js/src/base/types.d.ts +2 -0
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +37 -43
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +4 -3
- 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 +18 -19
- 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 +2 -2
- package/js/src/bithumb.js +0 -1
- package/js/src/bitmart.d.ts +53 -2
- package/js/src/bitmart.js +257 -5
- 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 +10 -11
- 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 +1 -1
- package/js/src/digifinex.js +1 -1
- package/js/src/exmo.d.ts +35 -0
- package/js/src/exmo.js +64 -6
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +2 -2
- package/js/src/hashkey.d.ts +1 -1
- package/js/src/hashkey.js +3 -5
- package/js/src/htx.d.ts +1 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.d.ts +21 -2
- package/js/src/hyperliquid.js +66 -2
- package/js/src/kraken.d.ts +14 -8
- package/js/src/kraken.js +130 -27
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +30 -25
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +1 -2
- package/js/src/mexc.js +138 -2
- 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 +3 -3
- package/js/src/okx.js +27 -22
- 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/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 +33 -33
- 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 +31 -28
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +2 -2
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
|
@@ -259,6 +259,7 @@ class okx extends okx$1 {
|
|
|
259
259
|
'tradingBot/public/rsi-back-testing': 1,
|
|
260
260
|
'asset/exchange-list': 5 / 3,
|
|
261
261
|
'finance/staking-defi/eth/apy-history': 5 / 3,
|
|
262
|
+
'finance/staking-defi/sol/apy-history': 5 / 3,
|
|
262
263
|
'finance/savings/lending-rate-summary': 5 / 3,
|
|
263
264
|
'finance/savings/lending-rate-history': 5 / 3,
|
|
264
265
|
'finance/fixed-loan/lending-offers': 10 / 3,
|
|
@@ -397,6 +398,8 @@ class okx extends okx$1 {
|
|
|
397
398
|
'finance/staking-defi/eth/balance': 5 / 3,
|
|
398
399
|
'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
|
|
399
400
|
'finance/staking-defi/eth/product-info': 3,
|
|
401
|
+
'finance/staking-defi/sol/balance': 5 / 3,
|
|
402
|
+
'finance/staking-defi/sol/purchase-redeem-history': 5 / 3,
|
|
400
403
|
// copytrading
|
|
401
404
|
'copytrading/current-subpositions': 1,
|
|
402
405
|
'copytrading/subpositions-history': 1,
|
|
@@ -531,6 +534,8 @@ class okx extends okx$1 {
|
|
|
531
534
|
// eth staking
|
|
532
535
|
'finance/staking-defi/eth/purchase': 5,
|
|
533
536
|
'finance/staking-defi/eth/redeem': 5,
|
|
537
|
+
'finance/staking-defi/sol/purchase': 5,
|
|
538
|
+
'finance/staking-defi/sol/redeem': 5,
|
|
534
539
|
// copytrading
|
|
535
540
|
'copytrading/algo-order': 1,
|
|
536
541
|
'copytrading/close-subposition': 1,
|
|
@@ -3399,9 +3404,9 @@ class okx extends okx$1 {
|
|
|
3399
3404
|
if (symbol === undefined) {
|
|
3400
3405
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
3401
3406
|
}
|
|
3402
|
-
const
|
|
3407
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3403
3408
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3404
|
-
if (
|
|
3409
|
+
if (trigger || trailing) {
|
|
3405
3410
|
const orderInner = await this.cancelOrders([id], symbol, params);
|
|
3406
3411
|
return this.safeValue(orderInner, 0);
|
|
3407
3412
|
}
|
|
@@ -3467,9 +3472,9 @@ class okx extends okx$1 {
|
|
|
3467
3472
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3468
3473
|
const clientOrderIds = this.parseIds(this.safeValue2(params, 'clOrdId', 'clientOrderId'));
|
|
3469
3474
|
const algoIds = this.parseIds(this.safeValue(params, 'algoId'));
|
|
3470
|
-
const
|
|
3475
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3471
3476
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3472
|
-
if (
|
|
3477
|
+
if (trigger || trailing) {
|
|
3473
3478
|
method = 'privatePostTradeCancelAlgos';
|
|
3474
3479
|
}
|
|
3475
3480
|
if (clientOrderIds === undefined) {
|
|
@@ -3483,7 +3488,7 @@ class okx extends okx$1 {
|
|
|
3483
3488
|
}
|
|
3484
3489
|
}
|
|
3485
3490
|
for (let i = 0; i < ids.length; i++) {
|
|
3486
|
-
if (trailing ||
|
|
3491
|
+
if (trailing || trigger) {
|
|
3487
3492
|
request.push({
|
|
3488
3493
|
'algoId': ids[i],
|
|
3489
3494
|
'instId': market['id'],
|
|
@@ -3562,9 +3567,9 @@ class okx extends okx$1 {
|
|
|
3562
3567
|
const options = this.safeDict(this.options, 'cancelOrders', {});
|
|
3563
3568
|
const defaultMethod = this.safeString(options, 'method', 'privatePostTradeCancelBatchOrders');
|
|
3564
3569
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3565
|
-
const
|
|
3570
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3566
3571
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3567
|
-
const isStopOrTrailing =
|
|
3572
|
+
const isStopOrTrailing = trigger || trailing;
|
|
3568
3573
|
if (isStopOrTrailing) {
|
|
3569
3574
|
method = 'privatePostTradeCancelAlgos';
|
|
3570
3575
|
}
|
|
@@ -3903,8 +3908,8 @@ class okx extends okx$1 {
|
|
|
3903
3908
|
const options = this.safeValue(this.options, 'fetchOrder', {});
|
|
3904
3909
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrder');
|
|
3905
3910
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3906
|
-
const
|
|
3907
|
-
if (
|
|
3911
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
3912
|
+
if (trigger) {
|
|
3908
3913
|
method = 'privateGetTradeOrderAlgo';
|
|
3909
3914
|
if (clientOrderId !== undefined) {
|
|
3910
3915
|
request['algoClOrdId'] = clientOrderId;
|
|
@@ -4039,7 +4044,7 @@ class okx extends okx$1 {
|
|
|
4039
4044
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4040
4045
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
4041
4046
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4042
|
-
* @param {bool} [params.
|
|
4047
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
4043
4048
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
4044
4049
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
4045
4050
|
* @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)
|
|
@@ -4076,15 +4081,15 @@ class okx extends okx$1 {
|
|
|
4076
4081
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersPending');
|
|
4077
4082
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4078
4083
|
const ordType = this.safeString(params, 'ordType');
|
|
4079
|
-
const
|
|
4084
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4080
4085
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4081
|
-
if (trailing ||
|
|
4086
|
+
if (trailing || trigger || (ordType in algoOrderTypes)) {
|
|
4082
4087
|
method = 'privateGetTradeOrdersAlgoPending';
|
|
4083
4088
|
}
|
|
4084
4089
|
if (trailing) {
|
|
4085
4090
|
request['ordType'] = 'move_order_stop';
|
|
4086
4091
|
}
|
|
4087
|
-
else if (
|
|
4092
|
+
else if (trigger && (ordType === undefined)) {
|
|
4088
4093
|
request['ordType'] = 'trigger';
|
|
4089
4094
|
}
|
|
4090
4095
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
|
|
@@ -4203,7 +4208,7 @@ class okx extends okx$1 {
|
|
|
4203
4208
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4204
4209
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4205
4210
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4206
|
-
* @param {bool} [params.
|
|
4211
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
4207
4212
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
4208
4213
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
4209
4214
|
* @param {int} [params.until] timestamp in ms to fetch orders for
|
|
@@ -4241,20 +4246,20 @@ class okx extends okx$1 {
|
|
|
4241
4246
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4242
4247
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4243
4248
|
const ordType = this.safeString(params, 'ordType');
|
|
4244
|
-
const
|
|
4249
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4245
4250
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4246
4251
|
if (trailing) {
|
|
4247
4252
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4248
4253
|
request['ordType'] = 'move_order_stop';
|
|
4249
4254
|
}
|
|
4250
|
-
else if (
|
|
4255
|
+
else if (trigger || (ordType in algoOrderTypes)) {
|
|
4251
4256
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4252
4257
|
const algoId = this.safeString(params, 'algoId');
|
|
4253
4258
|
if (algoId !== undefined) {
|
|
4254
4259
|
request['algoId'] = algoId;
|
|
4255
4260
|
params = this.omit(params, 'algoId');
|
|
4256
4261
|
}
|
|
4257
|
-
if (
|
|
4262
|
+
if (trigger) {
|
|
4258
4263
|
if (ordType === undefined) {
|
|
4259
4264
|
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
|
|
4260
4265
|
}
|
|
@@ -4435,16 +4440,16 @@ class okx extends okx$1 {
|
|
|
4435
4440
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4436
4441
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4437
4442
|
const ordType = this.safeString(params, 'ordType');
|
|
4438
|
-
const
|
|
4443
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4439
4444
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4440
|
-
if (trailing ||
|
|
4445
|
+
if (trailing || trigger || (ordType in algoOrderTypes)) {
|
|
4441
4446
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4442
4447
|
request['state'] = 'effective';
|
|
4443
4448
|
}
|
|
4444
4449
|
if (trailing) {
|
|
4445
4450
|
request['ordType'] = 'move_order_stop';
|
|
4446
4451
|
}
|
|
4447
|
-
else if (
|
|
4452
|
+
else if (trigger) {
|
|
4448
4453
|
if (ordType === undefined) {
|
|
4449
4454
|
request['ordType'] = 'trigger';
|
|
4450
4455
|
}
|
|
@@ -4677,7 +4682,7 @@ class okx extends okx$1 {
|
|
|
4677
4682
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
4678
4683
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4679
4684
|
* @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)
|
|
4680
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
4685
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
4681
4686
|
*/
|
|
4682
4687
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4683
4688
|
await this.loadMarkets();
|
|
@@ -7395,7 +7400,7 @@ class okx extends okx$1 {
|
|
|
7395
7400
|
// }
|
|
7396
7401
|
//
|
|
7397
7402
|
const data = this.safeList(response, 'data', []);
|
|
7398
|
-
return this.
|
|
7403
|
+
return this.parseOpenInterestsHistory(data, undefined, since, limit);
|
|
7399
7404
|
}
|
|
7400
7405
|
parseOpenInterest(interest, market = undefined) {
|
|
7401
7406
|
//
|
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'
|
|
@@ -106,6 +106,12 @@ class bybit extends bybit$1 {
|
|
|
106
106
|
'fetchPositionsSnapshot': true,
|
|
107
107
|
'awaitPositionsSnapshot': true, // whether to wait for the positions snapshot before providing updates
|
|
108
108
|
},
|
|
109
|
+
'watchMyTrades': {
|
|
110
|
+
// filter execType: https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
111
|
+
'filterExecTypes': [
|
|
112
|
+
'Trade', 'AdlTrade', 'BustTrade', 'Settle',
|
|
113
|
+
],
|
|
114
|
+
},
|
|
109
115
|
'spot': {
|
|
110
116
|
'timeframes': {
|
|
111
117
|
'1m': '1m',
|
|
@@ -306,7 +312,7 @@ class bybit extends bybit$1 {
|
|
|
306
312
|
* @param {string} id order id
|
|
307
313
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
308
314
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
309
|
-
* @param {boolean} [params.
|
|
315
|
+
* @param {boolean} [params.trigger] *spot only* whether the order is a trigger order
|
|
310
316
|
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
311
317
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
312
318
|
*/
|
|
@@ -1350,6 +1356,7 @@ class bybit extends bybit$1 {
|
|
|
1350
1356
|
}
|
|
1351
1357
|
const trades = this.myTrades;
|
|
1352
1358
|
const symbols = {};
|
|
1359
|
+
const filterExecTypes = this.handleOption('watchMyTrades', 'filterExecTypes', []);
|
|
1353
1360
|
for (let i = 0; i < data.length; i++) {
|
|
1354
1361
|
const rawTrade = data[i];
|
|
1355
1362
|
let parsed = undefined;
|
|
@@ -1357,6 +1364,11 @@ class bybit extends bybit$1 {
|
|
|
1357
1364
|
parsed = this.parseWsTrade(rawTrade);
|
|
1358
1365
|
}
|
|
1359
1366
|
else {
|
|
1367
|
+
// filter unified trades
|
|
1368
|
+
const execType = this.safeString(rawTrade, 'execType', '');
|
|
1369
|
+
if (!this.inArray(execType, filterExecTypes)) {
|
|
1370
|
+
continue;
|
|
1371
|
+
}
|
|
1360
1372
|
parsed = this.parseTrade(rawTrade);
|
|
1361
1373
|
}
|
|
1362
1374
|
const symbol = parsed['symbol'];
|
|
@@ -893,7 +893,7 @@ class coinex extends coinex$1 {
|
|
|
893
893
|
*/
|
|
894
894
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
895
895
|
await this.loadMarkets();
|
|
896
|
-
const
|
|
896
|
+
const trigger = this.safeBool2(params, 'trigger', 'stop');
|
|
897
897
|
params = this.omit(params, ['trigger', 'stop']);
|
|
898
898
|
let messageHash = 'orders';
|
|
899
899
|
let market = undefined;
|
|
@@ -919,7 +919,7 @@ class coinex extends coinex$1 {
|
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
921
|
let method = undefined;
|
|
922
|
-
if (
|
|
922
|
+
if (trigger) {
|
|
923
923
|
method = 'stop.subscribe';
|
|
924
924
|
}
|
|
925
925
|
else {
|
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -200,14 +200,14 @@ class gate extends gate$1 {
|
|
|
200
200
|
async cancelAllOrdersWs(symbol = undefined, params = {}) {
|
|
201
201
|
await this.loadMarkets();
|
|
202
202
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
203
|
-
const
|
|
203
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
204
204
|
const messageType = this.getTypeByMarket(market);
|
|
205
205
|
let channel = messageType + '.order_cancel_cp';
|
|
206
206
|
[channel, params] = this.handleOptionAndParams(params, 'cancelAllOrdersWs', 'channel', channel);
|
|
207
207
|
const url = this.getUrlByMarket(market);
|
|
208
208
|
params = this.omit(params, ['stop', 'trigger']);
|
|
209
209
|
const [type, query] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
|
|
210
|
-
const [request, requestParams] = (type === 'spot') ? this.multiOrderSpotPrepareRequest(market,
|
|
210
|
+
const [request, requestParams] = (type === 'spot') ? this.multiOrderSpotPrepareRequest(market, trigger, query) : this.prepareRequest(market, type, query);
|
|
211
211
|
await this.authenticate(url, messageType);
|
|
212
212
|
const rawOrders = await this.requestPrivate(url, this.extend(request, requestParams), channel);
|
|
213
213
|
return this.parseOrders(rawOrders, market);
|
|
@@ -221,16 +221,16 @@ class gate extends gate$1 {
|
|
|
221
221
|
* @param {string} id Order id
|
|
222
222
|
* @param {string} symbol Unified market symbol
|
|
223
223
|
* @param {object} [params] Parameters specified by the exchange api
|
|
224
|
-
* @param {bool} [params.
|
|
224
|
+
* @param {bool} [params.trigger] True if the order to be cancelled is a trigger order
|
|
225
225
|
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
226
226
|
*/
|
|
227
227
|
async cancelOrderWs(id, symbol = undefined, params = {}) {
|
|
228
228
|
await this.loadMarkets();
|
|
229
229
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
230
|
-
const
|
|
230
|
+
const trigger = this.safeValueN(params, ['is_stop_order', 'stop', 'trigger'], false);
|
|
231
231
|
params = this.omit(params, ['is_stop_order', 'stop', 'trigger']);
|
|
232
232
|
const [type, query] = this.handleMarketTypeAndParams('cancelOrder', market, params);
|
|
233
|
-
const [request, requestParams] = (type === 'spot' || type === 'margin') ? this.spotOrderPrepareRequest(market,
|
|
233
|
+
const [request, requestParams] = (type === 'spot' || type === 'margin') ? this.spotOrderPrepareRequest(market, trigger, query) : this.prepareRequest(market, type, query);
|
|
234
234
|
const messageType = this.getTypeByMarket(market);
|
|
235
235
|
const channel = messageType + '.order_cancel';
|
|
236
236
|
const url = this.getUrlByMarket(market);
|
|
@@ -274,7 +274,7 @@ class gate extends gate$1 {
|
|
|
274
274
|
* @param {string} id Order id
|
|
275
275
|
* @param {string} symbol Unified market symbol, *required for spot and margin*
|
|
276
276
|
* @param {object} [params] Parameters specified by the exchange api
|
|
277
|
-
* @param {bool} [params.
|
|
277
|
+
* @param {bool} [params.trigger] True if the order being fetched is a trigger order
|
|
278
278
|
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
279
279
|
* @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
|
|
280
280
|
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - market settle currency is used if symbol !== undefined, default="usdt" for swap and "btc" for future
|
|
@@ -948,15 +948,15 @@ class kucoin extends kucoin$1 {
|
|
|
948
948
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
949
949
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
950
950
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
951
|
-
* @param {boolean} [params.
|
|
951
|
+
* @param {boolean} [params.trigger] trigger orders are watched if true
|
|
952
952
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
953
953
|
*/
|
|
954
954
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
955
955
|
await this.loadMarkets();
|
|
956
|
-
const
|
|
956
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
957
957
|
params = this.omit(params, ['stop', 'trigger']);
|
|
958
958
|
const url = await this.negotiate(true);
|
|
959
|
-
const topic =
|
|
959
|
+
const topic = trigger ? '/spotMarket/advancedOrders' : '/spotMarket/tradeOrders';
|
|
960
960
|
const request = {
|
|
961
961
|
'privateChannel': true,
|
|
962
962
|
};
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -744,9 +744,9 @@ class okx extends okx$1 {
|
|
|
744
744
|
*/
|
|
745
745
|
async watchMyLiquidationsForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
746
746
|
await this.loadMarkets();
|
|
747
|
-
const
|
|
747
|
+
const isTrigger = this.safeValue2(params, 'stop', 'trigger', false);
|
|
748
748
|
params = this.omit(params, ['stop', 'trigger']);
|
|
749
|
-
await this.authenticate({ 'access':
|
|
749
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
750
750
|
symbols = this.marketSymbols(symbols, undefined, true, true);
|
|
751
751
|
const messageHash = 'myLiquidations';
|
|
752
752
|
const messageHashes = [];
|
|
@@ -1591,7 +1591,7 @@ class okx extends okx$1 {
|
|
|
1591
1591
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1592
1592
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
1593
1593
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1594
|
-
* @param {bool} [params.
|
|
1594
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional trades
|
|
1595
1595
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1596
1596
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1597
1597
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
@@ -1600,11 +1600,11 @@ class okx extends okx$1 {
|
|
|
1600
1600
|
// By default, receive order updates from any instrument type
|
|
1601
1601
|
let type = undefined;
|
|
1602
1602
|
[type, params] = this.handleOptionAndParams(params, 'watchMyTrades', 'type', 'ANY');
|
|
1603
|
-
const
|
|
1604
|
-
params = this.omit(params, ['stop']);
|
|
1603
|
+
const isTrigger = this.safeBool2(params, 'trigger', 'stop', false);
|
|
1604
|
+
params = this.omit(params, ['trigger', 'stop']);
|
|
1605
1605
|
await this.loadMarkets();
|
|
1606
|
-
await this.authenticate({ 'access':
|
|
1607
|
-
const channel =
|
|
1606
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
1607
|
+
const channel = isTrigger ? 'orders-algo' : 'orders';
|
|
1608
1608
|
let messageHash = channel + '::myTrades';
|
|
1609
1609
|
let market = undefined;
|
|
1610
1610
|
if (symbol !== undefined) {
|
|
@@ -1780,7 +1780,7 @@ class okx extends okx$1 {
|
|
|
1780
1780
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1781
1781
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1782
1782
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1783
|
-
* @param {bool} [params.
|
|
1783
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional orders
|
|
1784
1784
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1785
1785
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1786
1786
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1789,10 +1789,10 @@ class okx extends okx$1 {
|
|
|
1789
1789
|
let type = undefined;
|
|
1790
1790
|
// By default, receive order updates from any instrument type
|
|
1791
1791
|
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'type', 'ANY');
|
|
1792
|
-
const
|
|
1792
|
+
const isTrigger = this.safeValue2(params, 'stop', 'trigger', false);
|
|
1793
1793
|
params = this.omit(params, ['stop', 'trigger']);
|
|
1794
1794
|
await this.loadMarkets();
|
|
1795
|
-
await this.authenticate({ 'access':
|
|
1795
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
1796
1796
|
let market = undefined;
|
|
1797
1797
|
if (symbol !== undefined) {
|
|
1798
1798
|
market = this.market(symbol);
|
|
@@ -1813,7 +1813,7 @@ class okx extends okx$1 {
|
|
|
1813
1813
|
const request = {
|
|
1814
1814
|
'instType': uppercaseType,
|
|
1815
1815
|
};
|
|
1816
|
-
const channel =
|
|
1816
|
+
const channel = isTrigger ? 'orders-algo' : 'orders';
|
|
1817
1817
|
const orders = await this.subscribe('private', channel, channel, symbol, this.extend(request, params));
|
|
1818
1818
|
if (this.newUpdates) {
|
|
1819
1819
|
limit = orders.getLimit(symbol, limit);
|
|
@@ -98,10 +98,10 @@ class upbit extends upbit$1 {
|
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* @method
|
|
101
|
-
* @name upbit#
|
|
102
|
-
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific
|
|
101
|
+
* @name upbit#watchTickers
|
|
102
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
103
103
|
* @see https://global-docs.upbit.com/reference/websocket-ticker
|
|
104
|
-
* @param symbols
|
|
104
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
105
105
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
106
106
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
107
107
|
*/
|