@dynamic-labs/wallet-connect 5.3.1 → 5.4.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/CHANGELOG.md +39 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +4 -3
- package/src/getSignClientSingleton/createResilientStorage.cjs +64 -0
- package/src/getSignClientSingleton/createResilientStorage.d.ts +12 -0
- package/src/getSignClientSingleton/createResilientStorage.js +60 -0
- package/src/getSignClientSingleton/getSignClientSingleton.cjs +4 -0
- package/src/getSignClientSingleton/getSignClientSingleton.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
|
|
2
|
+
## [5.4.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.3.2...v5.4.0) (2026-08-25)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **aleo:** wire up signMessage on the WaaS Aleo connector ([#12235](https://github.com/dynamic-labs/dynamic-auth/issues/12235)) ([e56cbf5](https://github.com/dynamic-labs/dynamic-auth/commit/e56cbf5546bdcc21ce916dece43ae36dcea9b808))
|
|
8
|
+
* **waas:** thread isRawScalarImport through importPrivateKey for ed25519 chains ([#12220](https://github.com/dynamic-labs/dynamic-auth/issues/12220)) ([ced9efa](https://github.com/dynamic-labs/dynamic-auth/commit/ced9efac5fa5a4a1280383419f56fe22733722cd))
|
|
9
|
+
* **webview:** add policies message contract and controller ([#12248](https://github.com/dynamic-labs/dynamic-auth/issues/12248)) ([8557c1e](https://github.com/dynamic-labs/dynamic-auth/commit/8557c1ed3861e12f1f06b2bb610184813b577daa))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **bitcoin:** pass the wallet's address type when signing ([#12265](https://github.com/dynamic-labs/dynamic-auth/issues/12265)) ([b8a8eab](https://github.com/dynamic-labs/dynamic-auth/commit/b8a8eab7e4cc294cc307fb10ea6814e76111a274))
|
|
15
|
+
* remediate high-severity tar vulnerability and prune a dead override ([#12268](https://github.com/dynamic-labs/dynamic-auth/issues/12268)) ([6b1b343](https://github.com/dynamic-labs/dynamic-auth/commit/6b1b343e7947e8da30012446677e342ae9bfe14a))
|
|
16
|
+
* **waas-svm:** fix retry-classification and environmentId gaps in [#12240](https://github.com/dynamic-labs/dynamic-auth/issues/12240) ([#12247](https://github.com/dynamic-labs/dynamic-auth/issues/12247)) ([e79cecc](https://github.com/dynamic-labs/dynamic-auth/commit/e79ceccd424c48c3a7f45fdd6ea288c269ac0171))
|
|
17
|
+
* **wallet-connect:** reopen WalletConnect IndexedDB when the browser closes the connection ([#12262](https://github.com/dynamic-labs/dynamic-auth/issues/12262)) ([1a20dde](https://github.com/dynamic-labs/dynamic-auth/commit/1a20ddeaeec590ae3390c9e47ef3c14738379b83))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Performance Improvements
|
|
21
|
+
|
|
22
|
+
* **ethereum-gasless-core:** parallel 7702 auth signing and long-poll sponsored-tx status ([#12225](https://github.com/dynamic-labs/dynamic-auth/issues/12225)) ([53ca916](https://github.com/dynamic-labs/dynamic-auth/commit/53ca91668f8dd839c52d55a0e5d7bb5257f7f415))
|
|
23
|
+
|
|
24
|
+
### [5.3.2](https://github.com/dynamic-labs/dynamic-auth/compare/v5.3.1...v5.3.2) (2026-08-19)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **bitcoin:** add allowedSighash to embedded wallet signPsbt ([#12233](https://github.com/dynamic-labs/dynamic-auth/issues/12233)) ([d0ff829](https://github.com/dynamic-labs/dynamic-auth/commit/d0ff8291a3d1771d5ca356172acc10af94349b15))
|
|
30
|
+
* **bitcoin:** forward signingIndexes to embedded PSBT signing ([#12211](https://github.com/dynamic-labs/dynamic-auth/issues/12211)) ([733da3d](https://github.com/dynamic-labs/dynamic-auth/commit/733da3d32f39a9ae6d813df84fcff6350ba12eb5))
|
|
31
|
+
* expose createOfflineRecoveryShares SDK function in webview and legacy client ([#12239](https://github.com/dynamic-labs/dynamic-auth/issues/12239)) ([c8056e8](https://github.com/dynamic-labs/dynamic-auth/commit/c8056e8d5a1c66ac0146b046bc7cc198de118f0b))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* **bitcoin:** parse PSBTs with the active network's address encoding ([#12219](https://github.com/dynamic-labs/dynamic-auth/issues/12219)) ([8b151e2](https://github.com/dynamic-labs/dynamic-auth/commit/8b151e23440094cfa0d48728e1d0f19de567ca05))
|
|
37
|
+
* **bitcoin:** stop ensureActiveAccount from resetting a switched network ([#12215](https://github.com/dynamic-labs/dynamic-auth/issues/12215)) ([86668b7](https://github.com/dynamic-labs/dynamic-auth/commit/86668b79d23cd89b7e96518551cdaecab7dd5ce3))
|
|
38
|
+
* remediate high-severity dependency vulnerabilities ([#12238](https://github.com/dynamic-labs/dynamic-auth/issues/12238)) ([a4fc78c](https://github.com/dynamic-labs/dynamic-auth/commit/a4fc78ca27ee44ce6a1038c4e0d07f55528b4994))
|
|
39
|
+
* **waas-svm:** retry SVM gas sponsorship before falling back, then throw ([#12240](https://github.com/dynamic-labs/dynamic-auth/issues/12240)) ([f599a7a](https://github.com/dynamic-labs/dynamic-auth/commit/f599a7af55727e06373772acf574ee7c43e56bbb))
|
|
40
|
+
|
|
2
41
|
### [5.3.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.3.0...v5.3.1) (2026-08-14)
|
|
3
42
|
|
|
4
43
|
## [5.3.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.2.0...v5.3.0) (2026-08-12)
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connect",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/logger": "5.
|
|
21
|
+
"@dynamic-labs/logger": "5.4.0",
|
|
22
|
+
"@walletconnect/keyvaluestorage": "1.1.1",
|
|
22
23
|
"@walletconnect/sign-client": "2.21.5",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "5.
|
|
24
|
+
"@dynamic-labs/assert-package-version": "5.4.0"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {}
|
|
26
27
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
|
+
var keyvaluestorage = require('@walletconnect/keyvaluestorage');
|
|
8
|
+
var logger = require('../utils/logger.cjs');
|
|
9
|
+
|
|
10
|
+
// WalletConnect's browser storage keeps a single IndexedDB connection cached for
|
|
11
|
+
// the life of the page (idb-keyval's `createStore`). WebKit unilaterally closes
|
|
12
|
+
// IndexedDB connections under memory pressure and on some page lifecycle
|
|
13
|
+
// transitions, and the cached connection is never reopened, so every read and
|
|
14
|
+
// write from that point on rejects with one of these errors — WalletConnect
|
|
15
|
+
// pairing, session persistence and signing stay broken until a full reload.
|
|
16
|
+
const CLOSING_CONNECTION_MESSAGE = 'The database connection is closing';
|
|
17
|
+
const RECOVERABLE_ERROR_NAMES = new Set([
|
|
18
|
+
'InvalidStateError',
|
|
19
|
+
'UnknownError',
|
|
20
|
+
'AbortError',
|
|
21
|
+
'TransactionInactiveError',
|
|
22
|
+
]);
|
|
23
|
+
const isRecoverableError = (error) => {
|
|
24
|
+
if (!(error instanceof Error)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const hasRecoverableName = RECOVERABLE_ERROR_NAMES.has(error.name);
|
|
28
|
+
return (hasRecoverableName || error.message.includes(CLOSING_CONNECTION_MESSAGE));
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Wraps WalletConnect's own key/value storage so a dead IndexedDB connection is
|
|
32
|
+
* recovered instead of failing every subsequent operation.
|
|
33
|
+
*
|
|
34
|
+
* A fresh `KeyValueStorage` opens a fresh IndexedDB connection, so retrying the
|
|
35
|
+
* operation against a new instance succeeds once the browser has closed the
|
|
36
|
+
* previous one. Instantiating it also re-runs WalletConnect's own
|
|
37
|
+
* localStorage-to-IndexedDB migration check, which is a no-op for already
|
|
38
|
+
* migrated data, and falls back to localStorage when IndexedDB is unusable.
|
|
39
|
+
*/
|
|
40
|
+
const createResilientStorage = () => {
|
|
41
|
+
let storage = new keyvaluestorage.KeyValueStorage();
|
|
42
|
+
const withRecovery = (operation) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
return yield operation(storage);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (!isRecoverableError(error)) {
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
logger.logger.warn('WalletConnect storage operation failed, reopening the connection', error);
|
|
51
|
+
storage = new keyvaluestorage.KeyValueStorage();
|
|
52
|
+
return operation(storage);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
getEntries: () => withRecovery((current) => current.getEntries()),
|
|
57
|
+
getItem: (key) => withRecovery((current) => current.getItem(key)),
|
|
58
|
+
getKeys: () => withRecovery((current) => current.getKeys()),
|
|
59
|
+
removeItem: (key) => withRecovery((current) => current.removeItem(key)),
|
|
60
|
+
setItem: (key, value) => withRecovery((current) => current.setItem(key, value)),
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.createResilientStorage = createResilientStorage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IKeyValueStorage } from '@walletconnect/keyvaluestorage';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps WalletConnect's own key/value storage so a dead IndexedDB connection is
|
|
4
|
+
* recovered instead of failing every subsequent operation.
|
|
5
|
+
*
|
|
6
|
+
* A fresh `KeyValueStorage` opens a fresh IndexedDB connection, so retrying the
|
|
7
|
+
* operation against a new instance succeeds once the browser has closed the
|
|
8
|
+
* previous one. Instantiating it also re-runs WalletConnect's own
|
|
9
|
+
* localStorage-to-IndexedDB migration check, which is a no-op for already
|
|
10
|
+
* migrated data, and falls back to localStorage when IndexedDB is unusable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createResilientStorage: () => IKeyValueStorage;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
|
+
import { KeyValueStorage } from '@walletconnect/keyvaluestorage';
|
|
4
|
+
import { logger } from '../utils/logger.js';
|
|
5
|
+
|
|
6
|
+
// WalletConnect's browser storage keeps a single IndexedDB connection cached for
|
|
7
|
+
// the life of the page (idb-keyval's `createStore`). WebKit unilaterally closes
|
|
8
|
+
// IndexedDB connections under memory pressure and on some page lifecycle
|
|
9
|
+
// transitions, and the cached connection is never reopened, so every read and
|
|
10
|
+
// write from that point on rejects with one of these errors — WalletConnect
|
|
11
|
+
// pairing, session persistence and signing stay broken until a full reload.
|
|
12
|
+
const CLOSING_CONNECTION_MESSAGE = 'The database connection is closing';
|
|
13
|
+
const RECOVERABLE_ERROR_NAMES = new Set([
|
|
14
|
+
'InvalidStateError',
|
|
15
|
+
'UnknownError',
|
|
16
|
+
'AbortError',
|
|
17
|
+
'TransactionInactiveError',
|
|
18
|
+
]);
|
|
19
|
+
const isRecoverableError = (error) => {
|
|
20
|
+
if (!(error instanceof Error)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const hasRecoverableName = RECOVERABLE_ERROR_NAMES.has(error.name);
|
|
24
|
+
return (hasRecoverableName || error.message.includes(CLOSING_CONNECTION_MESSAGE));
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Wraps WalletConnect's own key/value storage so a dead IndexedDB connection is
|
|
28
|
+
* recovered instead of failing every subsequent operation.
|
|
29
|
+
*
|
|
30
|
+
* A fresh `KeyValueStorage` opens a fresh IndexedDB connection, so retrying the
|
|
31
|
+
* operation against a new instance succeeds once the browser has closed the
|
|
32
|
+
* previous one. Instantiating it also re-runs WalletConnect's own
|
|
33
|
+
* localStorage-to-IndexedDB migration check, which is a no-op for already
|
|
34
|
+
* migrated data, and falls back to localStorage when IndexedDB is unusable.
|
|
35
|
+
*/
|
|
36
|
+
const createResilientStorage = () => {
|
|
37
|
+
let storage = new KeyValueStorage();
|
|
38
|
+
const withRecovery = (operation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
return yield operation(storage);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (!isRecoverableError(error)) {
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
logger.warn('WalletConnect storage operation failed, reopening the connection', error);
|
|
47
|
+
storage = new KeyValueStorage();
|
|
48
|
+
return operation(storage);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
getEntries: () => withRecovery((current) => current.getEntries()),
|
|
53
|
+
getItem: (key) => withRecovery((current) => current.getItem(key)),
|
|
54
|
+
getKeys: () => withRecovery((current) => current.getKeys()),
|
|
55
|
+
removeItem: (key) => withRecovery((current) => current.removeItem(key)),
|
|
56
|
+
setItem: (key, value) => withRecovery((current) => current.setItem(key, value)),
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { createResilientStorage };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var SignClient = require('@walletconnect/sign-client');
|
|
8
|
+
var createResilientStorage = require('./createResilientStorage.cjs');
|
|
8
9
|
var ensureWalletConnectStore = require('./ensureWalletConnectStore.cjs');
|
|
9
10
|
var reconcileOrphanedPairings = require('./reconcileOrphanedPairings.cjs');
|
|
10
11
|
|
|
@@ -36,6 +37,9 @@ const getSignClientSingleton = (_a) => _tslib.__awaiter(void 0, [_a], void 0, fu
|
|
|
36
37
|
url: '',
|
|
37
38
|
},
|
|
38
39
|
projectId,
|
|
40
|
+
// WalletConnect's default storage caches one IndexedDB connection for the
|
|
41
|
+
// life of the page; this wrapper reopens it when the browser closes it.
|
|
42
|
+
storage: createResilientStorage.createResilientStorage(),
|
|
39
43
|
});
|
|
40
44
|
// Drain any pairings left over from a prior page load that never got
|
|
41
45
|
// cleaned up (closed tabs, crashes, abandoned QR scans). Without this,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import SignClient from '@walletconnect/sign-client';
|
|
4
|
+
import { createResilientStorage } from './createResilientStorage.js';
|
|
4
5
|
import { ensureWalletConnectStore } from './ensureWalletConnectStore.js';
|
|
5
6
|
import { reconcileOrphanedPairings } from './reconcileOrphanedPairings.js';
|
|
6
7
|
|
|
@@ -28,6 +29,9 @@ const getSignClientSingleton = (_a) => __awaiter(void 0, [_a], void 0, function*
|
|
|
28
29
|
url: '',
|
|
29
30
|
},
|
|
30
31
|
projectId,
|
|
32
|
+
// WalletConnect's default storage caches one IndexedDB connection for the
|
|
33
|
+
// life of the page; this wrapper reopens it when the browser closes it.
|
|
34
|
+
storage: createResilientStorage(),
|
|
31
35
|
});
|
|
32
36
|
// Drain any pairings left over from a prior page load that never got
|
|
33
37
|
// cleaned up (closed tabs, crashes, abandoned QR scans). Without this,
|