@hashgraphonline/hashinal-wc 1.0.91 → 1.0.92-canary

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.
@@ -2419,7 +2419,7 @@ function pfGlobalThisOrFallback() {
2419
2419
  const qt = /* @__PURE__ */ getDefaultExportFromCjs$1(browser$1);
2420
2420
  const c = { level: "info" }, n = "custom_context";
2421
2421
  var x$1 = Object.defineProperty, S$1 = Object.defineProperties, _ = Object.getOwnPropertyDescriptors, p = Object.getOwnPropertySymbols, T = Object.prototype.hasOwnProperty, z$1 = Object.prototype.propertyIsEnumerable, f = (r, e, t) => e in r ? x$1(r, e, { enumerable: true, configurable: true, writable: true, value: t }) : r[e] = t, i = (r, e) => {
2422
- for (var t in e || (e = {})) T.call(e, t) && f(r, t, e[t]);
2422
+ for (var t in e) T.call(e, t) && f(r, t, e[t]);
2423
2423
  if (p) for (var t of p(e)) z$1.call(e, t) && f(r, t, e[t]);
2424
2424
  return r;
2425
2425
  }, g = (r, e) => S$1(r, _(e));
@@ -5177,6 +5177,9 @@ class DAppConnector {
5177
5177
  this.signers = existingSessions.flatMap((session) => this.createSigners(session));
5178
5178
  else
5179
5179
  this.checkIframeConnect();
5180
+ setInterval(() => {
5181
+ this.validateAndRefreshSigners();
5182
+ }, 1e4);
5180
5183
  this.walletConnectClient.on("session_event", this.handleSessionEvent.bind(this));
5181
5184
  this.walletConnectClient.on("session_update", this.handleSessionUpdate.bind(this));
5182
5185
  this.walletConnectClient.on("session_delete", this.handleSessionDelete.bind(this));
@@ -5292,18 +5295,26 @@ class DAppConnector {
5292
5295
  return false;
5293
5296
  }
5294
5297
  const session = this.walletConnectClient.session.get(topic);
5295
- const hasSigner = this.signers.some((signer) => signer.topic === topic);
5298
+ const signer = this.signers.find((signer2) => signer2.topic === topic);
5296
5299
  if (!session) {
5297
- if (hasSigner) {
5300
+ if (Boolean(signer)) {
5298
5301
  this.logger.warn(`Signer exists but no session found for topic: ${topic}`);
5299
5302
  this.handleSessionDelete({ topic });
5300
5303
  }
5301
5304
  return false;
5302
5305
  }
5303
- if (!hasSigner) {
5306
+ if (!Boolean(signer)) {
5304
5307
  this.logger.warn(`Session exists but no signer found for topic: ${topic}`);
5305
5308
  return false;
5306
5309
  }
5310
+ this.logger.info(`Session validated for topic: ${topic} - will extend expiry`);
5311
+ this.walletConnectClient.extend({
5312
+ topic
5313
+ }).then(() => {
5314
+ this.logger.info(`Session extended for topic: ${topic}`);
5315
+ }).catch((e) => {
5316
+ this.logger.error("Error extending session:", e);
5317
+ });
5307
5318
  return true;
5308
5319
  } catch (e) {
5309
5320
  this.logger.error("Error validating session:", e);