ccxt 4.3.74 → 4.3.76

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.
@@ -538,6 +538,12 @@ export default class binance extends binanceRest {
538
538
  /**
539
539
  * @method
540
540
  * @name binance#watchOrderBook
541
+ * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
542
+ * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
543
+ * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
544
+ * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
545
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
546
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
541
547
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
542
548
  * @param {string} symbol unified symbol of the market to fetch the order book for
543
549
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -587,6 +593,12 @@ export default class binance extends binanceRest {
587
593
  /**
588
594
  * @method
589
595
  * @name binance#watchOrderBookForSymbols
596
+ * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
597
+ * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
598
+ * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
599
+ * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
600
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
601
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
590
602
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
591
603
  * @param {string[]} symbols unified array of symbols
592
604
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -1479,6 +1491,12 @@ export default class binance extends binanceRest {
1479
1491
  /**
1480
1492
  * @method
1481
1493
  * @name binance#watchTicker
1494
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1495
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1496
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1497
+ * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1498
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1499
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1482
1500
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1483
1501
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1484
1502
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1494,6 +1512,12 @@ export default class binance extends binanceRest {
1494
1512
  /**
1495
1513
  * @method
1496
1514
  * @name binance#watchTickers
1515
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1516
+ * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1517
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1518
+ * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1519
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1520
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1497
1521
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1498
1522
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1499
1523
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -43,8 +43,8 @@ export default class bitmart extends bitmartRest {
43
43
  'private': 'wss://ws-manager-compress.{hostname}/user?protocol=1.1',
44
44
  },
45
45
  'swap': {
46
- 'public': 'wss://openapi-ws.{hostname}/api?protocol=1.1',
47
- 'private': 'wss://openapi-ws.{hostname}/user?protocol=1.1',
46
+ 'public': 'wss://openapi-ws-v2.{hostname}/api?protocol=1.1',
47
+ 'private': 'wss://openapi-ws-v2.{hostname}/user?protocol=1.1',
48
48
  },
49
49
  },
50
50
  },
@@ -138,7 +138,7 @@ export default class bitmart extends bitmartRest {
138
138
  * @method
139
139
  * @name bitmart#watchBalance
140
140
  * @see https://developer-pro.bitmart.com/en/spot/#private-balance-change
141
- * @see https://developer-pro.bitmart.com/en/futures/#private-assets-channel
141
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#private-assets-channel
142
142
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
143
143
  * @param {object} [params] extra parameters specific to the exchange API endpoint
144
144
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -272,7 +272,7 @@ export default class bitmart extends bitmartRest {
272
272
  * @method
273
273
  * @name bitmart#watchTrades
274
274
  * @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
275
- * @see https://developer-pro.bitmart.com/en/futures/#public-trade-channel
275
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-trade-channel
276
276
  * @description get the list of most recent trades for a particular symbol
277
277
  * @param {string} symbol unified symbol of the market to fetch trades for
278
278
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -322,6 +322,7 @@ export default class bitmart extends bitmartRest {
322
322
  * @method
323
323
  * @name bitmart#watchTicker
324
324
  * @see https://developer-pro.bitmart.com/en/spot/#public-ticker-channel
325
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
325
326
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
326
327
  * @param {string} symbol unified symbol of the market to fetch the ticker for
327
328
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -336,7 +337,7 @@ export default class bitmart extends bitmartRest {
336
337
  /**
337
338
  * @method
338
339
  * @name bitmart#watchTickers
339
- * @see https://developer-pro.bitmart.com/en/futures/#overview
340
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
340
341
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
341
342
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
342
343
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -360,7 +361,7 @@ export default class bitmart extends bitmartRest {
360
361
  * @name bitmart#watchOrders
361
362
  * @description watches information on multiple orders made by the user
362
363
  * @see https://developer-pro.bitmart.com/en/spot/#private-order-progress
363
- * @see https://developer-pro.bitmart.com/en/futures/#private-order-channel
364
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#private-order-channel
364
365
  * @param {string} symbol unified market symbol of the market orders were made in
365
366
  * @param {int} [since] the earliest time in ms to fetch orders for
366
367
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -995,7 +996,7 @@ export default class bitmart extends bitmartRest {
995
996
  * @method
996
997
  * @name bitmart#watchOHLCV
997
998
  * @see https://developer-pro.bitmart.com/en/spot/#public-kline-channel
998
- * @see https://developer-pro.bitmart.com/en/futures/#public-klinebin-channel
999
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-klinebin-channel
999
1000
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1000
1001
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1001
1002
  * @param {string} timeframe the length of time each candle represents
@@ -1123,7 +1124,7 @@ export default class bitmart extends bitmartRest {
1123
1124
  * @name bitmart#watchOrderBook
1124
1125
  * @see https://developer-pro.bitmart.com/en/spot/#public-depth-all-channel
1125
1126
  * @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
1126
- * @see https://developer-pro.bitmart.com/en/futures/#public-depth-channel
1127
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#public-depth-channel
1127
1128
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
1128
1129
  * @param {string} symbol unified symbol of the market to fetch the order book for
1129
1130
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -169,7 +169,7 @@ export default class bybit extends bybitRest {
169
169
  if (isSpot) {
170
170
  url = url[accessibility]['spot'];
171
171
  }
172
- else if (type === 'swap') {
172
+ else if ((type === 'swap') || (type === 'future')) {
173
173
  let subType = undefined;
174
174
  [subType, params] = this.handleSubTypeAndParams(method, market, params, 'linear');
175
175
  url = url[accessibility][subType];
@@ -2064,7 +2064,7 @@ export default class bybit extends bybitRest {
2064
2064
  this.handleSubscriptionStatus(client, message);
2065
2065
  return;
2066
2066
  }
2067
- const topic = this.safeString2(message, 'topic', 'op');
2067
+ const topic = this.safeString2(message, 'topic', 'op', '');
2068
2068
  const methods = {
2069
2069
  'orderbook': this.handleOrderBook,
2070
2070
  'kline': this.handleOHLCV,
@@ -807,8 +807,23 @@ export default class whitebit extends Exchange {
807
807
  // "change": "2.12" // in percent
808
808
  // }
809
809
  //
810
+ // WS market_update
811
+ //
812
+ // {
813
+ // "open": "52853.04",
814
+ // "close": "55913.88",
815
+ // "high": "56272",
816
+ // "low": "49549.67",
817
+ // "volume": "57331.067185",
818
+ // "deal": "3063860382.42985338",
819
+ // "last": "55913.88",
820
+ // "period": 86400
821
+ // }
810
822
  market = this.safeMarket(undefined, market);
811
- const last = this.safeString(ticker, 'last_price');
823
+ // last price is provided as "last" or "last_price"
824
+ const last = this.safeString2(ticker, 'last', 'last_price');
825
+ // if "close" is provided, use it, otherwise use <last>
826
+ const close = this.safeString(ticker, 'close', last);
812
827
  return this.safeTicker({
813
828
  'symbol': market['symbol'],
814
829
  'timestamp': undefined,
@@ -821,7 +836,7 @@ export default class whitebit extends Exchange {
821
836
  'askVolume': undefined,
822
837
  'vwap': undefined,
823
838
  'open': this.safeString(ticker, 'open'),
824
- 'close': last,
839
+ 'close': close,
825
840
  'last': last,
826
841
  'previousClose': undefined,
827
842
  'change': undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.74",
3
+ "version": "4.3.76",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",