ccxt 4.2.16 → 4.2.18
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 +4 -4
- package/dist/ccxt.browser.js +546 -276
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/js/ccxt.js +3 -1
- package/dist/cjs/js/src/base/Exchange.js +5 -2
- package/dist/cjs/js/src/binance.js +7 -0
- package/dist/cjs/js/src/bingx.js +26 -0
- package/dist/cjs/js/src/bybit.js +21 -47
- package/dist/cjs/js/src/coincheck.js +1 -0
- package/dist/cjs/js/src/coinlist.js +10 -2
- package/dist/cjs/js/src/coinsph.js +2 -2
- package/dist/cjs/js/src/deribit.js +5 -1
- package/dist/cjs/js/src/kraken.js +1 -1
- package/dist/cjs/js/src/pro/binance.js +3 -3
- package/dist/cjs/js/src/pro/bitget.js +1 -1
- package/dist/cjs/js/src/pro/coincheck.js +208 -0
- package/dist/cjs/js/src/pro/hitbtc.js +5 -4
- package/dist/cjs/js/src/pro/kucoin.js +46 -36
- package/dist/cjs/js/src/pro/kucoinfutures.js +45 -37
- package/dist/cjs/js/src/pro/poloniex.js +2 -2
- package/dist/cjs/js/src/pro/poloniexfutures.js +43 -35
- package/dist/cjs/js/src/whitebit.js +1 -0
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/coinlist.d.ts +8 -0
- package/js/src/base/Exchange.d.ts +2 -3
- package/js/src/base/Exchange.js +5 -2
- package/js/src/binance.js +7 -0
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +26 -0
- package/js/src/bybit.js +21 -47
- package/js/src/coincheck.js +1 -0
- package/js/src/coinlist.js +10 -2
- package/js/src/coinsph.js +2 -2
- package/js/src/deribit.js +5 -1
- package/js/src/kraken.js +1 -1
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/coincheck.d.ts +12 -0
- package/js/src/pro/coincheck.js +209 -0
- package/js/src/pro/hitbtc.js +5 -4
- package/js/src/pro/kucoin.js +46 -36
- package/js/src/pro/kucoinfutures.js +45 -37
- package/js/src/pro/poloniex.js +2 -2
- package/js/src/pro/poloniexfutures.js +43 -35
- package/js/src/whitebit.js +1 -0
- package/package.json +1 -1
- package/skip-tests.json +12 -1
|
@@ -307,7 +307,8 @@ class hitbtc extends hitbtc$1 {
|
|
|
307
307
|
'symbols': [market['id']],
|
|
308
308
|
},
|
|
309
309
|
};
|
|
310
|
-
|
|
310
|
+
const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
311
|
+
return this.safeValue(result, symbol);
|
|
311
312
|
}
|
|
312
313
|
async watchTickers(symbols = undefined, params = {}) {
|
|
313
314
|
/**
|
|
@@ -390,16 +391,16 @@ class hitbtc extends hitbtc$1 {
|
|
|
390
391
|
const data = this.safeValue(message, 'data', {});
|
|
391
392
|
const marketIds = Object.keys(data);
|
|
392
393
|
const channel = this.safeString(message, 'ch');
|
|
393
|
-
const newTickers =
|
|
394
|
+
const newTickers = {};
|
|
394
395
|
for (let i = 0; i < marketIds.length; i++) {
|
|
395
396
|
const marketId = marketIds[i];
|
|
396
397
|
const market = this.safeMarket(marketId);
|
|
397
398
|
const symbol = market['symbol'];
|
|
398
399
|
const ticker = this.parseWsTicker(data[marketId], market);
|
|
399
400
|
this.tickers[symbol] = ticker;
|
|
400
|
-
newTickers
|
|
401
|
+
newTickers[symbol] = ticker;
|
|
401
402
|
const messageHash = channel + '::' + symbol;
|
|
402
|
-
client.resolve(
|
|
403
|
+
client.resolve(newTickers, messageHash);
|
|
403
404
|
}
|
|
404
405
|
const messageHashes = this.findMessageHashes(client, channel + '::');
|
|
405
406
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
@@ -64,43 +64,51 @@ class kucoin extends kucoin$1 {
|
|
|
64
64
|
async negotiateHelper(privateChannel, params = {}) {
|
|
65
65
|
let response = undefined;
|
|
66
66
|
const connectId = privateChannel ? 'private' : 'public';
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
try {
|
|
68
|
+
if (privateChannel) {
|
|
69
|
+
response = await this.privatePostBulletPrivate(params);
|
|
70
|
+
//
|
|
71
|
+
// {
|
|
72
|
+
// "code": "200000",
|
|
73
|
+
// "data": {
|
|
74
|
+
// "instanceServers": [
|
|
75
|
+
// {
|
|
76
|
+
// "pingInterval": 50000,
|
|
77
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
78
|
+
// "protocol": "websocket",
|
|
79
|
+
// "encrypt": true,
|
|
80
|
+
// "pingTimeout": 10000
|
|
81
|
+
// }
|
|
82
|
+
// ],
|
|
83
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
84
|
+
// }
|
|
85
|
+
// }
|
|
86
|
+
//
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
response = await this.publicPostBulletPublic(params);
|
|
90
|
+
}
|
|
91
|
+
const data = this.safeValue(response, 'data', {});
|
|
92
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
93
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
94
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
95
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
96
|
+
const token = this.safeString(data, 'token');
|
|
97
|
+
const result = endpoint + '?' + this.urlencode({
|
|
98
|
+
'token': token,
|
|
99
|
+
'privateChannel': privateChannel,
|
|
100
|
+
'connectId': connectId,
|
|
101
|
+
});
|
|
102
|
+
const client = this.client(result);
|
|
103
|
+
client.keepAlive = pingInterval;
|
|
104
|
+
return result;
|
|
86
105
|
}
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
catch (e) {
|
|
107
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
108
|
+
future.reject(e);
|
|
109
|
+
delete this.options['urls'][connectId];
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
92
|
-
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
93
|
-
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
94
|
-
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
95
|
-
const token = this.safeString(data, 'token');
|
|
96
|
-
const result = endpoint + '?' + this.urlencode({
|
|
97
|
-
'token': token,
|
|
98
|
-
'privateChannel': privateChannel,
|
|
99
|
-
'connectId': connectId,
|
|
100
|
-
});
|
|
101
|
-
const client = this.client(result);
|
|
102
|
-
client.keepAlive = pingInterval;
|
|
103
|
-
return result;
|
|
111
|
+
return undefined;
|
|
104
112
|
}
|
|
105
113
|
requestId() {
|
|
106
114
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
|
@@ -258,7 +266,9 @@ class kucoin extends kucoin$1 {
|
|
|
258
266
|
const messageHash = 'ticker:' + symbol;
|
|
259
267
|
client.resolve(ticker, messageHash);
|
|
260
268
|
// watchTickers
|
|
261
|
-
|
|
269
|
+
const allTickers = {};
|
|
270
|
+
allTickers[symbol] = ticker;
|
|
271
|
+
client.resolve(allTickers, 'tickers');
|
|
262
272
|
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
263
273
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
264
274
|
const currentMessageHash = messageHashes[i];
|
|
@@ -74,43 +74,51 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
74
74
|
async negotiateHelper(privateChannel, params = {}) {
|
|
75
75
|
let response = undefined;
|
|
76
76
|
const connectId = privateChannel ? 'private' : 'public';
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
77
|
+
try {
|
|
78
|
+
if (privateChannel) {
|
|
79
|
+
response = await this.futuresPrivatePostBulletPrivate(params);
|
|
80
|
+
//
|
|
81
|
+
// {
|
|
82
|
+
// "code": "200000",
|
|
83
|
+
// "data": {
|
|
84
|
+
// "instanceServers": [
|
|
85
|
+
// {
|
|
86
|
+
// "pingInterval": 50000,
|
|
87
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
88
|
+
// "protocol": "websocket",
|
|
89
|
+
// "encrypt": true,
|
|
90
|
+
// "pingTimeout": 10000
|
|
91
|
+
// }
|
|
92
|
+
// ],
|
|
93
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
//
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
response = await this.futuresPublicPostBulletPublic(params);
|
|
100
|
+
}
|
|
101
|
+
const data = this.safeValue(response, 'data', {});
|
|
102
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
103
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
104
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
105
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
106
|
+
const token = this.safeString(data, 'token');
|
|
107
|
+
const result = endpoint + '?' + this.urlencode({
|
|
108
|
+
'token': token,
|
|
109
|
+
'privateChannel': privateChannel,
|
|
110
|
+
'connectId': connectId,
|
|
111
|
+
});
|
|
112
|
+
const client = this.client(result);
|
|
113
|
+
client.keepAlive = pingInterval;
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
118
|
+
future.reject(e);
|
|
119
|
+
delete this.options['urls'][connectId];
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
114
122
|
}
|
|
115
123
|
requestId() {
|
|
116
124
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
|
@@ -940,7 +940,7 @@ class poloniex extends poloniex$1 {
|
|
|
940
940
|
// }
|
|
941
941
|
//
|
|
942
942
|
const data = this.safeValue(message, 'data', []);
|
|
943
|
-
const newTickers =
|
|
943
|
+
const newTickers = {};
|
|
944
944
|
for (let i = 0; i < data.length; i++) {
|
|
945
945
|
const item = data[i];
|
|
946
946
|
const marketId = this.safeString(item, 'symbol');
|
|
@@ -948,7 +948,7 @@ class poloniex extends poloniex$1 {
|
|
|
948
948
|
const ticker = this.parseTicker(item);
|
|
949
949
|
const symbol = ticker['symbol'];
|
|
950
950
|
this.tickers[symbol] = ticker;
|
|
951
|
-
newTickers
|
|
951
|
+
newTickers[symbol] = ticker;
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
const messageHashes = this.findMessageHashes(client, 'ticker::');
|
|
@@ -75,43 +75,51 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
75
75
|
async negotiateHelper(privateChannel, params = {}) {
|
|
76
76
|
let response = undefined;
|
|
77
77
|
const connectId = privateChannel ? 'private' : 'public';
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
try {
|
|
79
|
+
if (privateChannel) {
|
|
80
|
+
response = await this.privatePostBulletPrivate(params);
|
|
81
|
+
//
|
|
82
|
+
// {
|
|
83
|
+
// "code": "200000",
|
|
84
|
+
// "data": {
|
|
85
|
+
// "instanceServers": [
|
|
86
|
+
// {
|
|
87
|
+
// "pingInterval": 50000,
|
|
88
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
89
|
+
// "protocol": "websocket",
|
|
90
|
+
// "encrypt": true,
|
|
91
|
+
// "pingTimeout": 10000
|
|
92
|
+
// }
|
|
93
|
+
// ],
|
|
94
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
//
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
response = await this.publicPostBulletPublic(params);
|
|
101
|
+
}
|
|
102
|
+
const data = this.safeValue(response, 'data', {});
|
|
103
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
104
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
105
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
106
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
107
|
+
const token = this.safeString(data, 'token');
|
|
108
|
+
const result = endpoint + '?' + this.urlencode({
|
|
109
|
+
'token': token,
|
|
110
|
+
'privateChannel': privateChannel,
|
|
111
|
+
'connectId': connectId,
|
|
112
|
+
});
|
|
113
|
+
const client = this.client(result);
|
|
114
|
+
client.keepAlive = pingInterval;
|
|
115
|
+
return result;
|
|
97
116
|
}
|
|
98
|
-
|
|
99
|
-
|
|
117
|
+
catch (e) {
|
|
118
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
119
|
+
future.reject(e);
|
|
120
|
+
delete this.options['urls'][connectId];
|
|
100
121
|
}
|
|
101
|
-
|
|
102
|
-
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
103
|
-
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
104
|
-
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
105
|
-
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
106
|
-
const token = this.safeString(data, 'token');
|
|
107
|
-
const result = endpoint + '?' + this.urlencode({
|
|
108
|
-
'token': token,
|
|
109
|
-
'privateChannel': privateChannel,
|
|
110
|
-
'connectId': connectId,
|
|
111
|
-
});
|
|
112
|
-
const client = this.client(result);
|
|
113
|
-
client.keepAlive = pingInterval;
|
|
114
|
-
return result;
|
|
122
|
+
return undefined;
|
|
115
123
|
}
|
|
116
124
|
requestId() {
|
|
117
125
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
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.2.
|
|
7
|
+
declare const version = "4.2.17";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -127,6 +127,7 @@ import bybitPro from './src/pro/bybit.js';
|
|
|
127
127
|
import cexPro from './src/pro/cex.js';
|
|
128
128
|
import coinbasePro from './src/pro/coinbase.js';
|
|
129
129
|
import coinbaseproPro from './src/pro/coinbasepro.js';
|
|
130
|
+
import coincheckPro from './src/pro/coincheck.js';
|
|
130
131
|
import coinexPro from './src/pro/coinex.js';
|
|
131
132
|
import coinonePro from './src/pro/coinone.js';
|
|
132
133
|
import cryptocomPro from './src/pro/cryptocom.js';
|
|
@@ -285,6 +286,7 @@ declare const pro: {
|
|
|
285
286
|
cex: typeof cexPro;
|
|
286
287
|
coinbase: typeof coinbasePro;
|
|
287
288
|
coinbasepro: typeof coinbaseproPro;
|
|
289
|
+
coincheck: typeof coincheckPro;
|
|
288
290
|
coinex: typeof coinexPro;
|
|
289
291
|
coinone: typeof coinonePro;
|
|
290
292
|
cryptocom: typeof cryptocomPro;
|
|
@@ -349,6 +351,7 @@ declare const ccxt: {
|
|
|
349
351
|
cex: typeof cexPro;
|
|
350
352
|
coinbase: typeof coinbasePro;
|
|
351
353
|
coinbasepro: typeof coinbaseproPro;
|
|
354
|
+
coincheck: typeof coincheckPro;
|
|
352
355
|
coinex: typeof coinexPro;
|
|
353
356
|
coinone: typeof coinonePro;
|
|
354
357
|
cryptocom: typeof cryptocomPro;
|
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.2.
|
|
41
|
+
const version = '4.2.18';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -164,6 +164,7 @@ import bybitPro from './src/pro/bybit.js';
|
|
|
164
164
|
import cexPro from './src/pro/cex.js';
|
|
165
165
|
import coinbasePro from './src/pro/coinbase.js';
|
|
166
166
|
import coinbaseproPro from './src/pro/coinbasepro.js';
|
|
167
|
+
import coincheckPro from './src/pro/coincheck.js';
|
|
167
168
|
import coinexPro from './src/pro/coinex.js';
|
|
168
169
|
import coinonePro from './src/pro/coinone.js';
|
|
169
170
|
import cryptocomPro from './src/pro/cryptocom.js';
|
|
@@ -322,6 +323,7 @@ const pro = {
|
|
|
322
323
|
'cex': cexPro,
|
|
323
324
|
'coinbase': coinbasePro,
|
|
324
325
|
'coinbasepro': coinbaseproPro,
|
|
326
|
+
'coincheck': coincheckPro,
|
|
325
327
|
'coinex': coinexPro,
|
|
326
328
|
'coinone': coinonePro,
|
|
327
329
|
'cryptocom': cryptocomPro,
|
|
@@ -8,6 +8,7 @@ interface Exchange {
|
|
|
8
8
|
sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -8,6 +8,7 @@ interface binance {
|
|
|
8
8
|
sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -8,6 +8,7 @@ interface binance {
|
|
|
8
8
|
sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -8,6 +8,7 @@ interface binance {
|
|
|
8
8
|
sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
sapiGetMarginAllPairs(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
sapiGetMarginPriceIndex(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
sapiGetSpotDelistSchedule(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
sapiGetAssetAssetDividend(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
sapiGetAssetDribblet(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
sapiGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -12,9 +12,13 @@ interface Exchange {
|
|
|
12
12
|
publicGetV1SymbolsSymbolAuctionsAuctionCode(params?: {}): Promise<implicitReturnType>;
|
|
13
13
|
publicGetV1Time(params?: {}): Promise<implicitReturnType>;
|
|
14
14
|
publicGetV1Assets(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
publicGetV1Leaderboard(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
publicGetV1AffiliateCompetitionCode(params?: {}): Promise<implicitReturnType>;
|
|
17
|
+
publicGetV1CompetitionCompetitionId(params?: {}): Promise<implicitReturnType>;
|
|
15
18
|
privateGetV1Fees(params?: {}): Promise<implicitReturnType>;
|
|
16
19
|
privateGetV1Accounts(params?: {}): Promise<implicitReturnType>;
|
|
17
20
|
privateGetV1AccountsTraderId(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetV1AccountsTraderIdAlias(params?: {}): Promise<implicitReturnType>;
|
|
18
22
|
privateGetV1AccountsTraderIdLedger(params?: {}): Promise<implicitReturnType>;
|
|
19
23
|
privateGetV1AccountsTraderIdWallets(params?: {}): Promise<implicitReturnType>;
|
|
20
24
|
privateGetV1AccountsTraderIdWalletLedger(params?: {}): Promise<implicitReturnType>;
|
|
@@ -28,6 +32,8 @@ interface Exchange {
|
|
|
28
32
|
privateGetV1Transfers(params?: {}): Promise<implicitReturnType>;
|
|
29
33
|
privateGetV1User(params?: {}): Promise<implicitReturnType>;
|
|
30
34
|
privateGetV1Credits(params?: {}): Promise<implicitReturnType>;
|
|
35
|
+
privateGetV1Positions(params?: {}): Promise<implicitReturnType>;
|
|
36
|
+
privateGetV1AccountsTraderIdCompetitions(params?: {}): Promise<implicitReturnType>;
|
|
31
37
|
privatePostV1Keys(params?: {}): Promise<implicitReturnType>;
|
|
32
38
|
privatePostV1Orders(params?: {}): Promise<implicitReturnType>;
|
|
33
39
|
privatePostV1OrdersCancelAllAfter(params?: {}): Promise<implicitReturnType>;
|
|
@@ -37,6 +43,8 @@ interface Exchange {
|
|
|
37
43
|
privatePostV1TransfersInternalTransfer(params?: {}): Promise<implicitReturnType>;
|
|
38
44
|
privatePostV1TransfersWithdrawalRequest(params?: {}): Promise<implicitReturnType>;
|
|
39
45
|
privatePostV1OrdersBulk(params?: {}): Promise<implicitReturnType>;
|
|
46
|
+
privatePostV1AccountsTraderIdCompetitions(params?: {}): Promise<implicitReturnType>;
|
|
47
|
+
privatePostV1AccountsTraderIdCreateCompetition(params?: {}): Promise<implicitReturnType>;
|
|
40
48
|
privatePatchV1OrdersOrderId(params?: {}): Promise<implicitReturnType>;
|
|
41
49
|
privatePatchV1OrdersBulk(params?: {}): Promise<implicitReturnType>;
|
|
42
50
|
privateDeleteV1KeysKey(params?: {}): Promise<implicitReturnType>;
|
|
@@ -2,7 +2,6 @@ import * as functions from './functions.js';
|
|
|
2
2
|
import { // eslint-disable-line object-curly-newline
|
|
3
3
|
ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
|
|
4
4
|
import WsClient from './ws/WsClient.js';
|
|
5
|
-
import { Future } from './ws/Future.js';
|
|
6
5
|
import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
|
|
7
6
|
import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, FundingHistory, MarginMode, Tickers, Greeks, Str, Num, MarketInterface, CurrencyInterface, Account } from './types.js';
|
|
8
7
|
export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, Liquidation, FundingHistory, Greeks } from './types.js';
|
|
@@ -377,7 +376,7 @@ export default class Exchange {
|
|
|
377
376
|
fetchPositionsForSymbol: any;
|
|
378
377
|
fetchPositionsRisk: any;
|
|
379
378
|
fetchPremiumIndexOHLCV: any;
|
|
380
|
-
fetchStatus:
|
|
379
|
+
fetchStatus: any;
|
|
381
380
|
fetchTicker: boolean;
|
|
382
381
|
fetchTickers: any;
|
|
383
382
|
fetchTime: any;
|
|
@@ -540,7 +539,7 @@ export default class Exchange {
|
|
|
540
539
|
checkOrderArguments(market: any, type: any, side: any, amount: any, price: any, params: any): void;
|
|
541
540
|
handleHttpStatusCode(code: any, reason: any, url: any, method: any, body: any): void;
|
|
542
541
|
remove0xPrefix(hexData: any): any;
|
|
543
|
-
spawn(method: any, ...args: any[]):
|
|
542
|
+
spawn(method: any, ...args: any[]): import("./ws/Future.js").FutureInterface;
|
|
544
543
|
delay(timeout: any, method: any, ...args: any[]): void;
|
|
545
544
|
orderBook(snapshot?: {}, depth?: number): WsOrderBook;
|
|
546
545
|
indexedOrderBook(snapshot?: {}, depth?: number): IndexedOrderBook;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -433,7 +433,7 @@ export default class Exchange {
|
|
|
433
433
|
'fetchPositionsForSymbol': undefined,
|
|
434
434
|
'fetchPositionsRisk': undefined,
|
|
435
435
|
'fetchPremiumIndexOHLCV': undefined,
|
|
436
|
-
'fetchStatus':
|
|
436
|
+
'fetchStatus': undefined,
|
|
437
437
|
'fetchTicker': true,
|
|
438
438
|
'fetchTickers': undefined,
|
|
439
439
|
'fetchTime': undefined,
|
|
@@ -1015,7 +1015,10 @@ export default class Exchange {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
spawn(method, ...args) {
|
|
1017
1017
|
const future = Future();
|
|
1018
|
-
|
|
1018
|
+
// using setTimeout 0 to force the execution to run after the future is returned
|
|
1019
|
+
setTimeout(() => {
|
|
1020
|
+
method.apply(this, args).then(future.resolve).catch(future.reject);
|
|
1021
|
+
}, 0);
|
|
1019
1022
|
return future;
|
|
1020
1023
|
}
|
|
1021
1024
|
delay(timeout, method, ...args) {
|
package/js/src/binance.js
CHANGED
|
@@ -225,6 +225,7 @@ export default class binance extends Exchange {
|
|
|
225
225
|
'margin/allPairs': 0.1,
|
|
226
226
|
'margin/priceIndex': 1,
|
|
227
227
|
// these endpoints require this.apiKey + this.secret
|
|
228
|
+
'spot/delist-schedule': 10,
|
|
228
229
|
'asset/assetDividend': 1,
|
|
229
230
|
'asset/dribblet': 0.1,
|
|
230
231
|
'asset/transfer': 0.1,
|
|
@@ -5582,6 +5583,7 @@ export default class binance extends Exchange {
|
|
|
5582
5583
|
* @param {int} [since] the earliest time in ms to fetch my dust trades for
|
|
5583
5584
|
* @param {int} [limit] the maximum number of dust trades to retrieve
|
|
5584
5585
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5586
|
+
* @param {string} [params.type] 'spot' or 'margin', default spot
|
|
5585
5587
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5586
5588
|
*/
|
|
5587
5589
|
//
|
|
@@ -5596,6 +5598,11 @@ export default class binance extends Exchange {
|
|
|
5596
5598
|
request['startTime'] = since;
|
|
5597
5599
|
request['endTime'] = this.sum(since, 7776000000);
|
|
5598
5600
|
}
|
|
5601
|
+
const accountType = this.safeStringUpper(params, 'type');
|
|
5602
|
+
params = this.omit(params, 'type');
|
|
5603
|
+
if (accountType !== undefined) {
|
|
5604
|
+
request['accountType'] = accountType;
|
|
5605
|
+
}
|
|
5599
5606
|
const response = await this.sapiGetAssetDribblet(this.extend(request, params));
|
|
5600
5607
|
// {
|
|
5601
5608
|
// "total": "4",
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export default class bingx extends Exchange {
|
|
|
32
32
|
previousFundingTimestamp: any;
|
|
33
33
|
previousFundingDatetime: any;
|
|
34
34
|
}>;
|
|
35
|
+
fetchFundingRates(symbols?: Strings, params?: {}): Promise<any[]>;
|
|
35
36
|
parseFundingRate(contract: any, market?: Market): {
|
|
36
37
|
info: any;
|
|
37
38
|
symbol: string;
|
package/js/src/bingx.js
CHANGED
|
@@ -53,6 +53,7 @@ export default class bingx extends Exchange {
|
|
|
53
53
|
'fetchDepositWithdrawFee': 'emulated',
|
|
54
54
|
'fetchDepositWithdrawFees': true,
|
|
55
55
|
'fetchFundingRate': true,
|
|
56
|
+
'fetchFundingRates': true,
|
|
56
57
|
'fetchFundingRateHistory': true,
|
|
57
58
|
'fetchLeverage': true,
|
|
58
59
|
'fetchLiquidations': false,
|
|
@@ -1113,6 +1114,31 @@ export default class bingx extends Exchange {
|
|
|
1113
1114
|
const data = this.safeValue(response, 'data', {});
|
|
1114
1115
|
return this.parseFundingRate(data, market);
|
|
1115
1116
|
}
|
|
1117
|
+
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
1118
|
+
/**
|
|
1119
|
+
* @method
|
|
1120
|
+
* @name bingx#fetchFundingRate
|
|
1121
|
+
* @description fetch the current funding rate
|
|
1122
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1123
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1124
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1125
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1126
|
+
*/
|
|
1127
|
+
await this.loadMarkets();
|
|
1128
|
+
symbols = this.marketSymbols(symbols, 'swap', true);
|
|
1129
|
+
const response = await this.swapV2PublicGetQuotePremiumIndex(this.extend(params));
|
|
1130
|
+
const data = this.safeValue(response, 'data', []);
|
|
1131
|
+
const filteredResponse = [];
|
|
1132
|
+
for (let i = 0; i < data.length; i++) {
|
|
1133
|
+
const item = data[i];
|
|
1134
|
+
const marketId = this.safeString(item, 'symbol');
|
|
1135
|
+
const market = this.safeMarket(marketId, undefined, undefined, 'swap');
|
|
1136
|
+
if ((symbols === undefined) || this.inArray(market['symbol'], symbols)) {
|
|
1137
|
+
filteredResponse.push(this.parseFundingRate(item, market));
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return filteredResponse;
|
|
1141
|
+
}
|
|
1116
1142
|
parseFundingRate(contract, market = undefined) {
|
|
1117
1143
|
//
|
|
1118
1144
|
// {
|