@dynamic-labs/sdk-react-core 4.9.6 → 4.9.8
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/data/api/wallets/wallets.cjs +3 -1
- package/src/lib/data/api/wallets/wallets.js +3 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +5 -6
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +5 -6
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +3 -3
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.9.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.7...v4.9.8) (2025-03-24)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* unlink wallets when using 7702 account ([#8367](https://github.com/dynamic-labs/dynamic-auth/issues/8367)) ([f5acf05](https://github.com/dynamic-labs/dynamic-auth/commit/f5acf05ef31b8f411f3b0cd0e90e919e71f4ad50))
|
|
8
|
+
|
|
9
|
+
### [4.9.7](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.6...v4.9.7) (2025-03-21)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* back button for metamask qr code ([#8343](https://github.com/dynamic-labs/dynamic-auth/issues/8343)) ([2a9defd](https://github.com/dynamic-labs/dynamic-auth/commit/2a9defdbb19dc9879e4967fbba28b3a98414105a))
|
|
15
|
+
|
|
2
16
|
### [4.9.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.5...v4.9.6) (2025-03-21)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.8",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.644",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.9.
|
|
18
|
-
"@dynamic-labs/iconic": "4.9.
|
|
19
|
-
"@dynamic-labs/logger": "4.9.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.9.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.9.
|
|
22
|
-
"@dynamic-labs/store": "4.9.
|
|
23
|
-
"@dynamic-labs/types": "4.9.
|
|
24
|
-
"@dynamic-labs/utils": "4.9.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.9.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.9.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.9.8",
|
|
18
|
+
"@dynamic-labs/iconic": "4.9.8",
|
|
19
|
+
"@dynamic-labs/logger": "4.9.8",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.9.8",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.9.8",
|
|
22
|
+
"@dynamic-labs/store": "4.9.8",
|
|
23
|
+
"@dynamic-labs/types": "4.9.8",
|
|
24
|
+
"@dynamic-labs/utils": "4.9.8",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.9.8",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.9.8",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -70,11 +70,13 @@ const linkWallet = (environmentId_1, _b) => _tslib.__awaiter(void 0, [environmen
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
const unlinkWallet = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ environmentId, primaryWalletId, walletId, onSuccess, }) {
|
|
73
|
+
// 7702 wallets have a -zerodev suffix because it's a credential created on the fly
|
|
74
|
+
const normalizedPrimaryWalletId = primaryWalletId === null || primaryWalletId === void 0 ? void 0 : primaryWalletId.replace('-zerodev', '');
|
|
73
75
|
try {
|
|
74
76
|
const response = yield api.sdkApi().verifyUnlink({
|
|
75
77
|
environmentId,
|
|
76
78
|
verifyUnlinkRequest: {
|
|
77
|
-
primaryWalletId,
|
|
79
|
+
primaryWalletId: normalizedPrimaryWalletId,
|
|
78
80
|
walletId,
|
|
79
81
|
},
|
|
80
82
|
});
|
|
@@ -66,11 +66,13 @@ const linkWallet = (environmentId_1, _b) => __awaiter(void 0, [environmentId_1,
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
const unlinkWallet = (_c) => __awaiter(void 0, [_c], void 0, function* ({ environmentId, primaryWalletId, walletId, onSuccess, }) {
|
|
69
|
+
// 7702 wallets have a -zerodev suffix because it's a credential created on the fly
|
|
70
|
+
const normalizedPrimaryWalletId = primaryWalletId === null || primaryWalletId === void 0 ? void 0 : primaryWalletId.replace('-zerodev', '');
|
|
69
71
|
try {
|
|
70
72
|
const response = yield sdkApi().verifyUnlink({
|
|
71
73
|
environmentId,
|
|
72
74
|
verifyUnlinkRequest: {
|
|
73
|
-
primaryWalletId,
|
|
75
|
+
primaryWalletId: normalizedPrimaryWalletId,
|
|
74
76
|
walletId,
|
|
75
77
|
},
|
|
76
78
|
});
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
|
-
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
10
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
10
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
12
11
|
var utils$1 = require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.cjs');
|
|
12
|
+
require('@dynamic-labs/sdk-api-core');
|
|
13
13
|
require('../../../config/ApiEndpoint.cjs');
|
|
14
14
|
require('../../constants/values.cjs');
|
|
15
15
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -110,11 +110,10 @@ const useEmbeddedWalletSessionKeys = ({ environmentId, projectSettings, }) => {
|
|
|
110
110
|
}
|
|
111
111
|
return decodedSessionKeys === null || decodedSessionKeys === void 0 ? void 0 : decodedSessionKeys.publicKey;
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
113
|
+
// this is a temporary fix to ensure that session keys are registered on signin for all wallets
|
|
114
|
+
// the user is undefined at this point in the auth flow and we cant check the users wallet version
|
|
115
|
+
// so we just return true for now
|
|
116
|
+
const shouldRegisterSessionKeysOnSignin = () => true;
|
|
118
117
|
const toEncodedFormat = (publicKey, privateKey, privateKeyJwk, registered, expirationDate) => {
|
|
119
118
|
const sessionKeys = {
|
|
120
119
|
expirationDate,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { StorageService, InvalidEmbeddedWalletSessionKeyError } from '@dynamic-labs/utils';
|
|
5
|
-
import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';
|
|
6
5
|
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
7
6
|
import { SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS } from '../../constants/localStorage.js';
|
|
8
7
|
import { p256Sign, p256Keygen } from '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.js';
|
|
8
|
+
import '@dynamic-labs/sdk-api-core';
|
|
9
9
|
import '../../../config/ApiEndpoint.js';
|
|
10
10
|
import '../../constants/values.js';
|
|
11
11
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -106,11 +106,10 @@ const useEmbeddedWalletSessionKeys = ({ environmentId, projectSettings, }) => {
|
|
|
106
106
|
}
|
|
107
107
|
return decodedSessionKeys === null || decodedSessionKeys === void 0 ? void 0 : decodedSessionKeys.publicKey;
|
|
108
108
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
};
|
|
109
|
+
// this is a temporary fix to ensure that session keys are registered on signin for all wallets
|
|
110
|
+
// the user is undefined at this point in the auth flow and we cant check the users wallet version
|
|
111
|
+
// so we just return true for now
|
|
112
|
+
const shouldRegisterSessionKeysOnSignin = () => true;
|
|
114
113
|
const toEncodedFormat = (publicKey, privateKey, privateKeyJwk, registered, expirationDate) => {
|
|
115
114
|
const sessionKeys = {
|
|
116
115
|
expirationDate,
|
package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs
CHANGED
|
@@ -102,7 +102,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
102
102
|
const { setMultiWalletWidgetState, setShowAuthFlow, setSelectedWalletConnectorKey, walletConnectorOptions, setQrcodeUri, setDesktopUri, user, linkedWallets, setLegacyIsVerifying, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
103
103
|
const { mockedSDK } = MockContext.useMockContext();
|
|
104
104
|
const { setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
105
|
-
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
105
|
+
const { pushView, clearStackAndPushInitialView, replaceView } = ViewContext.useViewContext();
|
|
106
106
|
const handleCustodialWalletClick = (walletConnector) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
107
107
|
logger.logger.debug('handleCustodialWalletClick', walletConnector);
|
|
108
108
|
const twoStepAuthentication = requiresTwoStepAuthentication.requiresTwoStepAuthentication(walletConnector);
|
|
@@ -149,7 +149,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
149
149
|
logger.logger.debug('handleUninstalledClick', walletConnector);
|
|
150
150
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
151
151
|
if (!walletConnector.canConnectViaQrCode) {
|
|
152
|
-
|
|
152
|
+
replaceView('no-qr-not-installed');
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
155
|
onQrCodeConnect({
|
|
@@ -163,7 +163,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
163
163
|
},
|
|
164
164
|
walletConnector,
|
|
165
165
|
});
|
|
166
|
-
|
|
166
|
+
replaceView('qr-code');
|
|
167
167
|
}
|
|
168
168
|
setError(undefined);
|
|
169
169
|
});
|
|
@@ -98,7 +98,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
98
98
|
const { setMultiWalletWidgetState, setShowAuthFlow, setSelectedWalletConnectorKey, walletConnectorOptions, setQrcodeUri, setDesktopUri, user, linkedWallets, setLegacyIsVerifying, authMode, } = useInternalDynamicContext();
|
|
99
99
|
const { mockedSDK } = useMockContext();
|
|
100
100
|
const { setError, setErrorMessage } = useErrorContext();
|
|
101
|
-
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
101
|
+
const { pushView, clearStackAndPushInitialView, replaceView } = useViewContext();
|
|
102
102
|
const handleCustodialWalletClick = (walletConnector) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
103
|
logger.debug('handleCustodialWalletClick', walletConnector);
|
|
104
104
|
const twoStepAuthentication = requiresTwoStepAuthentication(walletConnector);
|
|
@@ -145,7 +145,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
145
145
|
logger.debug('handleUninstalledClick', walletConnector);
|
|
146
146
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
147
147
|
if (!walletConnector.canConnectViaQrCode) {
|
|
148
|
-
|
|
148
|
+
replaceView('no-qr-not-installed');
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
onQrCodeConnect({
|
|
@@ -159,7 +159,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
159
159
|
},
|
|
160
160
|
walletConnector,
|
|
161
161
|
});
|
|
162
|
-
|
|
162
|
+
replaceView('qr-code');
|
|
163
163
|
}
|
|
164
164
|
setError(undefined);
|
|
165
165
|
});
|