@dynamic-labs/sdk-react-core 4.12.2 → 4.12.4

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +3 -92
  6. package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +2 -91
  7. package/src/lib/components/UserProfile/UserProfile.cjs +2 -3
  8. package/src/lib/components/UserProfile/UserProfile.js +2 -3
  9. package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.cjs +86 -33
  10. package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.js +88 -35
  11. package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +8 -4
  12. package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +8 -4
  13. package/src/lib/locale/en/translation.cjs +16 -1
  14. package/src/lib/locale/en/translation.d.ts +15 -0
  15. package/src/lib/locale/en/translation.js +16 -1
  16. package/src/lib/shared/assets/index.d.ts +1 -0
  17. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +14 -9
  18. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +14 -9
  19. package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.cjs +13 -4
  20. package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.js +13 -4
  21. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +3 -1
  22. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +3 -1
  23. package/src/lib/widgets/DynamicWidget/components/BottomNavBar/BottomNavBar.cjs +1 -1
  24. package/src/lib/widgets/DynamicWidget/components/BottomNavBar/BottomNavBar.d.ts +1 -0
  25. package/src/lib/widgets/DynamicWidget/components/BottomNavBar/BottomNavBar.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
1
 
2
+ ### [4.12.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.12.3...v4.12.4) (2025-04-18)
3
+
4
+ ### [4.12.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.12.2...v4.12.3) (2025-04-17)
5
+
6
+
7
+ ### Features
8
+
9
+ * default waas sui connector network based on enabled chains ([#8570](https://github.com/dynamic-labs/dynamic-auth/issues/8570)) ([9a11b01](https://github.com/dynamic-labs/dynamic-auth/commit/9a11b019bc8ed51873de9d24c93bcc3c1ed6406b))
10
+ * dynamic waas can sign smart account transactiosn ([#8551](https://github.com/dynamic-labs/dynamic-auth/issues/8551)) ([f4882eb](https://github.com/dynamic-labs/dynamic-auth/commit/f4882ebc869b5af72c3beb187bd1a98b83c06e04))
11
+
2
12
  ### [4.12.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.12.1...v4.12.2) (2025-04-16)
3
13
 
4
14
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.12.2";
6
+ var version = "4.12.4";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.658",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "4.12.2";
2
+ var version = "4.12.4";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.658",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.12.2",
3
+ "version": "4.12.4",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.658",
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.12.2",
18
- "@dynamic-labs/iconic": "4.12.2",
19
- "@dynamic-labs/logger": "4.12.2",
20
- "@dynamic-labs/multi-wallet": "4.12.2",
21
- "@dynamic-labs/rpc-providers": "4.12.2",
22
- "@dynamic-labs/store": "4.12.2",
23
- "@dynamic-labs/types": "4.12.2",
24
- "@dynamic-labs/utils": "4.12.2",
25
- "@dynamic-labs/wallet-book": "4.12.2",
26
- "@dynamic-labs/wallet-connector-core": "4.12.2",
17
+ "@dynamic-labs/assert-package-version": "4.12.4",
18
+ "@dynamic-labs/iconic": "4.12.4",
19
+ "@dynamic-labs/logger": "4.12.4",
20
+ "@dynamic-labs/multi-wallet": "4.12.4",
21
+ "@dynamic-labs/rpc-providers": "4.12.4",
22
+ "@dynamic-labs/store": "4.12.4",
23
+ "@dynamic-labs/types": "4.12.4",
24
+ "@dynamic-labs/utils": "4.12.4",
25
+ "@dynamic-labs/wallet-book": "4.12.4",
26
+ "@dynamic-labs/wallet-connector-core": "4.12.4",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
29
29
  "devDependencies": {
@@ -8,97 +8,8 @@ var classNames = require('../../utils/functions/classNames/classNames.cjs');
8
8
  var Typography = require('../Typography/Typography.cjs');
9
9
  require('react');
10
10
  var dynamicLogo = require('../../assets/dynamic-logo.cjs');
11
- require('../../context/DynamicContext/DynamicContext.cjs');
12
- require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
13
- require('@dynamic-labs/sdk-api-core');
14
- require('../../shared/logger.cjs');
15
- require('@dynamic-labs/iconic');
16
- require('@dynamic-labs/wallet-connector-core');
17
- require('../../context/ViewContext/ViewContext.cjs');
18
- require('@dynamic-labs/wallet-book');
19
- require('@dynamic-labs/utils');
20
- require('../../utils/constants/colors.cjs');
21
- require('../../utils/constants/values.cjs');
22
- require('../../shared/consts/index.cjs');
23
- require('../../events/dynamicEvents.cjs');
24
- require('../../../../_virtual/_tslib.cjs');
25
- require('../../context/CaptchaContext/CaptchaContext.cjs');
26
- require('../../context/ErrorContext/ErrorContext.cjs');
27
- require('@dynamic-labs/multi-wallet');
28
- require('react-international-phone');
29
- require('../../store/state/nonce/nonce.cjs');
30
- require('../../store/state/projectSettings/projectSettings.cjs');
31
- require('../../config/ApiEndpoint.cjs');
32
- require('../../store/state/user/user.cjs');
33
- require('../../locale/locale.cjs');
34
- require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
35
- require('../../store/state/primaryWalletId/primaryWalletId.cjs');
36
- require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
37
- require('../../context/AccountExistsContext/AccountExistsContext.cjs');
38
- require('../../context/UserWalletsContext/UserWalletsContext.cjs');
39
- require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
40
- require('../../context/VerificationContext/VerificationContext.cjs');
41
- require('react-dom');
42
- require('../../utils/functions/compareChains/compareChains.cjs');
43
- require('../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
44
- require('../../context/ThemeContext/ThemeContext.cjs');
45
- require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
46
- require('bs58');
47
- require('@dynamic-labs/types');
48
- require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
49
- require('../../context/LoadingContext/LoadingContext.cjs');
50
- require('../../context/WalletContext/WalletContext.cjs');
51
- require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
52
- require('yup');
53
- require('../../context/MockContext/MockContext.cjs');
54
- require('../../views/CollectUserDataView/useFields.cjs');
55
- require('../../context/FieldsStateContext/FieldsStateContext.cjs');
56
- require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
57
- require('@dynamic-labs/rpc-providers');
58
- require('../../store/state/walletOptions/walletOptions.cjs');
59
- require('react-i18next');
60
- require('../Accordion/components/AccordionItem/AccordionItem.cjs');
61
- require('../Alert/Alert.cjs');
62
- require('../ShadowDOM/ShadowDOM.cjs');
63
- require('../IconButton/IconButton.cjs');
64
- require('../InlineWidget/InlineWidget.cjs');
65
- require('../Input/Input.cjs');
66
- require('../IsBrowser/IsBrowser.cjs');
67
- require('../MenuList/Dropdown/Dropdown.cjs');
68
- require('../OverlayCard/OverlayCard.cjs');
69
- require('../Transition/ZoomTransition/ZoomTransition.cjs');
70
- require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
71
- require('../Transition/OpacityTransition/OpacityTransition.cjs');
72
- require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
73
- require('../Popper/Popper/Popper.cjs');
74
- require('../Popper/PopperContext/PopperContext.cjs');
75
- require('react-focus-lock');
76
11
  var DynamicWidgetFooter = require('../../widgets/DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.cjs');
77
- require('qrcode');
78
- require('formik');
79
- require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
80
- require('../../context/WalletGroupContext/WalletGroupContext.cjs');
81
- require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
82
- require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
83
- require('../../context/ConnectWithOtpContext/constants.cjs');
84
- require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
85
- require('@hcaptcha/react-hcaptcha');
86
- require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
87
- require('../../context/FooterAnimationContext/index.cjs');
88
- require('../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
89
- require('../../context/PasskeyContext/PasskeyContext.cjs');
90
- require('../../store/state/sendBalances.cjs');
91
- require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
92
- require('../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
93
- require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
94
- require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
95
- require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
96
- require('../../context/OnrampContext/OnrampContext.cjs');
97
- require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
98
- require('../../../index.cjs');
99
- require('../../store/state/tokenBalances.cjs');
100
- require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
101
- var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
12
+ var projectSettings = require('../../store/state/projectSettings/projectSettings.cjs');
102
13
 
103
14
  const URL = 'https://dynamic.xyz';
104
15
  const alignClassNames = {
@@ -107,8 +18,8 @@ const alignClassNames = {
107
18
  };
108
19
  const PoweredByDynamic = ({ align = 'center', classNameLogo, classNameRoot, classNameText, asFooter, }) => {
109
20
  var _a;
110
- const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
111
- if (((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) === false) {
21
+ const projectSettings$1 = projectSettings.useProjectSettings();
22
+ if (((_a = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) === false) {
112
23
  return null;
113
24
  }
114
25
  const content = (jsxRuntime.jsxs("a", { target: '_blank', href: URL, className: classNames.classNames('powered-by-dynamic', alignClassNames[align], classNameRoot), rel: 'noreferrer', children: [jsxRuntime.jsx(Typography.Typography, { as: 'span', color: 'tertiary', weight: 'regular', variant: 'body_mini', className: classNames.classNames('powered-by-dynamic__text', classNameText), children: "Powered by" }), jsxRuntime.jsx(dynamicLogo.ReactComponent, { className: classNames.classNames('powered-by-dynamic__logo', classNameLogo) })] }));
@@ -4,97 +4,8 @@ import { classNames } from '../../utils/functions/classNames/classNames.js';
4
4
  import { Typography } from '../Typography/Typography.js';
5
5
  import 'react';
6
6
  import { ReactComponent as SvgDynamicLogo } from '../../assets/dynamic-logo.js';
7
- import '../../context/DynamicContext/DynamicContext.js';
8
- import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
9
- import '@dynamic-labs/sdk-api-core';
10
- import '../../shared/logger.js';
11
- import '@dynamic-labs/iconic';
12
- import '@dynamic-labs/wallet-connector-core';
13
- import '../../context/ViewContext/ViewContext.js';
14
- import '@dynamic-labs/wallet-book';
15
- import '@dynamic-labs/utils';
16
- import '../../utils/constants/colors.js';
17
- import '../../utils/constants/values.js';
18
- import '../../shared/consts/index.js';
19
- import '../../events/dynamicEvents.js';
20
- import '../../../../_virtual/_tslib.js';
21
- import '../../context/CaptchaContext/CaptchaContext.js';
22
- import '../../context/ErrorContext/ErrorContext.js';
23
- import '@dynamic-labs/multi-wallet';
24
- import 'react-international-phone';
25
- import '../../store/state/nonce/nonce.js';
26
- import '../../store/state/projectSettings/projectSettings.js';
27
- import '../../config/ApiEndpoint.js';
28
- import '../../store/state/user/user.js';
29
- import '../../locale/locale.js';
30
- import '../../store/state/dynamicContextProps/dynamicContextProps.js';
31
- import '../../store/state/primaryWalletId/primaryWalletId.js';
32
- import '../../context/AccessDeniedContext/AccessDeniedContext.js';
33
- import '../../context/AccountExistsContext/AccountExistsContext.js';
34
- import '../../context/UserWalletsContext/UserWalletsContext.js';
35
- import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
36
- import '../../context/VerificationContext/VerificationContext.js';
37
- import 'react-dom';
38
- import '../../utils/functions/compareChains/compareChains.js';
39
- import '../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
40
- import '../../context/ThemeContext/ThemeContext.js';
41
- import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
42
- import 'bs58';
43
- import '@dynamic-labs/types';
44
- import '../../context/SocialRedirectContext/SocialRedirectContext.js';
45
- import '../../context/LoadingContext/LoadingContext.js';
46
- import '../../context/WalletContext/WalletContext.js';
47
- import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
48
- import 'yup';
49
- import '../../context/MockContext/MockContext.js';
50
- import '../../views/CollectUserDataView/useFields.js';
51
- import '../../context/FieldsStateContext/FieldsStateContext.js';
52
- import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
53
- import '@dynamic-labs/rpc-providers';
54
- import '../../store/state/walletOptions/walletOptions.js';
55
- import 'react-i18next';
56
- import '../Accordion/components/AccordionItem/AccordionItem.js';
57
- import '../Alert/Alert.js';
58
- import '../ShadowDOM/ShadowDOM.js';
59
- import '../IconButton/IconButton.js';
60
- import '../InlineWidget/InlineWidget.js';
61
- import '../Input/Input.js';
62
- import '../IsBrowser/IsBrowser.js';
63
- import '../MenuList/Dropdown/Dropdown.js';
64
- import '../OverlayCard/OverlayCard.js';
65
- import '../Transition/ZoomTransition/ZoomTransition.js';
66
- import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
67
- import '../Transition/OpacityTransition/OpacityTransition.js';
68
- import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
69
- import '../Popper/Popper/Popper.js';
70
- import '../Popper/PopperContext/PopperContext.js';
71
- import 'react-focus-lock';
72
7
  import { DynamicWidgetFooter } from '../../widgets/DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.js';
73
- import 'qrcode';
74
- import 'formik';
75
- import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
76
- import '../../context/WalletGroupContext/WalletGroupContext.js';
77
- import '../../context/IpConfigurationContext/IpConfigurationContext.js';
78
- import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
79
- import '../../context/ConnectWithOtpContext/constants.js';
80
- import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
81
- import '@hcaptcha/react-hcaptcha';
82
- import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
83
- import '../../context/FooterAnimationContext/index.js';
84
- import '../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
85
- import '../../context/PasskeyContext/PasskeyContext.js';
86
- import '../../store/state/sendBalances.js';
87
- import '../../store/state/connectorsInitializing/connectorsInitializing.js';
88
- import '../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
89
- import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
90
- import '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
91
- import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
92
- import '../../context/OnrampContext/OnrampContext.js';
93
- import '../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
94
- import '../../../index.js';
95
- import '../../store/state/tokenBalances.js';
96
- import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
97
- import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
8
+ import { useProjectSettings } from '../../store/state/projectSettings/projectSettings.js';
98
9
 
99
10
  const URL = 'https://dynamic.xyz';
100
11
  const alignClassNames = {
@@ -103,7 +14,7 @@ const alignClassNames = {
103
14
  };
104
15
  const PoweredByDynamic = ({ align = 'center', classNameLogo, classNameRoot, classNameText, asFooter, }) => {
105
16
  var _a;
106
- const { projectSettings } = useInternalDynamicContext();
17
+ const projectSettings = useProjectSettings();
107
18
  if (((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) === false) {
108
19
  return null;
109
20
  }
@@ -172,10 +172,9 @@ const UserProfile = ({ rootClassName }) => {
172
172
  }
173
173
  return (jsxRuntime.jsx(UserProfileField.UserProfileField, { name: name, label: fieldLabel, value: fieldValue }, name));
174
174
  }
175
- const { label: defaultLabel, key } = index$1.getValueByKey(fieldsConfig, name);
176
- label !== null && label !== void 0 ? label : (label = defaultLabel);
175
+ const { key } = index$1.getValueByKey(fieldsConfig, name);
177
176
  const value = mapFieldKeyToValue(name);
178
- return (jsxRuntime.jsx(UserProfileField.UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
177
+ return (jsxRuntime.jsx(UserProfileField.UserProfileField, { copykey: key, name: name, label: t(`${key}`), value: value }, name));
179
178
  }) }) })), canLink && !multiWallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.wallets.title'), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'link-wallet-button', onClick: addNewWallet, startSlot: jsxRuntime.jsx(add.ReactComponent, {}), showInternalLoading: false, children: jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_user_profile.wallets.link_wallet_button', children: t('dyn_user_profile.wallets.link_wallet_button') }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.social_accounts.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsxRuntime.jsx(UserProfileSocialAccount.UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
180
179
  };
181
180
 
@@ -168,10 +168,9 @@ const UserProfile = ({ rootClassName }) => {
168
168
  }
169
169
  return (jsx(UserProfileField, { name: name, label: fieldLabel, value: fieldValue }, name));
170
170
  }
171
- const { label: defaultLabel, key } = getValueByKey(fieldsConfig, name);
172
- label !== null && label !== void 0 ? label : (label = defaultLabel);
171
+ const { key } = getValueByKey(fieldsConfig, name);
173
172
  const value = mapFieldKeyToValue(name);
174
- return (jsx(UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
173
+ return (jsx(UserProfileField, { copykey: key, name: name, label: t(`${key}`), value: value }, name));
175
174
  }) }) })), canLink && !multiWallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.wallets.title'), children: jsx(TypographyButton, { dataTestId: 'link-wallet-button', onClick: addNewWallet, startSlot: jsx(SvgAdd, {}), showInternalLoading: false, children: jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_user_profile.wallets.link_wallet_button', children: t('dyn_user_profile.wallets.link_wallet_button') }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.social_accounts.title'), children: jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
176
175
  };
177
176
 
@@ -99,8 +99,19 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
99
99
  var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
100
100
 
101
101
  const WalletConnectorEvents = ({ connectorProps, }) => {
102
- const { walletConnectorOptions, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
102
+ const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
103
103
  const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
104
+ const pendingConstructorRef = React.useRef([]);
105
+ const injectedDebounceTimeoutRef = React.useRef();
106
+ const pendingReadyConnectorsRef = React.useRef([]);
107
+ const readyDebounceTimeoutRef = React.useRef();
108
+ // need to add the timeout to ensure the setConnectorInitializing call is
109
+ // not made in the same tick to avoid a bad setState call error from React
110
+ const waitAndSetState = (func) => {
111
+ setTimeout(() => {
112
+ func();
113
+ }, 0);
114
+ };
104
115
  const walletConnectorConstructorOptions = React.useMemo(() => {
105
116
  var _a, _b;
106
117
  if (!connectorProps.projectSettings ||
@@ -112,44 +123,84 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
112
123
  }, [connectorProps]);
113
124
  // add listener for providerInjected event
114
125
  React.useEffect(() => {
115
- const handleProviderInjected = ({ injectedConnectorConstructor, }) => {
116
- if (!walletConnectorConstructorOptions)
126
+ const processPendingConstructors = () => {
127
+ if (pendingConstructorRef.current.length === 0) {
117
128
  return;
118
- const injectedConnector = new injectedConnectorConstructor(walletConnectorConstructorOptions);
119
- logger.logger.debug('[WalletConnectorEvents] handleProviderInjected', {
120
- injectedConnector,
129
+ }
130
+ logger.logger.debug('[WalletConnectorEvents] processPendingConstructors', {
131
+ pendingConstructors: pendingConstructorRef.current,
121
132
  });
122
- walletConnectorCore.walletConnectorEvents.emit('providerReady', {
123
- connector: injectedConnector,
133
+ pendingConstructorRef.current.forEach((injectedConnectorConstructor) => {
134
+ if (!walletConnectorConstructorOptions)
135
+ return;
136
+ const injectedConnector = new injectedConnectorConstructor(walletConnectorConstructorOptions);
137
+ logger.logger.debug('[WalletConnectorEvents] handleProviderInjected', {
138
+ injectedConnector,
139
+ });
140
+ walletConnectorCore.walletConnectorEvents.emit('providerReady', {
141
+ connector: injectedConnector,
142
+ });
124
143
  });
144
+ pendingConstructorRef.current = [];
145
+ };
146
+ const handleProviderInjected = ({ injectedConnectorConstructor, }) => {
147
+ pendingConstructorRef.current.push(injectedConnectorConstructor);
148
+ if (injectedDebounceTimeoutRef.current) {
149
+ clearTimeout(injectedDebounceTimeoutRef.current);
150
+ }
151
+ injectedDebounceTimeoutRef.current = setTimeout(() => {
152
+ processPendingConstructors();
153
+ }, 100); // 100ms debounce window
125
154
  };
126
155
  walletConnectorCore.walletConnectorEvents.on('providerInjected', handleProviderInjected);
127
156
  return () => {
128
157
  walletConnectorCore.walletConnectorEvents.off('providerInjected', handleProviderInjected);
158
+ if (injectedDebounceTimeoutRef.current) {
159
+ clearTimeout(injectedDebounceTimeoutRef.current);
160
+ }
161
+ // Process any remaining constructors on cleanup
162
+ processPendingConstructors();
129
163
  };
130
164
  }, [walletConnectorConstructorOptions]);
131
165
  // add listener for providerReady event
132
166
  React.useEffect(() => {
133
- const handleProviderReady = ({ connector, }) => {
134
- logger.logger.debug('[WalletConnectorEvents] handleProviderReady', {
135
- connector,
167
+ const processReadyConnectors = () => {
168
+ if (pendingReadyConnectorsRef.current.length === 0) {
169
+ return;
170
+ }
171
+ logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] processReadyConnectors', {
172
+ connectors: pendingReadyConnectorsRef.current,
136
173
  });
137
- let foundWallet = false;
138
- const updatedConnectors = walletConnectorOptions.map((walletOption) => {
139
- if (walletOption.key === connector.key) {
140
- foundWallet = true;
141
- return Object.assign(Object.assign({}, walletOption), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
174
+ const walletConnectorOptions = walletOptions.getWalletConnectorOptions();
175
+ const updatedConnectors = [...walletConnectorOptions];
176
+ pendingReadyConnectorsRef.current.forEach((connector) => {
177
+ let foundWallet = false;
178
+ for (let i = 0; i < updatedConnectors.length; i++) {
179
+ if (updatedConnectors[i].key === connector.key) {
180
+ foundWallet = true;
181
+ updatedConnectors[i] = Object.assign(Object.assign({}, updatedConnectors[i]), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
182
+ break;
183
+ }
184
+ }
185
+ if (!foundWallet) {
186
+ const newWalletOption = createWallet.createWallet(connectorProps.walletBook, connector);
187
+ updatedConnectors.push(newWalletOption);
142
188
  }
143
- return walletOption;
144
189
  });
145
- logger.logger.debug('[WalletConnectorEvents] handleProviderReady', {
146
- foundWallet,
190
+ walletOptions.mergeWalletConnectorOptions(updatedConnectors);
191
+ pendingReadyConnectorsRef.current = [];
192
+ };
193
+ const handleProviderReady = ({ connector, }) => {
194
+ logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', {
195
+ connector,
147
196
  });
148
- if (!foundWallet) {
149
- const newWalletOption = createWallet.createWallet(connectorProps.walletBook, connector);
150
- updatedConnectors.push(newWalletOption);
197
+ pendingReadyConnectorsRef.current.push(connector);
198
+ if (readyDebounceTimeoutRef.current) {
199
+ clearTimeout(readyDebounceTimeoutRef.current);
151
200
  }
152
- walletOptions.mergeWalletConnectorOptions(updatedConnectors);
201
+ readyDebounceTimeoutRef.current = setTimeout(() => {
202
+ processReadyConnectors();
203
+ }, 100); // 100ms debounce window
153
204
  };
154
205
  if (!walletBook.isWalletBookPopulated(connectorProps.walletBook)) {
155
206
  return;
@@ -157,12 +208,18 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
157
208
  walletConnectorCore.walletConnectorEvents.on('providerReady', handleProviderReady);
158
209
  return () => {
159
210
  walletConnectorCore.walletConnectorEvents.off('providerReady', handleProviderReady);
211
+ if (readyDebounceTimeoutRef.current) {
212
+ clearTimeout(readyDebounceTimeoutRef.current);
213
+ }
214
+ // Process any remaining connectors on cleanup
215
+ processReadyConnectors();
160
216
  };
161
- }, [connectorProps.walletBook, walletConnectorOptions]);
217
+ }, [connectorProps.walletBook]);
162
218
  // add listener for autoConnect event
163
219
  React.useEffect(() => {
164
220
  const handleAutoConnect = ({ connector, }) => {
165
221
  logger.logger.debug('[WalletConnectorEvents] handleAutoConnect', { connector });
222
+ const walletConnectorOptions = walletOptions.getWalletConnectorOptions();
166
223
  const walletOption = walletConnectorOptions.find((wallet) => wallet.walletConnector.key === connector.key);
167
224
  logger.logger.debug('[WalletConnectorEvents] handleAutoConnect - found walletOption', Boolean(walletOption));
168
225
  if (!walletOption)
@@ -177,24 +234,20 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
177
234
  return () => {
178
235
  walletConnectorCore.walletConnectorEvents.off('autoConnect', handleAutoConnect);
179
236
  };
180
- }, [handleWalletItemClick, walletConnectorOptions, primaryWallet]);
237
+ }, [handleWalletItemClick, primaryWallet]);
181
238
  // add listener for connectorInitStarted and connectorInitCompleted events
182
239
  React.useEffect(() => {
183
240
  const handleConnectorInitStarted = (key) => {
184
241
  logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitStarted', { key });
185
- // need to add the timeout to ensure the setConnectorInitializing call is not
186
- // made in the same tick to avoid a bad setState call error from React
187
- setTimeout(() => {
242
+ waitAndSetState(() => {
188
243
  connectorsInitializing.setConnectorInitializing(key, true);
189
- }, 0);
244
+ });
190
245
  };
191
246
  const handleConnectorInitCompleted = (key) => {
192
247
  logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitCompleted', { key });
193
- // need to add the timeout to ensure the setConnectorInitializing call is not
194
- // made in the same tick to avoid a bad setState call error from React
195
- setTimeout(() => {
248
+ waitAndSetState(() => {
196
249
  connectorsInitializing.setConnectorInitializing(key, false);
197
- }, 0);
250
+ });
198
251
  };
199
252
  walletConnectorCore.walletConnectorEvents.on('connectorInitStarted', handleConnectorInitStarted);
200
253
  walletConnectorCore.walletConnectorEvents.on('connectorInitCompleted', handleConnectorInitCompleted);
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- import { useMemo, useEffect } from 'react';
2
+ import { useRef, useMemo, useEffect } from 'react';
3
3
  import { walletConnectorEvents } from '@dynamic-labs/wallet-connector-core';
4
4
  import { getWalletConnectorConstructorOptions } from '@dynamic-labs/multi-wallet';
5
5
  import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
@@ -50,7 +50,7 @@ import '../../context/MockContext/MockContext.js';
50
50
  import '../../views/CollectUserDataView/useFields.js';
51
51
  import '../../context/FieldsStateContext/FieldsStateContext.js';
52
52
  import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
53
- import { mergeWalletConnectorOptions } from '../../store/state/walletOptions/walletOptions.js';
53
+ import { getWalletConnectorOptions, mergeWalletConnectorOptions } from '../../store/state/walletOptions/walletOptions.js';
54
54
  import 'react-i18next';
55
55
  import '../Accordion/components/AccordionItem/AccordionItem.js';
56
56
  import '../Alert/Alert.js';
@@ -95,8 +95,19 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
95
95
  import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
96
96
 
97
97
  const WalletConnectorEvents = ({ connectorProps, }) => {
98
- const { walletConnectorOptions, primaryWallet } = useInternalDynamicContext();
98
+ const { primaryWallet } = useInternalDynamicContext();
99
99
  const { handleWalletItemClick } = useWalletItemActions();
100
+ const pendingConstructorRef = useRef([]);
101
+ const injectedDebounceTimeoutRef = useRef();
102
+ const pendingReadyConnectorsRef = useRef([]);
103
+ const readyDebounceTimeoutRef = useRef();
104
+ // need to add the timeout to ensure the setConnectorInitializing call is
105
+ // not made in the same tick to avoid a bad setState call error from React
106
+ const waitAndSetState = (func) => {
107
+ setTimeout(() => {
108
+ func();
109
+ }, 0);
110
+ };
100
111
  const walletConnectorConstructorOptions = useMemo(() => {
101
112
  var _a, _b;
102
113
  if (!connectorProps.projectSettings ||
@@ -108,44 +119,84 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
108
119
  }, [connectorProps]);
109
120
  // add listener for providerInjected event
110
121
  useEffect(() => {
111
- const handleProviderInjected = ({ injectedConnectorConstructor, }) => {
112
- if (!walletConnectorConstructorOptions)
122
+ const processPendingConstructors = () => {
123
+ if (pendingConstructorRef.current.length === 0) {
113
124
  return;
114
- const injectedConnector = new injectedConnectorConstructor(walletConnectorConstructorOptions);
115
- logger.debug('[WalletConnectorEvents] handleProviderInjected', {
116
- injectedConnector,
125
+ }
126
+ logger.debug('[WalletConnectorEvents] processPendingConstructors', {
127
+ pendingConstructors: pendingConstructorRef.current,
117
128
  });
118
- walletConnectorEvents.emit('providerReady', {
119
- connector: injectedConnector,
129
+ pendingConstructorRef.current.forEach((injectedConnectorConstructor) => {
130
+ if (!walletConnectorConstructorOptions)
131
+ return;
132
+ const injectedConnector = new injectedConnectorConstructor(walletConnectorConstructorOptions);
133
+ logger.debug('[WalletConnectorEvents] handleProviderInjected', {
134
+ injectedConnector,
135
+ });
136
+ walletConnectorEvents.emit('providerReady', {
137
+ connector: injectedConnector,
138
+ });
120
139
  });
140
+ pendingConstructorRef.current = [];
141
+ };
142
+ const handleProviderInjected = ({ injectedConnectorConstructor, }) => {
143
+ pendingConstructorRef.current.push(injectedConnectorConstructor);
144
+ if (injectedDebounceTimeoutRef.current) {
145
+ clearTimeout(injectedDebounceTimeoutRef.current);
146
+ }
147
+ injectedDebounceTimeoutRef.current = setTimeout(() => {
148
+ processPendingConstructors();
149
+ }, 100); // 100ms debounce window
121
150
  };
122
151
  walletConnectorEvents.on('providerInjected', handleProviderInjected);
123
152
  return () => {
124
153
  walletConnectorEvents.off('providerInjected', handleProviderInjected);
154
+ if (injectedDebounceTimeoutRef.current) {
155
+ clearTimeout(injectedDebounceTimeoutRef.current);
156
+ }
157
+ // Process any remaining constructors on cleanup
158
+ processPendingConstructors();
125
159
  };
126
160
  }, [walletConnectorConstructorOptions]);
127
161
  // add listener for providerReady event
128
162
  useEffect(() => {
129
- const handleProviderReady = ({ connector, }) => {
130
- logger.debug('[WalletConnectorEvents] handleProviderReady', {
131
- connector,
163
+ const processReadyConnectors = () => {
164
+ if (pendingReadyConnectorsRef.current.length === 0) {
165
+ return;
166
+ }
167
+ logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] processReadyConnectors', {
168
+ connectors: pendingReadyConnectorsRef.current,
132
169
  });
133
- let foundWallet = false;
134
- const updatedConnectors = walletConnectorOptions.map((walletOption) => {
135
- if (walletOption.key === connector.key) {
136
- foundWallet = true;
137
- return Object.assign(Object.assign({}, walletOption), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
170
+ const walletConnectorOptions = getWalletConnectorOptions();
171
+ const updatedConnectors = [...walletConnectorOptions];
172
+ pendingReadyConnectorsRef.current.forEach((connector) => {
173
+ let foundWallet = false;
174
+ for (let i = 0; i < updatedConnectors.length; i++) {
175
+ if (updatedConnectors[i].key === connector.key) {
176
+ foundWallet = true;
177
+ updatedConnectors[i] = Object.assign(Object.assign({}, updatedConnectors[i]), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
178
+ break;
179
+ }
180
+ }
181
+ if (!foundWallet) {
182
+ const newWalletOption = createWallet(connectorProps.walletBook, connector);
183
+ updatedConnectors.push(newWalletOption);
138
184
  }
139
- return walletOption;
140
185
  });
141
- logger.debug('[WalletConnectorEvents] handleProviderReady', {
142
- foundWallet,
186
+ mergeWalletConnectorOptions(updatedConnectors);
187
+ pendingReadyConnectorsRef.current = [];
188
+ };
189
+ const handleProviderReady = ({ connector, }) => {
190
+ logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', {
191
+ connector,
143
192
  });
144
- if (!foundWallet) {
145
- const newWalletOption = createWallet(connectorProps.walletBook, connector);
146
- updatedConnectors.push(newWalletOption);
193
+ pendingReadyConnectorsRef.current.push(connector);
194
+ if (readyDebounceTimeoutRef.current) {
195
+ clearTimeout(readyDebounceTimeoutRef.current);
147
196
  }
148
- mergeWalletConnectorOptions(updatedConnectors);
197
+ readyDebounceTimeoutRef.current = setTimeout(() => {
198
+ processReadyConnectors();
199
+ }, 100); // 100ms debounce window
149
200
  };
150
201
  if (!isWalletBookPopulated(connectorProps.walletBook)) {
151
202
  return;
@@ -153,12 +204,18 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
153
204
  walletConnectorEvents.on('providerReady', handleProviderReady);
154
205
  return () => {
155
206
  walletConnectorEvents.off('providerReady', handleProviderReady);
207
+ if (readyDebounceTimeoutRef.current) {
208
+ clearTimeout(readyDebounceTimeoutRef.current);
209
+ }
210
+ // Process any remaining connectors on cleanup
211
+ processReadyConnectors();
156
212
  };
157
- }, [connectorProps.walletBook, walletConnectorOptions]);
213
+ }, [connectorProps.walletBook]);
158
214
  // add listener for autoConnect event
159
215
  useEffect(() => {
160
216
  const handleAutoConnect = ({ connector, }) => {
161
217
  logger.debug('[WalletConnectorEvents] handleAutoConnect', { connector });
218
+ const walletConnectorOptions = getWalletConnectorOptions();
162
219
  const walletOption = walletConnectorOptions.find((wallet) => wallet.walletConnector.key === connector.key);
163
220
  logger.debug('[WalletConnectorEvents] handleAutoConnect - found walletOption', Boolean(walletOption));
164
221
  if (!walletOption)
@@ -173,24 +230,20 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
173
230
  return () => {
174
231
  walletConnectorEvents.off('autoConnect', handleAutoConnect);
175
232
  };
176
- }, [handleWalletItemClick, walletConnectorOptions, primaryWallet]);
233
+ }, [handleWalletItemClick, primaryWallet]);
177
234
  // add listener for connectorInitStarted and connectorInitCompleted events
178
235
  useEffect(() => {
179
236
  const handleConnectorInitStarted = (key) => {
180
237
  logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitStarted', { key });
181
- // need to add the timeout to ensure the setConnectorInitializing call is not
182
- // made in the same tick to avoid a bad setState call error from React
183
- setTimeout(() => {
238
+ waitAndSetState(() => {
184
239
  setConnectorInitializing(key, true);
185
- }, 0);
240
+ });
186
241
  };
187
242
  const handleConnectorInitCompleted = (key) => {
188
243
  logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitCompleted', { key });
189
- // need to add the timeout to ensure the setConnectorInitializing call is not
190
- // made in the same tick to avoid a bad setState call error from React
191
- setTimeout(() => {
244
+ waitAndSetState(() => {
192
245
  setConnectorInitializing(key, false);
193
- }, 0);
246
+ });
194
247
  };
195
248
  walletConnectorEvents.on('connectorInitStarted', handleConnectorInitStarted);
196
249
  walletConnectorEvents.on('connectorInitCompleted', handleConnectorInitCompleted);
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
+ var reactI18next = require('react-i18next');
7
8
  require('react');
8
9
  require('react-dom');
9
10
  require('@dynamic-labs/sdk-api-core');
@@ -59,7 +60,6 @@ require('../../context/FieldsStateContext/FieldsStateContext.cjs');
59
60
  require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
60
61
  require('@dynamic-labs/rpc-providers');
61
62
  require('../../store/state/walletOptions/walletOptions.cjs');
62
- require('react-i18next');
63
63
  require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
64
64
  require('../../components/Alert/Alert.cjs');
65
65
  require('../../components/ShadowDOM/ShadowDOM.cjs');
@@ -129,25 +129,29 @@ const DynamicUserProfileLayout = ({ variant, className, style, }) => {
129
129
  const { multiWallet } = useInternalDynamicContext.useInternalDynamicContext();
130
130
  const isKYCEnabled = useKYCFlag.useKYCFlag();
131
131
  const { dynamicWidgetView, setDynamicWidgetView, overridenWidgetView } = DynamicWidgetContext.useWidgetContext();
132
+ const { t } = reactI18next.useTranslation();
132
133
  const getNavBarOptions = () => {
133
134
  const options = [];
134
135
  if (multiWallet) {
135
136
  options.push({
137
+ copykey: 'dyn_nav_bar.wallets',
136
138
  icon: jsxRuntime.jsx(walletOutlineV2.ReactComponent, {}),
137
- label: 'Wallets',
139
+ label: t('dyn_nav_bar.wallets'),
138
140
  value: 'wallets',
139
141
  });
140
142
  }
141
143
  if (isKYCEnabled) {
142
144
  options.push({
145
+ copykey: 'dyn_nav_bar.profile',
143
146
  icon: jsxRuntime.jsx(profileOutline.ReactComponent, {}),
144
- label: 'Profile',
147
+ label: t('dyn_nav_bar.profile'),
145
148
  value: 'profile',
146
149
  });
147
150
  }
148
151
  options.push({
152
+ copykey: 'dyn_nav_bar.settings',
149
153
  icon: jsxRuntime.jsx(settingsOutline.ReactComponent, {}),
150
- label: 'Settings',
154
+ label: t('dyn_nav_bar.settings'),
151
155
  value: 'settings',
152
156
  });
153
157
  return options;
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { useTranslation } from 'react-i18next';
3
4
  import 'react';
4
5
  import 'react-dom';
5
6
  import '@dynamic-labs/sdk-api-core';
@@ -55,7 +56,6 @@ import '../../context/FieldsStateContext/FieldsStateContext.js';
55
56
  import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
56
57
  import '@dynamic-labs/rpc-providers';
57
58
  import '../../store/state/walletOptions/walletOptions.js';
58
- import 'react-i18next';
59
59
  import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
60
60
  import '../../components/Alert/Alert.js';
61
61
  import '../../components/ShadowDOM/ShadowDOM.js';
@@ -125,25 +125,29 @@ const DynamicUserProfileLayout = ({ variant, className, style, }) => {
125
125
  const { multiWallet } = useInternalDynamicContext();
126
126
  const isKYCEnabled = useKYCFlag();
127
127
  const { dynamicWidgetView, setDynamicWidgetView, overridenWidgetView } = useWidgetContext();
128
+ const { t } = useTranslation();
128
129
  const getNavBarOptions = () => {
129
130
  const options = [];
130
131
  if (multiWallet) {
131
132
  options.push({
133
+ copykey: 'dyn_nav_bar.wallets',
132
134
  icon: jsx(SvgWalletOutlineV2, {}),
133
- label: 'Wallets',
135
+ label: t('dyn_nav_bar.wallets'),
134
136
  value: 'wallets',
135
137
  });
136
138
  }
137
139
  if (isKYCEnabled) {
138
140
  options.push({
141
+ copykey: 'dyn_nav_bar.profile',
139
142
  icon: jsx(SvgProfileOutline, {}),
140
- label: 'Profile',
143
+ label: t('dyn_nav_bar.profile'),
141
144
  value: 'profile',
142
145
  });
143
146
  }
144
147
  options.push({
148
+ copykey: 'dyn_nav_bar.settings',
145
149
  icon: jsx(SvgSettingsOutline, {}),
146
- label: 'Settings',
150
+ label: t('dyn_nav_bar.settings'),
147
151
  value: 'settings',
148
152
  });
149
153
  return options;
@@ -251,7 +251,7 @@ const translation = {
251
251
  label: 'Country',
252
252
  },
253
253
  email: {
254
- label: 'Email',
254
+ label: 'E-mail',
255
255
  validation: 'Email is not valid',
256
256
  },
257
257
  first_name: {
@@ -2181,6 +2181,21 @@ const translation = {
2181
2181
  title: 'Sign to confirm transfer',
2182
2182
  },
2183
2183
  },
2184
+ /**
2185
+ * @description copy keys for Dynamic widget nav bar
2186
+ * @default
2187
+ *
2188
+ dyn_nav_bar: {
2189
+ wallets: 'Wallets',
2190
+ profile: 'Profile',
2191
+ settings: 'Settings',
2192
+ },
2193
+ **/
2194
+ dyn_nav_bar: {
2195
+ wallets: 'Wallets',
2196
+ profile: 'Profile',
2197
+ settings: 'Settings',
2198
+ },
2184
2199
  /**
2185
2200
  * @description copy keys for Dynamic widget
2186
2201
  * @default
@@ -2177,6 +2177,21 @@ export declare const translation: {
2177
2177
  title: string;
2178
2178
  };
2179
2179
  };
2180
+ /**
2181
+ * @description copy keys for Dynamic widget nav bar
2182
+ * @default
2183
+ *
2184
+ dyn_nav_bar: {
2185
+ wallets: 'Wallets',
2186
+ profile: 'Profile',
2187
+ settings: 'Settings',
2188
+ },
2189
+ **/
2190
+ dyn_nav_bar: {
2191
+ wallets: string;
2192
+ profile: string;
2193
+ settings: string;
2194
+ };
2180
2195
  /**
2181
2196
  * @description copy keys for Dynamic widget
2182
2197
  * @default
@@ -247,7 +247,7 @@ const translation = {
247
247
  label: 'Country',
248
248
  },
249
249
  email: {
250
- label: 'Email',
250
+ label: 'E-mail',
251
251
  validation: 'Email is not valid',
252
252
  },
253
253
  first_name: {
@@ -2177,6 +2177,21 @@ const translation = {
2177
2177
  title: 'Sign to confirm transfer',
2178
2178
  },
2179
2179
  },
2180
+ /**
2181
+ * @description copy keys for Dynamic widget nav bar
2182
+ * @default
2183
+ *
2184
+ dyn_nav_bar: {
2185
+ wallets: 'Wallets',
2186
+ profile: 'Profile',
2187
+ settings: 'Settings',
2188
+ },
2189
+ **/
2190
+ dyn_nav_bar: {
2191
+ wallets: 'Wallets',
2192
+ profile: 'Profile',
2193
+ settings: 'Settings',
2194
+ },
2180
2195
  /**
2181
2196
  * @description copy keys for Dynamic widget
2182
2197
  * @default
@@ -31,6 +31,7 @@ export { ReactComponent as CurrencyIcon } from './currency.svg';
31
31
  export { ReactComponent as DefaultWallet } from './default-wallet.svg';
32
32
  export { ReactComponent as DeleteEmbeddedHero } from './delete-embedded-hero.svg';
33
33
  export { ReactComponent as DomainIcon } from './domain.svg';
34
+ export { ReactComponent as DomainBlockedIcon } from './domain-blocked.svg';
34
35
  export { ReactComponent as DotsHorizontalIcon } from './dots-horizontal.svg';
35
36
  export { ReactComponent as DoubleArrowRightIcon } from './double-arrow-right.svg';
36
37
  export { ReactComponent as DownloadIcon } from './download.svg';
@@ -40,9 +40,10 @@ require('../../../locale/locale.cjs');
40
40
  require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
41
41
  require('../../../context/VerificationContext/VerificationContext.cjs');
42
42
  require('react-dom');
43
- require('../../functions/compareChains/compareChains.cjs');
43
+ var smartWallet = require('../useWalletConnectors/utils/smartWallet/smartWallet.cjs');
44
44
  require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
45
45
  require('../../../context/ThemeContext/ThemeContext.cjs');
46
+ require('../../functions/compareChains/compareChains.cjs');
46
47
  require('../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
47
48
  require('bs58');
48
49
  require('@dynamic-labs/types');
@@ -169,14 +170,18 @@ const useDynamicWaas = () => {
169
170
  })));
170
171
  const primaryWalletAccount = createdWalletAccounts === null || createdWalletAccounts === void 0 ? void 0 : createdWalletAccounts.find((wallet) => (wallet === null || wallet === void 0 ? void 0 : wallet.chainName) === (primaryChain === null || primaryChain === void 0 ? void 0 : primaryChain.name));
171
172
  const refreshedUser = yield refresh();
172
- const createdPrimaryWallet = refreshedUser === null || refreshedUser === void 0 ? void 0 : refreshedUser.verifiedCredentials.find((wallet) => {
173
- var _a, _b, _c;
174
- return ((_a = wallet.walletName) === null || _a === void 0 ? void 0 : _a.includes(dynamicWaasKey)) &&
175
- ((_b = wallet.address) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
176
- ((_c = primaryWalletAccount === null || primaryWalletAccount === void 0 ? void 0 : primaryWalletAccount.accountAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
177
- });
178
- if (createdPrimaryWallet) {
179
- updatePrimaryWalletId.updatePrimaryWalletId(createdPrimaryWallet.id);
173
+ if (refreshedUser && primaryWalletAccount) {
174
+ const createdPrimaryWallet = refreshedUser.verifiedCredentials.find((wallet) => {
175
+ var _a, _b, _c;
176
+ return ((_a = wallet.walletName) === null || _a === void 0 ? void 0 : _a.includes(dynamicWaasKey)) &&
177
+ ((_b = wallet.address) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
178
+ ((_c = primaryWalletAccount.accountAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
179
+ });
180
+ if (createdPrimaryWallet) {
181
+ const smartWalletAccount = smartWallet.findSmartWallet(createdPrimaryWallet, refreshedUser.verifiedCredentials);
182
+ const walletIdToUse = (smartWalletAccount === null || smartWalletAccount === void 0 ? void 0 : smartWalletAccount.id) || createdPrimaryWallet.id;
183
+ updatePrimaryWalletId.updatePrimaryWalletId(walletIdToUse);
184
+ }
180
185
  }
181
186
  setShowAuthFlow(false, { performMultiWalletChecks: false }); // close email otp pin modal
182
187
  return createdWalletAccounts;
@@ -36,9 +36,10 @@ import '../../../locale/locale.js';
36
36
  import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
37
37
  import '../../../context/VerificationContext/VerificationContext.js';
38
38
  import 'react-dom';
39
- import '../../functions/compareChains/compareChains.js';
39
+ import { findSmartWallet } from '../useWalletConnectors/utils/smartWallet/smartWallet.js';
40
40
  import '../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
41
41
  import '../../../context/ThemeContext/ThemeContext.js';
42
+ import '../../functions/compareChains/compareChains.js';
42
43
  import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
43
44
  import 'bs58';
44
45
  import '@dynamic-labs/types';
@@ -165,14 +166,18 @@ const useDynamicWaas = () => {
165
166
  })));
166
167
  const primaryWalletAccount = createdWalletAccounts === null || createdWalletAccounts === void 0 ? void 0 : createdWalletAccounts.find((wallet) => (wallet === null || wallet === void 0 ? void 0 : wallet.chainName) === (primaryChain === null || primaryChain === void 0 ? void 0 : primaryChain.name));
167
168
  const refreshedUser = yield refresh();
168
- const createdPrimaryWallet = refreshedUser === null || refreshedUser === void 0 ? void 0 : refreshedUser.verifiedCredentials.find((wallet) => {
169
- var _a, _b, _c;
170
- return ((_a = wallet.walletName) === null || _a === void 0 ? void 0 : _a.includes(dynamicWaasKey)) &&
171
- ((_b = wallet.address) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
172
- ((_c = primaryWalletAccount === null || primaryWalletAccount === void 0 ? void 0 : primaryWalletAccount.accountAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
173
- });
174
- if (createdPrimaryWallet) {
175
- updatePrimaryWalletId(createdPrimaryWallet.id);
169
+ if (refreshedUser && primaryWalletAccount) {
170
+ const createdPrimaryWallet = refreshedUser.verifiedCredentials.find((wallet) => {
171
+ var _a, _b, _c;
172
+ return ((_a = wallet.walletName) === null || _a === void 0 ? void 0 : _a.includes(dynamicWaasKey)) &&
173
+ ((_b = wallet.address) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
174
+ ((_c = primaryWalletAccount.accountAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
175
+ });
176
+ if (createdPrimaryWallet) {
177
+ const smartWalletAccount = findSmartWallet(createdPrimaryWallet, refreshedUser.verifiedCredentials);
178
+ const walletIdToUse = (smartWalletAccount === null || smartWalletAccount === void 0 ? void 0 : smartWalletAccount.id) || createdPrimaryWallet.id;
179
+ updatePrimaryWalletId(walletIdToUse);
180
+ }
176
181
  }
177
182
  setShowAuthFlow(false, { performMultiWalletChecks: false }); // close email otp pin modal
178
183
  return createdWalletAccounts;
@@ -98,13 +98,22 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
98
98
  var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
99
99
 
100
100
  const useIsLoadingEmbeddedWallet = () => {
101
- const { user } = useInternalDynamicContext.useInternalDynamicContext();
101
+ const { user, authMode } = useInternalDynamicContext.useInternalDynamicContext();
102
102
  const projectSettings$1 = projectSettings.getProjectSettings();
103
+ // we only want to show the loading state if the user has no wallets at all, and is creating a waas wallet
104
+ // for example if they sign up with phantom wallet, we don't want to show the loading state
105
+ // always return false for connect-only mode, because verified credentials are not used in this mode
103
106
  const isLoadingEmbeddedWallet = React.useMemo(() => {
104
107
  var _a;
105
- return usingV3Wallets.usingV3Wallets(projectSettings$1) &&
106
- !((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletProvider }) => walletProvider === 'embeddedWallet'));
107
- }, [projectSettings$1, user]);
108
+ if (!usingV3Wallets.usingV3Wallets(projectSettings$1)) {
109
+ return false;
110
+ }
111
+ if (authMode === 'connect-only') {
112
+ return false;
113
+ }
114
+ // If user has NO blockchain credential, then we show loading state
115
+ return !((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.some((credential) => credential.format === 'blockchain'));
116
+ }, [projectSettings$1, user, authMode]);
108
117
  return { isLoadingEmbeddedWallet };
109
118
  };
110
119
 
@@ -94,13 +94,22 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
94
94
  import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
95
95
 
96
96
  const useIsLoadingEmbeddedWallet = () => {
97
- const { user } = useInternalDynamicContext();
97
+ const { user, authMode } = useInternalDynamicContext();
98
98
  const projectSettings = getProjectSettings();
99
+ // we only want to show the loading state if the user has no wallets at all, and is creating a waas wallet
100
+ // for example if they sign up with phantom wallet, we don't want to show the loading state
101
+ // always return false for connect-only mode, because verified credentials are not used in this mode
99
102
  const isLoadingEmbeddedWallet = useMemo(() => {
100
103
  var _a;
101
- return usingV3Wallets(projectSettings) &&
102
- !((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletProvider }) => walletProvider === 'embeddedWallet'));
103
- }, [projectSettings, user]);
104
+ if (!usingV3Wallets(projectSettings)) {
105
+ return false;
106
+ }
107
+ if (authMode === 'connect-only') {
108
+ return false;
109
+ }
110
+ // If user has NO blockchain credential, then we show loading state
111
+ return !((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.some((credential) => credential.format === 'blockchain'));
112
+ }, [projectSettings, user, authMode]);
104
113
  return { isLoadingEmbeddedWallet };
105
114
  };
106
115
 
@@ -41,6 +41,7 @@ require('../../functions/compareChains/compareChains.cjs');
41
41
  require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
42
42
  require('../../../context/ThemeContext/ThemeContext.cjs');
43
43
  var useSmartWallets = require('../useSmartWallets/useSmartWallets.cjs');
44
+ var usingV3Wallets = require('../../functions/usingV3Wallets/usingV3Wallets.cjs');
44
45
  require('../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
45
46
  require('bs58');
46
47
  require('@dynamic-labs/types');
@@ -111,7 +112,8 @@ const useIsLoggedIn = () => {
111
112
  const isLoggedIn = Boolean(user) || (authMode === 'connect-only' && Boolean(primaryWallet));
112
113
  const userWalletsCredentials = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.filter(({ walletProvider }) => walletProvider);
113
114
  const hasEmbeddedWalletVerifiedCredential = Boolean(userWalletsCredentials === null || userWalletsCredentials === void 0 ? void 0 : userWalletsCredentials.find(({ walletProvider }) => walletProvider === 'embeddedWallet'));
114
- const isTurnkeyPregen = isTurnkeyProviderEnabled &&
115
+ const isTurnkeyPregen = !usingV3Wallets.usingV3Wallets(projectSettings) &&
116
+ isTurnkeyProviderEnabled &&
115
117
  ((_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.embeddedWallets) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) &&
116
118
  (!(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets.forceAuthenticatorAtSignup) ||
117
119
  isSessionKeyCompatible);
@@ -37,6 +37,7 @@ import '../../functions/compareChains/compareChains.js';
37
37
  import '../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
38
38
  import '../../../context/ThemeContext/ThemeContext.js';
39
39
  import { useSmartWallets } from '../useSmartWallets/useSmartWallets.js';
40
+ import { usingV3Wallets } from '../../functions/usingV3Wallets/usingV3Wallets.js';
40
41
  import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
41
42
  import 'bs58';
42
43
  import '@dynamic-labs/types';
@@ -107,7 +108,8 @@ const useIsLoggedIn = () => {
107
108
  const isLoggedIn = Boolean(user) || (authMode === 'connect-only' && Boolean(primaryWallet));
108
109
  const userWalletsCredentials = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.filter(({ walletProvider }) => walletProvider);
109
110
  const hasEmbeddedWalletVerifiedCredential = Boolean(userWalletsCredentials === null || userWalletsCredentials === void 0 ? void 0 : userWalletsCredentials.find(({ walletProvider }) => walletProvider === 'embeddedWallet'));
110
- const isTurnkeyPregen = isTurnkeyProviderEnabled &&
111
+ const isTurnkeyPregen = !usingV3Wallets(projectSettings) &&
112
+ isTurnkeyProviderEnabled &&
111
113
  ((_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.embeddedWallets) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) &&
112
114
  (!(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets.forceAuthenticatorAtSignup) ||
113
115
  isSessionKeyCompatible);
@@ -101,7 +101,7 @@ const BottomNavBar = ({ value, onChange, options }) => {
101
101
  const isActive = (_value) => _value === value;
102
102
  return (jsxRuntime.jsx("div", { className: 'footer-options-switcher__container', "data-testid": 'OptionsSwitcher', children: options.map((option) => (jsxRuntime.jsxs("div", { className: classNames.classNames('footer-options-switcher__tab', {
103
103
  'footer-options-switcher__tab--active': isActive(option.value),
104
- }), onClick: () => onChange(option.value), children: [option.icon, jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', className: 'footer-options-switcher__label', children: option.label })] }, option.value))) }));
104
+ }), onClick: () => onChange(option.value), children: [option.icon, jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', className: 'footer-options-switcher__label', copykey: option.copykey, children: option.label })] }, option.value))) }));
105
105
  };
106
106
 
107
107
  exports.BottomNavBar = BottomNavBar;
@@ -4,6 +4,7 @@ export type OptionsSwitcherOption = {
4
4
  value: string;
5
5
  label: string;
6
6
  icon: ReactNode;
7
+ copykey?: string;
7
8
  };
8
9
  export declare const BottomNavBar: FC<{
9
10
  value: DynamicWidgetViews;
@@ -97,7 +97,7 @@ const BottomNavBar = ({ value, onChange, options }) => {
97
97
  const isActive = (_value) => _value === value;
98
98
  return (jsx("div", { className: 'footer-options-switcher__container', "data-testid": 'OptionsSwitcher', children: options.map((option) => (jsxs("div", { className: classNames('footer-options-switcher__tab', {
99
99
  'footer-options-switcher__tab--active': isActive(option.value),
100
- }), onClick: () => onChange(option.value), children: [option.icon, jsx(Typography, { variant: 'body_small', className: 'footer-options-switcher__label', children: option.label })] }, option.value))) }));
100
+ }), onClick: () => onChange(option.value), children: [option.icon, jsx(Typography, { variant: 'body_small', className: 'footer-options-switcher__label', copykey: option.copykey, children: option.label })] }, option.value))) }));
101
101
  };
102
102
 
103
103
  export { BottomNavBar };