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/bitteam.js
CHANGED
|
@@ -1193,7 +1193,6 @@ class bitteam extends bitteam$1 {
|
|
|
1193
1193
|
const side = this.safeString(order, 'side');
|
|
1194
1194
|
const feeRaw = this.safeValue(order, 'fee');
|
|
1195
1195
|
const price = this.safeString(order, 'price');
|
|
1196
|
-
const stopPrice = this.safeString(order, 'stopPrice');
|
|
1197
1196
|
const amount = this.safeString(order, 'quantity');
|
|
1198
1197
|
const filled = this.safeString(order, 'executed');
|
|
1199
1198
|
let fee = undefined;
|
|
@@ -1219,8 +1218,7 @@ class bitteam extends bitteam$1 {
|
|
|
1219
1218
|
'timeInForce': 'GTC',
|
|
1220
1219
|
'side': side,
|
|
1221
1220
|
'price': price,
|
|
1222
|
-
'
|
|
1223
|
-
'triggerPrice': stopPrice,
|
|
1221
|
+
'triggerPrice': this.safeString(order, 'stopPrice'),
|
|
1224
1222
|
'average': undefined,
|
|
1225
1223
|
'amount': amount,
|
|
1226
1224
|
'cost': undefined,
|
package/dist/cjs/src/bitvavo.js
CHANGED
|
@@ -1128,7 +1128,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
1128
1128
|
* @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1129
1129
|
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1130
1130
|
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
1131
|
-
* @param {float} [params.stopPrice]
|
|
1131
|
+
* @param {float} [params.stopPrice] Alias for triggerPrice
|
|
1132
1132
|
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1133
1133
|
* @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
|
|
1134
1134
|
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
@@ -1599,7 +1599,6 @@ class bitvavo extends bitvavo$1 {
|
|
|
1599
1599
|
const timeInForce = this.safeString(order, 'timeInForce');
|
|
1600
1600
|
const postOnly = this.safeValue(order, 'postOnly');
|
|
1601
1601
|
// https://github.com/ccxt/ccxt/issues/8489
|
|
1602
|
-
const stopPrice = this.safeNumber(order, 'triggerPrice');
|
|
1603
1602
|
return this.safeOrder({
|
|
1604
1603
|
'info': order,
|
|
1605
1604
|
'id': id,
|
|
@@ -1613,8 +1612,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
1613
1612
|
'postOnly': postOnly,
|
|
1614
1613
|
'side': side,
|
|
1615
1614
|
'price': price,
|
|
1616
|
-
'
|
|
1617
|
-
'triggerPrice': stopPrice,
|
|
1615
|
+
'triggerPrice': this.safeNumber(order, 'triggerPrice'),
|
|
1618
1616
|
'amount': amount,
|
|
1619
1617
|
'cost': cost,
|
|
1620
1618
|
'average': undefined,
|
|
@@ -568,14 +568,14 @@ class blockchaincom extends blockchaincom$1 {
|
|
|
568
568
|
'orderQty': this.amountToPrecision(symbol, amount),
|
|
569
569
|
'clOrdId': clientOrderId,
|
|
570
570
|
};
|
|
571
|
-
const
|
|
571
|
+
const triggerPrice = this.safeValue2(params, 'stopPx', 'stopPrice');
|
|
572
572
|
params = this.omit(params, ['stopPx', 'stopPrice']);
|
|
573
573
|
if (uppercaseOrderType === 'STOP' || uppercaseOrderType === 'STOPLIMIT') {
|
|
574
|
-
if (
|
|
575
|
-
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stopPx or
|
|
574
|
+
if (triggerPrice === undefined) {
|
|
575
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stopPx or triggerPrice param for a ' + uppercaseOrderType + ' order');
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
if (
|
|
578
|
+
if (triggerPrice !== undefined) {
|
|
579
579
|
if (uppercaseOrderType === 'MARKET') {
|
|
580
580
|
request['ordType'] = 'STOP';
|
|
581
581
|
}
|
|
@@ -595,7 +595,7 @@ class blockchaincom extends blockchaincom$1 {
|
|
|
595
595
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
596
596
|
}
|
|
597
597
|
if (stopPriceRequired) {
|
|
598
|
-
request['stopPx'] = this.priceToPrecision(symbol,
|
|
598
|
+
request['stopPx'] = this.priceToPrecision(symbol, triggerPrice);
|
|
599
599
|
}
|
|
600
600
|
const response = await this.privatePostOrders(this.extend(request, params));
|
|
601
601
|
return this.parseOrder(response, market);
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -1372,7 +1372,7 @@ class blofin extends blofin$1 {
|
|
|
1372
1372
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1373
1373
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1374
1374
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1375
|
-
* @param {bool} [params.
|
|
1375
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
1376
1376
|
* @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)
|
|
1377
1377
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1378
1378
|
*/
|
|
@@ -1392,12 +1392,12 @@ class blofin extends blofin$1 {
|
|
|
1392
1392
|
if (limit !== undefined) {
|
|
1393
1393
|
request['limit'] = limit; // default 100, max 100
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1395
|
+
const isTrigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
|
|
1396
1396
|
let method = undefined;
|
|
1397
1397
|
[method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersPending');
|
|
1398
1398
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
|
|
1399
1399
|
let response = undefined;
|
|
1400
|
-
if (
|
|
1400
|
+
if (isTrigger || (method === 'privateGetTradeOrdersTpslPending')) {
|
|
1401
1401
|
response = await this.privateGetTradeOrdersTpslPending(this.extend(request, query));
|
|
1402
1402
|
}
|
|
1403
1403
|
else {
|
|
@@ -1526,7 +1526,7 @@ class blofin extends blofin$1 {
|
|
|
1526
1526
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
1527
1527
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
1528
1528
|
* @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)
|
|
1529
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1529
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1530
1530
|
*/
|
|
1531
1531
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1532
1532
|
await this.loadMarkets();
|
|
@@ -1723,8 +1723,8 @@ class blofin extends blofin$1 {
|
|
|
1723
1723
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
1724
1724
|
const clientOrderIds = this.parseIds(this.safeValue(params, 'clientOrderId'));
|
|
1725
1725
|
const tpslIds = this.parseIds(this.safeValue(params, 'tpslId'));
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1726
|
+
const trigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl']);
|
|
1727
|
+
if (trigger) {
|
|
1728
1728
|
method = 'privatePostTradeCancelTpsl';
|
|
1729
1729
|
}
|
|
1730
1730
|
if (clientOrderIds === undefined) {
|
|
@@ -1738,7 +1738,7 @@ class blofin extends blofin$1 {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
for (let i = 0; i < ids.length; i++) {
|
|
1741
|
-
if (
|
|
1741
|
+
if (trigger) {
|
|
1742
1742
|
request.push({
|
|
1743
1743
|
'tpslId': ids[i],
|
|
1744
1744
|
'instId': market['id'],
|
|
@@ -2156,7 +2156,7 @@ class blofin extends blofin$1 {
|
|
|
2156
2156
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2157
2157
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
2158
2158
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2159
|
-
* @param {bool} [params.
|
|
2159
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
2160
2160
|
* @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)
|
|
2161
2161
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2162
2162
|
*/
|
|
@@ -2179,12 +2179,12 @@ class blofin extends blofin$1 {
|
|
|
2179
2179
|
if (since !== undefined) {
|
|
2180
2180
|
request['begin'] = since;
|
|
2181
2181
|
}
|
|
2182
|
-
const
|
|
2182
|
+
const isTrigger = this.safeBoolN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
|
|
2183
2183
|
let method = undefined;
|
|
2184
2184
|
[method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersHistory');
|
|
2185
2185
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
|
|
2186
2186
|
let response = undefined;
|
|
2187
|
-
if ((
|
|
2187
|
+
if ((isTrigger) || (method === 'privateGetTradeOrdersTpslHistory')) {
|
|
2188
2188
|
response = await this.privateGetTradeOrdersTpslHistory(this.extend(request, query));
|
|
2189
2189
|
}
|
|
2190
2190
|
else {
|
package/dist/cjs/src/btcalpha.js
CHANGED
package/dist/cjs/src/btcbox.js
CHANGED
|
@@ -1038,7 +1038,6 @@ class btcmarkets extends btcmarkets$1 {
|
|
|
1038
1038
|
const id = this.safeString(order, 'orderId');
|
|
1039
1039
|
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
1040
1040
|
const timeInForce = this.safeString(order, 'timeInForce');
|
|
1041
|
-
const stopPrice = this.safeNumber(order, 'triggerPrice');
|
|
1042
1041
|
const postOnly = this.safeBool(order, 'postOnly');
|
|
1043
1042
|
return this.safeOrder({
|
|
1044
1043
|
'info': order,
|
|
@@ -1053,8 +1052,7 @@ class btcmarkets extends btcmarkets$1 {
|
|
|
1053
1052
|
'postOnly': postOnly,
|
|
1054
1053
|
'side': side,
|
|
1055
1054
|
'price': price,
|
|
1056
|
-
'
|
|
1057
|
-
'triggerPrice': stopPrice,
|
|
1055
|
+
'triggerPrice': this.safeNumber(order, 'triggerPrice'),
|
|
1058
1056
|
'cost': undefined,
|
|
1059
1057
|
'amount': amount,
|
|
1060
1058
|
'filled': undefined,
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -3682,33 +3682,33 @@ class bybit extends bybit$1 {
|
|
|
3682
3682
|
const avgPrice = this.omitZero(this.safeString(order, 'avgPrice'));
|
|
3683
3683
|
const rawTimeInForce = this.safeString(order, 'timeInForce');
|
|
3684
3684
|
const timeInForce = this.parseTimeInForce(rawTimeInForce);
|
|
3685
|
-
const
|
|
3685
|
+
const triggerPrice = this.omitZero(this.safeString(order, 'triggerPrice'));
|
|
3686
3686
|
const reduceOnly = this.safeBool(order, 'reduceOnly');
|
|
3687
3687
|
let takeProfitPrice = this.omitZero(this.safeString(order, 'takeProfit'));
|
|
3688
3688
|
let stopLossPrice = this.omitZero(this.safeString(order, 'stopLoss'));
|
|
3689
3689
|
const triggerDirection = this.safeString(order, 'triggerDirection');
|
|
3690
3690
|
const isAscending = (triggerDirection === '1');
|
|
3691
|
-
const isStopOrderType2 = (
|
|
3691
|
+
const isStopOrderType2 = (triggerPrice !== undefined) && reduceOnly;
|
|
3692
3692
|
if ((stopLossPrice === undefined) && isStopOrderType2) {
|
|
3693
3693
|
// check if order is stop order type 2 - stopLossPrice
|
|
3694
3694
|
if (isAscending && (side === 'buy')) {
|
|
3695
3695
|
// stopLoss order against short position
|
|
3696
|
-
stopLossPrice =
|
|
3696
|
+
stopLossPrice = triggerPrice;
|
|
3697
3697
|
}
|
|
3698
3698
|
if (!isAscending && (side === 'sell')) {
|
|
3699
3699
|
// stopLoss order against a long position
|
|
3700
|
-
stopLossPrice =
|
|
3700
|
+
stopLossPrice = triggerPrice;
|
|
3701
3701
|
}
|
|
3702
3702
|
}
|
|
3703
3703
|
if ((takeProfitPrice === undefined) && isStopOrderType2) {
|
|
3704
3704
|
// check if order is stop order type 2 - takeProfitPrice
|
|
3705
3705
|
if (isAscending && (side === 'sell')) {
|
|
3706
3706
|
// takeprofit order against a long position
|
|
3707
|
-
takeProfitPrice =
|
|
3707
|
+
takeProfitPrice = triggerPrice;
|
|
3708
3708
|
}
|
|
3709
3709
|
if (!isAscending && (side === 'buy')) {
|
|
3710
3710
|
// takeprofit order against a short position
|
|
3711
|
-
takeProfitPrice =
|
|
3711
|
+
takeProfitPrice = triggerPrice;
|
|
3712
3712
|
}
|
|
3713
3713
|
}
|
|
3714
3714
|
return this.safeOrder({
|
|
@@ -3726,8 +3726,7 @@ class bybit extends bybit$1 {
|
|
|
3726
3726
|
'reduceOnly': this.safeBool(order, 'reduceOnly'),
|
|
3727
3727
|
'side': side,
|
|
3728
3728
|
'price': price,
|
|
3729
|
-
'
|
|
3730
|
-
'triggerPrice': stopPrice,
|
|
3729
|
+
'triggerPrice': triggerPrice,
|
|
3731
3730
|
'takeProfitPrice': takeProfitPrice,
|
|
3732
3731
|
'stopLossPrice': stopLossPrice,
|
|
3733
3732
|
'amount': amount,
|
|
@@ -5735,7 +5734,7 @@ class bybit extends bybit$1 {
|
|
|
5735
5734
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5736
5735
|
* @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)
|
|
5737
5736
|
* @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
|
|
5738
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
5737
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
5739
5738
|
*/
|
|
5740
5739
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5741
5740
|
await this.loadMarkets();
|
|
@@ -6755,7 +6754,7 @@ class bybit extends bybit$1 {
|
|
|
6755
6754
|
const data = this.addPaginationCursorToResult(response);
|
|
6756
6755
|
const id = this.safeString(result, 'symbol');
|
|
6757
6756
|
market = this.safeMarket(id, market, undefined, 'contract');
|
|
6758
|
-
return this.
|
|
6757
|
+
return this.parseOpenInterestsHistory(data, market, since, limit);
|
|
6759
6758
|
}
|
|
6760
6759
|
/**
|
|
6761
6760
|
* @method
|
|
@@ -8125,7 +8124,7 @@ class bybit extends bybit$1 {
|
|
|
8125
8124
|
}
|
|
8126
8125
|
symbol = market['symbol'];
|
|
8127
8126
|
}
|
|
8128
|
-
const data = await this.getLeverageTiersPaginated(symbol, this.extend({ 'paginate': true, 'paginationCalls':
|
|
8127
|
+
const data = await this.getLeverageTiersPaginated(symbol, this.extend({ 'paginate': true, 'paginationCalls': 40 }, params));
|
|
8129
8128
|
symbols = this.marketSymbols(symbols);
|
|
8130
8129
|
return this.parseLeverageTiers(data, symbols, 'symbol');
|
|
8131
8130
|
}
|
package/dist/cjs/src/cex.js
CHANGED
|
@@ -1261,7 +1261,7 @@ class cex extends cex$1 {
|
|
|
1261
1261
|
* @param {int} [limit] max number of ledger entries to return
|
|
1262
1262
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1263
1263
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
1264
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1264
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1265
1265
|
*/
|
|
1266
1266
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1267
1267
|
await this.loadMarkets();
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -374,6 +374,82 @@ class coinbase extends coinbase$1 {
|
|
|
374
374
|
'fetchTime': 'v2PublicGetTime',
|
|
375
375
|
'user_native_currency': 'USD', // needed to get fees for v3
|
|
376
376
|
},
|
|
377
|
+
'features': {
|
|
378
|
+
'spot': {
|
|
379
|
+
'sandbox': false,
|
|
380
|
+
'createOrder': {
|
|
381
|
+
'marginMode': true,
|
|
382
|
+
'triggerPrice': true,
|
|
383
|
+
'triggerPriceType': undefined,
|
|
384
|
+
'triggerDirection': true,
|
|
385
|
+
'stopLossPrice': true,
|
|
386
|
+
'takeProfitPrice': true,
|
|
387
|
+
'attachedStopLossTakeProfit': undefined,
|
|
388
|
+
'timeInForce': {
|
|
389
|
+
'IOC': true,
|
|
390
|
+
'FOK': true,
|
|
391
|
+
'PO': true,
|
|
392
|
+
'GTD': true,
|
|
393
|
+
},
|
|
394
|
+
'hedged': false,
|
|
395
|
+
'trailing': false,
|
|
396
|
+
},
|
|
397
|
+
'createOrders': undefined,
|
|
398
|
+
'fetchMyTrades': {
|
|
399
|
+
'marginMode': false,
|
|
400
|
+
'limit': 3000,
|
|
401
|
+
'daysBack': undefined,
|
|
402
|
+
'untilDays': 10000,
|
|
403
|
+
},
|
|
404
|
+
'fetchOrder': {
|
|
405
|
+
'marginMode': false,
|
|
406
|
+
'trigger': false,
|
|
407
|
+
'trailing': false,
|
|
408
|
+
},
|
|
409
|
+
'fetchOpenOrders': {
|
|
410
|
+
'marginMode': false,
|
|
411
|
+
'limit': undefined,
|
|
412
|
+
'trigger': false,
|
|
413
|
+
'trailing': false,
|
|
414
|
+
},
|
|
415
|
+
'fetchOrders': {
|
|
416
|
+
'marginMode': false,
|
|
417
|
+
'limit': undefined,
|
|
418
|
+
'daysBack': undefined,
|
|
419
|
+
'untilDays': 10000,
|
|
420
|
+
'trigger': false,
|
|
421
|
+
'trailing': false,
|
|
422
|
+
},
|
|
423
|
+
'fetchClosedOrders': {
|
|
424
|
+
'marginMode': false,
|
|
425
|
+
'limit': undefined,
|
|
426
|
+
'daysBackClosed': undefined,
|
|
427
|
+
'daysBackCanceled': undefined,
|
|
428
|
+
'untilDays': 10000,
|
|
429
|
+
'trigger': false,
|
|
430
|
+
'trailing': false,
|
|
431
|
+
},
|
|
432
|
+
'fetchOHLCV': {
|
|
433
|
+
'limit': 350,
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
'swap': {
|
|
437
|
+
'linear': {
|
|
438
|
+
'extends': 'spot',
|
|
439
|
+
},
|
|
440
|
+
'inverse': {
|
|
441
|
+
'extends': 'spot',
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
'future': {
|
|
445
|
+
'linear': {
|
|
446
|
+
'extends': 'spot',
|
|
447
|
+
},
|
|
448
|
+
'inverse': {
|
|
449
|
+
'extends': 'spot',
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
},
|
|
377
453
|
});
|
|
378
454
|
}
|
|
379
455
|
/**
|
|
@@ -2350,7 +2426,7 @@ class coinbase extends coinbase$1 {
|
|
|
2350
2426
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2351
2427
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2352
2428
|
* @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)
|
|
2353
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2429
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2354
2430
|
*/
|
|
2355
2431
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2356
2432
|
await this.loadMarkets();
|
|
@@ -1501,7 +1501,7 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
1501
1501
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1502
1502
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1503
1503
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
1504
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1504
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1505
1505
|
*/
|
|
1506
1506
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1507
1507
|
// https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
|
@@ -255,6 +255,68 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
255
255
|
'bitcoin': 'BTC',
|
|
256
256
|
},
|
|
257
257
|
},
|
|
258
|
+
'features': {
|
|
259
|
+
'spot': {
|
|
260
|
+
'sandbox': true,
|
|
261
|
+
'createOrder': {
|
|
262
|
+
'marginMode': false,
|
|
263
|
+
'triggerPrice': true,
|
|
264
|
+
'triggerPriceType': undefined,
|
|
265
|
+
'triggerDirection': true,
|
|
266
|
+
'stopLossPrice': false,
|
|
267
|
+
'takeProfitPrice': false,
|
|
268
|
+
'attachedStopLossTakeProfit': undefined,
|
|
269
|
+
'timeInForce': {
|
|
270
|
+
'IOC': true,
|
|
271
|
+
'FOK': true,
|
|
272
|
+
'PO': true,
|
|
273
|
+
'GTD': true,
|
|
274
|
+
'GTC': true, // has 30 days max
|
|
275
|
+
},
|
|
276
|
+
'hedged': false,
|
|
277
|
+
'trailing': false,
|
|
278
|
+
},
|
|
279
|
+
'createOrders': undefined,
|
|
280
|
+
'fetchMyTrades': {
|
|
281
|
+
'marginMode': false,
|
|
282
|
+
'limit': 100,
|
|
283
|
+
'daysBack': undefined,
|
|
284
|
+
'untilDays': 10000,
|
|
285
|
+
},
|
|
286
|
+
'fetchOrder': {
|
|
287
|
+
'marginMode': false,
|
|
288
|
+
'trigger': false,
|
|
289
|
+
'trailing': false,
|
|
290
|
+
},
|
|
291
|
+
'fetchOpenOrders': {
|
|
292
|
+
'marginMode': false,
|
|
293
|
+
'limit': 100,
|
|
294
|
+
'trigger': false,
|
|
295
|
+
'trailing': false,
|
|
296
|
+
},
|
|
297
|
+
'fetchOrders': undefined,
|
|
298
|
+
'fetchClosedOrders': undefined,
|
|
299
|
+
'fetchOHLCV': {
|
|
300
|
+
'limit': 300,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
'swap': {
|
|
304
|
+
'linear': {
|
|
305
|
+
'extends': 'spot',
|
|
306
|
+
},
|
|
307
|
+
'inverse': {
|
|
308
|
+
'extends': 'spot',
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
'future': {
|
|
312
|
+
'linear': {
|
|
313
|
+
'extends': 'spot',
|
|
314
|
+
},
|
|
315
|
+
'inverse': {
|
|
316
|
+
'extends': 'spot',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
258
320
|
});
|
|
259
321
|
}
|
|
260
322
|
async handlePortfolioAndParams(methodName, params = {}) {
|
|
@@ -5076,7 +5076,7 @@ class coincatch extends coincatch$1 {
|
|
|
5076
5076
|
* @param {string} [params.business] *swap only*
|
|
5077
5077
|
* @param {string} [params.lastEndId] *swap only*
|
|
5078
5078
|
* @param {bool} [params.next] *swap only*
|
|
5079
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
5079
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
5080
5080
|
*/
|
|
5081
5081
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5082
5082
|
const methodName = 'fetchLedger';
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -2629,21 +2629,21 @@ class coinex extends coinex$1 {
|
|
|
2629
2629
|
const request = {
|
|
2630
2630
|
'market': market['id'],
|
|
2631
2631
|
};
|
|
2632
|
-
const
|
|
2632
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
2633
2633
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2634
2634
|
let response = undefined;
|
|
2635
2635
|
const requestIds = [];
|
|
2636
2636
|
for (let i = 0; i < ids.length; i++) {
|
|
2637
2637
|
requestIds.push(parseInt(ids[i]));
|
|
2638
2638
|
}
|
|
2639
|
-
if (
|
|
2639
|
+
if (trigger) {
|
|
2640
2640
|
request['stop_ids'] = requestIds;
|
|
2641
2641
|
}
|
|
2642
2642
|
else {
|
|
2643
2643
|
request['order_ids'] = requestIds;
|
|
2644
2644
|
}
|
|
2645
2645
|
if (market['spot']) {
|
|
2646
|
-
if (
|
|
2646
|
+
if (trigger) {
|
|
2647
2647
|
response = await this.v2PrivatePostSpotCancelBatchStopOrder(this.extend(request, params));
|
|
2648
2648
|
//
|
|
2649
2649
|
// {
|
|
@@ -2715,7 +2715,7 @@ class coinex extends coinex$1 {
|
|
|
2715
2715
|
}
|
|
2716
2716
|
else {
|
|
2717
2717
|
request['market_type'] = 'FUTURES';
|
|
2718
|
-
if (
|
|
2718
|
+
if (trigger) {
|
|
2719
2719
|
response = await this.v2PrivatePostFuturesCancelBatchStopOrder(this.extend(request, params));
|
|
2720
2720
|
//
|
|
2721
2721
|
// {
|
|
@@ -3411,7 +3411,7 @@ class coinex extends coinex$1 {
|
|
|
3411
3411
|
if (limit !== undefined) {
|
|
3412
3412
|
request['limit'] = limit;
|
|
3413
3413
|
}
|
|
3414
|
-
const
|
|
3414
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3415
3415
|
params = this.omit(params, ['stop', 'trigger']);
|
|
3416
3416
|
let marketType = undefined;
|
|
3417
3417
|
[marketType, params] = this.handleMarketTypeAndParams('fetchOrdersByStatus', market, params);
|
|
@@ -3421,7 +3421,7 @@ class coinex extends coinex$1 {
|
|
|
3421
3421
|
if (marketType === 'swap') {
|
|
3422
3422
|
request['market_type'] = 'FUTURES';
|
|
3423
3423
|
if (isClosed) {
|
|
3424
|
-
if (
|
|
3424
|
+
if (trigger) {
|
|
3425
3425
|
response = await this.v2PrivateGetFuturesFinishedStopOrder(this.extend(request, params));
|
|
3426
3426
|
//
|
|
3427
3427
|
// {
|
|
@@ -3485,7 +3485,7 @@ class coinex extends coinex$1 {
|
|
|
3485
3485
|
}
|
|
3486
3486
|
}
|
|
3487
3487
|
else if (isOpen) {
|
|
3488
|
-
if (
|
|
3488
|
+
if (trigger) {
|
|
3489
3489
|
response = await this.v2PrivateGetFuturesPendingStopOrder(this.extend(request, params));
|
|
3490
3490
|
//
|
|
3491
3491
|
// {
|
|
@@ -3564,7 +3564,7 @@ class coinex extends coinex$1 {
|
|
|
3564
3564
|
request['market_type'] = 'SPOT';
|
|
3565
3565
|
}
|
|
3566
3566
|
if (isClosed) {
|
|
3567
|
-
if (
|
|
3567
|
+
if (trigger) {
|
|
3568
3568
|
response = await this.v2PrivateGetSpotFinishedStopOrder(this.extend(request, params));
|
|
3569
3569
|
//
|
|
3570
3570
|
// {
|
|
@@ -3631,7 +3631,7 @@ class coinex extends coinex$1 {
|
|
|
3631
3631
|
}
|
|
3632
3632
|
}
|
|
3633
3633
|
else if (status === 'pending') {
|
|
3634
|
-
if (
|
|
3634
|
+
if (trigger) {
|
|
3635
3635
|
response = await this.v2PrivateGetSpotPendingStopOrder(this.extend(request, params));
|
|
3636
3636
|
//
|
|
3637
3637
|
// {
|
package/dist/cjs/src/coinlist.js
CHANGED
|
@@ -2091,7 +2091,7 @@ class coinlist extends coinlist$1 {
|
|
|
2091
2091
|
* @param {int} [limit] max number of ledger entries to return (default 200, max 500)
|
|
2092
2092
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2093
2093
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
2094
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2094
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2095
2095
|
*/
|
|
2096
2096
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2097
2097
|
const traderId = this.safeString2(params, 'trader_id', 'traderId');
|
|
@@ -990,7 +990,7 @@ class coinmetro extends coinmetro$1 {
|
|
|
990
990
|
* @param {int} [limit] max number of ledger entries to return (default 200, max 500)
|
|
991
991
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
992
992
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
993
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
993
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
994
994
|
*/
|
|
995
995
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
996
996
|
await this.loadMarkets();
|