ccxt 4.4.39 → 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/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +12 -18
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/kucoin.js +24 -24
- 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 +21 -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/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 +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/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.js +12 -18
- 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 +1 -1
- package/js/src/digifinex.js +1 -1
- 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 +1 -1
- package/js/src/htx.js +1 -1
- 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 +24 -24
- 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 +21 -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/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 +26 -26
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +1 -1
package/js/src/pro/okx.d.ts
CHANGED
|
@@ -291,7 +291,7 @@ export default class okx extends okxRest {
|
|
|
291
291
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
292
292
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
293
293
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
294
|
-
* @param {bool} [params.
|
|
294
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional trades
|
|
295
295
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
296
296
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
297
297
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
@@ -319,7 +319,7 @@ export default class okx extends okxRest {
|
|
|
319
319
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
320
320
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
321
321
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
322
|
-
* @param {bool} [params.
|
|
322
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional orders
|
|
323
323
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
324
324
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
325
325
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/js/src/pro/okx.js
CHANGED
|
@@ -747,9 +747,9 @@ export default class okx extends okxRest {
|
|
|
747
747
|
*/
|
|
748
748
|
async watchMyLiquidationsForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
749
749
|
await this.loadMarkets();
|
|
750
|
-
const
|
|
750
|
+
const isTrigger = this.safeValue2(params, 'stop', 'trigger', false);
|
|
751
751
|
params = this.omit(params, ['stop', 'trigger']);
|
|
752
|
-
await this.authenticate({ 'access':
|
|
752
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
753
753
|
symbols = this.marketSymbols(symbols, undefined, true, true);
|
|
754
754
|
const messageHash = 'myLiquidations';
|
|
755
755
|
const messageHashes = [];
|
|
@@ -1596,7 +1596,7 @@ export default class okx extends okxRest {
|
|
|
1596
1596
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1597
1597
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
1598
1598
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1599
|
-
* @param {bool} [params.
|
|
1599
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional trades
|
|
1600
1600
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1601
1601
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1602
1602
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
@@ -1605,11 +1605,11 @@ export default class okx extends okxRest {
|
|
|
1605
1605
|
// By default, receive order updates from any instrument type
|
|
1606
1606
|
let type = undefined;
|
|
1607
1607
|
[type, params] = this.handleOptionAndParams(params, 'watchMyTrades', 'type', 'ANY');
|
|
1608
|
-
const
|
|
1609
|
-
params = this.omit(params, ['stop']);
|
|
1608
|
+
const isTrigger = this.safeBool2(params, 'trigger', 'stop', false);
|
|
1609
|
+
params = this.omit(params, ['trigger', 'stop']);
|
|
1610
1610
|
await this.loadMarkets();
|
|
1611
|
-
await this.authenticate({ 'access':
|
|
1612
|
-
const channel =
|
|
1611
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
1612
|
+
const channel = isTrigger ? 'orders-algo' : 'orders';
|
|
1613
1613
|
let messageHash = channel + '::myTrades';
|
|
1614
1614
|
let market = undefined;
|
|
1615
1615
|
if (symbol !== undefined) {
|
|
@@ -1785,7 +1785,7 @@ export default class okx extends okxRest {
|
|
|
1785
1785
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1786
1786
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1787
1787
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1788
|
-
* @param {bool} [params.
|
|
1788
|
+
* @param {bool} [params.trigger] true if fetching trigger or conditional orders
|
|
1789
1789
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1790
1790
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1791
1791
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1794,10 +1794,10 @@ export default class okx extends okxRest {
|
|
|
1794
1794
|
let type = undefined;
|
|
1795
1795
|
// By default, receive order updates from any instrument type
|
|
1796
1796
|
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'type', 'ANY');
|
|
1797
|
-
const
|
|
1797
|
+
const isTrigger = this.safeValue2(params, 'stop', 'trigger', false);
|
|
1798
1798
|
params = this.omit(params, ['stop', 'trigger']);
|
|
1799
1799
|
await this.loadMarkets();
|
|
1800
|
-
await this.authenticate({ 'access':
|
|
1800
|
+
await this.authenticate({ 'access': isTrigger ? 'business' : 'private' });
|
|
1801
1801
|
let market = undefined;
|
|
1802
1802
|
if (symbol !== undefined) {
|
|
1803
1803
|
market = this.market(symbol);
|
|
@@ -1818,7 +1818,7 @@ export default class okx extends okxRest {
|
|
|
1818
1818
|
const request = {
|
|
1819
1819
|
'instType': uppercaseType,
|
|
1820
1820
|
};
|
|
1821
|
-
const channel =
|
|
1821
|
+
const channel = isTrigger ? 'orders-algo' : 'orders';
|
|
1822
1822
|
const orders = await this.subscribe('private', channel, channel, symbol, this.extend(request, params));
|
|
1823
1823
|
if (this.newUpdates) {
|
|
1824
1824
|
limit = orders.getLimit(symbol, limit);
|
package/js/src/pro/upbit.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ export default class upbit extends upbitRest {
|
|
|
17
17
|
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
18
18
|
/**
|
|
19
19
|
* @method
|
|
20
|
-
* @name upbit#
|
|
21
|
-
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific
|
|
20
|
+
* @name upbit#watchTickers
|
|
21
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
22
22
|
* @see https://global-docs.upbit.com/reference/websocket-ticker
|
|
23
|
-
* @param symbols
|
|
23
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
24
24
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
25
25
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
26
26
|
*/
|
package/js/src/pro/upbit.js
CHANGED
|
@@ -101,10 +101,10 @@ export default class upbit extends upbitRest {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* @method
|
|
104
|
-
* @name upbit#
|
|
105
|
-
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific
|
|
104
|
+
* @name upbit#watchTickers
|
|
105
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
106
106
|
* @see https://global-docs.upbit.com/reference/websocket-ticker
|
|
107
|
-
* @param symbols
|
|
107
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
108
108
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
109
109
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
110
110
|
*/
|
package/js/src/vertex.d.ts
CHANGED
|
@@ -232,7 +232,7 @@ export default class vertex extends Exchange {
|
|
|
232
232
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
233
233
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
234
234
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
235
|
-
* @param {boolean} [params.
|
|
235
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
236
236
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
237
237
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
238
238
|
*/
|
|
@@ -246,7 +246,7 @@ export default class vertex extends Exchange {
|
|
|
246
246
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
247
247
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
248
248
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
249
|
-
* @param {boolean} [params.
|
|
249
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
250
250
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
251
251
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
252
252
|
*/
|
|
@@ -259,7 +259,7 @@ export default class vertex extends Exchange {
|
|
|
259
259
|
* @description cancel all open orders in a market
|
|
260
260
|
* @param {string} symbol unified market symbol
|
|
261
261
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
262
|
-
* @param {boolean} [params.
|
|
262
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
263
263
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
264
264
|
*/
|
|
265
265
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
package/js/src/vertex.js
CHANGED
|
@@ -2018,7 +2018,7 @@ export default class vertex extends Exchange {
|
|
|
2018
2018
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2019
2019
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2020
2020
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2021
|
-
* @param {boolean} [params.
|
|
2021
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
2022
2022
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2023
2023
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2024
2024
|
*/
|
|
@@ -2029,14 +2029,14 @@ export default class vertex extends Exchange {
|
|
|
2029
2029
|
[userAddress, params] = this.handlePublicAddress('fetchOpenOrders', params);
|
|
2030
2030
|
const request = {};
|
|
2031
2031
|
let market = undefined;
|
|
2032
|
-
const
|
|
2032
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
2033
2033
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2034
2034
|
if (symbol !== undefined) {
|
|
2035
2035
|
market = this.market(symbol);
|
|
2036
2036
|
request['product_id'] = this.parseToNumeric(market['id']);
|
|
2037
2037
|
}
|
|
2038
2038
|
let response = undefined;
|
|
2039
|
-
if (
|
|
2039
|
+
if (trigger) {
|
|
2040
2040
|
const contracts = await this.queryContracts();
|
|
2041
2041
|
const chainId = this.safeString(contracts, 'chain_id');
|
|
2042
2042
|
const verifyingContractAddress = this.safeString(contracts, 'endpoint_addr');
|
|
@@ -2135,15 +2135,15 @@ export default class vertex extends Exchange {
|
|
|
2135
2135
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2136
2136
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2137
2137
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2138
|
-
* @param {boolean} [params.
|
|
2138
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
2139
2139
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2140
2140
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2141
2141
|
*/
|
|
2142
2142
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2143
2143
|
this.checkRequiredCredentials();
|
|
2144
|
-
const
|
|
2144
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
2145
2145
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2146
|
-
if (!
|
|
2146
|
+
if (!trigger) {
|
|
2147
2147
|
throw new NotSupported(this.id + ' fetchOrders only support trigger orders');
|
|
2148
2148
|
}
|
|
2149
2149
|
let userAddress = undefined;
|
|
@@ -2221,7 +2221,7 @@ export default class vertex extends Exchange {
|
|
|
2221
2221
|
* @description cancel all open orders in a market
|
|
2222
2222
|
* @param {string} symbol unified market symbol
|
|
2223
2223
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2224
|
-
* @param {boolean} [params.
|
|
2224
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
2225
2225
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2226
2226
|
*/
|
|
2227
2227
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -2254,10 +2254,10 @@ export default class vertex extends Exchange {
|
|
|
2254
2254
|
'signature': this.buildCancelAllOrdersSig(cancels, chainId, verifyingContractAddress),
|
|
2255
2255
|
},
|
|
2256
2256
|
};
|
|
2257
|
-
const
|
|
2257
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
2258
2258
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2259
2259
|
let response = undefined;
|
|
2260
|
-
if (
|
|
2260
|
+
if (trigger) {
|
|
2261
2261
|
response = await this.v1TriggerPostExecute(this.extend(request, params));
|
|
2262
2262
|
//
|
|
2263
2263
|
// {
|
|
@@ -2355,10 +2355,10 @@ export default class vertex extends Exchange {
|
|
|
2355
2355
|
'signature': this.buildCancelOrdersSig(cancels, chainId, verifyingContractAddress),
|
|
2356
2356
|
},
|
|
2357
2357
|
};
|
|
2358
|
-
const
|
|
2358
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
2359
2359
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2360
2360
|
let response = undefined;
|
|
2361
|
-
if (
|
|
2361
|
+
if (trigger) {
|
|
2362
2362
|
response = await this.v1TriggerPostExecute(this.extend(request, params));
|
|
2363
2363
|
//
|
|
2364
2364
|
// {
|
package/js/src/woo.d.ts
CHANGED
|
@@ -188,7 +188,7 @@ export default class woo extends Exchange {
|
|
|
188
188
|
* @param {string} id order id
|
|
189
189
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
190
190
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
191
|
-
* @param {boolean} [params.
|
|
191
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
192
192
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
193
193
|
*/
|
|
194
194
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
@@ -201,7 +201,7 @@ export default class woo extends Exchange {
|
|
|
201
201
|
* @description cancel all open orders in a market
|
|
202
202
|
* @param {string} symbol unified market symbol
|
|
203
203
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
204
|
-
* @param {boolean} [params.
|
|
204
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
205
205
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
206
206
|
*/
|
|
207
207
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
@@ -224,7 +224,7 @@ export default class woo extends Exchange {
|
|
|
224
224
|
* @param {string} id the order id
|
|
225
225
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
226
226
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
227
|
-
* @param {boolean} [params.
|
|
227
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
228
228
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
229
229
|
*/
|
|
230
230
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -238,7 +238,7 @@ export default class woo extends Exchange {
|
|
|
238
238
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
239
239
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
240
240
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
241
|
-
* @param {boolean} [params.
|
|
241
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
242
242
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
243
243
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
244
244
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -256,7 +256,7 @@ export default class woo extends Exchange {
|
|
|
256
256
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
257
257
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
258
258
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
259
|
-
* @param {boolean} [params.
|
|
259
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
260
260
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
261
261
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
262
262
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -274,7 +274,7 @@ export default class woo extends Exchange {
|
|
|
274
274
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
275
275
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
276
276
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
277
|
-
* @param {boolean} [params.
|
|
277
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
278
278
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
279
279
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
280
280
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -383,7 +383,7 @@ export default class woo extends Exchange {
|
|
|
383
383
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
384
384
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
385
385
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
386
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
386
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
387
387
|
*/
|
|
388
388
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
389
389
|
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
package/js/src/woo.js
CHANGED
|
@@ -988,17 +988,17 @@ export default class woo extends Exchange {
|
|
|
988
988
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
989
989
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
990
990
|
const isTrailing = isTrailingAmountOrder || isTrailingPercentOrder;
|
|
991
|
-
const
|
|
991
|
+
const isConditional = isTrailing || stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
|
|
992
992
|
const isMarket = orderType === 'MARKET';
|
|
993
993
|
const timeInForce = this.safeStringLower(params, 'timeInForce');
|
|
994
994
|
const postOnly = this.isPostOnly(isMarket, undefined, params);
|
|
995
|
-
const reduceOnlyKey =
|
|
996
|
-
const clientOrderIdKey =
|
|
997
|
-
const orderQtyKey =
|
|
998
|
-
const priceKey =
|
|
999
|
-
const typeKey =
|
|
995
|
+
const reduceOnlyKey = isConditional ? 'reduceOnly' : 'reduce_only';
|
|
996
|
+
const clientOrderIdKey = isConditional ? 'clientOrderId' : 'client_order_id';
|
|
997
|
+
const orderQtyKey = isConditional ? 'quantity' : 'order_quantity';
|
|
998
|
+
const priceKey = isConditional ? 'price' : 'order_price';
|
|
999
|
+
const typeKey = isConditional ? 'type' : 'order_type';
|
|
1000
1000
|
request[typeKey] = orderType; // LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID
|
|
1001
|
-
if (!
|
|
1001
|
+
if (!isConditional) {
|
|
1002
1002
|
if (postOnly) {
|
|
1003
1003
|
request['order_type'] = 'POST_ONLY';
|
|
1004
1004
|
}
|
|
@@ -1015,7 +1015,7 @@ export default class woo extends Exchange {
|
|
|
1015
1015
|
if (!isMarket && price !== undefined) {
|
|
1016
1016
|
request[priceKey] = this.priceToPrecision(symbol, price);
|
|
1017
1017
|
}
|
|
1018
|
-
if (isMarket && !
|
|
1018
|
+
if (isMarket && !isConditional) {
|
|
1019
1019
|
// for market buy it requires the amount of quote currency to spend
|
|
1020
1020
|
const cost = this.safeString2(params, 'cost', 'order_amount');
|
|
1021
1021
|
params = this.omit(params, ['cost', 'order_amount']);
|
|
@@ -1099,7 +1099,7 @@ export default class woo extends Exchange {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingPercent', 'trailingAmount', 'trailingTriggerPrice']);
|
|
1101
1101
|
let response = undefined;
|
|
1102
|
-
if (
|
|
1102
|
+
if (isConditional) {
|
|
1103
1103
|
response = await this.v3PrivatePostAlgoOrder(this.extend(request, params));
|
|
1104
1104
|
}
|
|
1105
1105
|
else {
|
|
@@ -1208,11 +1208,11 @@ export default class woo extends Exchange {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
1210
|
params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent']);
|
|
1211
|
-
const
|
|
1211
|
+
const isConditional = isTrailing || (stopPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
|
|
1212
1212
|
let response = undefined;
|
|
1213
1213
|
if (isByClientOrder) {
|
|
1214
1214
|
request['client_order_id'] = clientOrderIdExchangeSpecific;
|
|
1215
|
-
if (
|
|
1215
|
+
if (isConditional) {
|
|
1216
1216
|
response = await this.v3PrivatePutAlgoOrderClientClientOrderId(this.extend(request, params));
|
|
1217
1217
|
}
|
|
1218
1218
|
else {
|
|
@@ -1221,7 +1221,7 @@ export default class woo extends Exchange {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
else {
|
|
1223
1223
|
request['oid'] = id;
|
|
1224
|
-
if (
|
|
1224
|
+
if (isConditional) {
|
|
1225
1225
|
response = await this.v3PrivatePutAlgoOrderOid(this.extend(request, params));
|
|
1226
1226
|
}
|
|
1227
1227
|
else {
|
|
@@ -1253,13 +1253,13 @@ export default class woo extends Exchange {
|
|
|
1253
1253
|
* @param {string} id order id
|
|
1254
1254
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1255
1255
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1256
|
-
* @param {boolean} [params.
|
|
1256
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1257
1257
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1258
1258
|
*/
|
|
1259
1259
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1260
|
-
const
|
|
1261
|
-
params = this.omit(params, 'stop');
|
|
1262
|
-
if (!
|
|
1260
|
+
const isTrigger = this.safeBool2(params, 'trigger', 'stop', false);
|
|
1261
|
+
params = this.omit(params, ['trigger', 'stop']);
|
|
1262
|
+
if (!isTrigger && (symbol === undefined)) {
|
|
1263
1263
|
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
1264
1264
|
}
|
|
1265
1265
|
await this.loadMarkets();
|
|
@@ -1272,7 +1272,7 @@ export default class woo extends Exchange {
|
|
|
1272
1272
|
const clientOrderIdExchangeSpecific = this.safeString(params, 'client_order_id', clientOrderIdUnified);
|
|
1273
1273
|
const isByClientOrder = clientOrderIdExchangeSpecific !== undefined;
|
|
1274
1274
|
let response = undefined;
|
|
1275
|
-
if (
|
|
1275
|
+
if (isTrigger) {
|
|
1276
1276
|
request['order_id'] = id;
|
|
1277
1277
|
response = await this.v3PrivateDeleteAlgoOrderOrderId(this.extend(request, params));
|
|
1278
1278
|
}
|
|
@@ -1309,14 +1309,14 @@ export default class woo extends Exchange {
|
|
|
1309
1309
|
* @description cancel all open orders in a market
|
|
1310
1310
|
* @param {string} symbol unified market symbol
|
|
1311
1311
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1312
|
-
* @param {boolean} [params.
|
|
1312
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1313
1313
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1314
1314
|
*/
|
|
1315
1315
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1316
1316
|
await this.loadMarkets();
|
|
1317
|
-
const
|
|
1317
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
1318
1318
|
params = this.omit(params, ['stop', 'trigger']);
|
|
1319
|
-
if (
|
|
1319
|
+
if (trigger) {
|
|
1320
1320
|
return await this.v3PrivateDeleteAlgoOrdersPending(params);
|
|
1321
1321
|
}
|
|
1322
1322
|
if (symbol === undefined) {
|
|
@@ -1374,18 +1374,18 @@ export default class woo extends Exchange {
|
|
|
1374
1374
|
* @param {string} id the order id
|
|
1375
1375
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1376
1376
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1377
|
-
* @param {boolean} [params.
|
|
1377
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1378
1378
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1379
1379
|
*/
|
|
1380
1380
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1381
1381
|
await this.loadMarkets();
|
|
1382
1382
|
const market = (symbol !== undefined) ? this.market(symbol) : undefined;
|
|
1383
|
-
const
|
|
1383
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
1384
1384
|
params = this.omit(params, ['stop', 'trigger']);
|
|
1385
1385
|
const request = {};
|
|
1386
1386
|
const clientOrderId = this.safeString2(params, 'clOrdID', 'clientOrderId');
|
|
1387
1387
|
let response = undefined;
|
|
1388
|
-
if (
|
|
1388
|
+
if (trigger) {
|
|
1389
1389
|
request['oid'] = id;
|
|
1390
1390
|
response = await this.v3PrivateGetAlgoOrderOid(this.extend(request, params));
|
|
1391
1391
|
}
|
|
@@ -1445,7 +1445,7 @@ export default class woo extends Exchange {
|
|
|
1445
1445
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1446
1446
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1447
1447
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1448
|
-
* @param {boolean} [params.
|
|
1448
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1449
1449
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
1450
1450
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
1451
1451
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -1461,7 +1461,7 @@ export default class woo extends Exchange {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
const request = {};
|
|
1463
1463
|
let market = undefined;
|
|
1464
|
-
const
|
|
1464
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
1465
1465
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
1466
1466
|
params = this.omit(params, ['stop', 'trailing', 'trigger']);
|
|
1467
1467
|
if (symbol !== undefined) {
|
|
@@ -1469,7 +1469,7 @@ export default class woo extends Exchange {
|
|
|
1469
1469
|
request['symbol'] = market['id'];
|
|
1470
1470
|
}
|
|
1471
1471
|
if (since !== undefined) {
|
|
1472
|
-
if (
|
|
1472
|
+
if (trigger || trailing) {
|
|
1473
1473
|
request['createdTimeStart'] = since;
|
|
1474
1474
|
}
|
|
1475
1475
|
else {
|
|
@@ -1482,14 +1482,14 @@ export default class woo extends Exchange {
|
|
|
1482
1482
|
else {
|
|
1483
1483
|
request['size'] = 500;
|
|
1484
1484
|
}
|
|
1485
|
-
if (
|
|
1485
|
+
if (trigger) {
|
|
1486
1486
|
request['algoType'] = 'stop';
|
|
1487
1487
|
}
|
|
1488
1488
|
else if (trailing) {
|
|
1489
1489
|
request['algoType'] = 'TRAILING_STOP';
|
|
1490
1490
|
}
|
|
1491
1491
|
let response = undefined;
|
|
1492
|
-
if (
|
|
1492
|
+
if (trigger || trailing) {
|
|
1493
1493
|
response = await this.v3PrivateGetAlgoOrders(this.extend(request, params));
|
|
1494
1494
|
}
|
|
1495
1495
|
else {
|
|
@@ -1540,7 +1540,7 @@ export default class woo extends Exchange {
|
|
|
1540
1540
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1541
1541
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1542
1542
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1543
|
-
* @param {boolean} [params.
|
|
1543
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1544
1544
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
1545
1545
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
1546
1546
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -1562,7 +1562,7 @@ export default class woo extends Exchange {
|
|
|
1562
1562
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1563
1563
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1564
1564
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1565
|
-
* @param {boolean} [params.
|
|
1565
|
+
* @param {boolean} [params.trigger] whether the order is a trigger/algo order
|
|
1566
1566
|
* @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
|
|
1567
1567
|
* @param {string} [params.side] 'buy' or 'sell'
|
|
1568
1568
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -2150,7 +2150,7 @@ export default class woo extends Exchange {
|
|
|
2150
2150
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2151
2151
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2152
2152
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2153
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2153
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2154
2154
|
*/
|
|
2155
2155
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2156
2156
|
const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, params);
|
|
@@ -2584,8 +2584,8 @@ export default class woo extends Exchange {
|
|
|
2584
2584
|
if (!isSandboxMode) {
|
|
2585
2585
|
const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
|
|
2586
2586
|
const brokerId = this.safeString(this.options, 'brokerId', applicationId);
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2587
|
+
const isTrigger = path.indexOf('algo') > -1;
|
|
2588
|
+
if (isTrigger) {
|
|
2589
2589
|
params['brokerId'] = brokerId;
|
|
2590
2590
|
}
|
|
2591
2591
|
else {
|
package/js/src/woofipro.d.ts
CHANGED
|
@@ -363,7 +363,7 @@ export default class woofipro extends Exchange {
|
|
|
363
363
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
364
364
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
365
365
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
366
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
366
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
367
367
|
*/
|
|
368
368
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
369
369
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|