ccxt 4.2.20 → 4.2.21

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/dist/cjs/ccxt.js CHANGED
@@ -174,7 +174,7 @@ var woo$1 = require('./src/pro/woo.js');
174
174
 
175
175
  //-----------------------------------------------------------------------------
176
176
  // this is updated by vss.js when building
177
- const version = '4.2.20';
177
+ const version = '4.2.21';
178
178
  Exchange["default"].ccxtVersion = version;
179
179
  const exchanges = {
180
180
  'ace': ace,
@@ -400,11 +400,13 @@ class Exchange {
400
400
  'fetchCrossBorrowRate': undefined,
401
401
  'fetchCrossBorrowRates': undefined,
402
402
  'fetchCurrencies': 'emulated',
403
+ 'fetchCurrenciesWs': 'emulated',
403
404
  'fetchDeposit': undefined,
404
405
  'fetchDepositAddress': undefined,
405
406
  'fetchDepositAddresses': undefined,
406
407
  'fetchDepositAddressesByNetwork': undefined,
407
408
  'fetchDeposits': undefined,
409
+ 'fetchDepositsWs': undefined,
408
410
  'fetchDepositsWithdrawals': undefined,
409
411
  'fetchTransactionFee': undefined,
410
412
  'fetchTransactionFees': undefined,
@@ -422,9 +424,11 @@ class Exchange {
422
424
  'fetchLeverageTiers': undefined,
423
425
  'fetchMarketLeverageTiers': undefined,
424
426
  'fetchMarkets': true,
427
+ 'fetchMarketsWs': undefined,
425
428
  'fetchMarkOHLCV': undefined,
426
429
  'fetchMyTrades': undefined,
427
430
  'fetchOHLCV': undefined,
431
+ 'fetchOHLCVWs': undefined,
428
432
  'fetchOpenInterest': undefined,
429
433
  'fetchOpenInterestHistory': undefined,
430
434
  'fetchOpenOrder': undefined,
@@ -447,12 +451,14 @@ class Exchange {
447
451
  'fetchTrades': true,
448
452
  'fetchTradingFee': undefined,
449
453
  'fetchTradingFees': undefined,
454
+ 'fetchTradingFeesWs': undefined,
450
455
  'fetchTradingLimits': undefined,
451
456
  'fetchTransactions': undefined,
452
457
  'fetchTransfers': undefined,
453
458
  'fetchWithdrawAddresses': undefined,
454
459
  'fetchWithdrawal': undefined,
455
460
  'fetchWithdrawals': undefined,
461
+ 'fetchWithdrawalsWs': undefined,
456
462
  'reduceMargin': undefined,
457
463
  'setLeverage': undefined,
458
464
  'setMargin': undefined,
@@ -972,6 +978,13 @@ class Exchange {
972
978
  // and may be changed for consistency later
973
979
  return new Promise((resolve, reject) => resolve(this.currencies));
974
980
  }
981
+ fetchCurrenciesWs(params = {}) {
982
+ // markets are returned as a list
983
+ // currencies are returned as a dict
984
+ // this is for historical reasons
985
+ // and may be changed for consistency later
986
+ return new Promise((resolve, reject) => resolve(this.currencies));
987
+ }
975
988
  fetchMarkets(params = {}) {
976
989
  // markets are returned as a list
977
990
  // currencies are returned as a dict
@@ -979,6 +992,13 @@ class Exchange {
979
992
  // and may be changed for consistency later
980
993
  return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
981
994
  }
995
+ fetchMarketsWs(params = {}) {
996
+ // markets are returned as a list
997
+ // currencies are returned as a dict
998
+ // this is for historical reasons
999
+ // and may be changed for consistency later
1000
+ return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
1001
+ }
982
1002
  checkRequiredDependencies() {
983
1003
  return;
984
1004
  }
@@ -2757,6 +2777,13 @@ class Exchange {
2757
2777
  }
2758
2778
  throw new errors.NotSupported(this.id + ' fetchOHLCV() is not supported yet' + message);
2759
2779
  }
2780
+ async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
2781
+ let message = '';
2782
+ if (this.has['fetchTradesWs']) {
2783
+ message = '. If you want to build OHLCV candles from trade executions data, visit https://github.com/ccxt/ccxt/tree/master/examples/ and see "build-ohlcv-bars" file';
2784
+ }
2785
+ throw new errors.NotSupported(this.id + ' fetchOHLCVWs() is not supported yet. Try using fetchOHLCV instead.' + message);
2786
+ }
2760
2787
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
2761
2788
  throw new errors.NotSupported(this.id + ' watchOHLCV() is not supported yet');
2762
2789
  }
@@ -3116,7 +3143,7 @@ class Exchange {
3116
3143
  for (let i = 0; i < response.length; i++) {
3117
3144
  const item = response[i];
3118
3145
  const id = this.safeString(item, marketIdKey);
3119
- const market = this.safeMarket(id, undefined, undefined, this.safeString(this.options, 'defaultType'));
3146
+ const market = this.safeMarket(id, undefined, undefined, 'swap');
3120
3147
  const symbol = market['symbol'];
3121
3148
  const contract = this.safeValue(market, 'contract', false);
3122
3149
  if (contract && ((symbols === undefined) || this.inArray(symbol, symbols))) {
@@ -4110,9 +4137,6 @@ class Exchange {
4110
4137
  async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4111
4138
  throw new errors.NotSupported(this.id + ' watchMyTrades() is not supported yet');
4112
4139
  }
4113
- async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
4114
- throw new errors.NotSupported(this.id + ' fetchOHLCVWs() is not supported yet');
4115
- }
4116
4140
  async fetchGreeks(symbol, params = {}) {
4117
4141
  throw new errors.NotSupported(this.id + ' fetchGreeks() is not supported yet');
4118
4142
  }
@@ -4132,9 +4156,15 @@ class Exchange {
4132
4156
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
4133
4157
  throw new errors.NotSupported(this.id + ' fetchDeposits() is not supported yet');
4134
4158
  }
4159
+ async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
4160
+ throw new errors.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
4161
+ }
4135
4162
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
4136
4163
  throw new errors.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
4137
4164
  }
4165
+ async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
4166
+ throw new errors.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
4167
+ }
4138
4168
  async fetchOpenInterest(symbol, params = {}) {
4139
4169
  throw new errors.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
4140
4170
  }
@@ -4614,6 +4644,9 @@ class Exchange {
4614
4644
  async fetchTradingFees(params = {}) {
4615
4645
  throw new errors.NotSupported(this.id + ' fetchTradingFees() is not supported yet');
4616
4646
  }
4647
+ async fetchTradingFeesWs(params = {}) {
4648
+ throw new errors.NotSupported(this.id + ' fetchTradingFeesWs() is not supported yet');
4649
+ }
4617
4650
  async fetchTradingFee(symbol, params = {}) {
4618
4651
  if (!this.has['fetchTradingFees']) {
4619
4652
  throw new errors.NotSupported(this.id + ' fetchTradingFee() is not supported yet');
@@ -1,17 +1,19 @@
1
1
  'use strict';
2
2
 
3
+ var WebSocket = require('ws');
3
4
  var Client = require('./Client.js');
4
5
  var platform = require('../functions/platform.js');
5
6
  require('../functions/encode.js');
6
7
  require('../functions/crypto.js');
7
8
  var time = require('../functions/time.js');
8
- var WebSocket = require('ws');
9
9
  var Future = require('./Future.js');
10
10
 
11
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
12
 
13
13
  var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket);
14
14
 
15
+ // eslint-disable-next-line no-shadow
16
+ // eslint-disable-next-line no-restricted-globals
15
17
  const WebSocketPlatform = platform.isNode ? WebSocket__default["default"] : self.WebSocket;
16
18
  class WsClient extends Client {
17
19
  createConnection() {
@@ -54,8 +54,8 @@ class bitget extends bitget$1 {
54
54
  'fetchBorrowInterest': true,
55
55
  'fetchBorrowRateHistories': false,
56
56
  'fetchBorrowRateHistory': false,
57
- 'fetchCanceledOrders': true,
58
57
  'fetchCanceledAndClosedOrders': true,
58
+ 'fetchCanceledOrders': true,
59
59
  'fetchClosedOrders': true,
60
60
  'fetchCrossBorrowRate': true,
61
61
  'fetchCrossBorrowRates': false,