ccxt 4.3.8 → 4.3.10
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/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -3
- package/dist/cjs/src/bingx.js +21 -11
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/coinex.js +689 -426
- package/dist/cjs/src/coinmetro.js +31 -31
- package/dist/cjs/src/kucoinfutures.js +159 -11
- package/dist/cjs/src/okx.js +58 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +1 -1
- package/js/src/abstract/coinmetro.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +2 -0
- package/js/src/base/Exchange.js +3 -3
- package/js/src/base/types.d.ts +2 -0
- package/js/src/bingx.js +21 -11
- package/js/src/bitget.js +1 -1
- package/js/src/coinex.js +689 -426
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +31 -31
- package/js/src/kucoinfutures.d.ts +3 -1
- package/js/src/kucoinfutures.js +159 -11
- package/js/src/okx.d.ts +4 -0
- package/js/src/okx.js +58 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -213,13 +213,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
213
213
|
|
|
214
214
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
215
215
|
|
|
216
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
217
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
|
216
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.10/dist/ccxt.browser.js
|
|
217
|
+
* unpkg: https://unpkg.com/ccxt@4.3.10/dist/ccxt.browser.js
|
|
218
218
|
|
|
219
219
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
220
220
|
|
|
221
221
|
```HTML
|
|
222
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
222
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.10/dist/ccxt.browser.js"></script>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
Creates a global `ccxt` object:
|
package/dist/cjs/ccxt.js
CHANGED
|
@@ -182,7 +182,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
182
182
|
|
|
183
183
|
//-----------------------------------------------------------------------------
|
|
184
184
|
// this is updated by vss.js when building
|
|
185
|
-
const version = '4.3.
|
|
185
|
+
const version = '4.3.10';
|
|
186
186
|
Exchange["default"].ccxtVersion = version;
|
|
187
187
|
const exchanges = {
|
|
188
188
|
'ace': ace,
|
|
@@ -6114,10 +6114,10 @@ class Exchange {
|
|
|
6114
6114
|
const fromId = this.safeString(entry, fromCurrencyKey);
|
|
6115
6115
|
const toId = this.safeString(entry, toCurrencyKey);
|
|
6116
6116
|
if (fromId !== undefined) {
|
|
6117
|
-
fromCurrency = this.
|
|
6117
|
+
fromCurrency = this.safeCurrency(fromId);
|
|
6118
6118
|
}
|
|
6119
6119
|
if (toId !== undefined) {
|
|
6120
|
-
toCurrency = this.
|
|
6120
|
+
toCurrency = this.safeCurrency(toId);
|
|
6121
6121
|
}
|
|
6122
6122
|
const conversion = this.extend(this.parseConversion(entry, fromCurrency, toCurrency), params);
|
|
6123
6123
|
result.push(conversion);
|
|
@@ -6125,7 +6125,7 @@ class Exchange {
|
|
|
6125
6125
|
const sorted = this.sortBy(result, 'timestamp');
|
|
6126
6126
|
let currency = undefined;
|
|
6127
6127
|
if (code !== undefined) {
|
|
6128
|
-
currency = this.
|
|
6128
|
+
currency = this.safeCurrency(code);
|
|
6129
6129
|
code = currency['code'];
|
|
6130
6130
|
}
|
|
6131
6131
|
if (code === undefined) {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -289,7 +289,6 @@ class bingx extends bingx$1 {
|
|
|
289
289
|
'get': {
|
|
290
290
|
'list': 3,
|
|
291
291
|
'assets': 3,
|
|
292
|
-
'apiKey/query': 1,
|
|
293
292
|
},
|
|
294
293
|
'post': {
|
|
295
294
|
'create': 3,
|
|
@@ -306,6 +305,7 @@ class bingx extends bingx$1 {
|
|
|
306
305
|
'private': {
|
|
307
306
|
'get': {
|
|
308
307
|
'uid': 1,
|
|
308
|
+
'apiKey/query': 1,
|
|
309
309
|
},
|
|
310
310
|
'post': {
|
|
311
311
|
'innerTransfer/authorizeSubAccount': 3,
|
|
@@ -1835,6 +1835,12 @@ class bingx extends bingx$1 {
|
|
|
1835
1835
|
};
|
|
1836
1836
|
const isMarketOrder = type === 'MARKET';
|
|
1837
1837
|
const isSpot = marketType === 'spot';
|
|
1838
|
+
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
1839
|
+
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
1840
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
1841
|
+
const isTriggerOrder = triggerPrice !== undefined;
|
|
1842
|
+
const isStopLossPriceOrder = stopLossPrice !== undefined;
|
|
1843
|
+
const isTakeProfitPriceOrder = takeProfitPrice !== undefined;
|
|
1838
1844
|
const exchangeClientOrderId = isSpot ? 'newClientOrderId' : 'clientOrderID';
|
|
1839
1845
|
const clientOrderId = this.safeString2(params, exchangeClientOrderId, 'clientOrderId');
|
|
1840
1846
|
if (clientOrderId !== undefined) {
|
|
@@ -1851,7 +1857,6 @@ class bingx extends bingx$1 {
|
|
|
1851
1857
|
else if (timeInForce === 'GTC') {
|
|
1852
1858
|
request['timeInForce'] = 'GTC';
|
|
1853
1859
|
}
|
|
1854
|
-
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
1855
1860
|
if (isSpot) {
|
|
1856
1861
|
const cost = this.safeNumber2(params, 'cost', 'quoteOrderQty');
|
|
1857
1862
|
params = this.omit(params, 'cost');
|
|
@@ -1883,19 +1888,24 @@ class bingx extends bingx$1 {
|
|
|
1883
1888
|
request['type'] = 'TRIGGER_MARKET';
|
|
1884
1889
|
}
|
|
1885
1890
|
}
|
|
1891
|
+
else if ((stopLossPrice !== undefined) || (takeProfitPrice !== undefined)) {
|
|
1892
|
+
const stopTakePrice = (stopLossPrice !== undefined) ? stopLossPrice : takeProfitPrice;
|
|
1893
|
+
if (type === 'LIMIT') {
|
|
1894
|
+
request['type'] = 'TAKE_STOP_LIMIT';
|
|
1895
|
+
}
|
|
1896
|
+
else if (type === 'MARKET') {
|
|
1897
|
+
request['type'] = 'TAKE_STOP_MARKET';
|
|
1898
|
+
}
|
|
1899
|
+
request['stopPrice'] = this.parseToNumeric(this.priceToPrecision(symbol, stopTakePrice));
|
|
1900
|
+
}
|
|
1886
1901
|
}
|
|
1887
1902
|
else {
|
|
1888
1903
|
if (timeInForce === 'FOK') {
|
|
1889
1904
|
request['timeInForce'] = 'FOK';
|
|
1890
1905
|
}
|
|
1891
|
-
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
1892
|
-
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
1893
1906
|
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
1894
1907
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'priceRate');
|
|
1895
1908
|
const trailingType = this.safeString(params, 'trailingType', 'TRAILING_STOP_MARKET');
|
|
1896
|
-
const isTriggerOrder = triggerPrice !== undefined;
|
|
1897
|
-
const isStopLossPriceOrder = stopLossPrice !== undefined;
|
|
1898
|
-
const isTakeProfitPriceOrder = takeProfitPrice !== undefined;
|
|
1899
1909
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
1900
1910
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
1901
1911
|
const isTrailing = isTrailingAmountOrder || isTrailingPercentOrder;
|
|
@@ -1994,8 +2004,8 @@ class bingx extends bingx$1 {
|
|
|
1994
2004
|
}
|
|
1995
2005
|
request['positionSide'] = positionSide;
|
|
1996
2006
|
request['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, amount));
|
|
1997
|
-
params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId']);
|
|
1998
2007
|
}
|
|
2008
|
+
params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId']);
|
|
1999
2009
|
return this.extend(request, params);
|
|
2000
2010
|
}
|
|
2001
2011
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -2015,9 +2025,9 @@ class bingx extends bingx$1 {
|
|
|
2015
2025
|
* @param {bool} [params.postOnly] true to place a post only order
|
|
2016
2026
|
* @param {string} [params.timeInForce] spot supports 'PO', 'GTC' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
|
|
2017
2027
|
* @param {bool} [params.reduceOnly] *swap only* true or false whether the order is reduce only
|
|
2018
|
-
* @param {float} [params.triggerPrice]
|
|
2019
|
-
* @param {float} [params.stopLossPrice]
|
|
2020
|
-
* @param {float} [params.takeProfitPrice]
|
|
2028
|
+
* @param {float} [params.triggerPrice] triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
2029
|
+
* @param {float} [params.stopLossPrice] stop loss trigger price
|
|
2030
|
+
* @param {float} [params.takeProfitPrice] take profit trigger price
|
|
2021
2031
|
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount
|
|
2022
2032
|
* @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
2023
2033
|
* @param {float} [params.trailingPercent] *swap only* the percent to trail away from the current market price
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -8455,7 +8455,7 @@ class bitget extends bitget$1 {
|
|
|
8455
8455
|
* @name bitget#fetchPositionsHistory
|
|
8456
8456
|
* @description fetches historical positions
|
|
8457
8457
|
* @see https://www.bitget.com/api-doc/contract/position/Get-History-Position
|
|
8458
|
-
* @param {string} [
|
|
8458
|
+
* @param {string[]} [symbols] unified contract symbols
|
|
8459
8459
|
* @param {int} [since] timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months
|
|
8460
8460
|
* @param {int} [limit] the maximum amount of records to fetch, default=20, max=100
|
|
8461
8461
|
* @param {object} params extra parameters specific to the exchange api endpoint
|