ccxt 4.5.17 → 4.5.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.
Files changed (44) hide show
  1. package/README.md +8 -5
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/deepcoin.js +11 -0
  5. package/dist/cjs/src/apex.js +33 -15
  6. package/dist/cjs/src/base/Exchange.js +3 -3
  7. package/dist/cjs/src/base/ws/Client.js +8 -7
  8. package/dist/cjs/src/bigone.js +20 -0
  9. package/dist/cjs/src/binanceus.js +31 -1
  10. package/dist/cjs/src/blofin.js +4 -1
  11. package/dist/cjs/src/bybit.js +3 -0
  12. package/dist/cjs/src/deepcoin.js +3024 -0
  13. package/dist/cjs/src/pro/ascendex.js +2 -2
  14. package/dist/cjs/src/pro/binance.js +100 -3
  15. package/dist/cjs/src/pro/binanceus.js +19 -0
  16. package/dist/cjs/src/pro/blofin.js +11 -2
  17. package/dist/cjs/src/pro/deepcoin.js +1225 -0
  18. package/dist/cjs/src/pro/kraken.js +5 -1
  19. package/js/ccxt.d.ts +8 -2
  20. package/js/ccxt.js +6 -2
  21. package/js/src/abstract/bybit.d.ts +3 -0
  22. package/js/src/abstract/deepcoin.d.ts +60 -0
  23. package/js/src/abstract/deepcoin.js +11 -0
  24. package/js/src/apex.d.ts +2 -0
  25. package/js/src/apex.js +33 -15
  26. package/js/src/base/Exchange.js +3 -3
  27. package/js/src/base/ws/Client.js +8 -7
  28. package/js/src/bigone.js +20 -0
  29. package/js/src/binanceus.js +31 -1
  30. package/js/src/blofin.js +4 -1
  31. package/js/src/bybit.js +3 -0
  32. package/js/src/deepcoin.d.ts +498 -0
  33. package/js/src/deepcoin.js +3022 -0
  34. package/js/src/pro/ascendex.d.ts +1 -1
  35. package/js/src/pro/ascendex.js +2 -2
  36. package/js/src/pro/binance.d.ts +35 -1
  37. package/js/src/pro/binance.js +97 -3
  38. package/js/src/pro/binanceus.js +19 -0
  39. package/js/src/pro/blofin.d.ts +5 -0
  40. package/js/src/pro/blofin.js +11 -2
  41. package/js/src/pro/deepcoin.d.ts +169 -0
  42. package/js/src/pro/deepcoin.js +1224 -0
  43. package/js/src/pro/kraken.js +5 -1
  44. package/package.json +1 -1
@@ -58,7 +58,7 @@ export default class ascendex extends ascendexRest {
58
58
  */
59
59
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
60
60
  watchOrderBookSnapshot(symbol: string, limit?: Int, params?: {}): Promise<any>;
61
- fetchOrderBookSnapshot(symbol: string, limit?: Int, params?: {}): Promise<import("../base/ws/OrderBook.js").OrderBook>;
61
+ fetchOrderBookSnapshotCustom(symbol: string, limit?: Int, params?: {}): Promise<import("../base/ws/OrderBook.js").OrderBook>;
62
62
  handleOrderBookSnapshot(client: Client, message: any): void;
63
63
  handleOrderBook(client: Client, message: any): void;
64
64
  handleDelta(bookside: any, delta: any): void;
@@ -272,7 +272,7 @@ export default class ascendex extends ascendexRest {
272
272
  const orderbook = await this.watchPublic(channel, params);
273
273
  return orderbook.limit();
274
274
  }
275
- async fetchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
275
+ async fetchOrderBookSnapshotCustom(symbol, limit = undefined, params = {}) {
276
276
  const restOrderBook = await this.fetchRestOrderBookSafe(symbol, limit, params);
277
277
  if (!(symbol in this.orderbooks)) {
278
278
  this.orderbooks[symbol] = this.orderBook();
@@ -962,7 +962,7 @@ export default class ascendex extends ascendexRest {
962
962
  }
963
963
  this.orderbooks[symbol] = this.orderBook({});
964
964
  if (this.options['defaultType'] === 'swap' || market['contract']) {
965
- this.spawn(this.fetchOrderBookSnapshot, symbol);
965
+ this.spawn(this.fetchOrderBookSnapshotCustom, symbol);
966
966
  }
967
967
  else {
968
968
  this.spawn(this.watchOrderBookSnapshot, symbol);
@@ -47,6 +47,19 @@ export default class binance extends binanceRest {
47
47
  fetchTradesWs: boolean;
48
48
  fetchTradingFeesWs: boolean;
49
49
  fetchWithdrawalsWs: boolean;
50
+ unWatchTicker: boolean;
51
+ unWatchTickers: boolean;
52
+ unWatchOHLCV: boolean;
53
+ unWatchOHLCVForSymbols: boolean;
54
+ unWatchOrderBook: boolean;
55
+ unWatchOrderBookForSymbols: boolean;
56
+ unWatchTrades: boolean;
57
+ unWatchTradesForSymbols: boolean;
58
+ unWatchMyTrades: boolean;
59
+ unWatchOrders: boolean;
60
+ unWatchPositions: boolean;
61
+ unWatchMarkPrices: boolean;
62
+ unWatchMarkPrice: boolean;
50
63
  };
51
64
  urls: {
52
65
  test: {
@@ -520,6 +533,26 @@ export default class binance extends binanceRest {
520
533
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
521
534
  */
522
535
  unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
536
+ /**
537
+ * @method
538
+ * @name binance#unWatchMarkPrices
539
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
540
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
541
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
542
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
543
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
544
+ */
545
+ unWatchMarkPrices(symbols?: Strings, params?: {}): Promise<any>;
546
+ /**
547
+ * @method
548
+ * @name binance#unWatchMarkPrice
549
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
550
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
551
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
552
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
553
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
554
+ */
555
+ unWatchMarkPrice(symbol: string, params?: {}): Promise<any>;
523
556
  /**
524
557
  * @method
525
558
  * @name binance#unWatchTicker
@@ -556,7 +589,8 @@ export default class binance extends binanceRest {
556
589
  getMessageHash(channelName: string, symbol: Str, isBidAsk: boolean): string;
557
590
  signParams(params?: {}): any;
558
591
  /**
559
- * Ensures a User Data Stream WebSocket subscription is active for the specified scope
592
+ * @name binance#ensureUserDataStreamWsSubscribeSignature
593
+ * @description watches best bid & ask for symbols
560
594
  * @param marketType {string} only support on 'spot'
561
595
  * @see {@link https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_data Binance User Data Stream Documentation}
562
596
  * @returns Promise<number> The subscription ID for the user data stream
@@ -64,6 +64,19 @@ export default class binance extends binanceRest {
64
64
  'fetchTradesWs': true,
65
65
  'fetchTradingFeesWs': false,
66
66
  'fetchWithdrawalsWs': false,
67
+ 'unWatchTicker': true,
68
+ 'unWatchTickers': true,
69
+ 'unWatchOHLCV': true,
70
+ 'unWatchOHLCVForSymbols': true,
71
+ 'unWatchOrderBook': true,
72
+ 'unWatchOrderBookForSymbols': true,
73
+ 'unWatchTrades': true,
74
+ 'unWatchTradesForSymbols': true,
75
+ 'unWatchMyTrades': false,
76
+ 'unWatchOrders': false,
77
+ 'unWatchPositions': false,
78
+ 'unWatchMarkPrices': true,
79
+ 'unWatchMarkPrice': true,
67
80
  },
68
81
  'urls': {
69
82
  'test': {
@@ -1942,11 +1955,91 @@ export default class binance extends binanceRest {
1942
1955
  'unsubscribe': true,
1943
1956
  'id': requestId.toString(),
1944
1957
  'subMessageHashes': subMessageHashes,
1945
- 'messageHashes': subMessageHashes,
1958
+ 'messageHashes': messageHashes,
1959
+ 'symbols': symbols,
1960
+ 'topic': 'ticker',
1961
+ };
1962
+ return await this.watchMultiple(url, messageHashes, this.extend(request, params), messageHashes, subscription);
1963
+ }
1964
+ /**
1965
+ * @method
1966
+ * @name binance#unWatchMarkPrices
1967
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1968
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
1969
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1970
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1971
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1972
+ */
1973
+ async unWatchMarkPrices(symbols = undefined, params = {}) {
1974
+ let channelName = undefined;
1975
+ [channelName, params] = this.handleOptionAndParams(params, 'watchMarkPrices', 'name', 'markPrice');
1976
+ await this.loadMarkets();
1977
+ const use1sFreq = this.safeBool(params, 'use1sFreq', true);
1978
+ const suffix = (use1sFreq) ? '@1s' : '';
1979
+ const methodName = 'watchMarkPrices';
1980
+ symbols = this.marketSymbols(symbols, undefined, true, false, true);
1981
+ let firstMarket = undefined;
1982
+ let marketType = undefined;
1983
+ const symbolsDefined = (symbols !== undefined);
1984
+ if (symbolsDefined) {
1985
+ firstMarket = this.market(symbols[0]);
1986
+ }
1987
+ [marketType, params] = this.handleMarketTypeAndParams(methodName, firstMarket, params);
1988
+ if (marketType !== 'swap' && marketType !== 'future') {
1989
+ throw new NotSupported(this.id + ' ' + methodName + '() only supports swap markets');
1990
+ }
1991
+ const rawMarketType = 'future';
1992
+ const subscriptionArgs = [];
1993
+ const subMessageHashes = [];
1994
+ const messageHashes = [];
1995
+ if (symbolsDefined) {
1996
+ for (let i = 0; i < symbols.length; i++) {
1997
+ const symbol = symbols[i];
1998
+ const market = this.market(symbol);
1999
+ const msgHash = this.getMessageHash(channelName, market['symbol'], false);
2000
+ subscriptionArgs.push(market['lowercaseId'] + '@' + channelName + suffix);
2001
+ subMessageHashes.push(msgHash);
2002
+ messageHashes.push('unsubscribe:' + msgHash);
2003
+ }
2004
+ }
2005
+ else {
2006
+ const msgHashNoSymbol = this.getMessageHash(channelName, undefined, false);
2007
+ subscriptionArgs.push('!' + channelName + '@arr');
2008
+ subMessageHashes.push(msgHashNoSymbol);
2009
+ messageHashes.push('unsubscribe:' + msgHashNoSymbol);
2010
+ }
2011
+ let streamHash = channelName;
2012
+ if (symbolsDefined) {
2013
+ streamHash = channelName + '::' + symbols.join(',');
2014
+ }
2015
+ const url = this.urls['api']['ws'][rawMarketType] + '/' + this.stream(rawMarketType, streamHash);
2016
+ const requestId = this.requestId(url);
2017
+ const request = {
2018
+ 'method': 'UNSUBSCRIBE',
2019
+ 'params': subscriptionArgs,
2020
+ 'id': requestId,
2021
+ };
2022
+ const subscription = {
2023
+ 'unsubscribe': true,
2024
+ 'id': requestId.toString(),
2025
+ 'subMessageHashes': subMessageHashes,
2026
+ 'messageHashes': messageHashes,
1946
2027
  'symbols': symbols,
1947
2028
  'topic': 'ticker',
1948
2029
  };
1949
- return await this.watchMultiple(url, subMessageHashes, this.extend(request, params), subMessageHashes, subscription);
2030
+ return await this.watchMultiple(url, messageHashes, this.extend(request, params), messageHashes, subscription);
2031
+ }
2032
+ /**
2033
+ * @method
2034
+ * @name binance#unWatchMarkPrice
2035
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
2036
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
2037
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
2038
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2039
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2040
+ */
2041
+ async unWatchMarkPrice(symbol, params = {}) {
2042
+ return await this.unWatchMarkPrices([symbol], params);
1950
2043
  }
1951
2044
  /**
1952
2045
  * @method
@@ -2353,7 +2446,8 @@ export default class binance extends binanceRest {
2353
2446
  return extendedParams;
2354
2447
  }
2355
2448
  /**
2356
- * Ensures a User Data Stream WebSocket subscription is active for the specified scope
2449
+ * @name binance#ensureUserDataStreamWsSubscribeSignature
2450
+ * @description watches best bid & ask for symbols
2357
2451
  * @param marketType {string} only support on 'spot'
2358
2452
  * @see {@link https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_data Binance User Data Stream Documentation}
2359
2453
  * @returns Promise<number> The subscription ID for the user data stream
@@ -39,6 +39,25 @@ export default class binanceus extends binance {
39
39
  'doc': 'https://github.com/binance-us/binance-official-api-docs',
40
40
  'fees': 'https://www.binance.us/en/fee/schedule',
41
41
  },
42
+ 'has': {
43
+ 'createOrderWithTakeProfitAndStopLossWs': false,
44
+ 'createReduceOnlyOrderWs': false,
45
+ 'createStopLossOrderWs': false,
46
+ 'createTakeProfitOrderWs': false,
47
+ 'fetchPositionForSymbolWs': false,
48
+ 'fetchPositionsForSymbolWs': false,
49
+ 'fetchPositionsWs': false,
50
+ 'fetchPositionWs': false,
51
+ 'unWatchPositions': false,
52
+ 'watchLiquidations': false,
53
+ 'watchLiquidationsForSymbols': false,
54
+ 'watchMarkPrice': false,
55
+ 'watchMarkPrices': false,
56
+ 'watchMyLiquidations': false,
57
+ 'watchMyLiquidationsForSymbols': false,
58
+ 'watchPosition': false,
59
+ 'watchPositions': false,
60
+ },
42
61
  'options': {
43
62
  'fetchCurrencies': false,
44
63
  'quoteOrderQty': false,
@@ -129,10 +129,13 @@ export default class blofin extends blofinRest {
129
129
  * @method
130
130
  * @name biofin#watchOrders
131
131
  * @description watches information on multiple orders made by the user
132
+ * @see https://docs.blofin.com/index.html#ws-order-channel
133
+ * @see https://docs.blofin.com/index.html#ws-algo-orders-channel
132
134
  * @param {string} symbol unified market symbol of the market orders were made in
133
135
  * @param {int} [since] the earliest time in ms to fetch orders for
134
136
  * @param {int} [limit] the maximum number of order structures to retrieve
135
137
  * @param {object} [params] extra parameters specific to the exchange API endpoint
138
+ * @param {boolean} [params.trigger] set to true for trigger orders
136
139
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
137
140
  */
138
141
  watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -141,10 +144,12 @@ export default class blofin extends blofinRest {
141
144
  * @name blofin#watchOrdersForSymbols
142
145
  * @description watches information on multiple orders made by the user across multiple symbols
143
146
  * @see https://docs.blofin.com/index.html#ws-order-channel
147
+ * @see https://docs.blofin.com/index.html#ws-algo-orders-channel
144
148
  * @param {string[]} symbols
145
149
  * @param {int} [since] the earliest time in ms to fetch orders for
146
150
  * @param {int} [limit] the maximum number of order structures to retrieve
147
151
  * @param {object} [params] extra parameters specific to the exchange API endpoint
152
+ * @param {boolean} [params.trigger] set to true for trigger orders
148
153
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
149
154
  */
150
155
  watchOrdersForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -485,10 +485,13 @@ export default class blofin extends blofinRest {
485
485
  * @method
486
486
  * @name biofin#watchOrders
487
487
  * @description watches information on multiple orders made by the user
488
+ * @see https://docs.blofin.com/index.html#ws-order-channel
489
+ * @see https://docs.blofin.com/index.html#ws-algo-orders-channel
488
490
  * @param {string} symbol unified market symbol of the market orders were made in
489
491
  * @param {int} [since] the earliest time in ms to fetch orders for
490
492
  * @param {int} [limit] the maximum number of order structures to retrieve
491
493
  * @param {object} [params] extra parameters specific to the exchange API endpoint
494
+ * @param {boolean} [params.trigger] set to true for trigger orders
492
495
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
493
496
  */
494
497
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -501,16 +504,21 @@ export default class blofin extends blofinRest {
501
504
  * @name blofin#watchOrdersForSymbols
502
505
  * @description watches information on multiple orders made by the user across multiple symbols
503
506
  * @see https://docs.blofin.com/index.html#ws-order-channel
507
+ * @see https://docs.blofin.com/index.html#ws-algo-orders-channel
504
508
  * @param {string[]} symbols
505
509
  * @param {int} [since] the earliest time in ms to fetch orders for
506
510
  * @param {int} [limit] the maximum number of order structures to retrieve
507
511
  * @param {object} [params] extra parameters specific to the exchange API endpoint
512
+ * @param {boolean} [params.trigger] set to true for trigger orders
508
513
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
509
514
  */
510
515
  async watchOrdersForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
511
516
  await this.authenticate();
512
517
  await this.loadMarkets();
513
- const orders = await this.watchMultipleWrapper(false, 'orders', 'watchOrdersForSymbols', symbols, params);
518
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
519
+ params = this.omit(params, ['stop', 'trigger']);
520
+ const channel = trigger ? 'orders-algo' : 'orders';
521
+ const orders = await this.watchMultipleWrapper(false, channel, 'watchOrdersForSymbols', symbols, params);
514
522
  if (this.newUpdates) {
515
523
  const first = this.safeValue(orders, 0);
516
524
  const tradeSymbol = this.safeString(first, 'symbol');
@@ -648,7 +656,7 @@ export default class blofin extends blofinRest {
648
656
  messageHashes.push(channelName);
649
657
  }
650
658
  // private channel are difference, they only need plural channel name for multiple symbols
651
- if (this.inArray(channelName, ['orders', 'positions'])) {
659
+ if (this.inArray(channelName, ['orders', 'orders-algo', 'positions'])) {
652
660
  rawSubscriptions = [{ 'channel': channelName }];
653
661
  }
654
662
  const request = this.getSubscriptionRequest(rawSubscriptions);
@@ -686,6 +694,7 @@ export default class blofin extends blofinRest {
686
694
  // private
687
695
  'account': this.handleBalance,
688
696
  'orders': this.handleOrders,
697
+ 'orders-algo': this.handleOrders,
689
698
  'positions': this.handlePositions,
690
699
  };
691
700
  let method = undefined;
@@ -0,0 +1,169 @@
1
+ import deepcoinRest from '../deepcoin.js';
2
+ import type { Dict, Int, Market, OHLCV, Order, OrderBook, Position, Str, Strings, Ticker, Trade } from '../base/types.js';
3
+ import Client from '../base/ws/Client.js';
4
+ export default class deepcoin extends deepcoinRest {
5
+ describe(): any;
6
+ ping(client: Client): string;
7
+ handlePong(client: Client, message: any): any;
8
+ requestId(): any;
9
+ createPublicRequest(market: Market, requestId: number, topicID: string, suffix?: string, unWatch?: boolean): {
10
+ sendTopicAction: {
11
+ Action: string;
12
+ FilterValue: string;
13
+ LocalNo: number;
14
+ ResumeNo: number;
15
+ TopicID: string;
16
+ };
17
+ };
18
+ watchPublic(market: Market, messageHash: string, topicID: string, params?: Dict, suffix?: string): Promise<any>;
19
+ unWatchPublic(market: Market, messageHash: string, topicID: string, params?: Dict, subscription?: Dict, suffix?: string): Promise<any>;
20
+ watchPrivate(messageHash: string, params?: Dict): Promise<any>;
21
+ authenticate(params?: {}): Promise<string>;
22
+ /**
23
+ * @method
24
+ * @name deepcoin#watchTicker
25
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
26
+ * @see https://www.deepcoin.com/docs/publicWS/latestMarketData
27
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
28
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
29
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
30
+ */
31
+ watchTicker(symbol: string, params?: {}): Promise<Ticker>;
32
+ /**
33
+ * @method
34
+ * @name deepcoin#unWatchTicker
35
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
36
+ * @see https://www.deepcoin.com/docs/publicWS/latestMarketData
37
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
38
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
39
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
40
+ */
41
+ unWatchTicker(symbol: string, params?: {}): Promise<any>;
42
+ handleTicker(client: Client, message: any): void;
43
+ parseWsTicker(ticker: Dict, market?: Market): Ticker;
44
+ /**
45
+ * @method
46
+ * @name deepcoin#watchTrades
47
+ * @description watches information on multiple trades made in a market
48
+ * @see https://www.deepcoin.com/docs/publicWS/lastTransactions
49
+ * @param {string} symbol unified market symbol of the market trades were made in
50
+ * @param {int} [since] the earliest time in ms to fetch orders for
51
+ * @param {int} [limit] the maximum number of trade structures to retrieve
52
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
53
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
54
+ */
55
+ watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
56
+ /**
57
+ * @method
58
+ * @name deepcoin#unWatchTrades
59
+ * @description unWatches the list of most recent trades for a particular symbol
60
+ * @see https://www.deepcoin.com/docs/publicWS/lastTransactions
61
+ * @param {string} symbol unified symbol of the market to fetch trades for
62
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
63
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
64
+ */
65
+ unWatchTrades(symbol: string, params?: {}): Promise<any>;
66
+ handleTrades(client: Client, message: any): void;
67
+ parseWsTrade(trade: Dict, market?: Market): Trade;
68
+ parseTradeSide(direction: Str): Str;
69
+ handleTakerOrMaker(matchRole: Str): Str;
70
+ /**
71
+ * @method
72
+ * @name deepcoin#watchOHLCV
73
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
74
+ * @see https://www.deepcoin.com/docs/publicWS/KLines
75
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
76
+ * @param {string} [timeframe] the length of time each candle represents
77
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
78
+ * @param {int} [limit] the maximum amount of candles to fetch
79
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
80
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
81
+ */
82
+ watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
83
+ /**
84
+ * @method
85
+ * @name deepcoin#unWatchOHLCV
86
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
87
+ * @see https://docs.backpack.exchange/#tag/Streams/Public/K-Line
88
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
89
+ * @param {string} [timeframe] the length of time each candle represents
90
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
91
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
92
+ */
93
+ unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
94
+ handleOHLCV(client: Client, message: any): void;
95
+ parseWsOHLCV(ohlcv: any, market?: Market): OHLCV;
96
+ /**
97
+ * @method
98
+ * @name deepcoin#watchOrderBook
99
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
100
+ * @see https://www.deepcoin.com/docs/publicWS/25LevelIncrementalMarketData
101
+ * @param {string} symbol unified symbol of the market to fetch the order book for
102
+ * @param {int} [limit] the maximum amount of order book entries to return.
103
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
104
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
105
+ */
106
+ watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
107
+ /**
108
+ * @method
109
+ * @name deepcoin#unWatchOrderBook
110
+ * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
111
+ * @see https://www.deepcoin.com/docs/publicWS/25LevelIncrementalMarketData
112
+ * @param {string} symbol unified array of symbols
113
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
114
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
115
+ */
116
+ unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
117
+ handleOrderBook(client: Client, message: any): void;
118
+ handleOrderBookSnapshot(client: Client, message: any): void;
119
+ handleOrderBookMessage(client: Client, message: any, orderbook: any): void;
120
+ handleDelta(orderbook: any, entry: any): void;
121
+ /**
122
+ * @method
123
+ * @name deepcoin#watchMyTrades
124
+ * @description watches information on multiple trades made by the user
125
+ * @see https://www.deepcoin.com/docs/privateWS/Trade
126
+ * @param {string} symbol unified market symbol of the market orders were made in
127
+ * @param {int} [since] the earliest time in ms to fetch orders for
128
+ * @param {int} [limit] the maximum number of order structures to retrieve
129
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
130
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
131
+ */
132
+ watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
133
+ handleMyTrade(client: Client, message: any): void;
134
+ /**
135
+ * @method
136
+ * @name deepcoin#watchOrders
137
+ * @description watches information on multiple orders made by the user
138
+ * @see https://www.deepcoin.com/docs/privateWS/order
139
+ * @param {string} symbol unified market symbol of the market orders were made in
140
+ * @param {int} [since] the earliest time in ms to fetch orders for
141
+ * @param {int} [limit] the maximum number of order structures to retrieve
142
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
143
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
144
+ */
145
+ watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
146
+ handleOrder(client: Client, message: any): void;
147
+ parseWsOrder(order: any, market?: Market): Order;
148
+ parseWsOrderStatus(status: Str): Str;
149
+ /**
150
+ * @method
151
+ * @name deepcoin#watchPositions
152
+ * @description watch all open positions
153
+ * @see https://www.deepcoin.com/docs/privateWS/Position
154
+ * @param {string[]} [symbols] list of unified market symbols to watch positions for
155
+ * @param {int} [since] the earliest time in ms to fetch positions for
156
+ * @param {int} [limit] the maximum number of positions to retrieve
157
+ * @param {object} params extra parameters specific to the exchange API endpoint
158
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
159
+ */
160
+ watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
161
+ handlePosition(client: Client, message: any): void;
162
+ parseWsPosition(position: any, market?: Market): Position;
163
+ parsePositionSide(direction: Str): Str;
164
+ parseWsMarginMode(marginMode: Str): Str;
165
+ handleMessage(client: Client, message: any): void;
166
+ handleSubscriptionStatus(client: Client, message: any): void;
167
+ handleUnSubscription(client: Client, subscription: Dict): void;
168
+ handleErrorMessage(client: Client, message: any): void;
169
+ }