@icgio/icg-exchanges-wrapper 1.10.22 → 1.10.24

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.
@@ -1249,7 +1249,7 @@ module.exports = class Orders {
1249
1249
  }
1250
1250
  let get_rates = (Exchanges, ExchangesRatesOnly, exchange_pairs, exchange_pairs_rates_only, interval_dict) => {
1251
1251
  for (let exchange in Exchanges) {
1252
- if (Exchanges[exchange].ws_market) {
1252
+ if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'spot') {
1253
1253
  setInterval(() => {
1254
1254
  if (!this.ws_market_first_time[exchange]) {
1255
1255
  Exchanges[exchange].ws_market(exchange_pairs[exchange])
@@ -1262,6 +1262,19 @@ module.exports = class Orders {
1262
1262
  }
1263
1263
  }
1264
1264
  }, interval_dict[exchange].rates)
1265
+ } else if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'dex') {
1266
+ setInterval(() => {
1267
+ if (!this.ws_market_first_time[exchange]) {
1268
+ Exchanges[exchange].ws_market(exchange_pairs[exchange])
1269
+ this.ws_market_first_time[exchange] = true
1270
+ } else {
1271
+ for (let pair of exchange_pairs[exchange]) {
1272
+ Exchanges[exchange].rate_with_routes_ws(pair, (res) => {
1273
+ rates_handler(exchange, pair, res, true)
1274
+ })
1275
+ }
1276
+ }
1277
+ }, interval_dict[exchange].rates)
1265
1278
  } else if (Exchanges[exchange].exchange_type === 'spot') {
1266
1279
  for (let pair of exchange_pairs[exchange]) {
1267
1280
  setInterval(() => {
@@ -1319,7 +1332,7 @@ module.exports = class Orders {
1319
1332
  let get_market_history = (Exchanges, exchange_pairs, interval_dict) => {
1320
1333
  for (let exchange in Exchanges) {
1321
1334
  const market_history_timeframe = exchange === 'coinbene' ? 30 * 24 * 60 * 60 * 1000 : MARKET_HISTORY_DEFAULT_TIME
1322
- if (Exchanges[exchange].ws_market) {
1335
+ if (Exchanges[exchange].ws_market && Exchanges[exchange].exchange_type === 'spot') {
1323
1336
  setInterval(() => {
1324
1337
  if (!this.ws_market_first_time[exchange]) {
1325
1338
  Exchanges[exchange].ws_market(exchange_pairs[exchange])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.10.22",
3
+ "version": "1.10.24",
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.28.15",
20
+ "@icgio/icg-exchanges": "^1.28.17",
21
21
  "@icgio/icg-exchanges-data": "^1.6.77",
22
22
  "@icgio/icg-utils": "^1.7.40",
23
23
  "influx": "^5.7.0",