@icgio/icg-exchanges-wrapper 1.17.26 → 1.17.28

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.
@@ -576,11 +576,12 @@ const get_exchanges_market_history = function (Exchanges, exchange_pair_dict, ti
576
576
  }
577
577
  check_status()
578
578
  })
579
- // Store the cached promise AFTER `new Promise(...)` returns — assigning inside
580
- // the synchronous executor reads the outer binding while it's still undefined.
581
- // Keep the entry alive while the socket is alive; the else-branch above
582
- // overwrites this slot when the socket is closed/stopped.
583
- ws_market_history_promises[ws_key] = ws_promise
579
+ // Do NOT cache this promise. `Exchange.market_history_ws(pair, tf, cb)` returns a
580
+ // filtered/sorted SNAPSHOT of `market_history_dict[pair]` at call time (see icg-exchanges
581
+ // mexc.js:214), so the result is frozen once the promise resolves. Rerunning the else
582
+ // branch each poll lets a new `market_history_ws` call pick up trades the WebSocket has
583
+ // appended since last tick; `first_time[Exchange_name]` still prevents the underlying
584
+ // WS from being reopened, so there's no reconnect cost.
584
585
  }
585
586
 
586
587
  // If WebSocket promise rejects (timeout/error), fall back to REST for all pairs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.17.26",
3
+ "version": "1.17.28",
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.41.0",
20
+ "@icgio/icg-exchanges": "^1.41.1",
21
21
  "@icgio/icg-utils": "^1.9.61",
22
22
  "lodash": "^4.17.23",
23
23
  "pg": "^8.17.2"