ccxt 4.2.85 → 4.2.86
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 +5 -5
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +465 -306
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bingx.js +34 -19
- package/dist/cjs/src/bitbank.js +19 -23
- package/dist/cjs/src/coinex.js +397 -251
- package/dist/cjs/src/idex.js +10 -11
- package/dist/cjs/src/okcoin.js +3 -1
- package/dist/cjs/src/pro/bitget.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinex.d.ts +232 -123
- package/js/src/base/Exchange.d.ts +9 -9
- package/js/src/bingx.js +34 -19
- package/js/src/bitbank.js +19 -23
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +397 -251
- package/js/src/idex.js +10 -11
- package/js/src/okcoin.js +3 -1
- package/js/src/pro/bitget.js +1 -0
- package/package.json +1 -1
- package/skip-tests.json +4 -0
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.2.
|
|
185
|
+
const version = '4.2.86';
|
|
186
186
|
Exchange["default"].ccxtVersion = version;
|
|
187
187
|
const exchanges = {
|
|
188
188
|
'ace': ace,
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -629,7 +629,7 @@ class bingx extends bingx$1 {
|
|
|
629
629
|
symbol += ':' + settle;
|
|
630
630
|
}
|
|
631
631
|
const fees = this.safeDict(this.fees, type, {});
|
|
632
|
-
const contractSize = this.
|
|
632
|
+
const contractSize = (swap) ? this.parseNumber('1') : undefined;
|
|
633
633
|
const isActive = this.safeString(market, 'status') === '1';
|
|
634
634
|
const isInverse = (spot) ? undefined : false;
|
|
635
635
|
const isLinear = (spot) ? undefined : swap;
|
|
@@ -670,7 +670,7 @@ class bingx extends bingx$1 {
|
|
|
670
670
|
'max': this.safeInteger(market, 'maxLongLeverage'),
|
|
671
671
|
},
|
|
672
672
|
'amount': {
|
|
673
|
-
'min': this.
|
|
673
|
+
'min': this.safeNumber2(market, 'minQty', 'tradeMinQuantity'),
|
|
674
674
|
'max': this.safeNumber(market, 'maxQty'),
|
|
675
675
|
},
|
|
676
676
|
'price': {
|
|
@@ -678,7 +678,7 @@ class bingx extends bingx$1 {
|
|
|
678
678
|
'max': undefined,
|
|
679
679
|
},
|
|
680
680
|
'cost': {
|
|
681
|
-
'min': this.
|
|
681
|
+
'min': this.safeNumber2(market, 'minNotional', 'tradeMinUSDT'),
|
|
682
682
|
'max': this.safeNumber(market, 'maxNotional'),
|
|
683
683
|
},
|
|
684
684
|
},
|
|
@@ -1035,6 +1035,13 @@ class bingx extends bingx$1 {
|
|
|
1035
1035
|
if (isMaker !== undefined) {
|
|
1036
1036
|
takeOrMaker = isMaker ? 'maker' : 'taker';
|
|
1037
1037
|
}
|
|
1038
|
+
let amount = this.safeStringN(trade, ['qty', 'amount', 'q']);
|
|
1039
|
+
if ((market !== undefined) && market['swap'] && ('volume' in trade)) {
|
|
1040
|
+
// private trade returns num of contracts instead of base currency (as the order-related methods do)
|
|
1041
|
+
const contractSize = this.safeString(market['info'], 'tradeMinQuantity');
|
|
1042
|
+
const volume = this.safeString(trade, 'volume');
|
|
1043
|
+
amount = Precise["default"].stringMul(volume, contractSize);
|
|
1044
|
+
}
|
|
1038
1045
|
return this.safeTrade({
|
|
1039
1046
|
'id': this.safeStringN(trade, ['id', 't']),
|
|
1040
1047
|
'info': trade,
|
|
@@ -1046,7 +1053,7 @@ class bingx extends bingx$1 {
|
|
|
1046
1053
|
'side': this.parseOrderSide(side),
|
|
1047
1054
|
'takerOrMaker': takeOrMaker,
|
|
1048
1055
|
'price': this.safeString2(trade, 'price', 'p'),
|
|
1049
|
-
'amount':
|
|
1056
|
+
'amount': amount,
|
|
1050
1057
|
'cost': cost,
|
|
1051
1058
|
'fee': {
|
|
1052
1059
|
'cost': this.parseNumber(Precise["default"].stringAbs(this.safeString2(trade, 'commission', 'n'))),
|
|
@@ -1678,19 +1685,27 @@ class bingx extends bingx$1 {
|
|
|
1678
1685
|
}
|
|
1679
1686
|
parsePosition(position, market = undefined) {
|
|
1680
1687
|
//
|
|
1681
|
-
//
|
|
1682
|
-
//
|
|
1683
|
-
//
|
|
1684
|
-
//
|
|
1685
|
-
//
|
|
1686
|
-
//
|
|
1687
|
-
//
|
|
1688
|
-
//
|
|
1689
|
-
//
|
|
1690
|
-
//
|
|
1691
|
-
//
|
|
1692
|
-
//
|
|
1693
|
-
//
|
|
1688
|
+
// {
|
|
1689
|
+
// "positionId":"1773122376147623936",
|
|
1690
|
+
// "symbol":"XRP-USDT",
|
|
1691
|
+
// "currency":"USDT",
|
|
1692
|
+
// "positionAmt":"3",
|
|
1693
|
+
// "availableAmt":"3",
|
|
1694
|
+
// "positionSide":"LONG",
|
|
1695
|
+
// "isolated":false,
|
|
1696
|
+
// "avgPrice":"0.6139",
|
|
1697
|
+
// "initialMargin":"0.0897",
|
|
1698
|
+
// "leverage":20,
|
|
1699
|
+
// "unrealizedProfit":"-0.0023",
|
|
1700
|
+
// "realisedProfit":"-0.0009",
|
|
1701
|
+
// "liquidationPrice":0,
|
|
1702
|
+
// "pnlRatio":"-0.0260",
|
|
1703
|
+
// "maxMarginReduction":"",
|
|
1704
|
+
// "riskRate":"",
|
|
1705
|
+
// "markPrice":"",
|
|
1706
|
+
// "positionValue":"",
|
|
1707
|
+
// "onlyOnePosition":false
|
|
1708
|
+
// }
|
|
1694
1709
|
//
|
|
1695
1710
|
// standard position
|
|
1696
1711
|
//
|
|
@@ -1717,7 +1732,7 @@ class bingx extends bingx$1 {
|
|
|
1717
1732
|
'info': position,
|
|
1718
1733
|
'id': this.safeString(position, 'positionId'),
|
|
1719
1734
|
'symbol': this.safeSymbol(marketId, market, '-', 'swap'),
|
|
1720
|
-
'notional': this.safeNumber(position, '
|
|
1735
|
+
'notional': this.safeNumber(position, 'positionValue'),
|
|
1721
1736
|
'marginMode': marginMode,
|
|
1722
1737
|
'liquidationPrice': undefined,
|
|
1723
1738
|
'entryPrice': this.safeNumber2(position, 'avgPrice', 'entryPrice'),
|
|
@@ -1735,7 +1750,7 @@ class bingx extends bingx$1 {
|
|
|
1735
1750
|
'lastUpdateTimestamp': undefined,
|
|
1736
1751
|
'maintenanceMargin': undefined,
|
|
1737
1752
|
'maintenanceMarginPercentage': undefined,
|
|
1738
|
-
'collateral':
|
|
1753
|
+
'collateral': undefined,
|
|
1739
1754
|
'initialMargin': this.safeNumber(position, 'initialMargin'),
|
|
1740
1755
|
'initialMarginPercentage': undefined,
|
|
1741
1756
|
'leverage': this.safeNumber(position, 'leverage'),
|
package/dist/cjs/src/bitbank.js
CHANGED
|
@@ -138,21 +138,23 @@ class bitbank extends bitbank$1 {
|
|
|
138
138
|
},
|
|
139
139
|
'precisionMode': number.TICK_SIZE,
|
|
140
140
|
'exceptions': {
|
|
141
|
-
'
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
'exact': {
|
|
142
|
+
'20001': errors.AuthenticationError,
|
|
143
|
+
'20002': errors.AuthenticationError,
|
|
144
|
+
'20003': errors.AuthenticationError,
|
|
145
|
+
'20005': errors.AuthenticationError,
|
|
146
|
+
'20004': errors.InvalidNonce,
|
|
147
|
+
'40020': errors.InvalidOrder,
|
|
148
|
+
'40021': errors.InvalidOrder,
|
|
149
|
+
'40025': errors.ExchangeError,
|
|
150
|
+
'40013': errors.OrderNotFound,
|
|
151
|
+
'40014': errors.OrderNotFound,
|
|
152
|
+
'50008': errors.PermissionDenied,
|
|
153
|
+
'50009': errors.OrderNotFound,
|
|
154
|
+
'50010': errors.OrderNotFound,
|
|
155
|
+
'60001': errors.InsufficientFunds,
|
|
156
|
+
'60005': errors.InvalidOrder,
|
|
157
|
+
},
|
|
156
158
|
},
|
|
157
159
|
});
|
|
158
160
|
}
|
|
@@ -983,16 +985,10 @@ class bitbank extends bitbank$1 {
|
|
|
983
985
|
'70009': 'We are currently temporarily restricting orders to be carried out. Please use the limit order.',
|
|
984
986
|
'70010': 'We are temporarily raising the minimum order quantity as the system load is now rising.',
|
|
985
987
|
};
|
|
986
|
-
const errorClasses = this.exceptions;
|
|
987
988
|
const code = this.safeString(data, 'code');
|
|
988
989
|
const message = this.safeString(errorMessages, code, 'Error');
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
throw new errorClasses[code](message);
|
|
992
|
-
}
|
|
993
|
-
else {
|
|
994
|
-
throw new errors.ExchangeError(this.id + ' ' + this.json(response));
|
|
995
|
-
}
|
|
990
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], code, message);
|
|
991
|
+
throw new errors.ExchangeError(this.id + ' ' + this.json(response));
|
|
996
992
|
}
|
|
997
993
|
return undefined;
|
|
998
994
|
}
|