ccxt 4.1.97 → 4.1.98
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/build.sh +1 -1
- package/dist/ccxt.browser.js +87 -55
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +29 -32
- package/dist/cjs/src/bingx.js +34 -2
- package/dist/cjs/src/bitget.js +13 -13
- package/dist/cjs/src/phemex.js +3 -3
- package/dist/cjs/src/pro/bingx.js +6 -3
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/binance.js +29 -32
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +34 -2
- package/js/src/bitget.js +13 -13
- package/js/src/phemex.js +3 -3
- package/js/src/pro/bingx.js +6 -3
- package/js/src/pro/bitmart.js +1 -1
- package/package.json +13 -13
- package/skip-tests.json +119 -71
- package/run-tests-ws.js +0 -290
package/js/src/bitget.js
CHANGED
|
@@ -1281,12 +1281,12 @@ export default class bitget extends Exchange {
|
|
|
1281
1281
|
'30m': '30min',
|
|
1282
1282
|
'1h': '1h',
|
|
1283
1283
|
'4h': '4h',
|
|
1284
|
-
'6h': '
|
|
1285
|
-
'12h': '
|
|
1286
|
-
'1d': '
|
|
1287
|
-
'3d': '
|
|
1288
|
-
'1w': '
|
|
1289
|
-
'1M': '
|
|
1284
|
+
'6h': '6Hutc',
|
|
1285
|
+
'12h': '12Hutc',
|
|
1286
|
+
'1d': '1Dutc',
|
|
1287
|
+
'3d': '3Dutc',
|
|
1288
|
+
'1w': '1Wutc',
|
|
1289
|
+
'1M': '1Mutc',
|
|
1290
1290
|
},
|
|
1291
1291
|
'swap': {
|
|
1292
1292
|
'1m': '1m',
|
|
@@ -1297,12 +1297,12 @@ export default class bitget extends Exchange {
|
|
|
1297
1297
|
'1h': '1H',
|
|
1298
1298
|
'2h': '2H',
|
|
1299
1299
|
'4h': '4H',
|
|
1300
|
-
'6h': '
|
|
1301
|
-
'12h': '
|
|
1302
|
-
'1d': '
|
|
1303
|
-
'3d': '
|
|
1304
|
-
'1w': '
|
|
1305
|
-
'1M': '
|
|
1300
|
+
'6h': '6Hutc',
|
|
1301
|
+
'12h': '12Hutc',
|
|
1302
|
+
'1d': '1Dutc',
|
|
1303
|
+
'3d': '3Dutc',
|
|
1304
|
+
'1w': '1Wutc',
|
|
1305
|
+
'1M': '1Mutc',
|
|
1306
1306
|
},
|
|
1307
1307
|
},
|
|
1308
1308
|
'fetchMarkets': [
|
|
@@ -2904,7 +2904,7 @@ export default class bitget extends Exchange {
|
|
|
2904
2904
|
const currencyCode = this.safeCurrencyCode(this.safeString(feeStructure, 'feeCoin'));
|
|
2905
2905
|
fee = {
|
|
2906
2906
|
'currency': currencyCode,
|
|
2907
|
-
'cost': Precise.
|
|
2907
|
+
'cost': Precise.stringAbs(this.safeString(feeStructure, 'totalFee')),
|
|
2908
2908
|
};
|
|
2909
2909
|
}
|
|
2910
2910
|
return this.safeTrade({
|
package/js/src/phemex.js
CHANGED
|
@@ -4291,7 +4291,7 @@ export default class phemex extends Exchange {
|
|
|
4291
4291
|
* @name phemex#setLeverage
|
|
4292
4292
|
* @description set the level of leverage for a market
|
|
4293
4293
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#set-leverage
|
|
4294
|
-
* @param {float} leverage the rate of leverage
|
|
4294
|
+
* @param {float} leverage the rate of leverage, 100 > leverage > -100 excluding numbers between -1 to 1
|
|
4295
4295
|
* @param {string} symbol unified market symbol
|
|
4296
4296
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4297
4297
|
* @param {bool} [params.hedged] set to true if hedged position mode is enabled (by default long and short leverage are set to the same value)
|
|
@@ -4304,8 +4304,8 @@ export default class phemex extends Exchange {
|
|
|
4304
4304
|
if (symbol === undefined) {
|
|
4305
4305
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
4306
4306
|
}
|
|
4307
|
-
if ((leverage <
|
|
4308
|
-
throw new BadRequest(this.id + ' setLeverage() leverage should be between
|
|
4307
|
+
if ((leverage < -100) || (leverage > 100)) {
|
|
4308
|
+
throw new BadRequest(this.id + ' setLeverage() leverage should be between -100 and 100');
|
|
4309
4309
|
}
|
|
4310
4310
|
await this.loadMarkets();
|
|
4311
4311
|
const isHedged = this.safeValue(params, 'hedged', false);
|
package/js/src/pro/bingx.js
CHANGED
|
@@ -172,7 +172,8 @@ export default class bingx extends bingxRest {
|
|
|
172
172
|
const data = this.safeValue(message, 'data', []);
|
|
173
173
|
const messageHash = this.safeString(message, 'dataType');
|
|
174
174
|
const marketId = messageHash.split('@')[0];
|
|
175
|
-
const
|
|
175
|
+
const isSwap = client.url.indexOf('swap') >= 0;
|
|
176
|
+
const marketType = isSwap ? 'swap' : 'spot';
|
|
176
177
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
177
178
|
const symbol = market['symbol'];
|
|
178
179
|
let trades = undefined;
|
|
@@ -287,7 +288,8 @@ export default class bingx extends bingxRest {
|
|
|
287
288
|
const data = this.safeValue(message, 'data', []);
|
|
288
289
|
const messageHash = this.safeString(message, 'dataType');
|
|
289
290
|
const marketId = messageHash.split('@')[0];
|
|
290
|
-
const
|
|
291
|
+
const isSwap = client.url.indexOf('swap') >= 0;
|
|
292
|
+
const marketType = isSwap ? 'swap' : 'spot';
|
|
291
293
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
292
294
|
const symbol = market['symbol'];
|
|
293
295
|
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
@@ -379,7 +381,8 @@ export default class bingx extends bingxRest {
|
|
|
379
381
|
const messageHash = this.safeString(message, 'dataType');
|
|
380
382
|
const timeframeId = messageHash.split('_')[1];
|
|
381
383
|
const marketId = messageHash.split('@')[0];
|
|
382
|
-
const
|
|
384
|
+
const isSwap = client.url.indexOf('swap') >= 0;
|
|
385
|
+
const marketType = isSwap ? 'swap' : 'spot';
|
|
383
386
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
384
387
|
const symbol = market['symbol'];
|
|
385
388
|
this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
|
package/js/src/pro/bitmart.js
CHANGED
|
@@ -438,7 +438,7 @@ export default class bitmart extends bitmartRest {
|
|
|
438
438
|
const symbolKeys = Object.keys(symbols);
|
|
439
439
|
for (let i = 0; i < symbolKeys.length; i++) {
|
|
440
440
|
const symbol = symbolKeys[i];
|
|
441
|
-
const symbolSpecificMessageHash = messageHash + '
|
|
441
|
+
const symbolSpecificMessageHash = messageHash + '::' + symbol;
|
|
442
442
|
client.resolve(newOrders, symbolSpecificMessageHash);
|
|
443
443
|
}
|
|
444
444
|
client.resolve(newOrders, messageHash);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.98",
|
|
4
4
|
"description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
|
|
5
5
|
"unpkg": "dist/ccxt.browser.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"pre-transpile": "npm run export-exchanges && npm run vss && npm run tsBuild && npm run emitAPI && npm run validate-types && npm run tsBuildExamples && npm run copy-python-files && npm run check-js-syntax && npm run bundle",
|
|
36
36
|
"pre-transpile-pr": "npm run export-exchanges && npm run tsBuild && npm run emitAPI && npm run check-js-syntax",
|
|
37
37
|
"post-transpile": "npm run check-python-syntax && npm run check-php-syntax",
|
|
38
|
-
"test-ws": "npm run build && node run-tests
|
|
38
|
+
"test-ws": "npm run build && node run-tests --ws",
|
|
39
39
|
"test": "npm run build && npm run commonjs-test && npm run static-tests && node run-tests",
|
|
40
40
|
"fast-test": "npm run commonjs-test && node run-tests --js",
|
|
41
41
|
"commonjs-test": "node test-commonjs.cjs",
|
|
42
|
-
"fast-test-ws": "node run-tests
|
|
42
|
+
"fast-test-ws": "node run-tests --ws --js",
|
|
43
43
|
"test-js": "npm run commonjs-test && node run-tests --js",
|
|
44
|
-
"test-js-ws": "node run-tests
|
|
44
|
+
"test-js-ws": "node run-tests --ws --js",
|
|
45
45
|
"test-py": "node run-tests --python",
|
|
46
|
-
"test-py-ws": "node run-tests
|
|
46
|
+
"test-py-ws": "node run-tests --ws --python",
|
|
47
47
|
"test-php": "node run-tests --php",
|
|
48
|
-
"test-php-ws": "node run-tests
|
|
48
|
+
"test-php-ws": "node run-tests --ws --php",
|
|
49
49
|
"test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base && npm run id-tests && npm run static-tests",
|
|
50
50
|
"test-base-ws": "npm run test-js-base-ws && npm run test-python-base-ws && npm run test-php-base-ws",
|
|
51
51
|
"test-js-base": "node ./js/src/test/base/test.base.js",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"fast-force-transpileWs": "node build/transpileWS.js --multiprocess",
|
|
77
77
|
"test-js-cache": "node js/src/pro/test/base/test.Cache.js",
|
|
78
78
|
"test-js-orderbook": "node js/src/pro/test/base/test.OrderBook.js",
|
|
79
|
-
"test-python-cache": "python python/ccxt/pro/test/test_cache.py",
|
|
80
|
-
"test-python-orderbook": "python python/ccxt/pro/test/test_order_book.py",
|
|
79
|
+
"test-python-cache": "python python/ccxt/pro/test/base/test_cache.py",
|
|
80
|
+
"test-python-orderbook": "python python/ccxt/pro/test/base/test_order_book.py",
|
|
81
81
|
"test-ws-php-base": "npm run test-php-cache && npm run test-php-orderbook",
|
|
82
|
-
"test-php-cache": "php -f php/pro/test/
|
|
83
|
-
"test-php-orderbook": "php -f php/pro/test/
|
|
82
|
+
"test-php-cache": "php -f php/pro/test/base/test_cache.php",
|
|
83
|
+
"test-php-orderbook": "php -f php/pro/test/base/test_order_book.php",
|
|
84
84
|
"vss": "node build/vss",
|
|
85
85
|
"lint": "eslint \"ts/src/*.ts\" \"ts/src/base/Exchange.ts\" \"ts/src/pro/*.ts\" --cache --cache-location .cache/eslintcache --cache-strategy metadata",
|
|
86
86
|
"check-syntax": "npm run transpile && npm run check-js-syntax && npm run check-python-syntax && npm run check-php-syntax",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"check-python-syntax": "cd python && tox -e qa && cd ..",
|
|
90
90
|
"check-python-types": "cd python && tox -e type && cd ..",
|
|
91
91
|
"check-php-syntax": "npm run check-rest-php-syntax && npm run check-ws-php-syntax",
|
|
92
|
-
"check-rest-php-syntax": "php -f php/test/syntax.php",
|
|
93
|
-
"check-ws-php-syntax": "php -f php/pro/test/syntax.php",
|
|
92
|
+
"check-rest-php-syntax": "php -f php/test/custom/syntax.php",
|
|
93
|
+
"check-ws-php-syntax": "php -f php/pro/test/custom/syntax.php",
|
|
94
94
|
"bundle": "npm run bundle-cjs && npm run bundle-browser",
|
|
95
95
|
"bundle-cjs": "rollup -c rollup.config.js",
|
|
96
96
|
"bundle-browser": "webpack build -c webpack.config.js && webpack build -c webpack.config.js --optimization-minimize --output-filename ccxt.browser.min.js",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"as-table": "1.0.37",
|
|
128
128
|
"asciichart": "^1.5.25",
|
|
129
129
|
"assert": "^2.0.0",
|
|
130
|
-
"ast-transpiler": "
|
|
130
|
+
"ast-transpiler": ">=0.0.36",
|
|
131
131
|
"docsify": "^4.11.4",
|
|
132
132
|
"eslint": "8.22.0",
|
|
133
133
|
"eslint-config-airbnb-base": "15.0.0",
|