ccxt 4.2.78 → 4.2.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +241 -52
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bingx.js +39 -5
- package/dist/cjs/src/bitstamp.js +21 -26
- package/dist/cjs/src/bybit.js +101 -0
- package/dist/cjs/src/coinbaseinternational.js +2 -2
- package/dist/cjs/src/gate.js +3 -1
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/bitfinex2.js +1 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +16 -1
- package/dist/cjs/src/pro/cex.js +9 -5
- package/dist/cjs/src/pro/cryptocom.js +1 -1
- package/dist/cjs/src/pro/hitbtc.js +1 -1
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/okcoin.js +1 -1
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/woo.js +38 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/gate.d.ts +1 -0
- package/js/src/abstract/gateio.d.ts +1 -0
- package/js/src/bingx.js +39 -5
- package/js/src/bitstamp.js +21 -26
- package/js/src/bybit.d.ts +12 -1
- package/js/src/bybit.js +101 -0
- package/js/src/coinbaseinternational.js +2 -2
- package/js/src/gate.js +3 -1
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/bitfinex2.js +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmart.js +1 -1
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +16 -1
- package/js/src/pro/cex.js +9 -5
- package/js/src/pro/cryptocom.js +1 -1
- package/js/src/pro/hitbtc.js +1 -1
- package/js/src/pro/htx.js +1 -1
- package/js/src/pro/okcoin.js +1 -1
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/woo.js +38 -0
- package/package.json +1 -1
package/js/src/bitstamp.js
CHANGED
|
@@ -1122,16 +1122,18 @@ export default class bitstamp extends Exchange {
|
|
|
1122
1122
|
'timestamp': undefined,
|
|
1123
1123
|
'datetime': undefined,
|
|
1124
1124
|
};
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
const
|
|
1125
|
+
if (response === undefined) {
|
|
1126
|
+
response = [];
|
|
1127
|
+
}
|
|
1128
|
+
for (let i = 0; i < response.length; i++) {
|
|
1129
|
+
const currencyBalance = response[i];
|
|
1130
|
+
const currencyId = this.safeString(currencyBalance, 'currency');
|
|
1131
|
+
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
1130
1132
|
const account = this.account();
|
|
1131
|
-
account['free'] = this.safeString(
|
|
1132
|
-
account['used'] = this.safeString(
|
|
1133
|
-
account['total'] = this.safeString(
|
|
1134
|
-
result[
|
|
1133
|
+
account['free'] = this.safeString(currencyBalance, 'available');
|
|
1134
|
+
account['used'] = this.safeString(currencyBalance, 'reserved');
|
|
1135
|
+
account['total'] = this.safeString(currencyBalance, 'total');
|
|
1136
|
+
result[currencyCode] = account;
|
|
1135
1137
|
}
|
|
1136
1138
|
return this.safeBalance(result);
|
|
1137
1139
|
}
|
|
@@ -1145,24 +1147,17 @@ export default class bitstamp extends Exchange {
|
|
|
1145
1147
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1146
1148
|
*/
|
|
1147
1149
|
await this.loadMarkets();
|
|
1148
|
-
const response = await this.
|
|
1150
|
+
const response = await this.privatePostAccountBalances(params);
|
|
1149
1151
|
//
|
|
1150
|
-
//
|
|
1151
|
-
//
|
|
1152
|
-
//
|
|
1153
|
-
//
|
|
1154
|
-
//
|
|
1155
|
-
//
|
|
1156
|
-
//
|
|
1157
|
-
//
|
|
1158
|
-
//
|
|
1159
|
-
// "bat_balance": "0.00000000",
|
|
1160
|
-
// "bat_reserved": "0.00000000",
|
|
1161
|
-
// "bat_withdrawal_fee": "5.00000000",
|
|
1162
|
-
// "batbtc_fee": "0.000",
|
|
1163
|
-
// "bateur_fee": "0.000",
|
|
1164
|
-
// "batusd_fee": "0.000",
|
|
1165
|
-
// }
|
|
1152
|
+
// [
|
|
1153
|
+
// {
|
|
1154
|
+
// "currency": "usdt",
|
|
1155
|
+
// "total": "7.00000",
|
|
1156
|
+
// "available": "7.00000",
|
|
1157
|
+
// "reserved": "0.00000"
|
|
1158
|
+
// },
|
|
1159
|
+
// ...
|
|
1160
|
+
// ]
|
|
1166
1161
|
//
|
|
1167
1162
|
return this.parseBalance(response);
|
|
1168
1163
|
}
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation, Leverage, Num, FundingHistory } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
@@ -256,6 +256,17 @@ export default class bybit extends Exchange {
|
|
|
256
256
|
fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
|
|
257
257
|
parseLeverageTiers(response: any, symbols?: Strings, marketIdKey?: any): {};
|
|
258
258
|
parseMarketLeverageTiers(info: any, market?: Market): any[];
|
|
259
|
+
fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
|
|
260
|
+
parseIncome(income: any, market?: Market): {
|
|
261
|
+
info: any;
|
|
262
|
+
symbol: string;
|
|
263
|
+
code: string;
|
|
264
|
+
timestamp: number;
|
|
265
|
+
datetime: string;
|
|
266
|
+
id: string;
|
|
267
|
+
amount: number;
|
|
268
|
+
rate: number;
|
|
269
|
+
};
|
|
259
270
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
260
271
|
url: string;
|
|
261
272
|
method: string;
|
package/js/src/bybit.js
CHANGED
|
@@ -113,6 +113,7 @@ export default class bybit extends Exchange {
|
|
|
113
113
|
'fetchUnderlyingAssets': false,
|
|
114
114
|
'fetchVolatilityHistory': true,
|
|
115
115
|
'fetchWithdrawals': true,
|
|
116
|
+
'fetchFundingHistory': true,
|
|
116
117
|
'repayCrossMargin': true,
|
|
117
118
|
'setLeverage': true,
|
|
118
119
|
'setMarginMode': true,
|
|
@@ -8113,6 +8114,106 @@ export default class bybit extends Exchange {
|
|
|
8113
8114
|
}
|
|
8114
8115
|
return tiers;
|
|
8115
8116
|
}
|
|
8117
|
+
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8118
|
+
/**
|
|
8119
|
+
* @method
|
|
8120
|
+
* @name bybit#fetchFundingHistory
|
|
8121
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
8122
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
8123
|
+
* @param {string} [symbol] unified market symbol
|
|
8124
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
8125
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
8126
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8127
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
8128
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
8129
|
+
*/
|
|
8130
|
+
await this.loadMarkets();
|
|
8131
|
+
let paginate = false;
|
|
8132
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingHistory', 'paginate');
|
|
8133
|
+
if (paginate) {
|
|
8134
|
+
return await this.fetchPaginatedCallCursor('fetchFundingHistory', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
|
|
8135
|
+
}
|
|
8136
|
+
let request = {
|
|
8137
|
+
'execType': 'Funding',
|
|
8138
|
+
};
|
|
8139
|
+
let market = undefined;
|
|
8140
|
+
if (symbol !== undefined) {
|
|
8141
|
+
market = this.market(symbol);
|
|
8142
|
+
request['symbol'] = market['id'];
|
|
8143
|
+
}
|
|
8144
|
+
let type = undefined;
|
|
8145
|
+
[type, params] = this.getBybitType('fetchFundingHistory', market, params);
|
|
8146
|
+
request['category'] = type;
|
|
8147
|
+
if (symbol !== undefined) {
|
|
8148
|
+
request['symbol'] = market['id'];
|
|
8149
|
+
}
|
|
8150
|
+
if (since !== undefined) {
|
|
8151
|
+
request['startTime'] = since;
|
|
8152
|
+
}
|
|
8153
|
+
if (limit !== undefined) {
|
|
8154
|
+
request['size'] = limit;
|
|
8155
|
+
}
|
|
8156
|
+
else {
|
|
8157
|
+
request['size'] = 100;
|
|
8158
|
+
}
|
|
8159
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
8160
|
+
const response = await this.privateGetV5ExecutionList(this.extend(request, params));
|
|
8161
|
+
const fundings = this.addPaginationCursorToResult(response);
|
|
8162
|
+
return this.parseIncomes(fundings, market, since, limit);
|
|
8163
|
+
}
|
|
8164
|
+
parseIncome(income, market = undefined) {
|
|
8165
|
+
//
|
|
8166
|
+
// {
|
|
8167
|
+
// "symbol": "XMRUSDT",
|
|
8168
|
+
// "orderType": "UNKNOWN",
|
|
8169
|
+
// "underlyingPrice": "",
|
|
8170
|
+
// "orderLinkId": "",
|
|
8171
|
+
// "orderId": "a11e5fe2-1dbf-4bab-a9b2-af80a14efc5d",
|
|
8172
|
+
// "stopOrderType": "UNKNOWN",
|
|
8173
|
+
// "execTime": "1710950400000",
|
|
8174
|
+
// "feeCurrency": "",
|
|
8175
|
+
// "createType": "",
|
|
8176
|
+
// "feeRate": "-0.000761",
|
|
8177
|
+
// "tradeIv": "",
|
|
8178
|
+
// "blockTradeId": "",
|
|
8179
|
+
// "markPrice": "136.79",
|
|
8180
|
+
// "execPrice": "137.11",
|
|
8181
|
+
// "markIv": "",
|
|
8182
|
+
// "orderQty": "0",
|
|
8183
|
+
// "orderPrice": "0",
|
|
8184
|
+
// "execValue": "134.3678",
|
|
8185
|
+
// "closedSize": "0",
|
|
8186
|
+
// "execType": "Funding",
|
|
8187
|
+
// "seq": "28097658790",
|
|
8188
|
+
// "side": "Sell",
|
|
8189
|
+
// "indexPrice": "",
|
|
8190
|
+
// "leavesQty": "0",
|
|
8191
|
+
// "isMaker": false,
|
|
8192
|
+
// "execFee": "-0.10232512",
|
|
8193
|
+
// "execId": "8d1ef156-4ec6-4445-9a6c-1c0c24dbd046",
|
|
8194
|
+
// "marketUnit": "",
|
|
8195
|
+
// "execQty": "0.98",
|
|
8196
|
+
// "nextPageCursor": "5774437%3A0%2C5771289%3A0"
|
|
8197
|
+
// }
|
|
8198
|
+
//
|
|
8199
|
+
const marketId = this.safeString(income, 'symbol');
|
|
8200
|
+
market = this.safeMarket(marketId, market, undefined, 'contract');
|
|
8201
|
+
let code = 'USDT';
|
|
8202
|
+
if (market['inverse']) {
|
|
8203
|
+
code = market['quote'];
|
|
8204
|
+
}
|
|
8205
|
+
const timestamp = this.safeInteger(income, 'execTime');
|
|
8206
|
+
return {
|
|
8207
|
+
'info': income,
|
|
8208
|
+
'symbol': this.safeSymbol(marketId, market, '-', 'swap'),
|
|
8209
|
+
'code': code,
|
|
8210
|
+
'timestamp': timestamp,
|
|
8211
|
+
'datetime': this.iso8601(timestamp),
|
|
8212
|
+
'id': this.safeString(income, 'execId'),
|
|
8213
|
+
'amount': this.safeNumber(income, 'execQty'),
|
|
8214
|
+
'rate': this.safeNumber(income, 'feeRate'),
|
|
8215
|
+
};
|
|
8216
|
+
}
|
|
8116
8217
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
8117
8218
|
let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
|
|
8118
8219
|
if (api === 'public') {
|
|
@@ -120,10 +120,10 @@ export default class coinbaseinternational extends Exchange {
|
|
|
120
120
|
},
|
|
121
121
|
'www': 'https://international.coinbase.com',
|
|
122
122
|
'doc': [
|
|
123
|
-
'https://docs.cloud.
|
|
123
|
+
'https://docs.cloud.coinbase.com/intx/docs',
|
|
124
124
|
],
|
|
125
125
|
'fees': [
|
|
126
|
-
'https://help.
|
|
126
|
+
'https://help.coinbase.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees',
|
|
127
127
|
],
|
|
128
128
|
'referral': '',
|
|
129
129
|
},
|
package/js/src/gate.js
CHANGED
|
@@ -313,6 +313,7 @@ export default class gate extends Exchange {
|
|
|
313
313
|
'loan_records': 20 / 15,
|
|
314
314
|
'interest_records': 20 / 15,
|
|
315
315
|
'estimate_rate': 20 / 15,
|
|
316
|
+
'currency_discount_tiers': 20 / 15,
|
|
316
317
|
},
|
|
317
318
|
'post': {
|
|
318
319
|
'account_mode': 20 / 15,
|
|
@@ -4233,7 +4234,8 @@ export default class gate extends Exchange {
|
|
|
4233
4234
|
'account': account,
|
|
4234
4235
|
};
|
|
4235
4236
|
if (amount !== undefined) {
|
|
4236
|
-
|
|
4237
|
+
const amountKey = (market['spot']) ? 'amount' : 'size';
|
|
4238
|
+
request[amountKey] = this.amountToPrecision(symbol, amount);
|
|
4237
4239
|
}
|
|
4238
4240
|
if (price !== undefined) {
|
|
4239
4241
|
request['price'] = this.priceToPrecision(symbol, price);
|
package/js/src/pro/alpaca.js
CHANGED
package/js/src/pro/bitfinex2.js
CHANGED
|
@@ -864,7 +864,7 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
864
864
|
const message = this.extend(request, params);
|
|
865
865
|
this.watch(url, messageHash, message, messageHash);
|
|
866
866
|
}
|
|
867
|
-
return future;
|
|
867
|
+
return await future;
|
|
868
868
|
}
|
|
869
869
|
handleAuthenticationMessage(client, message) {
|
|
870
870
|
const messageHash = 'authenticated';
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -1610,7 +1610,7 @@ export default class bitget extends bitgetRest {
|
|
|
1610
1610
|
const message = this.extend(request, params);
|
|
1611
1611
|
this.watch(url, messageHash, message, messageHash);
|
|
1612
1612
|
}
|
|
1613
|
-
return future;
|
|
1613
|
+
return await future;
|
|
1614
1614
|
}
|
|
1615
1615
|
async watchPrivate(messageHash, subscriptionHash, args, params = {}) {
|
|
1616
1616
|
await this.authenticate();
|
package/js/src/pro/bitmart.js
CHANGED
|
@@ -1409,7 +1409,7 @@ export default class bitmart extends bitmartRest {
|
|
|
1409
1409
|
const message = this.extend(request, params);
|
|
1410
1410
|
this.watch(url, messageHash, message, messageHash);
|
|
1411
1411
|
}
|
|
1412
|
-
return future;
|
|
1412
|
+
return await future;
|
|
1413
1413
|
}
|
|
1414
1414
|
handleSubscriptionStatus(client, message) {
|
|
1415
1415
|
//
|
package/js/src/pro/bitmex.js
CHANGED
|
@@ -612,7 +612,7 @@ export default class bitmex extends bitmexRest {
|
|
|
612
612
|
const message = this.extend(request, params);
|
|
613
613
|
this.watch(url, messageHash, message, messageHash);
|
|
614
614
|
}
|
|
615
|
-
return future;
|
|
615
|
+
return await future;
|
|
616
616
|
}
|
|
617
617
|
handleAuthenticationMessage(client, message) {
|
|
618
618
|
const authenticated = this.safeBool(message, 'success', false);
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -1040,8 +1040,23 @@ export default class bybit extends bybitRest {
|
|
|
1040
1040
|
for (let i = 0; i < rawPositions.length; i++) {
|
|
1041
1041
|
const rawPosition = rawPositions[i];
|
|
1042
1042
|
const position = this.parsePosition(rawPosition);
|
|
1043
|
+
const side = this.safeString(position, 'side');
|
|
1044
|
+
// hacky solution to handle closing positions
|
|
1045
|
+
// without crashing, we should handle this properly later
|
|
1043
1046
|
newPositions.push(position);
|
|
1044
|
-
|
|
1047
|
+
if (side === undefined || side === '') {
|
|
1048
|
+
// closing update, adding both sides to "reset" both sides
|
|
1049
|
+
// since we don't know which side is being closed
|
|
1050
|
+
position['side'] = 'long';
|
|
1051
|
+
cache.append(position);
|
|
1052
|
+
position['side'] = 'short';
|
|
1053
|
+
cache.append(position);
|
|
1054
|
+
position['side'] = undefined;
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
// regular update
|
|
1058
|
+
cache.append(position);
|
|
1059
|
+
}
|
|
1045
1060
|
}
|
|
1046
1061
|
const messageHashes = this.findMessageHashes(client, 'positions::');
|
|
1047
1062
|
for (let i = 0; i < messageHashes.length; i++) {
|
package/js/src/pro/cex.js
CHANGED
|
@@ -160,16 +160,20 @@ export default class cex extends cexRest {
|
|
|
160
160
|
// {
|
|
161
161
|
// "e": "history",
|
|
162
162
|
// "data": [
|
|
163
|
-
//
|
|
164
|
-
//
|
|
163
|
+
// 'buy:1710255706095:444444:71222.2:14892622'
|
|
164
|
+
// 'sell:1710255658251:42530:71300:14892621'
|
|
165
|
+
// 'buy:1710252424241:87913:72800:14892620'
|
|
166
|
+
// ... timestamp descending
|
|
165
167
|
// ]
|
|
166
168
|
// }
|
|
167
169
|
//
|
|
168
|
-
const data = this.
|
|
170
|
+
const data = this.safeList(message, 'data', []);
|
|
169
171
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
170
172
|
const stored = new ArrayCache(limit);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
const dataLength = data.length;
|
|
174
|
+
for (let i = 0; i < dataLength; i++) {
|
|
175
|
+
const index = dataLength - 1 - i;
|
|
176
|
+
const rawTrade = data[index];
|
|
173
177
|
const parsed = this.parseWsOldTrade(rawTrade);
|
|
174
178
|
stored.append(parsed);
|
|
175
179
|
}
|
package/js/src/pro/cryptocom.js
CHANGED
|
@@ -1006,7 +1006,7 @@ export default class cryptocom extends cryptocomRest {
|
|
|
1006
1006
|
const message = this.extend(request, params);
|
|
1007
1007
|
this.watch(url, messageHash, message, messageHash);
|
|
1008
1008
|
}
|
|
1009
|
-
return future;
|
|
1009
|
+
return await future;
|
|
1010
1010
|
}
|
|
1011
1011
|
handlePing(client, message) {
|
|
1012
1012
|
this.spawn(this.pong, client, message);
|
package/js/src/pro/hitbtc.js
CHANGED
package/js/src/pro/htx.js
CHANGED
package/js/src/pro/okcoin.js
CHANGED
package/js/src/pro/onetrading.js
CHANGED
package/js/src/pro/woo.js
CHANGED
|
@@ -85,6 +85,15 @@ export default class woo extends wooRest {
|
|
|
85
85
|
return await this.watch(url, messageHash, request, messageHash, subscribe);
|
|
86
86
|
}
|
|
87
87
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
88
|
+
/**
|
|
89
|
+
* @method
|
|
90
|
+
* @name woo#watchOrderBook
|
|
91
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
92
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
93
|
+
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
94
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
95
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
96
|
+
*/
|
|
88
97
|
await this.loadMarkets();
|
|
89
98
|
const name = 'orderbook';
|
|
90
99
|
const market = this.market(symbol);
|
|
@@ -134,9 +143,18 @@ export default class woo extends wooRest {
|
|
|
134
143
|
client.resolve(orderbook, topic);
|
|
135
144
|
}
|
|
136
145
|
async watchTicker(symbol, params = {}) {
|
|
146
|
+
/**
|
|
147
|
+
* @method
|
|
148
|
+
* @name woo#watchTicker
|
|
149
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
150
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
151
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
152
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
153
|
+
*/
|
|
137
154
|
await this.loadMarkets();
|
|
138
155
|
const name = 'ticker';
|
|
139
156
|
const market = this.market(symbol);
|
|
157
|
+
symbol = market['symbol'];
|
|
140
158
|
const topic = market['id'] + '@' + name;
|
|
141
159
|
const request = {
|
|
142
160
|
'event': 'subscribe',
|
|
@@ -211,7 +229,16 @@ export default class woo extends wooRest {
|
|
|
211
229
|
return message;
|
|
212
230
|
}
|
|
213
231
|
async watchTickers(symbols = undefined, params = {}) {
|
|
232
|
+
/**
|
|
233
|
+
* @method
|
|
234
|
+
* @name woo#watchTickers
|
|
235
|
+
* @description n watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
236
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
237
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
238
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
239
|
+
*/
|
|
214
240
|
await this.loadMarkets();
|
|
241
|
+
symbols = this.marketSymbols(symbols);
|
|
215
242
|
const name = 'tickers';
|
|
216
243
|
const topic = name;
|
|
217
244
|
const request = {
|
|
@@ -330,8 +357,19 @@ export default class woo extends wooRest {
|
|
|
330
357
|
client.resolve(stored, topic);
|
|
331
358
|
}
|
|
332
359
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
360
|
+
/**
|
|
361
|
+
* @method
|
|
362
|
+
* @name woo#watchTrades
|
|
363
|
+
* @description watches information on multiple trades made in a market
|
|
364
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
365
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
366
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
367
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
368
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
369
|
+
*/
|
|
333
370
|
await this.loadMarkets();
|
|
334
371
|
const market = this.market(symbol);
|
|
372
|
+
symbol = market['symbol'];
|
|
335
373
|
const topic = market['id'] + '@trade';
|
|
336
374
|
const request = {
|
|
337
375
|
'event': 'subscribe',
|
package/package.json
CHANGED