ccxt 4.1.99 → 4.2.1
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 +101 -100
- package/dist/ccxt.browser.js +2874 -458
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/bitteam.js +9 -0
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bitget.js +14 -6
- package/dist/cjs/src/bitteam.js +2309 -0
- package/dist/cjs/src/cex.js +6 -5
- package/dist/cjs/src/deribit.js +38 -26
- package/dist/cjs/src/kucoinfutures.js +9 -4
- package/dist/cjs/src/mexc.js +3 -3
- package/dist/cjs/src/okx.js +5 -4
- package/dist/cjs/src/pro/bitmart.js +85 -50
- package/dist/cjs/src/pro/kucoin.js +10 -2
- package/dist/cjs/src/pro/kucoinfutures.js +10 -2
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/bitteam.d.ts +32 -0
- package/js/src/abstract/bitteam.js +11 -0
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bitget.js +14 -6
- package/js/src/bitteam.d.ts +46 -0
- package/js/src/bitteam.js +2310 -0
- package/js/src/cex.js +6 -5
- package/js/src/deribit.js +38 -26
- package/js/src/kucoinfutures.js +9 -4
- package/js/src/mexc.js +3 -3
- package/js/src/okx.js +5 -4
- package/js/src/pro/bitmart.js +85 -50
- package/js/src/pro/kucoin.js +10 -2
- package/js/src/pro/kucoinfutures.js +10 -2
- package/package.json +1 -1
- package/skip-tests.json +15 -1
package/dist/cjs/src/cex.js
CHANGED
|
@@ -1168,14 +1168,16 @@ class cex extends cex$1 {
|
|
|
1168
1168
|
*/
|
|
1169
1169
|
await this.loadMarkets();
|
|
1170
1170
|
const request = {};
|
|
1171
|
-
let method = 'privatePostOpenOrders';
|
|
1172
1171
|
let market = undefined;
|
|
1172
|
+
let orders = undefined;
|
|
1173
1173
|
if (symbol !== undefined) {
|
|
1174
1174
|
market = this.market(symbol);
|
|
1175
1175
|
request['pair'] = market['id'];
|
|
1176
|
-
|
|
1176
|
+
orders = await this.privatePostOpenOrdersPair(this.extend(request, params));
|
|
1177
|
+
}
|
|
1178
|
+
else {
|
|
1179
|
+
orders = await this.privatePostOpenOrders(this.extend(request, params));
|
|
1177
1180
|
}
|
|
1178
|
-
const orders = await this[method](this.extend(request, params));
|
|
1179
1181
|
for (let i = 0; i < orders.length; i++) {
|
|
1180
1182
|
orders[i] = this.extend(orders[i], { 'status': 'open' });
|
|
1181
1183
|
}
|
|
@@ -1197,10 +1199,9 @@ class cex extends cex$1 {
|
|
|
1197
1199
|
throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
1198
1200
|
}
|
|
1199
1201
|
await this.loadMarkets();
|
|
1200
|
-
const method = 'privatePostArchivedOrdersPair';
|
|
1201
1202
|
const market = this.market(symbol);
|
|
1202
1203
|
const request = { 'pair': market['id'] };
|
|
1203
|
-
const response = await this
|
|
1204
|
+
const response = await this.privatePostArchivedOrdersPair(this.extend(request, params));
|
|
1204
1205
|
return this.parseOrders(response, market, since, limit);
|
|
1205
1206
|
}
|
|
1206
1207
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
package/dist/cjs/src/deribit.js
CHANGED
|
@@ -1317,14 +1317,19 @@ class deribit extends deribit$1 {
|
|
|
1317
1317
|
'instrument_name': market['id'],
|
|
1318
1318
|
'include_old': true,
|
|
1319
1319
|
};
|
|
1320
|
-
const method = (since === undefined) ? 'publicGetGetLastTradesByInstrument' : 'publicGetGetLastTradesByInstrumentAndTime';
|
|
1321
1320
|
if (since !== undefined) {
|
|
1322
1321
|
request['start_timestamp'] = since;
|
|
1323
1322
|
}
|
|
1324
1323
|
if (limit !== undefined) {
|
|
1325
1324
|
request['count'] = Math.min(limit, 1000); // default 10
|
|
1326
1325
|
}
|
|
1327
|
-
|
|
1326
|
+
let response = undefined;
|
|
1327
|
+
if (since === undefined) {
|
|
1328
|
+
response = await this.publicGetGetLastTradesByInstrument(this.extend(request, params));
|
|
1329
|
+
}
|
|
1330
|
+
else {
|
|
1331
|
+
response = await this.publicGetGetLastTradesByInstrumentAndTime(this.extend(request, params));
|
|
1332
|
+
}
|
|
1328
1333
|
//
|
|
1329
1334
|
// {
|
|
1330
1335
|
// "jsonrpc":"2.0",
|
|
@@ -1821,9 +1826,14 @@ class deribit extends deribit$1 {
|
|
|
1821
1826
|
request['time_in_force'] = 'fill_or_kill';
|
|
1822
1827
|
}
|
|
1823
1828
|
}
|
|
1824
|
-
const method = 'privateGet' + this.capitalize(side);
|
|
1825
1829
|
params = this.omit(params, ['timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'reduceOnly']);
|
|
1826
|
-
|
|
1830
|
+
let response = undefined;
|
|
1831
|
+
if (this.capitalize(side) === 'Buy') {
|
|
1832
|
+
response = await this.privateGetBuy(this.extend(request, params));
|
|
1833
|
+
}
|
|
1834
|
+
else {
|
|
1835
|
+
response = await this.privateGetSell(this.extend(request, params));
|
|
1836
|
+
}
|
|
1827
1837
|
//
|
|
1828
1838
|
// {
|
|
1829
1839
|
// "jsonrpc": "2.0",
|
|
@@ -1938,16 +1948,15 @@ class deribit extends deribit$1 {
|
|
|
1938
1948
|
*/
|
|
1939
1949
|
await this.loadMarkets();
|
|
1940
1950
|
const request = {};
|
|
1941
|
-
let
|
|
1951
|
+
let response = undefined;
|
|
1942
1952
|
if (symbol === undefined) {
|
|
1943
|
-
|
|
1953
|
+
response = await this.privateGetCancelAll(this.extend(request, params));
|
|
1944
1954
|
}
|
|
1945
1955
|
else {
|
|
1946
|
-
method = 'privateGetCancelAllByInstrument';
|
|
1947
1956
|
const market = this.market(symbol);
|
|
1948
1957
|
request['instrument_name'] = market['id'];
|
|
1958
|
+
response = await this.privateGetCancelAllByInstrument(this.extend(request, params));
|
|
1949
1959
|
}
|
|
1950
|
-
const response = await this[method](this.extend(request, params));
|
|
1951
1960
|
return response;
|
|
1952
1961
|
}
|
|
1953
1962
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1964,19 +1973,18 @@ class deribit extends deribit$1 {
|
|
|
1964
1973
|
await this.loadMarkets();
|
|
1965
1974
|
const request = {};
|
|
1966
1975
|
let market = undefined;
|
|
1967
|
-
let
|
|
1976
|
+
let response = undefined;
|
|
1968
1977
|
if (symbol === undefined) {
|
|
1969
1978
|
const code = this.codeFromOptions('fetchOpenOrders', params);
|
|
1970
1979
|
const currency = this.currency(code);
|
|
1971
1980
|
request['currency'] = currency['id'];
|
|
1972
|
-
|
|
1981
|
+
response = await this.privateGetGetOpenOrdersByCurrency(this.extend(request, params));
|
|
1973
1982
|
}
|
|
1974
1983
|
else {
|
|
1975
1984
|
market = this.market(symbol);
|
|
1976
1985
|
request['instrument_name'] = market['id'];
|
|
1977
|
-
|
|
1986
|
+
response = await this.privateGetGetOpenOrdersByInstrument(this.extend(request, params));
|
|
1978
1987
|
}
|
|
1979
|
-
const response = await this[method](this.extend(request, params));
|
|
1980
1988
|
const result = this.safeValue(response, 'result', []);
|
|
1981
1989
|
return this.parseOrders(result, market, since, limit);
|
|
1982
1990
|
}
|
|
@@ -1994,19 +2002,18 @@ class deribit extends deribit$1 {
|
|
|
1994
2002
|
await this.loadMarkets();
|
|
1995
2003
|
const request = {};
|
|
1996
2004
|
let market = undefined;
|
|
1997
|
-
let
|
|
2005
|
+
let response = undefined;
|
|
1998
2006
|
if (symbol === undefined) {
|
|
1999
2007
|
const code = this.codeFromOptions('fetchClosedOrders', params);
|
|
2000
2008
|
const currency = this.currency(code);
|
|
2001
2009
|
request['currency'] = currency['id'];
|
|
2002
|
-
|
|
2010
|
+
response = await this.privateGetGetOrderHistoryByCurrency(this.extend(request, params));
|
|
2003
2011
|
}
|
|
2004
2012
|
else {
|
|
2005
2013
|
market = this.market(symbol);
|
|
2006
2014
|
request['instrument_name'] = market['id'];
|
|
2007
|
-
|
|
2015
|
+
response = await this.privateGetGetOrderHistoryByInstrument(this.extend(request, params));
|
|
2008
2016
|
}
|
|
2009
|
-
const response = await this[method](this.extend(request, params));
|
|
2010
2017
|
const result = this.safeValue(response, 'result', []);
|
|
2011
2018
|
return this.parseOrders(result, market, since, limit);
|
|
2012
2019
|
}
|
|
@@ -2079,34 +2086,33 @@ class deribit extends deribit$1 {
|
|
|
2079
2086
|
'include_old': true,
|
|
2080
2087
|
};
|
|
2081
2088
|
let market = undefined;
|
|
2082
|
-
|
|
2089
|
+
if (limit !== undefined) {
|
|
2090
|
+
request['count'] = limit; // default 10
|
|
2091
|
+
}
|
|
2092
|
+
let response = undefined;
|
|
2083
2093
|
if (symbol === undefined) {
|
|
2084
2094
|
const code = this.codeFromOptions('fetchMyTrades', params);
|
|
2085
2095
|
const currency = this.currency(code);
|
|
2086
2096
|
request['currency'] = currency['id'];
|
|
2087
2097
|
if (since === undefined) {
|
|
2088
|
-
|
|
2098
|
+
response = await this.privateGetGetUserTradesByCurrency(this.extend(request, params));
|
|
2089
2099
|
}
|
|
2090
2100
|
else {
|
|
2091
|
-
method = 'privateGetGetUserTradesByCurrencyAndTime';
|
|
2092
2101
|
request['start_timestamp'] = since;
|
|
2102
|
+
response = await this.privateGetGetUserTradesByCurrencyAndTime(this.extend(request, params));
|
|
2093
2103
|
}
|
|
2094
2104
|
}
|
|
2095
2105
|
else {
|
|
2096
2106
|
market = this.market(symbol);
|
|
2097
2107
|
request['instrument_name'] = market['id'];
|
|
2098
2108
|
if (since === undefined) {
|
|
2099
|
-
|
|
2109
|
+
response = await this.privateGetGetUserTradesByInstrument(this.extend(request, params));
|
|
2100
2110
|
}
|
|
2101
2111
|
else {
|
|
2102
|
-
method = 'privateGetGetUserTradesByInstrumentAndTime';
|
|
2103
2112
|
request['start_timestamp'] = since;
|
|
2113
|
+
response = await this.privateGetGetUserTradesByInstrumentAndTime(this.extend(request, params));
|
|
2104
2114
|
}
|
|
2105
2115
|
}
|
|
2106
|
-
if (limit !== undefined) {
|
|
2107
|
-
request['count'] = limit; // default 10
|
|
2108
|
-
}
|
|
2109
|
-
const response = await this[method](this.extend(request, params));
|
|
2110
2116
|
//
|
|
2111
2117
|
// {
|
|
2112
2118
|
// "jsonrpc": "2.0",
|
|
@@ -2640,7 +2646,13 @@ class deribit extends deribit$1 {
|
|
|
2640
2646
|
const transferOptions = this.safeValue(this.options, 'transfer', {});
|
|
2641
2647
|
method = this.safeString(transferOptions, 'method', 'privateGetSubmitTransferToSubaccount');
|
|
2642
2648
|
}
|
|
2643
|
-
|
|
2649
|
+
let response = undefined;
|
|
2650
|
+
if (method === 'privateGetSubmitTransferToUser') {
|
|
2651
|
+
response = await this.privateGetSubmitTransferToUser(this.extend(request, params));
|
|
2652
|
+
}
|
|
2653
|
+
else {
|
|
2654
|
+
response = await this.privateGetSubmitTransferToSubaccount(this.extend(request, params));
|
|
2655
|
+
}
|
|
2644
2656
|
//
|
|
2645
2657
|
// {
|
|
2646
2658
|
// "jsonrpc": "2.0",
|
|
@@ -1732,14 +1732,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1732
1732
|
const cancelExist = this.safeValue(order, 'cancelExist', false);
|
|
1733
1733
|
let status = isActive ? 'open' : 'closed';
|
|
1734
1734
|
status = cancelExist ? 'canceled' : status;
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1735
|
+
let fee = undefined;
|
|
1736
|
+
if (feeCost !== undefined) {
|
|
1737
|
+
fee = {
|
|
1738
|
+
'currency': feeCurrency,
|
|
1739
|
+
'cost': feeCost,
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1739
1742
|
const clientOrderId = this.safeString(order, 'clientOid');
|
|
1740
1743
|
const timeInForce = this.safeString(order, 'timeInForce');
|
|
1741
1744
|
const stopPrice = this.safeNumber(order, 'stopPrice');
|
|
1742
1745
|
const postOnly = this.safeValue(order, 'postOnly');
|
|
1746
|
+
const reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
1743
1747
|
const lastUpdateTimestamp = this.safeInteger(order, 'updatedAt');
|
|
1744
1748
|
return this.safeOrder({
|
|
1745
1749
|
'id': orderId,
|
|
@@ -1748,6 +1752,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1748
1752
|
'type': type,
|
|
1749
1753
|
'timeInForce': timeInForce,
|
|
1750
1754
|
'postOnly': postOnly,
|
|
1755
|
+
'reduceOnly': reduceOnly,
|
|
1751
1756
|
'side': side,
|
|
1752
1757
|
'amount': amount,
|
|
1753
1758
|
'price': price,
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -442,7 +442,7 @@ class mexc extends mexc$1 {
|
|
|
442
442
|
'BCH': 'BCH',
|
|
443
443
|
'TRC20': 'Tron(TRC20)',
|
|
444
444
|
'ERC20': 'Ethereum(ERC20)',
|
|
445
|
-
'BEP20': '
|
|
445
|
+
'BEP20': 'BNB Smart Chain(BEP20)',
|
|
446
446
|
'OPTIMISM': 'Optimism(OP)',
|
|
447
447
|
'SOL': 'Solana(SOL)',
|
|
448
448
|
'CRC20': 'CRONOS',
|
|
@@ -1040,7 +1040,7 @@ class mexc extends mexc$1 {
|
|
|
1040
1040
|
'Algorand(ALGO)': 'ALGO',
|
|
1041
1041
|
'ArbitrumOne(ARB)': 'ARBONE',
|
|
1042
1042
|
'AvalancheCChain(AVAXCCHAIN)': 'AVAXC',
|
|
1043
|
-
'
|
|
1043
|
+
'BNB Smart Chain(BEP20)': 'BEP20',
|
|
1044
1044
|
'Polygon(MATIC)': 'MATIC',
|
|
1045
1045
|
'Optimism(OP)': 'OPTIMISM',
|
|
1046
1046
|
'Solana(SOL)': 'SOL',
|
|
@@ -4353,8 +4353,8 @@ class mexc extends mexc$1 {
|
|
|
4353
4353
|
/**
|
|
4354
4354
|
* @method
|
|
4355
4355
|
* @name mexc3#createDepositAddress
|
|
4356
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
|
4357
4356
|
* @description create a currency deposit address
|
|
4357
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
|
4358
4358
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
4359
4359
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4360
4360
|
* @param {string} [params.network] the blockchain network name
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -871,8 +871,8 @@ class okx extends okx$1 {
|
|
|
871
871
|
'ALGO': 'Algorand',
|
|
872
872
|
'BHP': 'BHP',
|
|
873
873
|
'APT': 'Aptos',
|
|
874
|
-
'ARBONE': 'Arbitrum
|
|
875
|
-
'AVAXC': 'Avalanche C
|
|
874
|
+
'ARBONE': 'Arbitrum One',
|
|
875
|
+
'AVAXC': 'Avalanche C',
|
|
876
876
|
'AVAXX': 'Avalanche X-Chain',
|
|
877
877
|
'ARK': 'ARK',
|
|
878
878
|
'AR': 'Arweave',
|
|
@@ -4466,15 +4466,16 @@ class okx extends okx$1 {
|
|
|
4466
4466
|
// },
|
|
4467
4467
|
//
|
|
4468
4468
|
if (chain === 'USDT-Polygon') {
|
|
4469
|
-
networkData = this.
|
|
4469
|
+
networkData = this.safeValue2(networksById, 'USDT-Polygon-Bridge', 'USDT-Polygon');
|
|
4470
4470
|
}
|
|
4471
4471
|
const network = this.safeString(networkData, 'network');
|
|
4472
|
+
const networkCode = this.networkIdToCode(network, code);
|
|
4472
4473
|
this.checkAddress(address);
|
|
4473
4474
|
return {
|
|
4474
4475
|
'currency': code,
|
|
4475
4476
|
'address': address,
|
|
4476
4477
|
'tag': tag,
|
|
4477
|
-
'network':
|
|
4478
|
+
'network': networkCode,
|
|
4478
4479
|
'info': depositAddress,
|
|
4479
4480
|
};
|
|
4480
4481
|
}
|
|
@@ -51,7 +51,7 @@ class bitmart extends bitmart$1 {
|
|
|
51
51
|
'awaitBalanceSnapshot': false, // whether to wait for the balance snapshot before providing updates
|
|
52
52
|
},
|
|
53
53
|
'watchOrderBook': {
|
|
54
|
-
'depth': '
|
|
54
|
+
'depth': 'depth/increase100', // depth/increase100, depth5, depth20, depth50
|
|
55
55
|
},
|
|
56
56
|
'ws': {
|
|
57
57
|
'inflate': true,
|
|
@@ -1069,6 +1069,7 @@ class bitmart extends bitmart$1 {
|
|
|
1069
1069
|
* @method
|
|
1070
1070
|
* @name bitmart#watchOrderBook
|
|
1071
1071
|
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-all-channel
|
|
1072
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
|
|
1072
1073
|
* @see https://developer-pro.bitmart.com/en/futures/#public-depth-channel
|
|
1073
1074
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1074
1075
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -1078,11 +1079,14 @@ class bitmart extends bitmart$1 {
|
|
|
1078
1079
|
*/
|
|
1079
1080
|
await this.loadMarkets();
|
|
1080
1081
|
const options = this.safeValue(this.options, 'watchOrderBook', {});
|
|
1081
|
-
|
|
1082
|
+
let depth = this.safeString(options, 'depth', 'depth/increase100');
|
|
1082
1083
|
symbol = this.symbol(symbol);
|
|
1083
1084
|
const market = this.market(symbol);
|
|
1084
1085
|
let type = 'spot';
|
|
1085
1086
|
[type, params] = this.handleMarketTypeAndParams('watchOrderBook', market, params);
|
|
1087
|
+
if (type === 'swap' && depth === 'depth/increase100') {
|
|
1088
|
+
depth = 'depth50';
|
|
1089
|
+
}
|
|
1086
1090
|
const orderbook = await this.subscribe(depth, symbol, type, params);
|
|
1087
1091
|
return orderbook.limit();
|
|
1088
1092
|
}
|
|
@@ -1131,46 +1135,72 @@ class bitmart extends bitmart$1 {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
handleOrderBook(client, message) {
|
|
1133
1137
|
//
|
|
1134
|
-
// spot
|
|
1135
|
-
//
|
|
1136
|
-
//
|
|
1137
|
-
//
|
|
1138
|
-
//
|
|
1139
|
-
//
|
|
1140
|
-
//
|
|
1141
|
-
//
|
|
1142
|
-
//
|
|
1143
|
-
//
|
|
1144
|
-
//
|
|
1145
|
-
//
|
|
1146
|
-
//
|
|
1138
|
+
// spot depth-all
|
|
1139
|
+
// {
|
|
1140
|
+
// "data": [
|
|
1141
|
+
// {
|
|
1142
|
+
// "asks": [
|
|
1143
|
+
// [ '46828.38', "0.21847" ],
|
|
1144
|
+
// [ '46830.68', "0.08232" ],
|
|
1145
|
+
// ...
|
|
1146
|
+
// ],
|
|
1147
|
+
// "bids": [
|
|
1148
|
+
// [ '46820.78', "0.00444" ],
|
|
1149
|
+
// [ '46814.33', "0.00234" ],
|
|
1150
|
+
// ...
|
|
1151
|
+
// ],
|
|
1152
|
+
// "ms_t": 1631044962431,
|
|
1153
|
+
// "symbol": "BTC_USDT"
|
|
1154
|
+
// }
|
|
1155
|
+
// ],
|
|
1156
|
+
// "table": "spot/depth5"
|
|
1157
|
+
// }
|
|
1158
|
+
// spot increse depth snapshot
|
|
1159
|
+
// {
|
|
1160
|
+
// "data":[
|
|
1161
|
+
// {
|
|
1162
|
+
// "asks":[
|
|
1163
|
+
// [
|
|
1164
|
+
// "43652.52",
|
|
1165
|
+
// "0.02039"
|
|
1147
1166
|
// ],
|
|
1148
|
-
//
|
|
1149
|
-
//
|
|
1150
|
-
//
|
|
1151
|
-
//
|
|
1152
|
-
//
|
|
1153
|
-
//
|
|
1167
|
+
// ...
|
|
1168
|
+
// ],
|
|
1169
|
+
// "bids":[
|
|
1170
|
+
// [
|
|
1171
|
+
// "43652.51",
|
|
1172
|
+
// "0.00500"
|
|
1173
|
+
// ],
|
|
1174
|
+
// ...
|
|
1175
|
+
// ],
|
|
1176
|
+
// "ms_t":1703376836487,
|
|
1177
|
+
// "symbol":"BTC_USDT",
|
|
1178
|
+
// "type":"snapshot", // or update
|
|
1179
|
+
// "version":2141731
|
|
1180
|
+
// }
|
|
1181
|
+
// ],
|
|
1182
|
+
// "table":"spot/depth/increase100"
|
|
1183
|
+
// }
|
|
1154
1184
|
// swap
|
|
1155
|
-
//
|
|
1156
|
-
//
|
|
1157
|
-
//
|
|
1158
|
-
//
|
|
1159
|
-
//
|
|
1160
|
-
//
|
|
1161
|
-
//
|
|
1162
|
-
//
|
|
1163
|
-
//
|
|
1164
|
-
//
|
|
1165
|
-
//
|
|
1166
|
-
//
|
|
1167
|
-
//
|
|
1168
|
-
//
|
|
1169
|
-
//
|
|
1170
|
-
//
|
|
1171
|
-
//
|
|
1172
|
-
//
|
|
1173
|
-
//
|
|
1185
|
+
// {
|
|
1186
|
+
// "group":"futures/depth50:BTCUSDT",
|
|
1187
|
+
// "data":{
|
|
1188
|
+
// "symbol":"BTCUSDT",
|
|
1189
|
+
// "way":1,
|
|
1190
|
+
// "depths":[
|
|
1191
|
+
// {
|
|
1192
|
+
// "price":"39509.8",
|
|
1193
|
+
// "vol":"2379"
|
|
1194
|
+
// },
|
|
1195
|
+
// {
|
|
1196
|
+
// "price":"39509.6",
|
|
1197
|
+
// "vol":"6815"
|
|
1198
|
+
// },
|
|
1199
|
+
// ...
|
|
1200
|
+
// ],
|
|
1201
|
+
// "ms_t":1701566021194
|
|
1202
|
+
// }
|
|
1203
|
+
// }
|
|
1174
1204
|
//
|
|
1175
1205
|
const data = this.safeValue(message, 'data');
|
|
1176
1206
|
if (data === undefined) {
|
|
@@ -1179,12 +1209,16 @@ class bitmart extends bitmart$1 {
|
|
|
1179
1209
|
const depths = this.safeValue(data, 'depths');
|
|
1180
1210
|
const isSpot = (depths === undefined);
|
|
1181
1211
|
const table = this.safeString2(message, 'table', 'group');
|
|
1182
|
-
|
|
1183
|
-
const
|
|
1184
|
-
let
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1212
|
+
// find limit subscribed to
|
|
1213
|
+
const limitsToCheck = ['100', '50', '20', '10', '5'];
|
|
1214
|
+
let limit = 0;
|
|
1215
|
+
for (let i = 0; i < limitsToCheck.length; i++) {
|
|
1216
|
+
const limitString = limitsToCheck[i];
|
|
1217
|
+
if (table.indexOf(limitString) >= 0) {
|
|
1218
|
+
limit = this.parseToInt(limitString);
|
|
1219
|
+
break;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1188
1222
|
if (isSpot) {
|
|
1189
1223
|
for (let i = 0; i < data.length; i++) {
|
|
1190
1224
|
const update = data[i];
|
|
@@ -1196,7 +1230,10 @@ class bitmart extends bitmart$1 {
|
|
|
1196
1230
|
orderbook['symbol'] = symbol;
|
|
1197
1231
|
this.orderbooks[symbol] = orderbook;
|
|
1198
1232
|
}
|
|
1199
|
-
|
|
1233
|
+
const type = this.safeValue(update, 'type');
|
|
1234
|
+
if ((type === 'snapshot') || (!(table.indexOf('increase') >= 0))) {
|
|
1235
|
+
orderbook.reset({});
|
|
1236
|
+
}
|
|
1200
1237
|
this.handleOrderBookMessage(client, update, orderbook);
|
|
1201
1238
|
const timestamp = this.safeInteger(update, 'ms_t');
|
|
1202
1239
|
orderbook['timestamp'] = timestamp;
|
|
@@ -1388,9 +1425,7 @@ class bitmart extends bitmart$1 {
|
|
|
1388
1425
|
}
|
|
1389
1426
|
else {
|
|
1390
1427
|
const methods = {
|
|
1391
|
-
'
|
|
1392
|
-
'depth20': this.handleOrderBook,
|
|
1393
|
-
'depth50': this.handleOrderBook,
|
|
1428
|
+
'depth': this.handleOrderBook,
|
|
1394
1429
|
'ticker': this.handleTicker,
|
|
1395
1430
|
'trade': this.handleTrade,
|
|
1396
1431
|
'kline': this.handleOHLCV,
|
|
@@ -50,8 +50,9 @@ class kucoin extends kucoin$1 {
|
|
|
50
50
|
negotiate(privateChannel, params = {}) {
|
|
51
51
|
const connectId = privateChannel ? 'private' : 'public';
|
|
52
52
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const spawaned = this.safeValue(urls, connectId);
|
|
54
|
+
if (spawaned !== undefined) {
|
|
55
|
+
return spawaned;
|
|
55
56
|
}
|
|
56
57
|
// we store an awaitable to the url
|
|
57
58
|
// so that multiple calls don't asynchronously
|
|
@@ -1022,6 +1023,13 @@ class kucoin extends kucoin$1 {
|
|
|
1022
1023
|
// }
|
|
1023
1024
|
//
|
|
1024
1025
|
const data = this.safeString(message, 'data', '');
|
|
1026
|
+
if (data === 'token is expired') {
|
|
1027
|
+
let type = 'public';
|
|
1028
|
+
if (client.url.indexOf('connectId=private') >= 0) {
|
|
1029
|
+
type = 'private';
|
|
1030
|
+
}
|
|
1031
|
+
this.options['urls'][type] = undefined;
|
|
1032
|
+
}
|
|
1025
1033
|
this.handleErrors(undefined, undefined, client.url, undefined, undefined, data, message, undefined, undefined);
|
|
1026
1034
|
}
|
|
1027
1035
|
handleMessage(client, message) {
|
|
@@ -60,8 +60,9 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
60
60
|
negotiate(privateChannel, params = {}) {
|
|
61
61
|
const connectId = privateChannel ? 'private' : 'public';
|
|
62
62
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const spawaned = this.safeValue(urls, connectId);
|
|
64
|
+
if (spawaned !== undefined) {
|
|
65
|
+
return spawaned;
|
|
65
66
|
}
|
|
66
67
|
// we store an awaitable to the url
|
|
67
68
|
// so that multiple calls don't asynchronously
|
|
@@ -951,6 +952,13 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
951
952
|
// }
|
|
952
953
|
//
|
|
953
954
|
const data = this.safeString(message, 'data', '');
|
|
955
|
+
if (data === 'token is expired') {
|
|
956
|
+
let type = 'public';
|
|
957
|
+
if (client.url.indexOf('connectId=private') >= 0) {
|
|
958
|
+
type = 'private';
|
|
959
|
+
}
|
|
960
|
+
this.options['urls'][type] = undefined;
|
|
961
|
+
}
|
|
954
962
|
this.handleErrors(undefined, undefined, client.url, undefined, undefined, data, message, undefined, undefined);
|
|
955
963
|
}
|
|
956
964
|
handleMessage(client, message) {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.
|
|
7
|
+
declare const version = "4.2.0";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -33,6 +33,7 @@ import bitpanda from './src/bitpanda.js';
|
|
|
33
33
|
import bitrue from './src/bitrue.js';
|
|
34
34
|
import bitso from './src/bitso.js';
|
|
35
35
|
import bitstamp from './src/bitstamp.js';
|
|
36
|
+
import bitteam from './src/bitteam.js';
|
|
36
37
|
import bitvavo from './src/bitvavo.js';
|
|
37
38
|
import bl3p from './src/bl3p.js';
|
|
38
39
|
import blockchaincom from './src/blockchaincom.js';
|
|
@@ -187,6 +188,7 @@ declare const exchanges: {
|
|
|
187
188
|
bitrue: typeof bitrue;
|
|
188
189
|
bitso: typeof bitso;
|
|
189
190
|
bitstamp: typeof bitstamp;
|
|
191
|
+
bitteam: typeof bitteam;
|
|
190
192
|
bitvavo: typeof bitvavo;
|
|
191
193
|
bl3p: typeof bl3p;
|
|
192
194
|
blockchaincom: typeof blockchaincom;
|
|
@@ -407,6 +409,7 @@ declare const ccxt: {
|
|
|
407
409
|
bitrue: typeof bitrue;
|
|
408
410
|
bitso: typeof bitso;
|
|
409
411
|
bitstamp: typeof bitstamp;
|
|
412
|
+
bitteam: typeof bitteam;
|
|
410
413
|
bitvavo: typeof bitvavo;
|
|
411
414
|
bl3p: typeof bl3p;
|
|
412
415
|
blockchaincom: typeof blockchaincom;
|
|
@@ -477,5 +480,5 @@ declare const ccxt: {
|
|
|
477
480
|
zaif: typeof zaif;
|
|
478
481
|
zonda: typeof zonda;
|
|
479
482
|
} & typeof functions & typeof errors;
|
|
480
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
483
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
481
484
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.1
|
|
41
|
+
const version = '4.2.1';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -69,6 +69,7 @@ import bitpanda from './src/bitpanda.js';
|
|
|
69
69
|
import bitrue from './src/bitrue.js';
|
|
70
70
|
import bitso from './src/bitso.js';
|
|
71
71
|
import bitstamp from './src/bitstamp.js';
|
|
72
|
+
import bitteam from './src/bitteam.js';
|
|
72
73
|
import bitvavo from './src/bitvavo.js';
|
|
73
74
|
import bl3p from './src/bl3p.js';
|
|
74
75
|
import blockchaincom from './src/blockchaincom.js';
|
|
@@ -224,6 +225,7 @@ const exchanges = {
|
|
|
224
225
|
'bitrue': bitrue,
|
|
225
226
|
'bitso': bitso,
|
|
226
227
|
'bitstamp': bitstamp,
|
|
228
|
+
'bitteam': bitteam,
|
|
227
229
|
'bitvavo': bitvavo,
|
|
228
230
|
'bl3p': bl3p,
|
|
229
231
|
'blockchaincom': blockchaincom,
|
|
@@ -364,6 +366,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
364
366
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
365
367
|
//-----------------------------------------------------------------------------
|
|
366
368
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
367
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
369
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
368
370
|
export default ccxt;
|
|
369
371
|
//-----------------------------------------------------------------------------
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
historyGetApiTwHistoryPairNameResolution(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
publicGetTradeApiAsset(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetTradeApiCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetTradeApiOrderbooksSymbol(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetTradeApiOrders(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetTradeApiPairName(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetTradeApiPairs(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetTradeApiPairsPrecisions(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
publicGetTradeApiRates(params?: {}): Promise<implicitReturnType>;
|
|
13
|
+
publicGetTradeApiTradeId(params?: {}): Promise<implicitReturnType>;
|
|
14
|
+
publicGetTradeApiTrades(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
publicGetTradeApiCcxtPairs(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
publicGetTradeApiCmcAssets(params?: {}): Promise<implicitReturnType>;
|
|
17
|
+
publicGetTradeApiCmcOrderbookPair(params?: {}): Promise<implicitReturnType>;
|
|
18
|
+
publicGetTradeApiCmcSummary(params?: {}): Promise<implicitReturnType>;
|
|
19
|
+
publicGetTradeApiCmcTicker(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
publicGetTradeApiCmcTradesPair(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetTradeApiCcxtBalance(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
privateGetTradeApiCcxtOrderId(params?: {}): Promise<implicitReturnType>;
|
|
23
|
+
privateGetTradeApiCcxtOrdersOfUser(params?: {}): Promise<implicitReturnType>;
|
|
24
|
+
privateGetTradeApiCcxtTradesOfUser(params?: {}): Promise<implicitReturnType>;
|
|
25
|
+
privateGetTradeApiTransactionsOfUser(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
privatePostTradeApiCcxtCancelAllOrder(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
privatePostTradeApiCcxtCancelorder(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privatePostTradeApiCcxtOrdercreate(params?: {}): Promise<implicitReturnType>;
|
|
29
|
+
}
|
|
30
|
+
declare abstract class Exchange extends _Exchange {
|
|
31
|
+
}
|
|
32
|
+
export default Exchange;
|