cosmos-connect-core 0.1.15 → 0.1.17
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.
|
@@ -127,7 +127,7 @@ export class WalletConnectV2 {
|
|
|
127
127
|
console.log(`WalletConnectV2: URI generated (attempt ${attempt + 1}/${maxRetries})`, uri);
|
|
128
128
|
this._uri = uri;
|
|
129
129
|
this.onUriCbs.forEach((cb) => cb(uri));
|
|
130
|
-
console.log(
|
|
130
|
+
console.log(`WalletConnectV2: Waiting for approval (timeout: ${pairingTimeout}ms)...`);
|
|
131
131
|
try {
|
|
132
132
|
const approvalPromise = approval();
|
|
133
133
|
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Connection approval timed out')), pairingTimeout));
|
|
@@ -144,9 +144,10 @@ export class WalletConnectV2 {
|
|
|
144
144
|
return; // Successfully connected
|
|
145
145
|
}
|
|
146
146
|
catch (err) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
const isRetryable = err?.message === 'Connection approval timed out' ||
|
|
148
|
+
err?.message === 'Proposal expired';
|
|
149
|
+
if (isRetryable && attempt < maxRetries - 1) {
|
|
150
|
+
console.log(`WalletConnectV2: ${err.message}, regenerating QR code (attempt ${attempt + 2}/${maxRetries})...`);
|
|
150
151
|
continue; // Retry with a new URI
|
|
151
152
|
}
|
|
152
153
|
throw err;
|