@hashgraph/hedera-wallet-connect 1.4.3-canary.72dd569.0 → 1.4.4-canary.fc5ac42.0
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.
- package/dist/lib/dapp/index.js +18 -3
- package/package.json +3 -3
package/dist/lib/dapp/index.js
CHANGED
@@ -111,6 +111,10 @@ export class DAppConnector {
|
|
111
111
|
this.signers = existingSessions.flatMap((session) => this.createSigners(session));
|
112
112
|
else
|
113
113
|
this.checkIframeConnect();
|
114
|
+
// Validate and refresh signers every 10 seconds
|
115
|
+
setInterval(() => {
|
116
|
+
this.validateAndRefreshSigners();
|
117
|
+
}, 10000);
|
114
118
|
this.walletConnectClient.on('session_event', this.handleSessionEvent.bind(this));
|
115
119
|
this.walletConnectClient.on('session_update', this.handleSessionUpdate.bind(this));
|
116
120
|
this.walletConnectClient.on('session_delete', this.handleSessionDelete.bind(this));
|
@@ -231,19 +235,30 @@ export class DAppConnector {
|
|
231
235
|
return false;
|
232
236
|
}
|
233
237
|
const session = this.walletConnectClient.session.get(topic);
|
234
|
-
const
|
238
|
+
const signer = this.signers.find((signer) => signer.topic === topic);
|
235
239
|
if (!session) {
|
236
240
|
// If session doesn't exist but we have a signer for it, clean up
|
237
|
-
if (
|
241
|
+
if (Boolean(signer)) {
|
238
242
|
this.logger.warn(`Signer exists but no session found for topic: ${topic}`);
|
239
243
|
this.handleSessionDelete({ topic });
|
240
244
|
}
|
241
245
|
return false;
|
242
246
|
}
|
243
|
-
if (!
|
247
|
+
if (!Boolean(signer)) {
|
244
248
|
this.logger.warn(`Session exists but no signer found for topic: ${topic}`);
|
245
249
|
return false;
|
246
250
|
}
|
251
|
+
this.logger.info(`Session validated for topic: ${topic} - will extend expiry`);
|
252
|
+
this.walletConnectClient
|
253
|
+
.extend({
|
254
|
+
topic: topic,
|
255
|
+
})
|
256
|
+
.then(() => {
|
257
|
+
this.logger.info(`Session extended for topic: ${topic}`);
|
258
|
+
})
|
259
|
+
.catch((e) => {
|
260
|
+
this.logger.error('Error extending session:', e);
|
261
|
+
});
|
247
262
|
return true;
|
248
263
|
}
|
249
264
|
catch (e) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hashgraph/hedera-wallet-connect",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.4-canary.fc5ac42.0",
|
4
4
|
"description": "A library to facilitate integrating Hedera with WalletConnect",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -23,8 +23,8 @@
|
|
23
23
|
"@types/node": "^22.5.0",
|
24
24
|
"@types/react-dom": "^18.2.21",
|
25
25
|
"@walletconnect/modal": "^2.7.0",
|
26
|
-
"@walletconnect/sign-client": "^2.17.
|
27
|
-
"@walletconnect/types": "^2.17.
|
26
|
+
"@walletconnect/sign-client": "^2.17.3",
|
27
|
+
"@walletconnect/types": "^2.17.3",
|
28
28
|
"concurrently": "^9.0.1",
|
29
29
|
"esbuild": "^0.24.0",
|
30
30
|
"esbuild-plugin-copy": "^2.1.1",
|