ccxt 4.2.20 → 4.2.22

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 (82) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +1405 -274
  3. package/dist/ccxt.browser.min.js +6 -6
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +37 -4
  6. package/dist/cjs/src/base/ws/WsClient.js +3 -1
  7. package/dist/cjs/src/bigone.js +1 -0
  8. package/dist/cjs/src/binance.js +14 -3
  9. package/dist/cjs/src/bitget.js +12 -2
  10. package/dist/cjs/src/bitrue.js +1 -0
  11. package/dist/cjs/src/bitvavo.js +271 -172
  12. package/dist/cjs/src/blockchaincom.js +3 -1
  13. package/dist/cjs/src/bybit.js +57 -9
  14. package/dist/cjs/src/coinbasepro.js +1 -0
  15. package/dist/cjs/src/coinex.js +37 -12
  16. package/dist/cjs/src/deribit.js +164 -0
  17. package/dist/cjs/src/gate.js +32 -1
  18. package/dist/cjs/src/novadax.js +26 -22
  19. package/dist/cjs/src/okcoin.js +3 -0
  20. package/dist/cjs/src/phemex.js +7 -3
  21. package/dist/cjs/src/poloniex.js +1 -0
  22. package/dist/cjs/src/pro/bequant.js +6 -1
  23. package/dist/cjs/src/pro/binance.js +7 -4
  24. package/dist/cjs/src/pro/binancecoinm.js +6 -1
  25. package/dist/cjs/src/pro/binanceus.js +6 -1
  26. package/dist/cjs/src/pro/bitcoincom.js +6 -1
  27. package/dist/cjs/src/pro/bitget.js +1 -1
  28. package/dist/cjs/src/pro/bitopro.js +7 -3
  29. package/dist/cjs/src/pro/bitrue.js +6 -1
  30. package/dist/cjs/src/pro/bitvavo.js +668 -22
  31. package/dist/cjs/src/pro/lbank.js +1 -1
  32. package/dist/cjs/src/pro/okx.js +13 -3
  33. package/dist/cjs/src/woo.js +1 -1
  34. package/js/ccxt.d.ts +1 -1
  35. package/js/ccxt.js +1 -1
  36. package/js/src/abstract/binance.d.ts +3 -0
  37. package/js/src/abstract/binancecoinm.d.ts +3 -0
  38. package/js/src/abstract/binanceus.d.ts +4 -0
  39. package/js/src/abstract/binanceusdm.d.ts +3 -0
  40. package/js/src/abstract/gate.d.ts +1 -0
  41. package/js/src/abstract/gateio.d.ts +1 -0
  42. package/js/src/abstract/novadax.d.ts +5 -1
  43. package/js/src/abstract/phemex.d.ts +1 -0
  44. package/js/src/base/Exchange.d.ts +12 -1
  45. package/js/src/base/Exchange.js +37 -4
  46. package/js/src/base/ws/WsClient.js +3 -2
  47. package/js/src/bigone.js +1 -0
  48. package/js/src/binance.js +14 -3
  49. package/js/src/bitget.js +12 -2
  50. package/js/src/bitrue.js +1 -0
  51. package/js/src/bitvavo.d.ts +14 -2
  52. package/js/src/bitvavo.js +271 -172
  53. package/js/src/blockchaincom.js +3 -1
  54. package/js/src/bybit.d.ts +2 -1
  55. package/js/src/bybit.js +57 -9
  56. package/js/src/coinbasepro.js +1 -0
  57. package/js/src/coinex.d.ts +1 -0
  58. package/js/src/coinex.js +37 -12
  59. package/js/src/deribit.d.ts +6 -1
  60. package/js/src/deribit.js +164 -0
  61. package/js/src/gate.d.ts +1 -0
  62. package/js/src/gate.js +32 -1
  63. package/js/src/novadax.js +26 -22
  64. package/js/src/okcoin.js +3 -0
  65. package/js/src/phemex.js +7 -3
  66. package/js/src/poloniex.js +1 -0
  67. package/js/src/pro/bequant.js +6 -1
  68. package/js/src/pro/binance.js +7 -4
  69. package/js/src/pro/binancecoinm.js +6 -1
  70. package/js/src/pro/binanceus.js +6 -1
  71. package/js/src/pro/bitcoincom.js +6 -1
  72. package/js/src/pro/bitget.js +1 -1
  73. package/js/src/pro/bitopro.js +7 -3
  74. package/js/src/pro/bitrue.js +6 -1
  75. package/js/src/pro/bitvavo.d.ts +35 -2
  76. package/js/src/pro/bitvavo.js +669 -23
  77. package/js/src/pro/lbank.js +1 -1
  78. package/js/src/pro/okx.js +13 -3
  79. package/js/src/woo.js +1 -1
  80. package/jsdoc2md.js +38 -16
  81. package/package.json +4 -1
  82. package/skip-tests.json +4 -0
@@ -1,12 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var binance = require('./binance.js');
4
+ var binancecoinm$1 = require('../binancecoinm.js');
4
5
 
5
6
  // ---------------------------------------------------------------------------
6
7
  // ---------------------------------------------------------------------------
7
8
  class binancecoinm extends binance {
8
9
  describe() {
9
- return this.deepExtend(super.describe(), {
10
+ // eslint-disable-next-line new-cap
11
+ const restInstance = new binancecoinm$1();
12
+ const restDescribe = restInstance.describe();
13
+ const extended = this.deepExtend(super.describe(), restDescribe);
14
+ return this.deepExtend(extended, {
10
15
  'id': 'binancecoinm',
11
16
  'name': 'Binance COIN-M',
12
17
  'urls': {
@@ -1,12 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var binance = require('./binance.js');
4
+ var binanceus$1 = require('../binanceus.js');
4
5
 
5
6
  // ---------------------------------------------------------------------------
6
7
  // ---------------------------------------------------------------------------
7
8
  class binanceus extends binance {
8
9
  describe() {
9
- return this.deepExtend(super.describe(), {
10
+ // eslint-disable-next-line new-cap
11
+ const restInstance = new binanceus$1();
12
+ const restDescribe = restInstance.describe();
13
+ const extended = this.deepExtend(super.describe(), restDescribe);
14
+ return this.deepExtend(extended, {
10
15
  'id': 'binanceus',
11
16
  'name': 'Binance US',
12
17
  'countries': ['US'],
@@ -1,12 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var hitbtc = require('./hitbtc.js');
4
+ var bequant = require('../bequant.js');
4
5
 
5
6
  // ---------------------------------------------------------------------------
6
7
  // ---------------------------------------------------------------------------
7
8
  class bitcoincom extends hitbtc {
8
9
  describe() {
9
- return this.deepExtend(super.describe(), {
10
+ // eslint-disable-next-line new-cap
11
+ const restInstance = new bequant();
12
+ const restDescribe = restInstance.describe();
13
+ const extended = this.deepExtend(super.describe(), restDescribe);
14
+ return this.deepExtend(extended, {
10
15
  'id': 'bitcoincom',
11
16
  'name': 'bitcoin.com',
12
17
  'countries': ['KN'],
@@ -1245,7 +1245,7 @@ class bitget extends bitget$1 {
1245
1245
  'price': this.safeString(order, 'price'),
1246
1246
  'stopPrice': triggerPrice,
1247
1247
  'triggerPrice': triggerPrice,
1248
- 'amount': this.safeString2(order, 'size', 'baseSize'),
1248
+ 'amount': this.safeString(order, 'baseVolume'),
1249
1249
  'cost': this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']),
1250
1250
  'average': this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice')),
1251
1251
  'filled': this.safeString2(order, 'accBaseVolume', 'baseVolume'),
@@ -23,8 +23,8 @@ class bitopro extends bitopro$1 {
23
23
  },
24
24
  'urls': {
25
25
  'ws': {
26
- 'public': 'wss://stream.bitopro.com:9443/ws/v1/pub',
27
- 'private': 'wss://stream.bitopro.com:9443/ws/v1/pub/auth',
26
+ 'public': 'wss://stream.bitopro.com:443/ws/v1/pub',
27
+ 'private': 'wss://stream.bitopro.com:443/ws/v1/pub/auth',
28
28
  },
29
29
  },
30
30
  'requiredCredentials': {
@@ -53,6 +53,7 @@ class bitopro extends bitopro$1 {
53
53
  * @method
54
54
  * @name bitopro#watchOrderBook
55
55
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
56
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/order_book_stream.md
56
57
  * @param {string} symbol unified symbol of the market to fetch the order book for
57
58
  * @param {int} [limit] the maximum amount of order book entries to return
58
59
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -118,6 +119,7 @@ class bitopro extends bitopro$1 {
118
119
  * @method
119
120
  * @name bitopro#watchTrades
120
121
  * @description get the list of most recent trades for a particular symbol
122
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/trade_stream.md
121
123
  * @param {string} symbol unified symbol of the market to fetch trades for
122
124
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
123
125
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -177,6 +179,7 @@ class bitopro extends bitopro$1 {
177
179
  * @method
178
180
  * @name bitopro#watchTicker
179
181
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
182
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/ticker_stream.md
180
183
  * @param {string} symbol unified symbol of the market to fetch the ticker for
181
184
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182
185
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -230,7 +233,7 @@ class bitopro extends bitopro$1 {
230
233
  'identity': this.login,
231
234
  });
232
235
  const payload = this.stringToBase64(rawData);
233
- const signature = this.hmac(payload, this.encode(this.secret), sha512.sha384);
236
+ const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha512.sha384);
234
237
  const defaultOptions = {
235
238
  'ws': {
236
239
  'options': {
@@ -256,6 +259,7 @@ class bitopro extends bitopro$1 {
256
259
  * @method
257
260
  * @name bitopro#watchBalance
258
261
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
262
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/private/user_balance_stream.md
259
263
  * @param {object} [params] extra parameters specific to the exchange API endpoint
260
264
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
261
265
  */
@@ -346,7 +346,12 @@ class bitrue extends bitrue$1 {
346
346
  const symbol = market['symbol'];
347
347
  const timestamp = this.safeInteger(message, 'ts');
348
348
  const tick = this.safeValue(message, 'tick', {});
349
- const orderbook = this.parseOrderBook(tick, symbol, timestamp, 'buys', 'asks');
349
+ let orderbook = this.safeValue(this.orderbooks, symbol);
350
+ if (orderbook === undefined) {
351
+ orderbook = this.orderBook();
352
+ }
353
+ const snapshot = this.parseOrderBook(tick, symbol, timestamp, 'buys', 'asks');
354
+ orderbook.reset(snapshot);
350
355
  this.orderbooks[symbol] = orderbook;
351
356
  const messageHash = 'orderbook:' + symbol;
352
357
  client.resolve(orderbook, messageHash);