@icgio/icg-exchanges 1.40.40 → 1.40.41

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.
@@ -197,6 +197,7 @@ class CoinbaseFixMd {
197
197
  target_comp_id: 'Coinbase',
198
198
  heartbeat_interval: 30,
199
199
  build_logon_fields: (seq, time) => build_logon_fields(options.api_key, options.secret_key, options.passphrase, seq, time),
200
+ on_inbound_message: options.on_inbound_message,
200
201
  on_market_data_batch: this.on_batch ? (batch) => this._handle_md_batch(batch) : undefined,
201
202
  on_market_data_incremental: this.on_batch ? undefined : (fields) => this._handle_md(fields),
202
203
  on_market_data_snapshot: (fields) => this._handle_md(fields),
@@ -179,6 +179,7 @@ module.exports = class Coinbase extends ExchangeBase {
179
179
  // --- Market data (FIX default for legacy keys, WS fallback) ---
180
180
 
181
181
  ws_market(pair_list, options = {}) {
182
+ this.ws.market.pair_stale_check_enabled = options.depth !== false
182
183
  if (this._use_fix) {
183
184
  this._fix_market_data(pair_list, options)
184
185
  } else if (!this.advanced && this.passphrase) {
@@ -602,6 +603,9 @@ module.exports = class Coinbase extends ExchangeBase {
602
603
  secret_key: Array.isArray(secret_key) ? secret_key[0] : secret_key,
603
604
  passphrase: this.passphrase,
604
605
  symbols,
606
+ on_inbound_message: () => {
607
+ this.ws.market.last_message_time = Date.now()
608
+ },
605
609
  on_status: (status) => {
606
610
  console.log('[coinbase FIX MD] status:', status)
607
611
  if (status === 'ready') {
@@ -82,6 +82,7 @@ module.exports = class ExchangeFix {
82
82
  this.on_market_data_batch = options.on_market_data_batch // called once per data chunk with array of fields
83
83
  this.on_market_data_snapshot = options.on_market_data_snapshot
84
84
  this.on_market_data_request_reject = options.on_market_data_request_reject
85
+ this.on_inbound_message = options.on_inbound_message || (() => {})
85
86
  this.on_status_change = options.on_status_change || (() => {})
86
87
 
87
88
  this.socket = null
@@ -139,6 +140,7 @@ module.exports = class ExchangeFix {
139
140
  this.recv_buffer = remaining
140
141
  let md_batch = null
141
142
  for (let msg of messages) {
143
+ this.on_inbound_message(msg)
142
144
  let t = msg.msg_type
143
145
  if (t === 'A') {
144
146
  this._set_status('ready')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges",
3
- "version": "1.40.40",
3
+ "version": "1.40.41",
4
4
  "description": "icgio exchanges package",
5
5
  "main": "./exchanges.js",
6
6
  "scripts": {