ccxt 4.0.101 → 4.0.103
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 -6
- package/dist/ccxt.browser.js +1130 -2730
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -4
- package/dist/cjs/src/base/errors.js +2 -1
- package/dist/cjs/src/binance.js +8 -0
- package/dist/cjs/src/bingx.js +111 -4
- package/dist/cjs/src/bitget.js +3 -0
- package/dist/cjs/src/bitmart.js +271 -46
- package/dist/cjs/src/bitrue.js +7 -0
- package/dist/cjs/src/bl3p.js +8 -0
- package/dist/cjs/src/bybit.js +79 -55
- package/dist/cjs/src/gate.js +221 -218
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/pro/binance.js +7 -7
- package/dist/cjs/src/pro/bybit.js +18 -17
- package/dist/cjs/src/pro/coinbasepro.js +10 -10
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/js/ccxt.d.ts +3 -6
- package/js/ccxt.js +3 -5
- package/js/src/abstract/binance.d.ts +8 -0
- package/js/src/abstract/binancecoinm.d.ts +8 -0
- package/js/src/abstract/binanceus.d.ts +8 -0
- package/js/src/abstract/binanceusdm.d.ts +8 -0
- package/js/src/abstract/bingx.d.ts +16 -1
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +2 -1
- package/js/src/base/errors.js +2 -2
- package/js/src/binance.js +8 -0
- package/js/src/bingx.d.ts +8 -0
- package/js/src/bingx.js +111 -4
- package/js/src/bitget.js +3 -0
- package/js/src/bitmart.d.ts +46 -5
- package/js/src/bitmart.js +271 -46
- package/js/src/bitrue.js +7 -0
- package/js/src/bl3p.js +8 -0
- package/js/src/bybit.js +80 -56
- package/js/src/gate.js +221 -218
- package/js/src/gemini.js +1 -0
- package/js/src/pro/binance.js +7 -7
- package/js/src/pro/bybit.js +18 -17
- package/js/src/pro/coinbasepro.js +10 -10
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/wavesexchange.js +2 -1
- package/package.json +1 -1
- package/skip-tests.json +5 -7
- package/js/src/abstract/bkex.d.ts +0 -61
- package/js/src/abstract/bkex.js +0 -11
package/js/src/pro/binance.js
CHANGED
|
@@ -505,8 +505,8 @@ export default class binance extends binanceRest {
|
|
|
505
505
|
for (let i = 0; i < symbols.length; i++) {
|
|
506
506
|
const symbol = symbols[i];
|
|
507
507
|
const market = this.market(symbol);
|
|
508
|
-
const
|
|
509
|
-
subParams.push(
|
|
508
|
+
const currentMessageHash = market['lowercaseId'] + '@' + name;
|
|
509
|
+
subParams.push(currentMessageHash);
|
|
510
510
|
}
|
|
511
511
|
const messageHash = 'multipleTrades::' + symbols.join(',');
|
|
512
512
|
const query = this.omit(params, 'type');
|
|
@@ -824,10 +824,10 @@ export default class binance extends binanceRest {
|
|
|
824
824
|
const hashes = [];
|
|
825
825
|
for (let i = 0; i < symbolsAndTimeframes.length; i++) {
|
|
826
826
|
const data = symbolsAndTimeframes[i];
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
const interval = this.safeString(this.timeframes,
|
|
830
|
-
const market = this.market(
|
|
827
|
+
const symbolString = data[0];
|
|
828
|
+
const timeframeString = data[1];
|
|
829
|
+
const interval = this.safeString(this.timeframes, timeframeString, timeframeString);
|
|
830
|
+
const market = this.market(symbolString);
|
|
831
831
|
let marketId = market['lowercaseId'];
|
|
832
832
|
if (name === 'indexPriceKline') {
|
|
833
833
|
// weird behavior for index price kline we can't use the perp suffix
|
|
@@ -835,7 +835,7 @@ export default class binance extends binanceRest {
|
|
|
835
835
|
}
|
|
836
836
|
const topic = marketId + '@' + name + '_' + interval;
|
|
837
837
|
subParams.push(topic);
|
|
838
|
-
hashes.push(
|
|
838
|
+
hashes.push(symbolString + '#' + timeframeString);
|
|
839
839
|
}
|
|
840
840
|
const messageHash = 'multipleOHLCV::' + hashes.join(',');
|
|
841
841
|
const url = this.urls['api']['ws'][type] + '/' + this.stream(type, messageHash);
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -364,17 +364,17 @@ export default class bybit extends bybitRest {
|
|
|
364
364
|
let firstSymbol = undefined;
|
|
365
365
|
for (let i = 0; i < symbolsAndTimeframes.length; i++) {
|
|
366
366
|
const data = symbolsAndTimeframes[i];
|
|
367
|
-
let
|
|
368
|
-
const
|
|
369
|
-
const market = this.market(
|
|
370
|
-
|
|
367
|
+
let symbolString = this.safeString(data, 0);
|
|
368
|
+
const timeframeString = this.safeString(data, 1);
|
|
369
|
+
const market = this.market(symbolString);
|
|
370
|
+
symbolString = market['symbol'];
|
|
371
371
|
if (i === 0) {
|
|
372
372
|
firstSymbol = market['symbol'];
|
|
373
373
|
}
|
|
374
|
-
const timeframeId = this.safeString(this.timeframes,
|
|
374
|
+
const timeframeId = this.safeString(this.timeframes, timeframeString, timeframeString);
|
|
375
375
|
const topic = 'kline.' + timeframeId + '.' + market['id'];
|
|
376
376
|
topics.push(topic);
|
|
377
|
-
hashes.push(
|
|
377
|
+
hashes.push(symbolString + '#' + timeframeString);
|
|
378
378
|
}
|
|
379
379
|
const messageHash = 'multipleOHLCV::' + hashes.join(',');
|
|
380
380
|
const url = this.getUrlByMarketType(firstSymbol, false, params);
|
|
@@ -921,8 +921,8 @@ export default class bybit extends bybitRest {
|
|
|
921
921
|
}
|
|
922
922
|
const keys = Object.keys(symbols);
|
|
923
923
|
for (let i = 0; i < keys.length; i++) {
|
|
924
|
-
const
|
|
925
|
-
client.resolve(trades,
|
|
924
|
+
const currentMessageHash = 'myTrades:' + keys[i];
|
|
925
|
+
client.resolve(trades, currentMessageHash);
|
|
926
926
|
}
|
|
927
927
|
// non-symbol specific
|
|
928
928
|
const messageHash = 'myTrades';
|
|
@@ -1054,25 +1054,26 @@ export default class bybit extends bybitRest {
|
|
|
1054
1054
|
const first = this.safeValue(rawOrders, 0, {});
|
|
1055
1055
|
const category = this.safeString(first, 'category');
|
|
1056
1056
|
const isSpot = category === 'spot';
|
|
1057
|
-
|
|
1058
|
-
if (isSpot) {
|
|
1059
|
-
parser = 'parseWsSpotOrder';
|
|
1060
|
-
}
|
|
1061
|
-
else {
|
|
1062
|
-
parser = 'parseContractOrder';
|
|
1057
|
+
if (!isSpot) {
|
|
1063
1058
|
rawOrders = this.safeValue(rawOrders, 'result', rawOrders);
|
|
1064
1059
|
}
|
|
1065
1060
|
const symbols = {};
|
|
1066
1061
|
for (let i = 0; i < rawOrders.length; i++) {
|
|
1067
|
-
|
|
1062
|
+
let parsed = undefined;
|
|
1063
|
+
if (isSpot) {
|
|
1064
|
+
parsed = this.parseWsSpotOrder(rawOrders[i]);
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
parsed = this.parseOrder(rawOrders[i]);
|
|
1068
|
+
}
|
|
1068
1069
|
const symbol = parsed['symbol'];
|
|
1069
1070
|
symbols[symbol] = true;
|
|
1070
1071
|
orders.append(parsed);
|
|
1071
1072
|
}
|
|
1072
1073
|
const symbolsArray = Object.keys(symbols);
|
|
1073
1074
|
for (let i = 0; i < symbolsArray.length; i++) {
|
|
1074
|
-
const
|
|
1075
|
-
client.resolve(orders,
|
|
1075
|
+
const currentMessageHash = 'orders:' + symbolsArray[i];
|
|
1076
|
+
client.resolve(orders, currentMessageHash);
|
|
1076
1077
|
}
|
|
1077
1078
|
const messageHash = 'orders';
|
|
1078
1079
|
client.resolve(orders, messageHash);
|
|
@@ -526,11 +526,11 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
526
526
|
// reason: 'filled'
|
|
527
527
|
// }
|
|
528
528
|
//
|
|
529
|
-
let
|
|
530
|
-
if (
|
|
529
|
+
let currentOrders = this.orders;
|
|
530
|
+
if (currentOrders === undefined) {
|
|
531
531
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
532
|
-
|
|
533
|
-
this.orders =
|
|
532
|
+
currentOrders = new ArrayCacheBySymbolById(limit);
|
|
533
|
+
this.orders = currentOrders;
|
|
534
534
|
}
|
|
535
535
|
const type = this.safeString(message, 'type');
|
|
536
536
|
const marketId = this.safeString(message, 'product_id');
|
|
@@ -567,9 +567,9 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
567
567
|
let totalAmount = 0;
|
|
568
568
|
const trades = previousOrder['trades'];
|
|
569
569
|
for (let i = 0; i < trades.length; i++) {
|
|
570
|
-
const
|
|
571
|
-
totalCost = this.sum(totalCost,
|
|
572
|
-
totalAmount = this.sum(totalAmount,
|
|
570
|
+
const tradeEntry = trades[i];
|
|
571
|
+
totalCost = this.sum(totalCost, tradeEntry['cost']);
|
|
572
|
+
totalAmount = this.sum(totalAmount, tradeEntry['amount']);
|
|
573
573
|
}
|
|
574
574
|
if (totalAmount > 0) {
|
|
575
575
|
previousOrder['average'] = totalCost / totalAmount;
|
|
@@ -697,12 +697,12 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
697
697
|
client.resolve(ticker, messageHash);
|
|
698
698
|
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
699
699
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
700
|
-
const
|
|
701
|
-
const parts =
|
|
700
|
+
const currentMessageHash = messageHashes[i];
|
|
701
|
+
const parts = currentMessageHash.split('::');
|
|
702
702
|
const symbolsString = parts[1];
|
|
703
703
|
const symbols = symbolsString.split(',');
|
|
704
704
|
if (this.inArray(symbol, symbols)) {
|
|
705
|
-
client.resolve(ticker,
|
|
705
|
+
client.resolve(ticker, currentMessageHash);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
}
|
package/js/src/pro/kucoin.js
CHANGED
|
@@ -238,15 +238,15 @@ export default class kucoin extends kucoinRest {
|
|
|
238
238
|
client.resolve(ticker, 'tickers');
|
|
239
239
|
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
240
240
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
241
|
-
const
|
|
242
|
-
const parts =
|
|
241
|
+
const currentMessageHash = messageHashes[i];
|
|
242
|
+
const parts = currentMessageHash.split('::');
|
|
243
243
|
const symbolsString = parts[1];
|
|
244
244
|
const symbols = symbolsString.split(',');
|
|
245
245
|
const tickers = this.filterByArray(this.tickers, 'symbol', symbols);
|
|
246
246
|
const tickersSymbols = Object.keys(tickers);
|
|
247
247
|
const numTickers = tickersSymbols.length;
|
|
248
248
|
if (numTickers > 0) {
|
|
249
|
-
client.resolve(tickers,
|
|
249
|
+
client.resolve(tickers, currentMessageHash);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
package/js/src/wavesexchange.js
CHANGED
|
@@ -1250,7 +1250,8 @@ export default class wavesexchange extends Exchange {
|
|
|
1250
1250
|
toPrecision(amount, scale) {
|
|
1251
1251
|
const amountString = this.numberToString(amount);
|
|
1252
1252
|
const precise = new Precise(amountString);
|
|
1253
|
-
precise.decimals
|
|
1253
|
+
// precise.decimals should be integer
|
|
1254
|
+
precise.decimals = this.parseToInt(Precise.stringSub(this.numberToString(precise.decimals), this.numberToString(scale)));
|
|
1254
1255
|
precise.reduce();
|
|
1255
1256
|
return precise;
|
|
1256
1257
|
}
|
package/package.json
CHANGED
package/skip-tests.json
CHANGED
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
}
|
|
538
538
|
},
|
|
539
539
|
"coinbasepro": {
|
|
540
|
-
|
|
540
|
+
"skipPhpAsync": true,
|
|
541
541
|
"skipMethods": {
|
|
542
542
|
"fetchStatus": "request timeout",
|
|
543
543
|
"fetchCurrencies": {
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
}
|
|
548
548
|
},
|
|
549
549
|
"coinbaseprime": {
|
|
550
|
-
|
|
550
|
+
"skipPhpAsync": true,
|
|
551
551
|
"skipMethods": {
|
|
552
552
|
"fetchStatus": "request timeout",
|
|
553
553
|
"fetchCurrencies": {
|
|
@@ -780,7 +780,6 @@
|
|
|
780
780
|
"skipWs": true
|
|
781
781
|
},
|
|
782
782
|
"huobi": {
|
|
783
|
-
"skipPhpAsync": true,
|
|
784
783
|
"skipWs": true,
|
|
785
784
|
"skipMethods": {
|
|
786
785
|
"loadMarkets": {
|
|
@@ -1018,7 +1017,9 @@
|
|
|
1018
1017
|
"skipMethods": {
|
|
1019
1018
|
"fetchTickers": {
|
|
1020
1019
|
"quoteVolume": "quoteVolume >= baseVolume * low is failing",
|
|
1021
|
-
"baseVolume": "quoteVolume >= baseVolume * low is failing"
|
|
1020
|
+
"baseVolume": "quoteVolume >= baseVolume * low is failing",
|
|
1021
|
+
"ask": "https://app.travis-ci.com/github/ccxt/ccxt/builds/266029139",
|
|
1022
|
+
"bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/266029139"
|
|
1022
1023
|
},
|
|
1023
1024
|
"fetchTicker": {
|
|
1024
1025
|
"quoteVolume": "quoteVolume >= baseVolume * low is failing",
|
|
@@ -1036,9 +1037,7 @@
|
|
|
1036
1037
|
}
|
|
1037
1038
|
},
|
|
1038
1039
|
"mexc": {
|
|
1039
|
-
"skip": "OnMaintenance https://www.mexc.com/support/articles/17827791510263",
|
|
1040
1040
|
"skipWs": true,
|
|
1041
|
-
"skipPhpAsync": "Connection ended before receiving response...",
|
|
1042
1041
|
"skipMethods": {
|
|
1043
1042
|
"loadMarkets":{
|
|
1044
1043
|
"currencyIdAndCode": "messed"
|
|
@@ -1283,7 +1282,6 @@
|
|
|
1283
1282
|
}
|
|
1284
1283
|
},
|
|
1285
1284
|
"woo": {
|
|
1286
|
-
"skipPhpAsync": true,
|
|
1287
1285
|
"skipMethods":{
|
|
1288
1286
|
"loadMarkets":{
|
|
1289
1287
|
"active": "undefined",
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { implicitReturnType } from '../base/types.js';
|
|
2
|
-
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
-
interface Exchange {
|
|
4
|
-
publicSpotGetCommonSymbols(params?: {}): Promise<implicitReturnType>;
|
|
5
|
-
publicSpotGetCommonCurrencys(params?: {}): Promise<implicitReturnType>;
|
|
6
|
-
publicSpotGetCommonTimestamp(params?: {}): Promise<implicitReturnType>;
|
|
7
|
-
publicSpotGetQKline(params?: {}): Promise<implicitReturnType>;
|
|
8
|
-
publicSpotGetQTickers(params?: {}): Promise<implicitReturnType>;
|
|
9
|
-
publicSpotGetQTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
10
|
-
publicSpotGetQDepth(params?: {}): Promise<implicitReturnType>;
|
|
11
|
-
publicSpotGetQDeals(params?: {}): Promise<implicitReturnType>;
|
|
12
|
-
publicSwapGetMarketCandle(params?: {}): Promise<implicitReturnType>;
|
|
13
|
-
publicSwapGetMarketDeals(params?: {}): Promise<implicitReturnType>;
|
|
14
|
-
publicSwapGetMarketDepth(params?: {}): Promise<implicitReturnType>;
|
|
15
|
-
publicSwapGetMarketFundingRate(params?: {}): Promise<implicitReturnType>;
|
|
16
|
-
publicSwapGetMarketIndex(params?: {}): Promise<implicitReturnType>;
|
|
17
|
-
publicSwapGetMarketRiskLimit(params?: {}): Promise<implicitReturnType>;
|
|
18
|
-
publicSwapGetMarketSymbols(params?: {}): Promise<implicitReturnType>;
|
|
19
|
-
publicSwapGetMarketTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
20
|
-
publicSwapGetMarketTickers(params?: {}): Promise<implicitReturnType>;
|
|
21
|
-
publicSwapGetServerPing(params?: {}): Promise<implicitReturnType>;
|
|
22
|
-
privateSpotGetUApiInfo(params?: {}): Promise<implicitReturnType>;
|
|
23
|
-
privateSpotGetUAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
24
|
-
privateSpotGetUWalletAddress(params?: {}): Promise<implicitReturnType>;
|
|
25
|
-
privateSpotGetUWalletDepositRecord(params?: {}): Promise<implicitReturnType>;
|
|
26
|
-
privateSpotGetUWalletWithdrawRecord(params?: {}): Promise<implicitReturnType>;
|
|
27
|
-
privateSpotGetUOrderOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
28
|
-
privateSpotGetUOrderOpenOrderDetail(params?: {}): Promise<implicitReturnType>;
|
|
29
|
-
privateSpotGetUOrderHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
30
|
-
privateSpotPostUAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
31
|
-
privateSpotPostUWalletWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
32
|
-
privateSpotPostUOrderCreate(params?: {}): Promise<implicitReturnType>;
|
|
33
|
-
privateSpotPostUOrderCancel(params?: {}): Promise<implicitReturnType>;
|
|
34
|
-
privateSpotPostUOrderBatchCreate(params?: {}): Promise<implicitReturnType>;
|
|
35
|
-
privateSpotPostUOrderBatchCancel(params?: {}): Promise<implicitReturnType>;
|
|
36
|
-
privateSwapGetAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
37
|
-
privateSwapGetAccountBalanceRecord(params?: {}): Promise<implicitReturnType>;
|
|
38
|
-
privateSwapGetAccountOrder(params?: {}): Promise<implicitReturnType>;
|
|
39
|
-
privateSwapGetAccountOrderForced(params?: {}): Promise<implicitReturnType>;
|
|
40
|
-
privateSwapGetAccountPosition(params?: {}): Promise<implicitReturnType>;
|
|
41
|
-
privateSwapGetEntrustFinished(params?: {}): Promise<implicitReturnType>;
|
|
42
|
-
privateSwapGetEntrustUnFinish(params?: {}): Promise<implicitReturnType>;
|
|
43
|
-
privateSwapGetOrderFinished(params?: {}): Promise<implicitReturnType>;
|
|
44
|
-
privateSwapGetOrderFinishedInfo(params?: {}): Promise<implicitReturnType>;
|
|
45
|
-
privateSwapGetOrderUnFinish(params?: {}): Promise<implicitReturnType>;
|
|
46
|
-
privateSwapGetPositionInfo(params?: {}): Promise<implicitReturnType>;
|
|
47
|
-
privateSwapPostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
|
|
48
|
-
privateSwapPostEntrustAdd(params?: {}): Promise<implicitReturnType>;
|
|
49
|
-
privateSwapPostEntrustCancel(params?: {}): Promise<implicitReturnType>;
|
|
50
|
-
privateSwapPostOrderBatchCancel(params?: {}): Promise<implicitReturnType>;
|
|
51
|
-
privateSwapPostOrderBatchOpen(params?: {}): Promise<implicitReturnType>;
|
|
52
|
-
privateSwapPostOrderCancel(params?: {}): Promise<implicitReturnType>;
|
|
53
|
-
privateSwapPostOrderClose(params?: {}): Promise<implicitReturnType>;
|
|
54
|
-
privateSwapPostOrderCloseAll(params?: {}): Promise<implicitReturnType>;
|
|
55
|
-
privateSwapPostOrderOpen(params?: {}): Promise<implicitReturnType>;
|
|
56
|
-
privateSwapPostPositionSetSpSl(params?: {}): Promise<implicitReturnType>;
|
|
57
|
-
privateSwapPostPositionUpdate(params?: {}): Promise<implicitReturnType>;
|
|
58
|
-
}
|
|
59
|
-
declare abstract class Exchange extends _Exchange {
|
|
60
|
-
}
|
|
61
|
-
export default Exchange;
|
package/js/src/abstract/bkex.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
|
-
// -------------------------------------------------------------------------------
|
|
8
|
-
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
9
|
-
class Exchange extends _Exchange {
|
|
10
|
-
}
|
|
11
|
-
export default Exchange;
|