@dynamic-labs/sdk-react-core 4.92.2 → 4.92.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 CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ### [4.92.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.2...v4.92.3) (2026-07-10)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **sdk-react-core:** fix deterministic 'Wallet not found' crash in embedded wallet export (v4) ([#11906](https://github.com/dynamic-labs/dynamic-auth/issues/11906)) ([913ef23](https://github.com/dynamic-labs/dynamic-auth/commit/913ef236b26245488e1cd5db7e874601b65ff0a2)), closes [#11905](https://github.com/dynamic-labs/dynamic-auth/issues/11905) [#11729](https://github.com/dynamic-labs/dynamic-auth/issues/11729)
8
+
2
9
  ### [4.92.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.1...v4.92.2) (2026-07-09)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.92.2";
6
+ var version = "4.92.3";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.1067",
9
9
  "@dynamic-labs-sdk/client": "1.18.0",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "4.92.2";
2
+ var version = "4.92.3";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.1067",
5
5
  "@dynamic-labs-sdk/client": "1.18.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.92.2",
3
+ "version": "4.92.3",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.1067",
6
6
  "@dynamic-labs-sdk/client": "1.18.0",
@@ -18,17 +18,17 @@
18
18
  "react-i18next": "13.5.0",
19
19
  "react-international-phone": "4.5.0",
20
20
  "yup": "0.32.11",
21
- "@dynamic-labs/assert-package-version": "4.92.2",
22
- "@dynamic-labs/iconic": "4.92.2",
23
- "@dynamic-labs/locale": "4.92.2",
24
- "@dynamic-labs/logger": "4.92.2",
25
- "@dynamic-labs/multi-wallet": "4.92.2",
26
- "@dynamic-labs/rpc-providers": "4.92.2",
27
- "@dynamic-labs/store": "4.92.2",
28
- "@dynamic-labs/types": "4.92.2",
29
- "@dynamic-labs/utils": "4.92.2",
30
- "@dynamic-labs/wallet-book": "4.92.2",
31
- "@dynamic-labs/wallet-connector-core": "4.92.2",
21
+ "@dynamic-labs/assert-package-version": "4.92.3",
22
+ "@dynamic-labs/iconic": "4.92.3",
23
+ "@dynamic-labs/locale": "4.92.3",
24
+ "@dynamic-labs/logger": "4.92.3",
25
+ "@dynamic-labs/multi-wallet": "4.92.3",
26
+ "@dynamic-labs/rpc-providers": "4.92.3",
27
+ "@dynamic-labs/store": "4.92.3",
28
+ "@dynamic-labs/types": "4.92.3",
29
+ "@dynamic-labs/utils": "4.92.3",
30
+ "@dynamic-labs/wallet-book": "4.92.3",
31
+ "@dynamic-labs/wallet-connector-core": "4.92.3",
32
32
  "eventemitter3": "5.0.1"
33
33
  },
34
34
  "devDependencies": {
@@ -139,7 +139,7 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
139
139
  const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, walletId, }) => {
140
140
  var _a, _b, _c, _d, _e;
141
141
  const { primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
142
- const { userWallets } = UserWalletsContext.useInternalUserWallets();
142
+ const userWallets = UserWalletsContext.useUserWalletsExternal();
143
143
  const { handleAcknowledgeExportPrompt } = useSyncEmbeddedWalletFlow.useSyncEmbeddedWalletFlow();
144
144
  const isWaasWallet = Boolean(user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => { var _a; return (_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('dynamicwaas'); }));
145
145
  const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
@@ -147,8 +147,10 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, walle
147
147
  const { getEOAWallet, isSmartWallet } = useSmartWallets.useSmartWallets();
148
148
  const [isAcknowledged, setIsAcknowledged] = React.useState(false);
149
149
  const [iframeContainerRef, setIframeContainerRef] = React.useState(null);
150
+ // Smart wallets' signer EOAs are not registered in userWallets, so also
151
+ // match a user wallet whose derived EOA carries the requested id
150
152
  const walletFromId = walletId
151
- ? userWallets.find((w) => w.id === walletId)
153
+ ? userWallets.find((w) => { var _a; return w.id === walletId || ((_a = getEOAWallet(w)) === null || _a === void 0 ? void 0 : _a.id) === walletId; })
152
154
  : undefined;
153
155
  if (walletId && !walletFromId) {
154
156
  throw new utils.DynamicError('Wallet not found. Please try again.', errors.INVALID_WALLET_DATA);
@@ -51,7 +51,7 @@ import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
51
51
  import '../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
52
52
  import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
53
53
  import '../../../context/AccountExistsContext/AccountExistsContext.js';
54
- import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
54
+ import { useUserWalletsExternal } from '../../../context/UserWalletsContext/UserWalletsContext.js';
55
55
  import '../../../store/state/authMode/authMode.js';
56
56
  import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
57
57
  import '../../../context/VerificationContext/VerificationContext.js';
@@ -135,7 +135,7 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
135
135
  const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, walletId, }) => {
136
136
  var _a, _b, _c, _d, _e;
137
137
  const { primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext();
138
- const { userWallets } = useInternalUserWallets();
138
+ const userWallets = useUserWalletsExternal();
139
139
  const { handleAcknowledgeExportPrompt } = useSyncEmbeddedWalletFlow();
140
140
  const isWaasWallet = Boolean(user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => { var _a; return (_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('dynamicwaas'); }));
141
141
  const { setDynamicWidgetView } = useWidgetContext();
@@ -143,8 +143,10 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, walle
143
143
  const { getEOAWallet, isSmartWallet } = useSmartWallets();
144
144
  const [isAcknowledged, setIsAcknowledged] = useState(false);
145
145
  const [iframeContainerRef, setIframeContainerRef] = useState(null);
146
+ // Smart wallets' signer EOAs are not registered in userWallets, so also
147
+ // match a user wallet whose derived EOA carries the requested id
146
148
  const walletFromId = walletId
147
- ? userWallets.find((w) => w.id === walletId)
149
+ ? userWallets.find((w) => { var _a; return w.id === walletId || ((_a = getEOAWallet(w)) === null || _a === void 0 ? void 0 : _a.id) === walletId; })
148
150
  : undefined;
149
151
  if (walletId && !walletFromId) {
150
152
  throw new DynamicError('Wallet not found. Please try again.', INVALID_WALLET_DATA);
@@ -178,7 +178,11 @@ const EmbeddedWalletExportSection = () => {
178
178
  }, [setShowAuthFlow, pushView]);
179
179
  const handleExportClick = React.useCallback((recoveryPhrase) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
180
180
  var _l;
181
- const targetWalletId = wallet === null || wallet === void 0 ? void 0 : wallet.id;
181
+ // Pin the primary wallet's id: when the primary wallet is a smart wallet,
182
+ // the derived EOA wallet is not registered in userWallets, so its id
183
+ // would fail EmbeddedRevealView's lookup. The view derives the EOA from
184
+ // the pinned wallet itself.
185
+ const targetWalletId = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id;
182
186
  logger.logger.info('Starting embedded wallet export process', {
183
187
  userId: user === null || user === void 0 ? void 0 : user.userId,
184
188
  walletId: targetWalletId,
@@ -219,6 +223,7 @@ const EmbeddedWalletExportSection = () => {
219
223
  }
220
224
  return initExportProcess(recoveryPhrase, false, targetWalletId);
221
225
  }), [
226
+ primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
222
227
  wallet,
223
228
  user,
224
229
  isStepUpRequired,
@@ -174,7 +174,11 @@ const EmbeddedWalletExportSection = () => {
174
174
  }, [setShowAuthFlow, pushView]);
175
175
  const handleExportClick = useCallback((recoveryPhrase) => __awaiter(void 0, void 0, void 0, function* () {
176
176
  var _l;
177
- const targetWalletId = wallet === null || wallet === void 0 ? void 0 : wallet.id;
177
+ // Pin the primary wallet's id: when the primary wallet is a smart wallet,
178
+ // the derived EOA wallet is not registered in userWallets, so its id
179
+ // would fail EmbeddedRevealView's lookup. The view derives the EOA from
180
+ // the pinned wallet itself.
181
+ const targetWalletId = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id;
178
182
  logger.info('Starting embedded wallet export process', {
179
183
  userId: user === null || user === void 0 ? void 0 : user.userId,
180
184
  walletId: targetWalletId,
@@ -215,6 +219,7 @@ const EmbeddedWalletExportSection = () => {
215
219
  }
216
220
  return initExportProcess(recoveryPhrase, false, targetWalletId);
217
221
  }), [
222
+ primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
218
223
  wallet,
219
224
  user,
220
225
  isStepUpRequired,