@icgio/icg-exchanges-wrapper 1.17.3 → 1.17.4

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.
@@ -135,6 +135,7 @@ module.exports = class Orders {
135
135
  this.no_cancel_previous_exchanges = settings.no_cancel_previous_exchanges || []
136
136
  this.no_cancel_range_exchanges = settings.no_cancel_range_exchanges || []
137
137
  this.no_trades_function_exchanges = settings.no_trades_function_exchanges || []
138
+ this.ws_market_options = settings.ws_market_options || {}
138
139
  this.no_trades_function_f_filled_timeout = 30 * 1000
139
140
  this.buy_sell_limits_threshold = 0.95
140
141
  this.p_filled_threshold = 0
@@ -1440,7 +1441,7 @@ module.exports = class Orders {
1440
1441
  for (let exchange in exchange_pairs) {
1441
1442
  if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'spot') {
1442
1443
  if (!this.ws_market_first_time[exchange]) {
1443
- Exchanges[exchange].ws_market(exchange_pairs[exchange])
1444
+ Exchanges[exchange].ws_market(exchange_pairs[exchange], this.ws_market_options)
1444
1445
  this.ws_market_first_time[exchange] = true
1445
1446
  }
1446
1447
  for (let pair of exchange_pairs[exchange]) {
@@ -1451,7 +1452,7 @@ module.exports = class Orders {
1451
1452
  } else if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'dex') {
1452
1453
  setInterval(() => {
1453
1454
  if (!this.ws_market_first_time[exchange]) {
1454
- Exchanges[exchange].ws_market(exchange_pairs[exchange])
1455
+ Exchanges[exchange].ws_market(exchange_pairs[exchange], this.ws_market_options)
1455
1456
  this.ws_market_first_time[exchange] = true
1456
1457
  } else {
1457
1458
  for (let pair of exchange_pairs[exchange]) {
@@ -1482,11 +1483,11 @@ module.exports = class Orders {
1482
1483
  for (let exchange in exchange_pairs_rates_only) {
1483
1484
  if (ExchangesRatesOnly[exchange].ws_market) {
1484
1485
  if (!this.ws_market_first_time[exchange]) {
1485
- ExchangesRatesOnly[exchange].ws_market(exchange_pairs_rates_only[exchange])
1486
+ ExchangesRatesOnly[exchange].ws_market(exchange_pairs_rates_only[exchange], { bbo: true, depth: false, trades: false })
1486
1487
  this.ws_market_first_time[exchange] = true
1487
1488
  }
1488
1489
  for (let pair of exchange_pairs_rates_only[exchange]) {
1489
- ExchangesRatesOnly[exchange].rate_ws_top_observable(pair, (res) => {
1490
+ ExchangesRatesOnly[exchange].bbo_ws_observable(pair, (res) => {
1490
1491
  rates_handler(exchange, pair, res)
1491
1492
  })
1492
1493
  }
@@ -1517,7 +1518,7 @@ module.exports = class Orders {
1517
1518
  const market_history_timeframe = exchange === 'coinbene' ? 30 * 24 * 60 * 60 * 1000 : MARKET_HISTORY_DEFAULT_MS
1518
1519
  if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'spot') {
1519
1520
  if (!this.ws_market_first_time[exchange]) {
1520
- Exchanges[exchange].ws_market(exchange_pairs[exchange])
1521
+ Exchanges[exchange].ws_market(exchange_pairs[exchange], this.ws_market_options)
1521
1522
  this.ws_market_first_time[exchange] = true
1522
1523
  }
1523
1524
  for (let pair of exchange_pairs[exchange]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.17.3",
3
+ "version": "1.17.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
19
19
  "dependencies": {
20
- "@icgio/icg-exchanges": "^1.40.2",
20
+ "@icgio/icg-exchanges": "^1.40.3",
21
21
  "@icgio/icg-utils": "^1.9.53",
22
22
  "lodash": "^4.17.23",
23
23
  "pg": "^8.17.2"