ccxt 4.2.17 → 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 +522 -264
- 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 -1
- 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/deribit.js +5 -1
- package/dist/cjs/js/src/kraken.js +1 -1
- package/dist/cjs/js/src/pro/binance.js +1 -1
- 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/kucoin.js +43 -35
- package/dist/cjs/js/src/pro/kucoinfutures.js +45 -37
- 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/base/Exchange.d.ts +2 -3
- package/js/src/base/Exchange.js +5 -2
- package/js/src/binance.js +7 -1
- 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/deribit.js +5 -1
- package/js/src/kraken.js +1 -1
- package/js/src/pro/binance.js +1 -1
- 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/kucoin.js +43 -35
- package/js/src/pro/kucoinfutures.js +45 -37
- 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
|
@@ -0,0 +1,209 @@
|
|
|
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 coincheckRest from '../coincheck.js';
|
|
9
|
+
import { AuthenticationError } from '../base/errors.js';
|
|
10
|
+
import { ArrayCache } from '../base/ws/Cache.js';
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export default class coincheck extends coincheckRest {
|
|
13
|
+
describe() {
|
|
14
|
+
return this.deepExtend(super.describe(), {
|
|
15
|
+
'has': {
|
|
16
|
+
'ws': true,
|
|
17
|
+
'watchOrderBook': true,
|
|
18
|
+
'watchOrders': false,
|
|
19
|
+
'watchTrades': true,
|
|
20
|
+
'watchOHLCV': false,
|
|
21
|
+
'watchTicker': false,
|
|
22
|
+
'watchTickers': false,
|
|
23
|
+
},
|
|
24
|
+
'urls': {
|
|
25
|
+
'api': {
|
|
26
|
+
'ws': 'wss://ws-api.coincheck.com/',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
'options': {
|
|
30
|
+
'expiresIn': '',
|
|
31
|
+
'userId': '',
|
|
32
|
+
'wsSessionToken': '',
|
|
33
|
+
'watchOrderBook': {
|
|
34
|
+
'snapshotDelay': 6,
|
|
35
|
+
'snapshotMaxRetries': 3,
|
|
36
|
+
},
|
|
37
|
+
'tradesLimit': 1000,
|
|
38
|
+
'OHLCVLimit': 1000,
|
|
39
|
+
},
|
|
40
|
+
'exceptions': {
|
|
41
|
+
'exact': {
|
|
42
|
+
'4009': AuthenticationError,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
48
|
+
/**
|
|
49
|
+
* @method
|
|
50
|
+
* @name coincheck#watchOrderBook
|
|
51
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
52
|
+
* @see https://coincheck.com/documents/exchange/api#websocket-order-book
|
|
53
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
54
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
55
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
56
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
57
|
+
*/
|
|
58
|
+
await this.loadMarkets();
|
|
59
|
+
const market = this.market(symbol);
|
|
60
|
+
const messageHash = 'orderbook:' + market['symbol'];
|
|
61
|
+
const url = this.urls['api']['ws'];
|
|
62
|
+
const request = {
|
|
63
|
+
'type': 'subscribe',
|
|
64
|
+
'channel': market['id'] + '-orderbook',
|
|
65
|
+
};
|
|
66
|
+
const message = this.extend(request, params);
|
|
67
|
+
const orderbook = await this.watch(url, messageHash, message, messageHash);
|
|
68
|
+
return orderbook.limit();
|
|
69
|
+
}
|
|
70
|
+
handleOrderBook(client, message) {
|
|
71
|
+
//
|
|
72
|
+
// [
|
|
73
|
+
// "btc_jpy",
|
|
74
|
+
// {
|
|
75
|
+
// "bids": [
|
|
76
|
+
// [
|
|
77
|
+
// "6288279.0",
|
|
78
|
+
// "0"
|
|
79
|
+
// ]
|
|
80
|
+
// ],
|
|
81
|
+
// "asks": [
|
|
82
|
+
// [
|
|
83
|
+
// "6290314.0",
|
|
84
|
+
// "0"
|
|
85
|
+
// ]
|
|
86
|
+
// ],
|
|
87
|
+
// "last_update_at": "1705396097"
|
|
88
|
+
// }
|
|
89
|
+
// ]
|
|
90
|
+
//
|
|
91
|
+
const symbol = this.symbol(this.safeString(message, 0));
|
|
92
|
+
const data = this.safeValue(message, 1, {});
|
|
93
|
+
const timestamp = this.safeTimestamp(data, 'last_update_at');
|
|
94
|
+
const snapshot = this.parseOrderBook(data, symbol, timestamp);
|
|
95
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
96
|
+
if (orderbook === undefined) {
|
|
97
|
+
orderbook = this.orderBook(snapshot);
|
|
98
|
+
this.orderbooks[symbol] = orderbook;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
orderbook = this.orderbooks[symbol];
|
|
102
|
+
orderbook.reset(snapshot);
|
|
103
|
+
}
|
|
104
|
+
const messageHash = 'orderbook:' + symbol;
|
|
105
|
+
client.resolve(orderbook, messageHash);
|
|
106
|
+
}
|
|
107
|
+
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
108
|
+
/**
|
|
109
|
+
* @method
|
|
110
|
+
* @name coincheck#watchTrades
|
|
111
|
+
* @description watches information on multiple trades made in a market
|
|
112
|
+
* @see https://coincheck.com/documents/exchange/api#websocket-trades
|
|
113
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
114
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
115
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
116
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
117
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
118
|
+
*/
|
|
119
|
+
await this.loadMarkets();
|
|
120
|
+
const market = this.market(symbol);
|
|
121
|
+
symbol = market['symbol'];
|
|
122
|
+
const messageHash = 'trade:' + market['symbol'];
|
|
123
|
+
const url = this.urls['api']['ws'];
|
|
124
|
+
const request = {
|
|
125
|
+
'type': 'subscribe',
|
|
126
|
+
'channel': market['id'] + '-trades',
|
|
127
|
+
};
|
|
128
|
+
const message = this.extend(request, params);
|
|
129
|
+
const trades = await this.watch(url, messageHash, message, messageHash);
|
|
130
|
+
if (this.newUpdates) {
|
|
131
|
+
limit = trades.getLimit(symbol, limit);
|
|
132
|
+
}
|
|
133
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
134
|
+
}
|
|
135
|
+
handleTrades(client, message) {
|
|
136
|
+
//
|
|
137
|
+
// [
|
|
138
|
+
// [
|
|
139
|
+
// "1663318663", // transaction timestamp (unix time)
|
|
140
|
+
// "2357062", // transaction ID
|
|
141
|
+
// "btc_jpy", // pair
|
|
142
|
+
// "2820896.0", // transaction rate
|
|
143
|
+
// "5.0", // transaction amount
|
|
144
|
+
// "sell", // order side
|
|
145
|
+
// "1193401", // ID of the Taker
|
|
146
|
+
// "2078767" // ID of the Maker
|
|
147
|
+
// ]
|
|
148
|
+
// ]
|
|
149
|
+
//
|
|
150
|
+
const first = this.safeValue(message, 0, []);
|
|
151
|
+
const symbol = this.symbol(this.safeString(first, 2));
|
|
152
|
+
let stored = this.safeValue(this.trades, symbol);
|
|
153
|
+
if (stored === undefined) {
|
|
154
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
155
|
+
stored = new ArrayCache(limit);
|
|
156
|
+
this.trades[symbol] = stored;
|
|
157
|
+
}
|
|
158
|
+
for (let i = 0; i < message.length; i++) {
|
|
159
|
+
const data = this.safeValue(message, i);
|
|
160
|
+
const trade = this.parseWsTrade(data);
|
|
161
|
+
stored.append(trade);
|
|
162
|
+
}
|
|
163
|
+
const messageHash = 'trade:' + symbol;
|
|
164
|
+
client.resolve(stored, messageHash);
|
|
165
|
+
}
|
|
166
|
+
parseWsTrade(trade, market = undefined) {
|
|
167
|
+
//
|
|
168
|
+
// [
|
|
169
|
+
// "1663318663", // transaction timestamp (unix time)
|
|
170
|
+
// "2357062", // transaction ID
|
|
171
|
+
// "btc_jpy", // pair
|
|
172
|
+
// "2820896.0", // transaction rate
|
|
173
|
+
// "5.0", // transaction amount
|
|
174
|
+
// "sell", // order side
|
|
175
|
+
// "1193401", // ID of the Taker
|
|
176
|
+
// "2078767" // ID of the Maker
|
|
177
|
+
// ]
|
|
178
|
+
//
|
|
179
|
+
const symbol = this.symbol(this.safeString(trade, 2));
|
|
180
|
+
const timestamp = this.safeTimestamp(trade, 0);
|
|
181
|
+
const side = this.safeString(trade, 5);
|
|
182
|
+
const priceString = this.safeString(trade, 3);
|
|
183
|
+
const amountString = this.safeString(trade, 4);
|
|
184
|
+
return this.safeTrade({
|
|
185
|
+
'id': this.safeString(trade, 1),
|
|
186
|
+
'info': trade,
|
|
187
|
+
'timestamp': timestamp,
|
|
188
|
+
'datetime': this.iso8601(timestamp),
|
|
189
|
+
'order': undefined,
|
|
190
|
+
'symbol': symbol,
|
|
191
|
+
'type': undefined,
|
|
192
|
+
'side': side,
|
|
193
|
+
'takerOrMaker': undefined,
|
|
194
|
+
'price': priceString,
|
|
195
|
+
'amount': amountString,
|
|
196
|
+
'cost': undefined,
|
|
197
|
+
'fee': undefined,
|
|
198
|
+
}, market);
|
|
199
|
+
}
|
|
200
|
+
handleMessage(client, message) {
|
|
201
|
+
const data = this.safeValue(message, 0);
|
|
202
|
+
if (!Array.isArray(data)) {
|
|
203
|
+
this.handleOrderBook(client, message);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
this.handleTrades(client, message);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
package/js/src/pro/kucoin.js
CHANGED
|
@@ -67,43 +67,51 @@ export default class kucoin extends kucoinRest {
|
|
|
67
67
|
async negotiateHelper(privateChannel, params = {}) {
|
|
68
68
|
let response = undefined;
|
|
69
69
|
const connectId = privateChannel ? 'private' : 'public';
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
try {
|
|
71
|
+
if (privateChannel) {
|
|
72
|
+
response = await this.privatePostBulletPrivate(params);
|
|
73
|
+
//
|
|
74
|
+
// {
|
|
75
|
+
// "code": "200000",
|
|
76
|
+
// "data": {
|
|
77
|
+
// "instanceServers": [
|
|
78
|
+
// {
|
|
79
|
+
// "pingInterval": 50000,
|
|
80
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
81
|
+
// "protocol": "websocket",
|
|
82
|
+
// "encrypt": true,
|
|
83
|
+
// "pingTimeout": 10000
|
|
84
|
+
// }
|
|
85
|
+
// ],
|
|
86
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
87
|
+
// }
|
|
88
|
+
// }
|
|
89
|
+
//
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
response = await this.publicPostBulletPublic(params);
|
|
93
|
+
}
|
|
94
|
+
const data = this.safeValue(response, 'data', {});
|
|
95
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
96
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
97
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
98
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
99
|
+
const token = this.safeString(data, 'token');
|
|
100
|
+
const result = endpoint + '?' + this.urlencode({
|
|
101
|
+
'token': token,
|
|
102
|
+
'privateChannel': privateChannel,
|
|
103
|
+
'connectId': connectId,
|
|
104
|
+
});
|
|
105
|
+
const client = this.client(result);
|
|
106
|
+
client.keepAlive = pingInterval;
|
|
107
|
+
return result;
|
|
89
108
|
}
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
catch (e) {
|
|
110
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
111
|
+
future.reject(e);
|
|
112
|
+
delete this.options['urls'][connectId];
|
|
92
113
|
}
|
|
93
|
-
|
|
94
|
-
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
95
|
-
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
96
|
-
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
97
|
-
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
98
|
-
const token = this.safeString(data, 'token');
|
|
99
|
-
const result = endpoint + '?' + this.urlencode({
|
|
100
|
-
'token': token,
|
|
101
|
-
'privateChannel': privateChannel,
|
|
102
|
-
'connectId': connectId,
|
|
103
|
-
});
|
|
104
|
-
const client = this.client(result);
|
|
105
|
-
client.keepAlive = pingInterval;
|
|
106
|
-
return result;
|
|
114
|
+
return undefined;
|
|
107
115
|
}
|
|
108
116
|
requestId() {
|
|
109
117
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
|
@@ -77,43 +77,51 @@ export default class kucoinfutures extends kucoinfuturesRest {
|
|
|
77
77
|
async negotiateHelper(privateChannel, params = {}) {
|
|
78
78
|
let response = undefined;
|
|
79
79
|
const connectId = privateChannel ? 'private' : 'public';
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
80
|
+
try {
|
|
81
|
+
if (privateChannel) {
|
|
82
|
+
response = await this.futuresPrivatePostBulletPrivate(params);
|
|
83
|
+
//
|
|
84
|
+
// {
|
|
85
|
+
// "code": "200000",
|
|
86
|
+
// "data": {
|
|
87
|
+
// "instanceServers": [
|
|
88
|
+
// {
|
|
89
|
+
// "pingInterval": 50000,
|
|
90
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
91
|
+
// "protocol": "websocket",
|
|
92
|
+
// "encrypt": true,
|
|
93
|
+
// "pingTimeout": 10000
|
|
94
|
+
// }
|
|
95
|
+
// ],
|
|
96
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
99
|
+
//
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
response = await this.futuresPublicPostBulletPublic(params);
|
|
103
|
+
}
|
|
104
|
+
const data = this.safeValue(response, 'data', {});
|
|
105
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
106
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
107
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
108
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
109
|
+
const token = this.safeString(data, 'token');
|
|
110
|
+
const result = endpoint + '?' + this.urlencode({
|
|
111
|
+
'token': token,
|
|
112
|
+
'privateChannel': privateChannel,
|
|
113
|
+
'connectId': connectId,
|
|
114
|
+
});
|
|
115
|
+
const client = this.client(result);
|
|
116
|
+
client.keepAlive = pingInterval;
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
121
|
+
future.reject(e);
|
|
122
|
+
delete this.options['urls'][connectId];
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
117
125
|
}
|
|
118
126
|
requestId() {
|
|
119
127
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
|
@@ -80,43 +80,51 @@ export default class poloniexfutures extends poloniexfuturesRest {
|
|
|
80
80
|
async negotiateHelper(privateChannel, params = {}) {
|
|
81
81
|
let response = undefined;
|
|
82
82
|
const connectId = privateChannel ? 'private' : 'public';
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
try {
|
|
84
|
+
if (privateChannel) {
|
|
85
|
+
response = await this.privatePostBulletPrivate(params);
|
|
86
|
+
//
|
|
87
|
+
// {
|
|
88
|
+
// "code": "200000",
|
|
89
|
+
// "data": {
|
|
90
|
+
// "instanceServers": [
|
|
91
|
+
// {
|
|
92
|
+
// "pingInterval": 50000,
|
|
93
|
+
// "endpoint": "wss://push-private.kucoin.com/endpoint",
|
|
94
|
+
// "protocol": "websocket",
|
|
95
|
+
// "encrypt": true,
|
|
96
|
+
// "pingTimeout": 10000
|
|
97
|
+
// }
|
|
98
|
+
// ],
|
|
99
|
+
// "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ1UQy47YbpY4zVdzilNP-Bj3iXzrjjGlWtiYB9J6i9GjsxUuhPw3BlrzazF6ghq4Lzf7scStOz3KkxjwpsOBCH4=.WNQmhZQeUKIkh97KYgU0Lg=="
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
//
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
response = await this.publicPostBulletPublic(params);
|
|
106
|
+
}
|
|
107
|
+
const data = this.safeValue(response, 'data', {});
|
|
108
|
+
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
109
|
+
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
110
|
+
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
111
|
+
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
112
|
+
const token = this.safeString(data, 'token');
|
|
113
|
+
const result = endpoint + '?' + this.urlencode({
|
|
114
|
+
'token': token,
|
|
115
|
+
'privateChannel': privateChannel,
|
|
116
|
+
'connectId': connectId,
|
|
117
|
+
});
|
|
118
|
+
const client = this.client(result);
|
|
119
|
+
client.keepAlive = pingInterval;
|
|
120
|
+
return result;
|
|
102
121
|
}
|
|
103
|
-
|
|
104
|
-
|
|
122
|
+
catch (e) {
|
|
123
|
+
const future = this.safeValue(this.options['urls'], connectId);
|
|
124
|
+
future.reject(e);
|
|
125
|
+
delete this.options['urls'][connectId];
|
|
105
126
|
}
|
|
106
|
-
|
|
107
|
-
const instanceServers = this.safeValue(data, 'instanceServers', []);
|
|
108
|
-
const firstInstanceServer = this.safeValue(instanceServers, 0);
|
|
109
|
-
const pingInterval = this.safeInteger(firstInstanceServer, 'pingInterval');
|
|
110
|
-
const endpoint = this.safeString(firstInstanceServer, 'endpoint');
|
|
111
|
-
const token = this.safeString(data, 'token');
|
|
112
|
-
const result = endpoint + '?' + this.urlencode({
|
|
113
|
-
'token': token,
|
|
114
|
-
'privateChannel': privateChannel,
|
|
115
|
-
'connectId': connectId,
|
|
116
|
-
});
|
|
117
|
-
const client = this.client(result);
|
|
118
|
-
client.keepAlive = pingInterval;
|
|
119
|
-
return result;
|
|
127
|
+
return undefined;
|
|
120
128
|
}
|
|
121
129
|
requestId() {
|
|
122
130
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
package/js/src/whitebit.js
CHANGED
package/package.json
CHANGED
package/skip-tests.json
CHANGED
|
@@ -107,6 +107,9 @@
|
|
|
107
107
|
"watchTicker": {
|
|
108
108
|
"quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L2466"
|
|
109
109
|
},
|
|
110
|
+
"watchTickers": {
|
|
111
|
+
"quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268171081#L2414"
|
|
112
|
+
},
|
|
110
113
|
"watchOrderBook": "out of order update"
|
|
111
114
|
}
|
|
112
115
|
},
|
|
@@ -634,6 +637,7 @@
|
|
|
634
637
|
}
|
|
635
638
|
},
|
|
636
639
|
"coincheck": {
|
|
640
|
+
"skipWs": true,
|
|
637
641
|
"skipMethods": {
|
|
638
642
|
"loadMarkets":{
|
|
639
643
|
"info":"not provided",
|
|
@@ -902,11 +906,15 @@
|
|
|
902
906
|
"currencyIdAndCode": "messed codes"
|
|
903
907
|
},
|
|
904
908
|
"fetchCurrencies": {
|
|
905
|
-
"fee": "not provided"
|
|
909
|
+
"fee": "not provided",
|
|
910
|
+
"currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268371892#L2455"
|
|
906
911
|
},
|
|
907
912
|
"fetchTickers": {
|
|
908
913
|
"bid":"messed bid-ask",
|
|
909
914
|
"ask":"messed bid-ask"
|
|
915
|
+
},
|
|
916
|
+
"watchOrderBook": {
|
|
917
|
+
"bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268349324#L2400"
|
|
910
918
|
}
|
|
911
919
|
}
|
|
912
920
|
},
|
|
@@ -970,6 +978,9 @@
|
|
|
970
978
|
"contractSize": "broken for some markets",
|
|
971
979
|
"strike": "incorrect number type"
|
|
972
980
|
},
|
|
981
|
+
"fetchCurrencies": {
|
|
982
|
+
"currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/268371892#L2559"
|
|
983
|
+
},
|
|
973
984
|
"fetchTrades": {
|
|
974
985
|
"timestamp": "timestamp is in decimals"
|
|
975
986
|
},
|