@dynamic-labs/legacy-embedded-wallet-migration 5.9.2 → 5.9.3
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 +7 -0
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/constants.d.ts +12 -0
- package/src/lib/constants.js +13 -1
- package/src/lib/upgradeToDynamicWaas/upgradeToDynamicWaas.js +12 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [5.9.3](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.2...v5.9.3) (2026-10-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **deps:** patch undici/joi/webpack-dev-middleware highs (main) ([#12452](https://github.com/dynamic-labs/dynamic-auth/issues/12452)) ([3b2ac12](https://github.com/dynamic-labs/dynamic-auth/commit/3b2ac126153bec03c0f296353a71a97bb61974d9)), closes [#1030-1048](https://github.com/dynamic-labs/dynamic-auth/issues/1030-1048) [#1036](https://github.com/dynamic-labs/dynamic-auth/issues/1036) [#1035](https://github.com/dynamic-labs/dynamic-auth/issues/1035)
|
|
8
|
+
|
|
2
9
|
### [5.9.2](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.1...v5.9.2) (2026-09-28)
|
|
3
10
|
|
|
4
11
|
|
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/legacy-embedded-wallet-migration",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"module": "./src/index.js",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dynamic-labs-sdk/client": "1.
|
|
20
|
-
"@dynamic-labs/assert-package-version": "5.9.
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.
|
|
22
|
-
"@dynamic-labs/utils": "5.9.
|
|
23
|
-
"@dynamic-labs/wallet-connector-core": "5.9.
|
|
19
|
+
"@dynamic-labs-sdk/client": "1.37.0",
|
|
20
|
+
"@dynamic-labs/assert-package-version": "5.9.3",
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.70.0",
|
|
22
|
+
"@dynamic-labs/utils": "5.9.3",
|
|
23
|
+
"@dynamic-labs/wallet-connector-core": "5.9.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@dynamic-labs/sdk-react-core": "5.9.
|
|
26
|
+
"@dynamic-labs/sdk-react-core": "5.9.3",
|
|
27
27
|
"react": ">=18.0.0 <20.0.0",
|
|
28
28
|
"react-i18next": ">=13.0.0",
|
|
29
|
-
"@dynamic-labs/types": "5.9.
|
|
29
|
+
"@dynamic-labs/types": "5.9.3"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/lib/constants.d.ts
CHANGED
|
@@ -5,4 +5,16 @@ export declare const ERROR_PROCESSING_REVEAL_REQUEST = "error_processing_reveal_
|
|
|
5
5
|
export declare const INVALID_WALLET_DATA = "invalid_wallet";
|
|
6
6
|
export declare const USER_NOT_LOGGED_IN = "user_not_logged_in";
|
|
7
7
|
export declare const SECURE_ENCLAVE_WALLET_SESSION_KEYS = "dynamic_secure_enclave_session_keys";
|
|
8
|
+
export declare const UPGRADE_TO_WAAS_MESSAGES: {
|
|
9
|
+
readonly completed: "Upgrade to WaaS - migration completed";
|
|
10
|
+
readonly restore: "Upgrade to WaaS - restoring legacy wallet after failed import";
|
|
11
|
+
readonly softDeleted: "Upgrade to WaaS - legacy wallet soft deleted";
|
|
12
|
+
readonly started: "Upgrade to WaaS - migration started";
|
|
13
|
+
};
|
|
14
|
+
export declare const UPGRADE_TO_WAAS_KEYS: {
|
|
15
|
+
readonly completed: "upgradeToWaasCompleted";
|
|
16
|
+
readonly restore: "upgradeToWaasRestore";
|
|
17
|
+
readonly softDeleted: "upgradeToWaasSoftDeleted";
|
|
18
|
+
readonly started: "upgradeToWaasStarted";
|
|
19
|
+
};
|
|
8
20
|
export declare const SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS: StorageOptions;
|
package/src/lib/constants.js
CHANGED
|
@@ -5,8 +5,20 @@ const ERROR_PROCESSING_REVEAL_REQUEST = 'error_processing_reveal_request';
|
|
|
5
5
|
const INVALID_WALLET_DATA = 'invalid_wallet';
|
|
6
6
|
const USER_NOT_LOGGED_IN = 'user_not_logged_in';
|
|
7
7
|
const SECURE_ENCLAVE_WALLET_SESSION_KEYS = 'dynamic_secure_enclave_session_keys';
|
|
8
|
+
const UPGRADE_TO_WAAS_MESSAGES = {
|
|
9
|
+
completed: 'Upgrade to WaaS - migration completed',
|
|
10
|
+
restore: 'Upgrade to WaaS - restoring legacy wallet after failed import',
|
|
11
|
+
softDeleted: 'Upgrade to WaaS - legacy wallet soft deleted',
|
|
12
|
+
started: 'Upgrade to WaaS - migration started',
|
|
13
|
+
};
|
|
14
|
+
const UPGRADE_TO_WAAS_KEYS = {
|
|
15
|
+
completed: 'upgradeToWaasCompleted',
|
|
16
|
+
restore: 'upgradeToWaasRestore',
|
|
17
|
+
softDeleted: 'upgradeToWaasSoftDeleted',
|
|
18
|
+
started: 'upgradeToWaasStarted',
|
|
19
|
+
};
|
|
8
20
|
const SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS = {
|
|
9
21
|
priority: ['secureStorage', 'localStorage'],
|
|
10
22
|
};
|
|
11
23
|
|
|
12
|
-
export { ERROR_PROCESSING_REVEAL_REQUEST, INVALID_WALLET_DATA, SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS, USER_NOT_LOGGED_IN, iframeContainerId, iframeElementId };
|
|
24
|
+
export { ERROR_PROCESSING_REVEAL_REQUEST, INVALID_WALLET_DATA, SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS, UPGRADE_TO_WAAS_KEYS, UPGRADE_TO_WAAS_MESSAGES, USER_NOT_LOGGED_IN, iframeContainerId, iframeElementId };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
3
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
4
4
|
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import { UPGRADE_TO_WAAS_MESSAGES, UPGRADE_TO_WAAS_KEYS } from '../constants.js';
|
|
5
6
|
import { restoreEmbeddedWallet } from '../restoreEmbeddedWallet/restoreEmbeddedWallet.js';
|
|
6
7
|
import { softDeleteEmbeddedWallet } from '../softDeleteEmbeddedWallet/softDeleteEmbeddedWallet.js';
|
|
7
8
|
|
|
@@ -15,20 +16,19 @@ const upgradeToDynamicWaas = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
15
16
|
}
|
|
16
17
|
// 7702 wallets have a -zerodev suffix because it's a credential created on the fly
|
|
17
18
|
const normalizedWalletId = walletId.replace(ZERODEV_SUFFIX, '');
|
|
19
|
+
const migrationStart = Date.now();
|
|
18
20
|
let softDeleteSucceeded = false;
|
|
19
|
-
|
|
21
|
+
const upgradeLogBase = {
|
|
20
22
|
chain: chainName,
|
|
21
|
-
key: 'upgradeToWaasStarted',
|
|
22
23
|
walletId: normalizedWalletId,
|
|
23
|
-
}
|
|
24
|
+
};
|
|
25
|
+
logger.debug(UPGRADE_TO_WAAS_MESSAGES.started, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.started }, upgradeLogBase));
|
|
26
|
+
logger.instrument(UPGRADE_TO_WAAS_MESSAGES.started, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.started, time: 0 }, upgradeLogBase));
|
|
24
27
|
try {
|
|
25
28
|
yield softDeleteEmbeddedWallet({ walletId: normalizedWalletId });
|
|
26
29
|
softDeleteSucceeded = true;
|
|
27
|
-
logger.debug(
|
|
28
|
-
|
|
29
|
-
key: 'upgradeToWaasSoftDeleted',
|
|
30
|
-
walletId: normalizedWalletId,
|
|
31
|
-
});
|
|
30
|
+
logger.debug(UPGRADE_TO_WAAS_MESSAGES.softDeleted, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.softDeleted }, upgradeLogBase));
|
|
31
|
+
logger.instrument(UPGRADE_TO_WAAS_MESSAGES.softDeleted, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.softDeleted, time: Date.now() - migrationStart }, upgradeLogBase));
|
|
32
32
|
yield walletConnector.importPrivateKey({
|
|
33
33
|
chainName,
|
|
34
34
|
legacyWalletId: normalizedWalletId,
|
|
@@ -36,11 +36,8 @@ const upgradeToDynamicWaas = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
36
36
|
privateKey,
|
|
37
37
|
publicAddressCheck,
|
|
38
38
|
});
|
|
39
|
-
logger.info(
|
|
40
|
-
|
|
41
|
-
key: 'upgradeToWaasCompleted',
|
|
42
|
-
walletId: normalizedWalletId,
|
|
43
|
-
});
|
|
39
|
+
logger.info(UPGRADE_TO_WAAS_MESSAGES.completed, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.completed }, upgradeLogBase));
|
|
40
|
+
logger.instrument(UPGRADE_TO_WAAS_MESSAGES.completed, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.completed, time: Date.now() - migrationStart }, upgradeLogBase));
|
|
44
41
|
}
|
|
45
42
|
catch (error) {
|
|
46
43
|
logger.error('Upgrade to WaaS - migration failed', {
|
|
@@ -50,11 +47,8 @@ const upgradeToDynamicWaas = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
50
47
|
walletId: normalizedWalletId,
|
|
51
48
|
});
|
|
52
49
|
if (softDeleteSucceeded) {
|
|
53
|
-
logger.debug(
|
|
54
|
-
|
|
55
|
-
key: 'upgradeToWaasRestore',
|
|
56
|
-
walletId: normalizedWalletId,
|
|
57
|
-
});
|
|
50
|
+
logger.debug(UPGRADE_TO_WAAS_MESSAGES.restore, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.restore }, upgradeLogBase));
|
|
51
|
+
logger.instrument(UPGRADE_TO_WAAS_MESSAGES.restore, Object.assign({ key: UPGRADE_TO_WAAS_KEYS.restore, time: Date.now() - migrationStart }, upgradeLogBase));
|
|
58
52
|
yield restoreEmbeddedWallet({ walletId: normalizedWalletId });
|
|
59
53
|
yield onRestore();
|
|
60
54
|
}
|