ccxt 4.2.49 → 4.2.50
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 +3 -3
- package/dist/ccxt.browser.js +220 -17
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +5 -0
- package/dist/cjs/src/binance.js +2 -1
- package/dist/cjs/src/bl3p.js +47 -0
- package/dist/cjs/src/pro/bequant.js +3 -4
- package/dist/cjs/src/pro/binance.js +29 -2
- package/dist/cjs/src/pro/gemini.js +89 -1
- package/dist/cjs/src/pro/whitebit.js +9 -8
- package/dist/cjs/src/timex.js +35 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +5 -0
- package/js/src/binance.js +2 -1
- package/js/src/bl3p.d.ts +15 -1
- package/js/src/bl3p.js +47 -0
- package/js/src/pro/bequant.js +3 -4
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +29 -2
- package/js/src/pro/gemini.d.ts +3 -1
- package/js/src/pro/gemini.js +89 -1
- package/js/src/pro/whitebit.js +9 -8
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/timex.d.ts +1 -0
- package/js/src/timex.js +35 -1
- package/package.json +1 -1
- package/skip-tests.json +0 -1
package/js/src/bl3p.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class bl3p extends Exchange {
|
|
|
35
35
|
'cancelOrder': true,
|
|
36
36
|
'closeAllPositions': false,
|
|
37
37
|
'closePosition': false,
|
|
38
|
+
'createDepositAddress': true,
|
|
38
39
|
'createOrder': true,
|
|
39
40
|
'createReduceOnlyOrder': false,
|
|
40
41
|
'createStopLimitOrder': false,
|
|
@@ -45,6 +46,9 @@ export default class bl3p extends Exchange {
|
|
|
45
46
|
'fetchBorrowRateHistory': false,
|
|
46
47
|
'fetchCrossBorrowRate': false,
|
|
47
48
|
'fetchCrossBorrowRates': false,
|
|
49
|
+
'fetchDepositAddress': false,
|
|
50
|
+
'fetchDepositAddresses': false,
|
|
51
|
+
'fetchDepositAddressesByNetwork': false,
|
|
48
52
|
'fetchFundingHistory': false,
|
|
49
53
|
'fetchFundingRate': false,
|
|
50
54
|
'fetchFundingRateHistory': false,
|
|
@@ -426,6 +430,49 @@ export default class bl3p extends Exchange {
|
|
|
426
430
|
};
|
|
427
431
|
return await this.privatePostMarketMoneyOrderCancel(this.extend(request, params));
|
|
428
432
|
}
|
|
433
|
+
async createDepositAddress(code, params = {}) {
|
|
434
|
+
/**
|
|
435
|
+
* @method
|
|
436
|
+
* @name bl3p#createDepositAddress
|
|
437
|
+
* @description create a currency deposit address
|
|
438
|
+
* @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#32---create-a-new-deposit-address
|
|
439
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
440
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
441
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
442
|
+
*/
|
|
443
|
+
await this.loadMarkets();
|
|
444
|
+
const currency = this.currency(code);
|
|
445
|
+
const request = {
|
|
446
|
+
'currency': currency['id'],
|
|
447
|
+
};
|
|
448
|
+
const response = await this.privatePostGENMKTMoneyNewDepositAddress(this.extend(request, params));
|
|
449
|
+
//
|
|
450
|
+
// {
|
|
451
|
+
// "result": "success",
|
|
452
|
+
// "data": {
|
|
453
|
+
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
|
454
|
+
// }
|
|
455
|
+
// }
|
|
456
|
+
//
|
|
457
|
+
const data = this.safeDict(response, 'data');
|
|
458
|
+
return this.parseDepositAddress(data, currency);
|
|
459
|
+
}
|
|
460
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
461
|
+
//
|
|
462
|
+
// {
|
|
463
|
+
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
|
464
|
+
// }
|
|
465
|
+
//
|
|
466
|
+
const address = this.safeString(depositAddress, 'address');
|
|
467
|
+
this.checkAddress(address);
|
|
468
|
+
return {
|
|
469
|
+
'info': depositAddress,
|
|
470
|
+
'currency': this.safeString(currency, 'code'),
|
|
471
|
+
'address': address,
|
|
472
|
+
'tag': undefined,
|
|
473
|
+
'network': undefined,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
429
476
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
430
477
|
const request = this.implodeParams(path, params);
|
|
431
478
|
let url = this.urls['api']['rest'] + '/' + this.version + '/' + request;
|
package/js/src/pro/bequant.js
CHANGED
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import hitbtc from './hitbtc.js';
|
|
9
|
+
import hitbtcRest from '../hitbtc.js';
|
|
9
10
|
import bequantRest from '../bequant.js';
|
|
10
11
|
// ---------------------------------------------------------------------------
|
|
11
12
|
export default class bequant extends hitbtc {
|
|
12
13
|
describe() {
|
|
13
14
|
// eslint-disable-next-line new-cap
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
17
|
-
return this.deepExtend(extended, {
|
|
15
|
+
const describeExtended = this.getDescribeForExtendedWsExchange(new bequantRest(), new hitbtcRest(), super.describe());
|
|
16
|
+
return this.deepExtend(describeExtended, {
|
|
18
17
|
'id': 'bequant',
|
|
19
18
|
'name': 'Bequant',
|
|
20
19
|
'countries': ['MT'],
|
package/js/src/pro/binance.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export default class binance extends binanceRest {
|
|
|
44
44
|
cancelAllOrdersWs(symbol?: Str, params?: {}): Promise<any>;
|
|
45
45
|
fetchOrderWs(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
46
46
|
fetchOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
47
|
+
fetchClosedOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
47
48
|
fetchOpenOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
48
49
|
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
49
50
|
parseWsOrder(order: any, market?: any): Order;
|
package/js/src/pro/binance.js
CHANGED
|
@@ -37,10 +37,15 @@ export default class binance extends binanceRest {
|
|
|
37
37
|
'cancelOrderWs': true,
|
|
38
38
|
'cancelOrdersWs': false,
|
|
39
39
|
'cancelAllOrdersWs': true,
|
|
40
|
-
'fetchOrderWs': true,
|
|
41
|
-
'fetchOrdersWs': true,
|
|
42
40
|
'fetchBalanceWs': true,
|
|
41
|
+
'fetchDepositsWs': false,
|
|
42
|
+
'fetchMarketsWs': false,
|
|
43
43
|
'fetchMyTradesWs': true,
|
|
44
|
+
'fetchOpenOrdersWs': true,
|
|
45
|
+
'fetchOrderWs': true,
|
|
46
|
+
'fetchOrdersWs': true,
|
|
47
|
+
'fetchTradingFeesWs': false,
|
|
48
|
+
'fetchWithdrawalsWs': false,
|
|
44
49
|
},
|
|
45
50
|
'urls': {
|
|
46
51
|
'test': {
|
|
@@ -1941,6 +1946,28 @@ export default class binance extends binanceRest {
|
|
|
1941
1946
|
const orders = await this.watch(url, messageHash, message, messageHash, subscription);
|
|
1942
1947
|
return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
|
|
1943
1948
|
}
|
|
1949
|
+
async fetchClosedOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1950
|
+
/**
|
|
1951
|
+
* @method
|
|
1952
|
+
* @name binance#fetchClosedOrdersWs
|
|
1953
|
+
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data
|
|
1954
|
+
* @description fetch closed orders
|
|
1955
|
+
* @param {string} symbol unified market symbol
|
|
1956
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1957
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1958
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1959
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1960
|
+
*/
|
|
1961
|
+
const orders = await this.fetchOrdersWs(symbol, since, limit, params);
|
|
1962
|
+
const closedOrders = [];
|
|
1963
|
+
for (let i = 0; i < orders.length; i++) {
|
|
1964
|
+
const order = orders[i];
|
|
1965
|
+
if (order['status'] === 'closed') {
|
|
1966
|
+
closedOrders.push(order);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
return closedOrders;
|
|
1970
|
+
}
|
|
1944
1971
|
async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1945
1972
|
/**
|
|
1946
1973
|
* @method
|
package/js/src/pro/gemini.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import geminiRest from '../gemini.js';
|
|
2
|
-
import type { Int, Str, OrderBook, Order, Trade, OHLCV } from '../base/types.js';
|
|
2
|
+
import type { Int, Str, OrderBook, Order, Trade, OHLCV, Tickers } from '../base/types.js';
|
|
3
3
|
import Client from '../base/ws/Client.js';
|
|
4
4
|
export default class gemini extends geminiRest {
|
|
5
5
|
describe(): any;
|
|
@@ -14,6 +14,8 @@ export default class gemini extends geminiRest {
|
|
|
14
14
|
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
15
15
|
handleOrderBook(client: Client, message: any): void;
|
|
16
16
|
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
|
|
17
|
+
watchBidsAsks(symbols: string[], limit?: Int, params?: {}): Promise<Tickers>;
|
|
18
|
+
handleBidsAsksForMultidata(client: Client, rawBidAskChanges: any, timestamp: Int, nonce: Int): void;
|
|
17
19
|
helperForWatchMultipleConstruct(itemHashName: string, symbols: string[], params?: {}): Promise<any>;
|
|
18
20
|
handleOrderBookForMultidata(client: Client, rawOrderBookChanges: any, timestamp: Int, nonce: Int): void;
|
|
19
21
|
handleL2Updates(client: Client, message: any): void;
|
package/js/src/pro/gemini.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class gemini extends geminiRest {
|
|
|
18
18
|
'watchBalance': false,
|
|
19
19
|
'watchTicker': false,
|
|
20
20
|
'watchTickers': false,
|
|
21
|
+
'watchBidsAsks': true,
|
|
21
22
|
'watchTrades': true,
|
|
22
23
|
'watchTradesForSymbols': true,
|
|
23
24
|
'watchMyTrades': false,
|
|
@@ -417,6 +418,79 @@ export default class gemini extends geminiRest {
|
|
|
417
418
|
const orderbook = await this.helperForWatchMultipleConstruct('orderbook', symbols, params);
|
|
418
419
|
return orderbook.limit();
|
|
419
420
|
}
|
|
421
|
+
async watchBidsAsks(symbols, limit = undefined, params = {}) {
|
|
422
|
+
/**
|
|
423
|
+
* @method
|
|
424
|
+
* @name gemini#watchBidsAsks
|
|
425
|
+
* @description watches best bid & ask for symbols
|
|
426
|
+
* @see https://docs.gemini.com/websocket-api/#multi-market-data
|
|
427
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
428
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
429
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
430
|
+
*/
|
|
431
|
+
return await this.helperForWatchMultipleConstruct('bidsasks', symbols, params);
|
|
432
|
+
}
|
|
433
|
+
handleBidsAsksForMultidata(client, rawBidAskChanges, timestamp, nonce) {
|
|
434
|
+
//
|
|
435
|
+
// {
|
|
436
|
+
// eventId: '1683002916916153',
|
|
437
|
+
// events: [
|
|
438
|
+
// {
|
|
439
|
+
// price: '50945.37',
|
|
440
|
+
// reason: 'top-of-book',
|
|
441
|
+
// remaining: '0.0',
|
|
442
|
+
// side: 'bid',
|
|
443
|
+
// symbol: 'BTCUSDT',
|
|
444
|
+
// type: 'change'
|
|
445
|
+
// },
|
|
446
|
+
// {
|
|
447
|
+
// price: '50947.75',
|
|
448
|
+
// reason: 'top-of-book',
|
|
449
|
+
// remaining: '0.11725',
|
|
450
|
+
// side: 'bid',
|
|
451
|
+
// symbol: 'BTCUSDT',
|
|
452
|
+
// type: 'change'
|
|
453
|
+
// }
|
|
454
|
+
// ],
|
|
455
|
+
// socket_sequence: 322,
|
|
456
|
+
// timestamp: 1708674495,
|
|
457
|
+
// timestampms: 1708674495174,
|
|
458
|
+
// type: 'update'
|
|
459
|
+
// }
|
|
460
|
+
//
|
|
461
|
+
const marketId = rawBidAskChanges[0]['symbol'];
|
|
462
|
+
const market = this.safeMarket(marketId.toLowerCase());
|
|
463
|
+
const symbol = market['symbol'];
|
|
464
|
+
if (!(symbol in this.bidsasks)) {
|
|
465
|
+
this.bidsasks[symbol] = this.parseTicker({});
|
|
466
|
+
this.bidsasks[symbol]['symbol'] = symbol;
|
|
467
|
+
}
|
|
468
|
+
const currentBidAsk = this.bidsasks[symbol];
|
|
469
|
+
const messageHash = 'bidsasks:' + symbol;
|
|
470
|
+
// last update always overwrites the previous state and is the latest state
|
|
471
|
+
for (let i = 0; i < rawBidAskChanges.length; i++) {
|
|
472
|
+
const entry = rawBidAskChanges[i];
|
|
473
|
+
const rawSide = this.safeString(entry, 'side');
|
|
474
|
+
const price = this.safeNumber(entry, 'price');
|
|
475
|
+
const size = this.safeNumber(entry, 'remaining');
|
|
476
|
+
if (size === 0) {
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
if (rawSide === 'bid') {
|
|
480
|
+
currentBidAsk['bid'] = price;
|
|
481
|
+
currentBidAsk['bidVolume'] = size;
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
currentBidAsk['ask'] = price;
|
|
485
|
+
currentBidAsk['askVolume'] = size;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
currentBidAsk['timestamp'] = timestamp;
|
|
489
|
+
currentBidAsk['datetime'] = this.iso8601(timestamp);
|
|
490
|
+
currentBidAsk['info'] = rawBidAskChanges;
|
|
491
|
+
this.bidsasks[symbol] = currentBidAsk;
|
|
492
|
+
client.resolve(currentBidAsk, messageHash);
|
|
493
|
+
}
|
|
420
494
|
async helperForWatchMultipleConstruct(itemHashName, symbols, params = {}) {
|
|
421
495
|
await this.loadMarkets();
|
|
422
496
|
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
@@ -438,6 +512,9 @@ export default class gemini extends geminiRest {
|
|
|
438
512
|
if (itemHashName === 'orderbook') {
|
|
439
513
|
url += 'trades=false&bids=true&offers=true';
|
|
440
514
|
}
|
|
515
|
+
else if (itemHashName === 'bidsasks') {
|
|
516
|
+
url += 'trades=false&bids=true&offers=true&top_of_book=true';
|
|
517
|
+
}
|
|
441
518
|
else if (itemHashName === 'trades') {
|
|
442
519
|
url += 'trades=true&bids=false&offers=false';
|
|
443
520
|
}
|
|
@@ -780,18 +857,29 @@ export default class gemini extends geminiRest {
|
|
|
780
857
|
const eventId = this.safeInteger(message, 'eventId');
|
|
781
858
|
const events = this.safeList(message, 'events');
|
|
782
859
|
const orderBookItems = [];
|
|
860
|
+
const bidaskItems = [];
|
|
783
861
|
const collectedEventsOfTrades = [];
|
|
862
|
+
const eventsLength = events.length;
|
|
784
863
|
for (let i = 0; i < events.length; i++) {
|
|
785
864
|
const event = events[i];
|
|
786
865
|
const eventType = this.safeString(event, 'type');
|
|
787
866
|
const isOrderBook = (eventType === 'change') && ('side' in event) && this.inArray(event['side'], ['ask', 'bid']);
|
|
788
|
-
|
|
867
|
+
const eventReason = this.safeString(event, 'reason');
|
|
868
|
+
const isBidAsk = (eventReason === 'top-of-book') || (isOrderBook && (eventReason === 'initial') && eventsLength === 2);
|
|
869
|
+
if (isBidAsk) {
|
|
870
|
+
bidaskItems.push(event);
|
|
871
|
+
}
|
|
872
|
+
else if (isOrderBook) {
|
|
789
873
|
orderBookItems.push(event);
|
|
790
874
|
}
|
|
791
875
|
else if (eventType === 'trade') {
|
|
792
876
|
collectedEventsOfTrades.push(events[i]);
|
|
793
877
|
}
|
|
794
878
|
}
|
|
879
|
+
const lengthBa = bidaskItems.length;
|
|
880
|
+
if (lengthBa > 0) {
|
|
881
|
+
this.handleBidsAsksForMultidata(client, bidaskItems, ts, eventId);
|
|
882
|
+
}
|
|
795
883
|
const lengthOb = orderBookItems.length;
|
|
796
884
|
if (lengthOb > 0) {
|
|
797
885
|
this.handleOrderBookForMultidata(client, orderBookItems, ts, eventId);
|
package/js/src/pro/whitebit.js
CHANGED
|
@@ -166,6 +166,7 @@ export default class whitebit extends whitebitRest {
|
|
|
166
166
|
// "params":[
|
|
167
167
|
// true,
|
|
168
168
|
// {
|
|
169
|
+
// "timestamp": 1708679568.940867,
|
|
169
170
|
// "asks":[
|
|
170
171
|
// [ "21252.45","0.01957"],
|
|
171
172
|
// ["21252.55","0.126205"],
|
|
@@ -202,14 +203,14 @@ export default class whitebit extends whitebitRest {
|
|
|
202
203
|
const market = this.safeMarket(marketId);
|
|
203
204
|
const symbol = market['symbol'];
|
|
204
205
|
const data = this.safeValue(params, 1);
|
|
205
|
-
|
|
206
|
-
if (symbol in this.orderbooks) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
const timestamp = this.safeTimestamp(data, 'timestamp');
|
|
207
|
+
if (!(symbol in this.orderbooks)) {
|
|
208
|
+
const ob = this.orderBook();
|
|
209
|
+
this.orderbooks[symbol] = ob;
|
|
210
|
+
}
|
|
211
|
+
const orderbook = this.orderbooks[symbol];
|
|
212
|
+
orderbook['timestamp'] = timestamp;
|
|
213
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
213
214
|
if (isSnapshot) {
|
|
214
215
|
const snapshot = this.parseOrderBook(data, symbol);
|
|
215
216
|
orderbook.reset(snapshot);
|
|
@@ -15,7 +15,7 @@ export declare class BigInteger {
|
|
|
15
15
|
protected intValue(): number;
|
|
16
16
|
protected byteValue(): number;
|
|
17
17
|
protected shortValue(): number;
|
|
18
|
-
protected signum():
|
|
18
|
+
protected signum(): 0 | 1 | -1;
|
|
19
19
|
toByteArray(): number[];
|
|
20
20
|
protected equals(a: BigInteger): boolean;
|
|
21
21
|
protected min(a: BigInteger): BigInteger;
|
package/js/src/timex.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSid
|
|
|
6
6
|
*/
|
|
7
7
|
export default class timex extends Exchange {
|
|
8
8
|
describe(): any;
|
|
9
|
+
fetchTime(params?: {}): Promise<number>;
|
|
9
10
|
fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
|
|
10
11
|
fetchCurrencies(params?: {}): Promise<{}>;
|
|
11
12
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
package/js/src/timex.js
CHANGED
|
@@ -73,6 +73,7 @@ export default class timex extends Exchange {
|
|
|
73
73
|
'fetchPremiumIndexOHLCV': false,
|
|
74
74
|
'fetchTicker': true,
|
|
75
75
|
'fetchTickers': true,
|
|
76
|
+
'fetchTime': true,
|
|
76
77
|
'fetchTrades': true,
|
|
77
78
|
'fetchTradingFee': true,
|
|
78
79
|
'fetchWithdrawal': false,
|
|
@@ -268,11 +269,26 @@ export default class timex extends Exchange {
|
|
|
268
269
|
},
|
|
269
270
|
});
|
|
270
271
|
}
|
|
272
|
+
async fetchTime(params = {}) {
|
|
273
|
+
/**
|
|
274
|
+
* @method
|
|
275
|
+
* @name timex#fetchTime
|
|
276
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
277
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
278
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
279
|
+
*/
|
|
280
|
+
const response = await this.tradingviewGetTime(params);
|
|
281
|
+
//
|
|
282
|
+
// 1708682617
|
|
283
|
+
//
|
|
284
|
+
return this.parseToInt(response) * 1000;
|
|
285
|
+
}
|
|
271
286
|
async fetchMarkets(params = {}) {
|
|
272
287
|
/**
|
|
273
288
|
* @method
|
|
274
289
|
* @name timex#fetchMarkets
|
|
275
290
|
* @description retrieves data on all markets for timex
|
|
291
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listMarkets
|
|
276
292
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
277
293
|
* @returns {object[]} an array of objects representing market data
|
|
278
294
|
*/
|
|
@@ -305,6 +321,7 @@ export default class timex extends Exchange {
|
|
|
305
321
|
* @method
|
|
306
322
|
* @name timex#fetchCurrencies
|
|
307
323
|
* @description fetches all available currencies on an exchange
|
|
324
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCurrencies
|
|
308
325
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
309
326
|
* @returns {object} an associative dictionary of currencies
|
|
310
327
|
*/
|
|
@@ -346,6 +363,7 @@ export default class timex extends Exchange {
|
|
|
346
363
|
* @method
|
|
347
364
|
* @name timex#fetchDeposits
|
|
348
365
|
* @description fetch all deposits made to an account
|
|
366
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getDeposits
|
|
349
367
|
* @param {string} code unified currency code
|
|
350
368
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
351
369
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -381,6 +399,7 @@ export default class timex extends Exchange {
|
|
|
381
399
|
* @method
|
|
382
400
|
* @name timex#fetchWithdrawals
|
|
383
401
|
* @description fetch all withdrawals made to an account
|
|
402
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getWithdraws
|
|
384
403
|
* @param {string} code unified currency code
|
|
385
404
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
386
405
|
* @param {int} [limit] the maximum number of transaction structures to retrieve
|
|
@@ -465,6 +484,7 @@ export default class timex extends Exchange {
|
|
|
465
484
|
* @method
|
|
466
485
|
* @name timex#fetchTickers
|
|
467
486
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
487
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
|
|
468
488
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
469
489
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
470
490
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -499,6 +519,7 @@ export default class timex extends Exchange {
|
|
|
499
519
|
* @method
|
|
500
520
|
* @name timex#fetchTicker
|
|
501
521
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
522
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
|
|
502
523
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
503
524
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
504
525
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -536,6 +557,7 @@ export default class timex extends Exchange {
|
|
|
536
557
|
* @method
|
|
537
558
|
* @name timex#fetchOrderBook
|
|
538
559
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
560
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/orderbookV2
|
|
539
561
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
540
562
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
541
563
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -582,6 +604,7 @@ export default class timex extends Exchange {
|
|
|
582
604
|
* @method
|
|
583
605
|
* @name timex#fetchTrades
|
|
584
606
|
* @description get the list of most recent trades for a particular symbol
|
|
607
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTrades
|
|
585
608
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
586
609
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
587
610
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -629,6 +652,7 @@ export default class timex extends Exchange {
|
|
|
629
652
|
* @method
|
|
630
653
|
* @name timex#fetchOHLCV
|
|
631
654
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
655
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCandles
|
|
632
656
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
633
657
|
* @param {string} timeframe the length of time each candle represents
|
|
634
658
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -694,6 +718,7 @@ export default class timex extends Exchange {
|
|
|
694
718
|
* @method
|
|
695
719
|
* @name timex#fetchBalance
|
|
696
720
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
721
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getBalances
|
|
697
722
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
698
723
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
699
724
|
*/
|
|
@@ -715,6 +740,7 @@ export default class timex extends Exchange {
|
|
|
715
740
|
* @method
|
|
716
741
|
* @name timex#createOrder
|
|
717
742
|
* @description create a trade order
|
|
743
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/createOrder
|
|
718
744
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
719
745
|
* @param {string} type 'market' or 'limit'
|
|
720
746
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -843,6 +869,7 @@ export default class timex extends Exchange {
|
|
|
843
869
|
* @method
|
|
844
870
|
* @name timex#cancelOrder
|
|
845
871
|
* @description cancels an open order
|
|
872
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
|
|
846
873
|
* @param {string} id order id
|
|
847
874
|
* @param {string} symbol not used by timex cancelOrder ()
|
|
848
875
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -856,6 +883,7 @@ export default class timex extends Exchange {
|
|
|
856
883
|
* @method
|
|
857
884
|
* @name timex#cancelOrders
|
|
858
885
|
* @description cancel multiple orders
|
|
886
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
|
|
859
887
|
* @param {string[]} ids order ids
|
|
860
888
|
* @param {string} symbol unified market symbol, default is undefined
|
|
861
889
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -897,6 +925,7 @@ export default class timex extends Exchange {
|
|
|
897
925
|
* @method
|
|
898
926
|
* @name timex#fetchOrder
|
|
899
927
|
* @description fetches information on an order made by the user
|
|
928
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrderDetails
|
|
900
929
|
* @param {string} symbol not used by timex fetchOrder
|
|
901
930
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
902
931
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -948,6 +977,7 @@ export default class timex extends Exchange {
|
|
|
948
977
|
* @method
|
|
949
978
|
* @name timex#fetchOpenOrders
|
|
950
979
|
* @description fetch all unfilled currently open orders
|
|
980
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getOpenOrders
|
|
951
981
|
* @param {string} symbol unified market symbol
|
|
952
982
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
953
983
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1002,6 +1032,7 @@ export default class timex extends Exchange {
|
|
|
1002
1032
|
* @method
|
|
1003
1033
|
* @name timex#fetchClosedOrders
|
|
1004
1034
|
* @description fetches information on multiple closed orders made by the user
|
|
1035
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrders
|
|
1005
1036
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1006
1037
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1007
1038
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1061,6 +1092,7 @@ export default class timex extends Exchange {
|
|
|
1061
1092
|
* @method
|
|
1062
1093
|
* @name timex#fetchMyTrades
|
|
1063
1094
|
* @description fetch all trades made by the user
|
|
1095
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getTrades_1
|
|
1064
1096
|
* @param {string} symbol unified market symbol
|
|
1065
1097
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1066
1098
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1139,6 +1171,7 @@ export default class timex extends Exchange {
|
|
|
1139
1171
|
* @method
|
|
1140
1172
|
* @name timex#fetchTradingFee
|
|
1141
1173
|
* @description fetch the trading fees for a market
|
|
1174
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getFees
|
|
1142
1175
|
* @param {string} symbol unified market symbol
|
|
1143
1176
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1144
1177
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
@@ -1532,6 +1565,7 @@ export default class timex extends Exchange {
|
|
|
1532
1565
|
* @method
|
|
1533
1566
|
* @name timex#fetchDepositAddress
|
|
1534
1567
|
* @description fetch the deposit address for a currency associated with this account, does not accept params["network"]
|
|
1568
|
+
* @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
|
|
1535
1569
|
* @param {string} code unified currency code
|
|
1536
1570
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1537
1571
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1594,7 +1628,7 @@ export default class timex extends Exchange {
|
|
|
1594
1628
|
if (Object.keys(params).length) {
|
|
1595
1629
|
url += '?' + this.urlencodeWithArrayRepeat(params);
|
|
1596
1630
|
}
|
|
1597
|
-
if (api !== 'public') {
|
|
1631
|
+
if (api !== 'public' && api !== 'tradingview') {
|
|
1598
1632
|
this.checkRequiredCredentials();
|
|
1599
1633
|
const auth = this.stringToBase64(this.apiKey + ':' + this.secret);
|
|
1600
1634
|
const secret = 'Basic ' + auth;
|
package/package.json
CHANGED