ccxt 4.3.86 → 4.3.88
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 +6 -5
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/Exchange.js +2 -2
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/bingx.js +7 -1
- package/dist/cjs/src/hashkey.js +3 -4
- package/dist/cjs/src/kraken.js +37 -6
- package/dist/cjs/src/kucoin.js +2 -0
- package/dist/cjs/src/pro/bitfinex.js +1 -0
- package/dist/cjs/src/pro/bitfinex2.js +1 -0
- package/dist/cjs/src/pro/bitget.js +164 -19
- package/dist/cjs/src/pro/bitopro.js +1 -0
- package/dist/cjs/src/pro/bitstamp.js +1 -0
- package/dist/cjs/src/pro/blockchaincom.js +1 -0
- package/dist/cjs/src/pro/cex.js +1 -0
- package/dist/cjs/src/pro/coincheck.js +1 -0
- package/dist/cjs/src/pro/coinone.js +1 -0
- package/dist/cjs/src/pro/hashkey.js +1 -0
- package/dist/cjs/src/pro/hitbtc.js +1 -0
- package/dist/cjs/src/pro/hollaex.js +1 -0
- package/dist/cjs/src/pro/htx.js +1 -0
- package/dist/cjs/src/pro/huobijp.js +1 -0
- package/dist/cjs/src/pro/hyperliquid.js +7 -0
- package/dist/cjs/src/pro/independentreserve.js +1 -0
- package/dist/cjs/src/pro/lbank.js +1 -0
- package/dist/cjs/src/pro/luno.js +1 -0
- package/dist/cjs/src/pro/ndax.js +5 -0
- package/dist/cjs/src/pro/okcoin.js +7 -0
- package/dist/cjs/src/pro/onetrading.js +1 -0
- package/dist/cjs/src/pro/p2b.js +34 -7
- package/dist/cjs/src/pro/paradex.js +1 -0
- package/dist/cjs/src/pro/poloniex.js +36 -3
- package/dist/cjs/src/pro/poloniexfutures.js +1 -0
- package/dist/cjs/src/pro/probit.js +2 -0
- package/dist/cjs/src/pro/upbit.js +48 -3
- package/dist/cjs/src/pro/vertex.js +1 -0
- package/dist/cjs/src/pro/wazirx.js +3 -0
- package/dist/cjs/src/pro/whitebit.js +9 -0
- package/dist/cjs/src/upbit.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +1 -1
- package/js/src/base/Exchange.js +2 -2
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/bingx.js +7 -1
- package/js/src/coinex.d.ts +1 -1
- package/js/src/hashkey.js +3 -4
- package/js/src/kraken.js +37 -6
- package/js/src/kucoin.js +2 -0
- package/js/src/pro/bitfinex.js +1 -0
- package/js/src/pro/bitfinex2.js +1 -0
- package/js/src/pro/bitget.d.ts +8 -0
- package/js/src/pro/bitget.js +165 -20
- package/js/src/pro/bitopro.js +1 -0
- package/js/src/pro/bitstamp.js +1 -0
- package/js/src/pro/blockchaincom.js +1 -0
- package/js/src/pro/cex.js +1 -0
- package/js/src/pro/coincheck.js +1 -0
- package/js/src/pro/coinone.js +1 -0
- package/js/src/pro/hashkey.js +1 -0
- package/js/src/pro/hitbtc.js +1 -0
- package/js/src/pro/hollaex.js +1 -0
- package/js/src/pro/htx.js +1 -0
- package/js/src/pro/huobijp.js +1 -0
- package/js/src/pro/hyperliquid.js +7 -0
- package/js/src/pro/independentreserve.js +1 -0
- package/js/src/pro/lbank.js +1 -0
- package/js/src/pro/luno.js +1 -0
- package/js/src/pro/ndax.js +5 -0
- package/js/src/pro/okcoin.js +7 -0
- package/js/src/pro/onetrading.js +1 -0
- package/js/src/pro/p2b.d.ts +1 -0
- package/js/src/pro/p2b.js +34 -7
- package/js/src/pro/paradex.js +1 -0
- package/js/src/pro/poloniex.d.ts +1 -0
- package/js/src/pro/poloniex.js +36 -3
- package/js/src/pro/poloniexfutures.js +1 -0
- package/js/src/pro/probit.js +2 -0
- package/js/src/pro/upbit.d.ts +1 -0
- package/js/src/pro/upbit.js +48 -3
- package/js/src/pro/vertex.js +1 -0
- package/js/src/pro/wazirx.js +3 -0
- package/js/src/pro/whitebit.js +9 -0
- package/js/src/upbit.js +1 -1
- package/package.json +1 -1
package/js/src/pro/ndax.js
CHANGED
|
@@ -15,6 +15,7 @@ export default class ndax extends ndaxRest {
|
|
|
15
15
|
'ws': true,
|
|
16
16
|
'watchOrderBook': true,
|
|
17
17
|
'watchTrades': true,
|
|
18
|
+
'watchTradesForSymbols': false,
|
|
18
19
|
'watchTicker': true,
|
|
19
20
|
'watchOHLCV': true,
|
|
20
21
|
},
|
|
@@ -43,6 +44,7 @@ export default class ndax extends ndaxRest {
|
|
|
43
44
|
* @method
|
|
44
45
|
* @name ndax#watchTicker
|
|
45
46
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
47
|
+
* @see https://apidoc.ndax.io/#subscribelevel1
|
|
46
48
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
47
49
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
48
50
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -108,6 +110,7 @@ export default class ndax extends ndaxRest {
|
|
|
108
110
|
* @method
|
|
109
111
|
* @name ndax#watchTrades
|
|
110
112
|
* @description get the list of most recent trades for a particular symbol
|
|
113
|
+
* @see https://apidoc.ndax.io/#subscribetrades
|
|
111
114
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
112
115
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
113
116
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -189,6 +192,7 @@ export default class ndax extends ndaxRest {
|
|
|
189
192
|
* @method
|
|
190
193
|
* @name ndax#watchOHLCV
|
|
191
194
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
195
|
+
* @see https://apidoc.ndax.io/#subscribeticker
|
|
192
196
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
193
197
|
* @param {string} timeframe the length of time each candle represents
|
|
194
198
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -321,6 +325,7 @@ export default class ndax extends ndaxRest {
|
|
|
321
325
|
* @method
|
|
322
326
|
* @name ndax#watchOrderBook
|
|
323
327
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
328
|
+
* @see https://apidoc.ndax.io/#subscribelevel2
|
|
324
329
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
325
330
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
326
331
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
package/js/src/pro/okcoin.js
CHANGED
|
@@ -20,6 +20,7 @@ export default class okcoin extends okcoinRest {
|
|
|
20
20
|
'watchOrderBook': true,
|
|
21
21
|
'watchOrders': true,
|
|
22
22
|
'watchTrades': true,
|
|
23
|
+
'watchTradesForSymbols': false,
|
|
23
24
|
'watchBalance': true,
|
|
24
25
|
'watchOHLCV': true,
|
|
25
26
|
},
|
|
@@ -70,6 +71,7 @@ export default class okcoin extends okcoinRest {
|
|
|
70
71
|
* @method
|
|
71
72
|
* @name okcoin#watchTrades
|
|
72
73
|
* @description get the list of most recent trades for a particular symbol
|
|
74
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-trades-channel
|
|
73
75
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
74
76
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
75
77
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -89,6 +91,7 @@ export default class okcoin extends okcoinRest {
|
|
|
89
91
|
* @method
|
|
90
92
|
* @name okcoin#watchOrders
|
|
91
93
|
* @description watches information on multiple orders made by the user
|
|
94
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-private-channel-order-channel
|
|
92
95
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
93
96
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
94
97
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -175,6 +178,7 @@ export default class okcoin extends okcoinRest {
|
|
|
175
178
|
* @method
|
|
176
179
|
* @name okcoin#watchTicker
|
|
177
180
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
181
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-tickers-channel
|
|
178
182
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
179
183
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
180
184
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -255,6 +259,7 @@ export default class okcoin extends okcoinRest {
|
|
|
255
259
|
* @method
|
|
256
260
|
* @name okcoin#watchOHLCV
|
|
257
261
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
262
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-candlesticks-channel
|
|
258
263
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
259
264
|
* @param {string} timeframe the length of time each candle represents
|
|
260
265
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -322,6 +327,7 @@ export default class okcoin extends okcoinRest {
|
|
|
322
327
|
* @method
|
|
323
328
|
* @name okcoin#watchOrderBook
|
|
324
329
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
330
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-order-book-channel
|
|
325
331
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
326
332
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
327
333
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -485,6 +491,7 @@ export default class okcoin extends okcoinRest {
|
|
|
485
491
|
* @method
|
|
486
492
|
* @name okcoin#watchBalance
|
|
487
493
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
494
|
+
* @see https://www.okcoin.com/docs-v5/en/#websocket-api-private-channel-account-channel
|
|
488
495
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
489
496
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
490
497
|
*/
|
package/js/src/pro/onetrading.js
CHANGED
package/js/src/pro/p2b.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export default class p2b extends p2bRest {
|
|
|
7
7
|
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
8
8
|
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
9
9
|
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
10
|
+
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
10
11
|
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
11
12
|
handleOHLCV(client: Client, message: any): any;
|
|
12
13
|
handleTrade(client: Client, message: any): any;
|
package/js/src/pro/p2b.js
CHANGED
|
@@ -32,6 +32,7 @@ export default class p2b extends p2bRest {
|
|
|
32
32
|
'watchTicker': true,
|
|
33
33
|
'watchTickers': false,
|
|
34
34
|
'watchTrades': true,
|
|
35
|
+
'watchTradesForSymbols': true,
|
|
35
36
|
},
|
|
36
37
|
'urls': {
|
|
37
38
|
'api': {
|
|
@@ -147,15 +148,41 @@ export default class p2b extends p2bRest {
|
|
|
147
148
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
148
149
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
149
150
|
*/
|
|
151
|
+
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
152
|
+
}
|
|
153
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
154
|
+
/**
|
|
155
|
+
* @method
|
|
156
|
+
* @name p2b#watchTradesForSymbols
|
|
157
|
+
* @description get the list of most recent trades for a list of symbols
|
|
158
|
+
* @see https://github.com/P2B-team/P2B-WSS-Public/blob/main/wss_documentation.md#deals
|
|
159
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
160
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
161
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
162
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
163
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
164
|
+
*/
|
|
150
165
|
await this.loadMarkets();
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
166
|
+
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
167
|
+
const messageHashes = [];
|
|
168
|
+
if (symbols !== undefined) {
|
|
169
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
170
|
+
messageHashes.push('deals::' + symbols[i]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const marketIds = this.marketIds(symbols);
|
|
174
|
+
const url = this.urls['api']['ws'];
|
|
175
|
+
const subscribe = {
|
|
176
|
+
'method': 'deals.subscribe',
|
|
177
|
+
'params': marketIds,
|
|
178
|
+
'id': this.milliseconds(),
|
|
179
|
+
};
|
|
180
|
+
const query = this.extend(subscribe, params);
|
|
181
|
+
const trades = await this.watchMultiple(url, messageHashes, query, messageHashes);
|
|
157
182
|
if (this.newUpdates) {
|
|
158
|
-
|
|
183
|
+
const first = this.safeValue(trades, 0);
|
|
184
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
185
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
159
186
|
}
|
|
160
187
|
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
161
188
|
}
|
package/js/src/pro/paradex.js
CHANGED
package/js/src/pro/poloniex.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class poloniex extends poloniexRest {
|
|
|
15
15
|
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
16
16
|
watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
17
17
|
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
18
|
+
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
18
19
|
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
19
20
|
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
20
21
|
watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
package/js/src/pro/poloniex.js
CHANGED
|
@@ -21,6 +21,7 @@ export default class poloniex extends poloniexRest {
|
|
|
21
21
|
'watchTicker': true,
|
|
22
22
|
'watchTickers': true,
|
|
23
23
|
'watchTrades': true,
|
|
24
|
+
'watchTradesForSymbols': true,
|
|
24
25
|
'watchBalance': true,
|
|
25
26
|
'watchStatus': false,
|
|
26
27
|
'watchOrders': true,
|
|
@@ -398,12 +399,44 @@ export default class poloniex extends poloniexRest {
|
|
|
398
399
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
399
400
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
400
401
|
*/
|
|
402
|
+
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
403
|
+
}
|
|
404
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
405
|
+
/**
|
|
406
|
+
* @method
|
|
407
|
+
* @name poloniex#watchTradesForSymbols
|
|
408
|
+
* @description get the list of most recent trades for a list of symbols
|
|
409
|
+
* @see https://api-docs.poloniex.com/spot/websocket/market-data#trades
|
|
410
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
411
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
412
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
413
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
414
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
415
|
+
*/
|
|
401
416
|
await this.loadMarkets();
|
|
402
|
-
|
|
417
|
+
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
403
418
|
const name = 'trades';
|
|
404
|
-
const
|
|
419
|
+
const url = this.urls['api']['ws']['public'];
|
|
420
|
+
const marketIds = this.marketIds(symbols);
|
|
421
|
+
const subscribe = {
|
|
422
|
+
'event': 'subscribe',
|
|
423
|
+
'channel': [
|
|
424
|
+
name,
|
|
425
|
+
],
|
|
426
|
+
'symbols': marketIds,
|
|
427
|
+
};
|
|
428
|
+
const request = this.extend(subscribe, params);
|
|
429
|
+
const messageHashes = [];
|
|
430
|
+
if (symbols !== undefined) {
|
|
431
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
432
|
+
messageHashes.push(name + '::' + symbols[i]);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
const trades = await this.watchMultiple(url, messageHashes, request, messageHashes);
|
|
405
436
|
if (this.newUpdates) {
|
|
406
|
-
|
|
437
|
+
const first = this.safeValue(trades, 0);
|
|
438
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
439
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
407
440
|
}
|
|
408
441
|
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
409
442
|
}
|
package/js/src/pro/probit.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class probit extends probitRest {
|
|
|
18
18
|
'watchTicker': true,
|
|
19
19
|
'watchTickers': false,
|
|
20
20
|
'watchTrades': true,
|
|
21
|
+
'watchTradesForSymbols': false,
|
|
21
22
|
'watchMyTrades': true,
|
|
22
23
|
'watchOrders': true,
|
|
23
24
|
'watchOrderBook': true,
|
|
@@ -225,6 +226,7 @@ export default class probit extends probitRest {
|
|
|
225
226
|
* @method
|
|
226
227
|
* @name probit#watchMyTrades
|
|
227
228
|
* @description get the list of trades associated with the user
|
|
229
|
+
* @see https://docs-en.probit.com/reference/trade_history
|
|
228
230
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
229
231
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
230
232
|
* @param {int} [limit] the maximum amount of trades to fetch
|
package/js/src/pro/upbit.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export default class upbit extends upbitRest {
|
|
|
6
6
|
watchPublic(symbol: string, channel: any, params?: {}): Promise<any>;
|
|
7
7
|
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
8
8
|
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
9
|
+
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
9
10
|
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
10
11
|
handleTicker(client: Client, message: any): void;
|
|
11
12
|
handleOrderBook(client: Client, message: any): void;
|
package/js/src/pro/upbit.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class upbit extends upbitRest {
|
|
|
18
18
|
'watchOrderBook': true,
|
|
19
19
|
'watchTicker': true,
|
|
20
20
|
'watchTrades': true,
|
|
21
|
+
'watchTradesForSymbols': true,
|
|
21
22
|
'watchOrders': true,
|
|
22
23
|
'watchMyTrades': true,
|
|
23
24
|
'watchBalance': true,
|
|
@@ -82,11 +83,55 @@ export default class upbit extends upbitRest {
|
|
|
82
83
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
83
84
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
84
85
|
*/
|
|
86
|
+
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
87
|
+
}
|
|
88
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
89
|
+
/**
|
|
90
|
+
* @method
|
|
91
|
+
* @name upbit#watchTradesForSymbols
|
|
92
|
+
* @description get the list of most recent trades for a list of symbols
|
|
93
|
+
* @see https://global-docs.upbit.com/reference/websocket-trade
|
|
94
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
95
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
96
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
97
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
98
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
99
|
+
*/
|
|
85
100
|
await this.loadMarkets();
|
|
86
|
-
|
|
87
|
-
const
|
|
101
|
+
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
102
|
+
const channel = 'trade';
|
|
103
|
+
const messageHashes = [];
|
|
104
|
+
const url = this.implodeParams(this.urls['api']['ws'], {
|
|
105
|
+
'hostname': this.hostname,
|
|
106
|
+
});
|
|
107
|
+
if (symbols !== undefined) {
|
|
108
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
109
|
+
const market = this.market(symbols[i]);
|
|
110
|
+
const marketId = market['id'];
|
|
111
|
+
const symbol = market['symbol'];
|
|
112
|
+
this.options[channel] = this.safeValue(this.options, channel, {});
|
|
113
|
+
this.options[channel][symbol] = true;
|
|
114
|
+
messageHashes.push(channel + ':' + marketId);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const optionSymbols = Object.keys(this.options[channel]);
|
|
118
|
+
const marketIds = this.marketIds(optionSymbols);
|
|
119
|
+
const request = [
|
|
120
|
+
{
|
|
121
|
+
'ticket': this.uuid(),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
'type': channel,
|
|
125
|
+
'codes': marketIds,
|
|
126
|
+
// 'isOnlySnapshot': false,
|
|
127
|
+
// 'isOnlyRealtime': false,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
const trades = await this.watchMultiple(url, messageHashes, request, messageHashes);
|
|
88
131
|
if (this.newUpdates) {
|
|
89
|
-
|
|
132
|
+
const first = this.safeValue(trades, 0);
|
|
133
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
134
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
90
135
|
}
|
|
91
136
|
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
92
137
|
}
|
package/js/src/pro/vertex.js
CHANGED
package/js/src/pro/wazirx.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class wazirx extends wazirxRest {
|
|
|
18
18
|
'watchTicker': true,
|
|
19
19
|
'watchTickers': true,
|
|
20
20
|
'watchTrades': true,
|
|
21
|
+
'watchTradesForSymbols': false,
|
|
21
22
|
'watchMyTrades': true,
|
|
22
23
|
'watchOrders': true,
|
|
23
24
|
'watchOrderBook': true,
|
|
@@ -287,6 +288,7 @@ export default class wazirx extends wazirxRest {
|
|
|
287
288
|
* @method
|
|
288
289
|
* @name wazirx#watchTrades
|
|
289
290
|
* @description get the list of most recent trades for a particular symbol
|
|
291
|
+
* @see https://docs.wazirx.com/#trade-streams
|
|
290
292
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
291
293
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
292
294
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -384,6 +386,7 @@ export default class wazirx extends wazirxRest {
|
|
|
384
386
|
* @method
|
|
385
387
|
* @name wazirx#watchOHLCV
|
|
386
388
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
389
|
+
* @see https://docs.wazirx.com/#kline-candlestick-stream
|
|
387
390
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
388
391
|
* @param {string} timeframe the length of time each candle represents
|
|
389
392
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
package/js/src/pro/whitebit.js
CHANGED
|
@@ -22,6 +22,7 @@ export default class whitebit extends whitebitRest {
|
|
|
22
22
|
'watchOrders': true,
|
|
23
23
|
'watchTicker': true,
|
|
24
24
|
'watchTrades': true,
|
|
25
|
+
'watchTradesForSymbols': false,
|
|
25
26
|
},
|
|
26
27
|
'urls': {
|
|
27
28
|
'api': {
|
|
@@ -64,6 +65,7 @@ export default class whitebit extends whitebitRest {
|
|
|
64
65
|
* @method
|
|
65
66
|
* @name whitebit#watchOHLCV
|
|
66
67
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
68
|
+
* @see https://docs.whitebit.com/public/websocket/#kline
|
|
67
69
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
68
70
|
* @param {string} timeframe the length of time each candle represents
|
|
69
71
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -138,6 +140,7 @@ export default class whitebit extends whitebitRest {
|
|
|
138
140
|
* @method
|
|
139
141
|
* @name whitebit#watchOrderBook
|
|
140
142
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
143
|
+
* @see https://docs.whitebit.com/public/websocket/#market-depth
|
|
141
144
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
142
145
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
143
146
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -243,6 +246,7 @@ export default class whitebit extends whitebitRest {
|
|
|
243
246
|
* @method
|
|
244
247
|
* @name whitebit#watchTicker
|
|
245
248
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
249
|
+
* @see https://docs.whitebit.com/public/websocket/#market-statistics
|
|
246
250
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
247
251
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
248
252
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -309,6 +313,7 @@ export default class whitebit extends whitebitRest {
|
|
|
309
313
|
* @method
|
|
310
314
|
* @name whitebit#watchTrades
|
|
311
315
|
* @description get the list of most recent trades for a particular symbol
|
|
316
|
+
* @see https://docs.whitebit.com/public/websocket/#market-trades
|
|
312
317
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
313
318
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
314
319
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -375,6 +380,7 @@ export default class whitebit extends whitebitRest {
|
|
|
375
380
|
* @method
|
|
376
381
|
* @name whitebit#watchMyTrades
|
|
377
382
|
* @description watches trades made by the user
|
|
383
|
+
* @see https://docs.whitebit.com/private/websocket/#deals
|
|
378
384
|
* @param {str} symbol unified market symbol
|
|
379
385
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
380
386
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -474,6 +480,7 @@ export default class whitebit extends whitebitRest {
|
|
|
474
480
|
* @method
|
|
475
481
|
* @name whitebit#watchOrders
|
|
476
482
|
* @description watches information on multiple orders made by the user
|
|
483
|
+
* @see https://docs.whitebit.com/private/websocket/#orders-pending
|
|
477
484
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
478
485
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
479
486
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -649,6 +656,8 @@ export default class whitebit extends whitebitRest {
|
|
|
649
656
|
* @method
|
|
650
657
|
* @name whitebit#watchBalance
|
|
651
658
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
659
|
+
* @see https://docs.whitebit.com/private/websocket/#balance-spot
|
|
660
|
+
* @see https://docs.whitebit.com/private/websocket/#balance-margin
|
|
652
661
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
653
662
|
* @param {str} [params.type] spot or contract if not provided this.options['defaultType'] is used
|
|
654
663
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
package/js/src/upbit.js
CHANGED
|
@@ -2004,7 +2004,7 @@ export default class upbit extends Exchange {
|
|
|
2004
2004
|
headers['Content-Type'] = 'application/json';
|
|
2005
2005
|
}
|
|
2006
2006
|
if (hasQuery) {
|
|
2007
|
-
auth = this.
|
|
2007
|
+
auth = this.rawencode(query);
|
|
2008
2008
|
}
|
|
2009
2009
|
if (auth !== undefined) {
|
|
2010
2010
|
const hash = this.hash(this.encode(auth), sha512);
|
package/package.json
CHANGED