@icgio/icg-exchanges-wrapper 1.14.266 → 1.14.267

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.
@@ -7,7 +7,10 @@ const utils = require('@icgio/icg-utils').utils
7
7
  const { crypto_rates: get_crypto_rates, observable: Observable } = require('@icgio/icg-utils')
8
8
 
9
9
  const Account = require('./account.js')
10
- const { ws_data_client } = require('../lib/ws-data-client.js')
10
+ const { ws_data_client: default_ws_data_client } = require('../lib/ws-data-client.js')
11
+
12
+ // Module-level ws_data_client reference (can be overridden)
13
+ let ws_data_client = default_ws_data_client
11
14
 
12
15
  // Default precision functions - will be overridden if provided in settings
13
16
  let round_price = (exchange, pair, price) => price
@@ -244,7 +247,11 @@ module.exports = class Orders {
244
247
  }, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
245
248
  }
246
249
  // Initialize WS data client for streaming to dashboard backend
247
- if (settings.ws_backend_secret && settings.client_id) {
250
+ // If external ws_client is provided, use it instead of the default
251
+ if (settings.ws_client) {
252
+ ws_data_client = settings.ws_client
253
+ ws_data_client.set_order_info_ref(this.order_info)
254
+ } else if (settings.ws_backend_secret && settings.client_id) {
248
255
  ws_data_client.init(settings.ws_backend_secret, settings.client_id)
249
256
  ws_data_client.set_order_info_ref(this.order_info)
250
257
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.14.266",
3
+ "version": "1.14.267",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {