@dynamic-labs/sdk-react-core 4.40.0 → 4.40.2

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 (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -12
  5. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -2
  6. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -2
  7. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +5 -2
  8. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +5 -2
  9. package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +2 -1
  10. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/SetSelectedWalletConnectorKey.type.d.ts +5 -0
  11. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.cjs +19 -5
  12. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.d.ts +3 -3
  13. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.js +19 -5
  14. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -1
  15. package/src/lib/styles/index.shadow.cjs +1 -1
  16. package/src/lib/styles/index.shadow.js +1 -1
  17. package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.cjs +8 -3
  18. package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.js +8 -3
  19. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +4 -1
  20. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +4 -1
  21. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +14 -7
  22. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +14 -7
  23. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +4 -1
  24. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +4 -1
  25. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +4 -1
  26. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +4 -1
  27. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +7 -2
  28. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +7 -2
  29. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +8 -2
  30. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +8 -2
  31. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +24 -6
  32. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +24 -6
  33. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +7 -3
  34. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +7 -3
  35. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +6 -2
  36. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +6 -2
  37. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +17 -85
  38. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +17 -85
  39. package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +11 -7
  40. package/src/lib/views/LoginView/useLoginView/useLoginView.js +11 -7
  41. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +6 -6
  42. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +6 -6
  43. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +1 -8
  44. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +1 -8
  45. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +4 -1
  46. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +4 -1
@@ -19,7 +19,6 @@ import '../../../../events/dynamicEvents.js';
19
19
  import '../../../../context/DynamicContext/DynamicContext.js';
20
20
  import '../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
21
21
  import '../../../../store/state/authMode/authMode.js';
22
- import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
23
22
  import '../../../../context/CaptchaContext/CaptchaContext.js';
24
23
  import '../../../../context/ErrorContext/ErrorContext.js';
25
24
  import '@dynamic-labs/multi-wallet';
@@ -34,6 +33,7 @@ import '@dynamic-labs-sdk/client/core';
34
33
  import '../../../../client/client.js';
35
34
  import '@dynamic-labs-sdk/client';
36
35
  import '../../../../config/ApiEndpoint.js';
36
+ import { useProjectSettings } from '../../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
37
37
  import '@dynamic-labs/locale';
38
38
  import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
39
39
  import '../../../../store/state/primaryWalletId/primaryWalletId.js';
@@ -109,7 +109,7 @@ import '../../../../components/Popper/PopperContext/PopperContext.js';
109
109
 
110
110
  const PhoneNumberSignInSection = ({ isLoading, onSubmit, onSubmitError, }) => {
111
111
  var _a, _b;
112
- const { projectSettings } = useInternalDynamicContext();
112
+ const projectSettings = useProjectSettings();
113
113
  const countriesWithVerification = useMemo(() => {
114
114
  const enabledCountries = getSupportedCountriesForVerificationFromProjectSettings(projectSettings);
115
115
  // For login, we always want to use only countries with verification supported
@@ -134,6 +134,10 @@ const PhoneNumberSignInSection = ({ isLoading, onSubmit, onSubmitError, }) => {
134
134
  phone: phoneData.phone,
135
135
  setInvalidNumberMessage,
136
136
  });
137
+ if (!projectSettings) {
138
+ logger.debug('Failed to render PhoneNumberSignInSection - no project settings');
139
+ return null;
140
+ }
137
141
  if (!isPhoneNumberProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [])) {
138
142
  logger.error('Failed to render PhoneNumberSignInSection - no sign in provider enabled');
139
143
  return null;
@@ -5,24 +5,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var sdkApiCore = require('@dynamic-labs/sdk-api-core');
8
- require('react');
9
- require('../../../../context/DynamicContext/DynamicContext.cjs');
10
- require('../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
8
+ require('../../../../utils/constants/values.cjs');
9
+ require('@dynamic-labs/utils');
10
+ require('../../../../../../_virtual/_tslib.cjs');
11
+ require('@dynamic-labs/multi-wallet');
12
+ require('react-international-phone');
13
+ require('../../../../utils/constants/colors.cjs');
11
14
  require('@dynamic-labs/iconic');
12
15
  require('@dynamic-labs/wallet-connector-core');
16
+ require('react');
13
17
  require('../../../../context/ViewContext/ViewContext.cjs');
14
18
  var logger = require('../../../../shared/logger.cjs');
15
19
  require('@dynamic-labs/wallet-book');
16
- require('@dynamic-labs/utils');
17
- require('../../../../utils/constants/colors.cjs');
18
- require('../../../../utils/constants/values.cjs');
19
20
  require('../../../../shared/consts/index.cjs');
20
- require('../../../../events/dynamicEvents.cjs');
21
- require('../../../../../../_virtual/_tslib.cjs');
22
- require('../../../../context/CaptchaContext/CaptchaContext.cjs');
23
- require('../../../../context/ErrorContext/ErrorContext.cjs');
24
- require('@dynamic-labs/multi-wallet');
25
- require('react-international-phone');
26
21
  var getSocialSignInProviderFromString = require('../../../../utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.cjs');
27
22
  require('../../../../store/state/nonce/nonce.cjs');
28
23
  var isProviderEnabled = require('../../../../utils/functions/isProviderEnabled/isProviderEnabled.cjs');
@@ -30,86 +25,23 @@ require('@dynamic-labs-sdk/client/core');
30
25
  require('../../../../client/client.cjs');
31
26
  require('@dynamic-labs-sdk/client');
32
27
  require('../../../../config/ApiEndpoint.cjs');
28
+ require('../../../../events/dynamicEvents.cjs');
29
+ var useProjectSettings = require('../../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.cjs');
33
30
  require('@dynamic-labs/locale');
34
31
  require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
35
32
  require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
36
33
  require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
37
- require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
38
- require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
39
- require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
40
- require('../../../../store/state/authMode/authMode.cjs');
41
- require('../../../../context/VerificationContext/VerificationContext.cjs');
42
- require('react-dom');
43
- require('../../../../utils/functions/compareChains/compareChains.cjs');
44
- require('../../../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
45
- require('../../../../context/ThemeContext/ThemeContext.cjs');
46
- require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
47
- require('bs58');
48
- require('@dynamic-labs/types');
49
- require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
50
- require('../../../../context/LoadingContext/LoadingContext.cjs');
51
- require('../../../../context/WalletContext/WalletContext.cjs');
52
- require('../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
53
- require('yup');
54
- require('../../../../context/MockContext/MockContext.cjs');
55
- require('../../../CollectUserDataView/useFields.cjs');
56
- require('../../../../context/FieldsStateContext/FieldsStateContext.cjs');
57
- require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
58
- require('@dynamic-labs/rpc-providers');
59
- require('../../../../store/state/walletOptions/walletOptions.cjs');
60
- require('react-i18next');
61
- require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
62
- require('../../../../components/Alert/Alert.cjs');
63
- require('../../../../components/ShadowDOM/ShadowDOM.cjs');
64
- require('../../../../components/IconButton/IconButton.cjs');
65
- require('../../../../components/InlineWidget/InlineWidget.cjs');
66
- require('../../../../components/Input/Input.cjs');
67
- require('../../../../components/IsBrowser/IsBrowser.cjs');
68
- require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
69
- require('../../../../components/OverlayCard/OverlayCard.cjs');
70
- require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
71
- require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
72
- require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
73
- require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
74
- require('../../../../components/Popper/Popper/Popper.cjs');
75
- require('../../../../components/Popper/PopperContext/PopperContext.cjs');
76
- require('react-focus-lock');
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('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
84
- require('@hcaptcha/react-hcaptcha');
85
- require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
86
- require('../../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
87
- require('../../../ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
88
- require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
89
- require('../../../../context/FooterAnimationContext/index.cjs');
90
34
  var MagicSocialSignIn = require('./MagicSocialSignIn/MagicSocialSignIn.cjs');
91
35
  var DynamicSocialSignIn = require('./DynamicSocialSignIn/DynamicSocialSignIn.cjs');
92
- require('../../../MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
93
- require('../../../../context/PasskeyContext/PasskeyContext.cjs');
94
- require('../../../../context/OnrampContext/OnrampContext.cjs');
95
- require('../../../../store/state/sendBalances.cjs');
96
- require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
97
- require('../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
98
- require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
99
- require('../../../TransactionConfirmationView/TransactionConfirmationView.cjs');
100
- require('../../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
101
- require('../../../../../index.cjs');
102
- require('../../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
103
- require('../../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
104
- require('../../../../store/state/tokenBalances.cjs');
105
- require('../../../../store/state/multichainBalances.cjs');
106
- require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
107
- var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
108
36
 
109
37
  const SocialSignInSection = ({ sectionData, collapsedLayout, }) => {
110
38
  var _a, _b, _c;
111
- const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
112
- const providers = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [];
39
+ const projectSettings = useProjectSettings.useProjectSettings();
40
+ if (!projectSettings) {
41
+ logger.logger.debug('Failed to render SocialSignInSection - no project settings');
42
+ return null;
43
+ }
44
+ const providers = (_a = projectSettings.providers) !== null && _a !== void 0 ? _a : [];
113
45
  const componentProps = {
114
46
  collapsedLayout,
115
47
  defaultProvider: getSocialSignInProviderFromString.getSocialSignInProviderFromString(sectionData.defaultItem),
@@ -117,11 +49,11 @@ const SocialSignInSection = ({ sectionData, collapsedLayout, }) => {
117
49
  };
118
50
  const isMagicEnabled = isProviderEnabled.isProviderEnabled(providers, sdkApiCore.ProviderEnum.MagicLink);
119
51
  if (isMagicEnabled &&
120
- ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.socialSignIn) === null || _b === void 0 ? void 0 : _b.signInProvider) ===
52
+ ((_b = projectSettings.sdk.socialSignIn) === null || _b === void 0 ? void 0 : _b.signInProvider) ===
121
53
  sdkApiCore.SignInProviderEnum.MagicLink) {
122
54
  return jsxRuntime.jsx(MagicSocialSignIn.MagicSocialSignIn, Object.assign({}, componentProps));
123
55
  }
124
- if (((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.socialSignIn) === null || _c === void 0 ? void 0 : _c.signInProvider) ===
56
+ if (((_c = projectSettings.sdk.socialSignIn) === null || _c === void 0 ? void 0 : _c.signInProvider) ===
125
57
  sdkApiCore.SignInProviderEnum.Dynamic) {
126
58
  return jsxRuntime.jsx(DynamicSocialSignIn.DynamicSocialSignIn, Object.assign({}, componentProps));
127
59
  }
@@ -1,24 +1,19 @@
1
1
  'use client'
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { ProviderEnum, SignInProviderEnum } from '@dynamic-labs/sdk-api-core';
4
- import 'react';
5
- import '../../../../context/DynamicContext/DynamicContext.js';
6
- import '../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
4
+ import '../../../../utils/constants/values.js';
5
+ import '@dynamic-labs/utils';
6
+ import '../../../../../../_virtual/_tslib.js';
7
+ import '@dynamic-labs/multi-wallet';
8
+ import 'react-international-phone';
9
+ import '../../../../utils/constants/colors.js';
7
10
  import '@dynamic-labs/iconic';
8
11
  import '@dynamic-labs/wallet-connector-core';
12
+ import 'react';
9
13
  import '../../../../context/ViewContext/ViewContext.js';
10
14
  import { logger } from '../../../../shared/logger.js';
11
15
  import '@dynamic-labs/wallet-book';
12
- import '@dynamic-labs/utils';
13
- import '../../../../utils/constants/colors.js';
14
- import '../../../../utils/constants/values.js';
15
16
  import '../../../../shared/consts/index.js';
16
- import '../../../../events/dynamicEvents.js';
17
- import '../../../../../../_virtual/_tslib.js';
18
- import '../../../../context/CaptchaContext/CaptchaContext.js';
19
- import '../../../../context/ErrorContext/ErrorContext.js';
20
- import '@dynamic-labs/multi-wallet';
21
- import 'react-international-phone';
22
17
  import { getSocialSignInProviderFromString } from '../../../../utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.js';
23
18
  import '../../../../store/state/nonce/nonce.js';
24
19
  import { isProviderEnabled } from '../../../../utils/functions/isProviderEnabled/isProviderEnabled.js';
@@ -26,86 +21,23 @@ import '@dynamic-labs-sdk/client/core';
26
21
  import '../../../../client/client.js';
27
22
  import '@dynamic-labs-sdk/client';
28
23
  import '../../../../config/ApiEndpoint.js';
24
+ import '../../../../events/dynamicEvents.js';
25
+ import { useProjectSettings } from '../../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
29
26
  import '@dynamic-labs/locale';
30
27
  import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
31
28
  import '../../../../store/state/primaryWalletId/primaryWalletId.js';
32
29
  import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
33
- import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
34
- import '../../../../context/AccountExistsContext/AccountExistsContext.js';
35
- import '../../../../context/UserWalletsContext/UserWalletsContext.js';
36
- import '../../../../store/state/authMode/authMode.js';
37
- import '../../../../context/VerificationContext/VerificationContext.js';
38
- import 'react-dom';
39
- import '../../../../utils/functions/compareChains/compareChains.js';
40
- import '../../../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
41
- import '../../../../context/ThemeContext/ThemeContext.js';
42
- import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
43
- import 'bs58';
44
- import '@dynamic-labs/types';
45
- import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
46
- import '../../../../context/LoadingContext/LoadingContext.js';
47
- import '../../../../context/WalletContext/WalletContext.js';
48
- import '../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
49
- import 'yup';
50
- import '../../../../context/MockContext/MockContext.js';
51
- import '../../../CollectUserDataView/useFields.js';
52
- import '../../../../context/FieldsStateContext/FieldsStateContext.js';
53
- import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
54
- import '@dynamic-labs/rpc-providers';
55
- import '../../../../store/state/walletOptions/walletOptions.js';
56
- import 'react-i18next';
57
- import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
58
- import '../../../../components/Alert/Alert.js';
59
- import '../../../../components/ShadowDOM/ShadowDOM.js';
60
- import '../../../../components/IconButton/IconButton.js';
61
- import '../../../../components/InlineWidget/InlineWidget.js';
62
- import '../../../../components/Input/Input.js';
63
- import '../../../../components/IsBrowser/IsBrowser.js';
64
- import '../../../../components/MenuList/Dropdown/Dropdown.js';
65
- import '../../../../components/OverlayCard/OverlayCard.js';
66
- import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
67
- import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
68
- import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
69
- import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
70
- import '../../../../components/Popper/Popper/Popper.js';
71
- import '../../../../components/Popper/PopperContext/PopperContext.js';
72
- import 'react-focus-lock';
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 '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
80
- import '@hcaptcha/react-hcaptcha';
81
- import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
82
- import '../../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
83
- import '../../../ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
84
- import '../../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
85
- import '../../../../context/FooterAnimationContext/index.js';
86
30
  import { MagicSocialSignIn } from './MagicSocialSignIn/MagicSocialSignIn.js';
87
31
  import { DynamicSocialSignIn } from './DynamicSocialSignIn/DynamicSocialSignIn.js';
88
- import '../../../MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
89
- import '../../../../context/PasskeyContext/PasskeyContext.js';
90
- import '../../../../context/OnrampContext/OnrampContext.js';
91
- import '../../../../store/state/sendBalances.js';
92
- import '../../../../store/state/connectorsInitializing/connectorsInitializing.js';
93
- import '../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
94
- import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
95
- import '../../../TransactionConfirmationView/TransactionConfirmationView.js';
96
- import '../../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
97
- import '../../../../../index.js';
98
- import '../../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
99
- import '../../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
100
- import '../../../../store/state/tokenBalances.js';
101
- import '../../../../store/state/multichainBalances.js';
102
- import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
103
- import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
104
32
 
105
33
  const SocialSignInSection = ({ sectionData, collapsedLayout, }) => {
106
34
  var _a, _b, _c;
107
- const { projectSettings } = useInternalDynamicContext();
108
- const providers = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [];
35
+ const projectSettings = useProjectSettings();
36
+ if (!projectSettings) {
37
+ logger.debug('Failed to render SocialSignInSection - no project settings');
38
+ return null;
39
+ }
40
+ const providers = (_a = projectSettings.providers) !== null && _a !== void 0 ? _a : [];
109
41
  const componentProps = {
110
42
  collapsedLayout,
111
43
  defaultProvider: getSocialSignInProviderFromString(sectionData.defaultItem),
@@ -113,11 +45,11 @@ const SocialSignInSection = ({ sectionData, collapsedLayout, }) => {
113
45
  };
114
46
  const isMagicEnabled = isProviderEnabled(providers, ProviderEnum.MagicLink);
115
47
  if (isMagicEnabled &&
116
- ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.socialSignIn) === null || _b === void 0 ? void 0 : _b.signInProvider) ===
48
+ ((_b = projectSettings.sdk.socialSignIn) === null || _b === void 0 ? void 0 : _b.signInProvider) ===
117
49
  SignInProviderEnum.MagicLink) {
118
50
  return jsx(MagicSocialSignIn, Object.assign({}, componentProps));
119
51
  }
120
- if (((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.socialSignIn) === null || _c === void 0 ? void 0 : _c.signInProvider) ===
52
+ if (((_c = projectSettings.sdk.socialSignIn) === null || _c === void 0 ? void 0 : _c.signInProvider) ===
121
53
  SignInProviderEnum.Dynamic) {
122
54
  return jsx(DynamicSocialSignIn, Object.assign({}, componentProps));
123
55
  }
@@ -31,6 +31,7 @@ require('@dynamic-labs-sdk/client/core');
31
31
  require('../../../client/client.cjs');
32
32
  require('@dynamic-labs-sdk/client');
33
33
  require('../../../config/ApiEndpoint.cjs');
34
+ var useProjectSettings = require('../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.cjs');
34
35
  require('@dynamic-labs/locale');
35
36
  require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
36
37
  require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
@@ -112,7 +113,8 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
112
113
  const NUMBER_OF_WALLETS = 3;
113
114
  const useLoginView = () => {
114
115
  const loginView = useViewSettings.useViewSettings(sdkApiCore.SdkViewType.Login);
115
- const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, walletsFilter, } = useInternalDynamicContext.useInternalDynamicContext();
116
+ const { authorizationViewDisplayOrder, loginWithEmail, walletsFilter } = useInternalDynamicContext.useInternalDynamicContext();
117
+ const projectSettings = useProjectSettings.useProjectSettings();
116
118
  const { t } = reactI18next.useTranslation();
117
119
  const { enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
118
120
  const { numberOfWallets } = useWalletList.useWalletList({
@@ -157,7 +159,8 @@ const useLoginView = () => {
157
159
  var _a;
158
160
  const hasEnabledNetwork = (chain) => { var _a; return (_a = chain.networks) === null || _a === void 0 ? void 0 : _a.some((network) => network.enabled); };
159
161
  const hasEnabledChain = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains) === null || _a === void 0 ? void 0 : _a.some((chain) => chain.enabled && hasEnabledNetwork(chain));
160
- if (!hasEnabledChain &&
162
+ if (projectSettings &&
163
+ !hasEnabledChain &&
161
164
  sections.find((section) => section.type === 'wallet')) {
162
165
  logger.logger.error('Failed to render WalletSignInSection - no chains enabled');
163
166
  }
@@ -165,7 +168,7 @@ const useLoginView = () => {
165
168
  return sections;
166
169
  }
167
170
  return sections.filter((section) => section.type !== 'wallet');
168
- }, [numberOfWallets, projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains]);
171
+ }, [numberOfWallets, projectSettings]);
169
172
  /**
170
173
  * returns the login view sections to be displayed in order from projectSettings?.sdk?.views
171
174
  * and has backwards compatibility with project settings design.modal props
@@ -212,15 +215,16 @@ const useLoginView = () => {
212
215
  }
213
216
  return sections;
214
217
  }, [
215
- authorizationViewDisplayOrder,
218
+ loginView === null || loginView === void 0 ? void 0 : loginView.sections,
219
+ projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal,
216
220
  enabledSocialProviders,
217
- filterLoginViewSections,
218
221
  hasEmailProviderEnabled,
222
+ hasPasskeyProviderEnabled,
219
223
  hasPhoneProviderEnabled,
220
- loginView === null || loginView === void 0 ? void 0 : loginView.sections,
221
- projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal,
222
224
  numberOfWallets,
225
+ authorizationViewDisplayOrder,
223
226
  t,
227
+ filterLoginViewSections,
224
228
  ]);
225
229
  return {
226
230
  isWalletOnly,
@@ -27,6 +27,7 @@ import '@dynamic-labs-sdk/client/core';
27
27
  import '../../../client/client.js';
28
28
  import '@dynamic-labs-sdk/client';
29
29
  import '../../../config/ApiEndpoint.js';
30
+ import { useProjectSettings } from '../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
30
31
  import '@dynamic-labs/locale';
31
32
  import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
32
33
  import '../../../store/state/primaryWalletId/primaryWalletId.js';
@@ -108,7 +109,8 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
108
109
  const NUMBER_OF_WALLETS = 3;
109
110
  const useLoginView = () => {
110
111
  const loginView = useViewSettings(SdkViewType.Login);
111
- const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, walletsFilter, } = useInternalDynamicContext();
112
+ const { authorizationViewDisplayOrder, loginWithEmail, walletsFilter } = useInternalDynamicContext();
113
+ const projectSettings = useProjectSettings();
112
114
  const { t } = useTranslation();
113
115
  const { enabledSocialProviders } = useSocialRedirectContext();
114
116
  const { numberOfWallets } = useWalletList({
@@ -153,7 +155,8 @@ const useLoginView = () => {
153
155
  var _a;
154
156
  const hasEnabledNetwork = (chain) => { var _a; return (_a = chain.networks) === null || _a === void 0 ? void 0 : _a.some((network) => network.enabled); };
155
157
  const hasEnabledChain = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains) === null || _a === void 0 ? void 0 : _a.some((chain) => chain.enabled && hasEnabledNetwork(chain));
156
- if (!hasEnabledChain &&
158
+ if (projectSettings &&
159
+ !hasEnabledChain &&
157
160
  sections.find((section) => section.type === 'wallet')) {
158
161
  logger.error('Failed to render WalletSignInSection - no chains enabled');
159
162
  }
@@ -161,7 +164,7 @@ const useLoginView = () => {
161
164
  return sections;
162
165
  }
163
166
  return sections.filter((section) => section.type !== 'wallet');
164
- }, [numberOfWallets, projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains]);
167
+ }, [numberOfWallets, projectSettings]);
165
168
  /**
166
169
  * returns the login view sections to be displayed in order from projectSettings?.sdk?.views
167
170
  * and has backwards compatibility with project settings design.modal props
@@ -208,15 +211,16 @@ const useLoginView = () => {
208
211
  }
209
212
  return sections;
210
213
  }, [
211
- authorizationViewDisplayOrder,
214
+ loginView === null || loginView === void 0 ? void 0 : loginView.sections,
215
+ projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal,
212
216
  enabledSocialProviders,
213
- filterLoginViewSections,
214
217
  hasEmailProviderEnabled,
218
+ hasPasskeyProviderEnabled,
215
219
  hasPhoneProviderEnabled,
216
- loginView === null || loginView === void 0 ? void 0 : loginView.sections,
217
- projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal,
218
220
  numberOfWallets,
221
+ authorizationViewDisplayOrder,
219
222
  t,
223
+ filterLoginViewSections,
220
224
  ]);
221
225
  return {
222
226
  isWalletOnly,
@@ -239,7 +239,7 @@ const WalletDelegationView = ({ wallets, }) => {
239
239
  setShowEditView(false);
240
240
  setAgreementChecked(false);
241
241
  }, dataTestId: 'embedded-delegation-okay-button', copykey: 'dyn_wallet_delegation.learn_more_okay_button', style: {
242
- backgroundColor: 'white',
242
+ backgroundColor: 'var(--dynamic-base-2)',
243
243
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
244
244
  width: '100%',
245
245
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.learn_more_okay_button') }));
@@ -249,7 +249,7 @@ const WalletDelegationView = ({ wallets, }) => {
249
249
  color: 'primary',
250
250
  weight: 'bold',
251
251
  }, onClick: () => setShowAuthFlow(false), dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
252
- backgroundColor: 'white',
252
+ backgroundColor: 'var(--dynamic-base-2)',
253
253
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
254
254
  width: '100%',
255
255
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
@@ -259,7 +259,7 @@ const WalletDelegationView = ({ wallets, }) => {
259
259
  color: 'primary',
260
260
  weight: 'bold',
261
261
  }, onClick: () => handleDelegateWallets(), dataTestId: 'embedded-delegation-try-again-button', copykey: 'dyn_wallet_delegation.try_again_button', style: {
262
- backgroundColor: 'white',
262
+ backgroundColor: 'var(--dynamic-base-2)',
263
263
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
264
264
  width: '100%',
265
265
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.try_again_button') }));
@@ -274,7 +274,7 @@ const WalletDelegationView = ({ wallets, }) => {
274
274
  setAgreementChecked(false);
275
275
  setShowLearnMoreView(false);
276
276
  }, dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
277
- backgroundColor: 'white',
277
+ backgroundColor: 'var(--dynamic-base-2)',
278
278
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
279
279
  width: '100%',
280
280
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
@@ -285,7 +285,7 @@ const WalletDelegationView = ({ wallets, }) => {
285
285
  color: 'primary',
286
286
  weight: 'bold',
287
287
  }, onClick: () => handleDenySelectedWallets(), dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
288
- backgroundColor: 'white',
288
+ backgroundColor: 'var(--dynamic-base-2)',
289
289
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
290
290
  width: '100%',
291
291
  }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__deny-button', expanded: true, children: t('dyn_wallet_delegation.deny_button') })), !isLoading && requiresDelegation && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
@@ -294,7 +294,7 @@ const WalletDelegationView = ({ wallets, }) => {
294
294
  }, onClick: () => {
295
295
  handleLogOut();
296
296
  }, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
297
- backgroundColor: 'white',
297
+ backgroundColor: 'var(--dynamic-base-2)',
298
298
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
299
299
  width: '100%',
300
300
  }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__logout-button', expanded: true, children: t('dyn_wallet_delegation.logout_button') }))] }));
@@ -235,7 +235,7 @@ const WalletDelegationView = ({ wallets, }) => {
235
235
  setShowEditView(false);
236
236
  setAgreementChecked(false);
237
237
  }, dataTestId: 'embedded-delegation-okay-button', copykey: 'dyn_wallet_delegation.learn_more_okay_button', style: {
238
- backgroundColor: 'white',
238
+ backgroundColor: 'var(--dynamic-base-2)',
239
239
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
240
240
  width: '100%',
241
241
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.learn_more_okay_button') }));
@@ -245,7 +245,7 @@ const WalletDelegationView = ({ wallets, }) => {
245
245
  color: 'primary',
246
246
  weight: 'bold',
247
247
  }, onClick: () => setShowAuthFlow(false), dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
248
- backgroundColor: 'white',
248
+ backgroundColor: 'var(--dynamic-base-2)',
249
249
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
250
250
  width: '100%',
251
251
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
@@ -255,7 +255,7 @@ const WalletDelegationView = ({ wallets, }) => {
255
255
  color: 'primary',
256
256
  weight: 'bold',
257
257
  }, onClick: () => handleDelegateWallets(), dataTestId: 'embedded-delegation-try-again-button', copykey: 'dyn_wallet_delegation.try_again_button', style: {
258
- backgroundColor: 'white',
258
+ backgroundColor: 'var(--dynamic-base-2)',
259
259
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
260
260
  width: '100%',
261
261
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.try_again_button') }));
@@ -270,7 +270,7 @@ const WalletDelegationView = ({ wallets, }) => {
270
270
  setAgreementChecked(false);
271
271
  setShowLearnMoreView(false);
272
272
  }, dataTestId: 'embedded-delegation-done-button', copykey: 'dyn_wallet_delegation.done_button', style: {
273
- backgroundColor: 'white',
273
+ backgroundColor: 'var(--dynamic-base-2)',
274
274
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
275
275
  width: '100%',
276
276
  }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.done_button') }));
@@ -281,7 +281,7 @@ const WalletDelegationView = ({ wallets, }) => {
281
281
  color: 'primary',
282
282
  weight: 'bold',
283
283
  }, onClick: () => handleDenySelectedWallets(), dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
284
- backgroundColor: 'white',
284
+ backgroundColor: 'var(--dynamic-base-2)',
285
285
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
286
286
  width: '100%',
287
287
  }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__deny-button', expanded: true, children: t('dyn_wallet_delegation.deny_button') })), !isLoading && requiresDelegation && (jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
@@ -290,7 +290,7 @@ const WalletDelegationView = ({ wallets, }) => {
290
290
  }, onClick: () => {
291
291
  handleLogOut();
292
292
  }, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
293
- backgroundColor: 'white',
293
+ backgroundColor: 'var(--dynamic-base-2)',
294
294
  border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
295
295
  width: '100%',
296
296
  }, className: 'embedded-delegated-view__body__button embedded-delegated-view__body__logout-button', expanded: true, children: t('dyn_wallet_delegation.logout_button') }))] }));
@@ -110,13 +110,6 @@ const currencyFormatter = new Intl.NumberFormat('en-US', {
110
110
  });
111
111
  const TokenBalanceItem = ({ tokenBalance, }) => {
112
112
  const { showFiat } = useInternalDynamicContext.useInternalDynamicContext();
113
- const roundToSixDecimal = (value) => {
114
- if (value === 0) {
115
- return '0';
116
- }
117
- const rounded = Math.round(value * 1e6) / 1e6; // 10^6 is 1000000
118
- return rounded === 0 ? '<0.000001' : rounded;
119
- };
120
113
  const formattedFiatValue = () => {
121
114
  var _a;
122
115
  if (tokenBalance.marketValue !== 0 && !tokenBalance.marketValue) {
@@ -126,7 +119,7 @@ const TokenBalanceItem = ({ tokenBalance, }) => {
126
119
  ? currencyFormatter.format(parseFloat((_a = tokenBalance.marketValue) === null || _a === void 0 ? void 0 : _a.toFixed(2)))
127
120
  : '<$0.01';
128
121
  };
129
- return (jsxRuntime.jsxs("div", { className: 'token-balance-item', children: [jsxRuntime.jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsxRuntime.jsx(Image.Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsxRuntime.jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxRuntime.jsxs("div", { className: 'flex', children: [showFiat ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsxRuntime.jsx("div", { className: 'token-balance-item__value', children: jsxRuntime.jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: roundToSixDecimal(tokenBalance.balance) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: tokenBalance.symbol })] }) })] })] }, tokenBalance.address));
122
+ return (jsxRuntime.jsxs("div", { className: 'token-balance-item', children: [jsxRuntime.jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsxRuntime.jsx(Image.Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsxRuntime.jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxRuntime.jsxs("div", { className: 'flex', children: [showFiat ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsxRuntime.jsx("div", { className: 'token-balance-item__value', children: jsxRuntime.jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: tokenBalance.balance }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: tokenBalance.symbol })] }) })] })] }, tokenBalance.address));
130
123
  };
131
124
 
132
125
  exports.TokenBalanceItem = TokenBalanceItem;
@@ -106,13 +106,6 @@ const currencyFormatter = new Intl.NumberFormat('en-US', {
106
106
  });
107
107
  const TokenBalanceItem = ({ tokenBalance, }) => {
108
108
  const { showFiat } = useInternalDynamicContext();
109
- const roundToSixDecimal = (value) => {
110
- if (value === 0) {
111
- return '0';
112
- }
113
- const rounded = Math.round(value * 1e6) / 1e6; // 10^6 is 1000000
114
- return rounded === 0 ? '<0.000001' : rounded;
115
- };
116
109
  const formattedFiatValue = () => {
117
110
  var _a;
118
111
  if (tokenBalance.marketValue !== 0 && !tokenBalance.marketValue) {
@@ -122,7 +115,7 @@ const TokenBalanceItem = ({ tokenBalance, }) => {
122
115
  ? currencyFormatter.format(parseFloat((_a = tokenBalance.marketValue) === null || _a === void 0 ? void 0 : _a.toFixed(2)))
123
116
  : '<$0.01';
124
117
  };
125
- return (jsxs("div", { className: 'token-balance-item', children: [jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsx(Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsx("div", { children: jsx(Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxs("div", { className: 'flex', children: [showFiat ? (jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsx("div", { className: 'token-balance-item__value', children: jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: roundToSixDecimal(tokenBalance.balance) }), jsx(Typography, { variant: 'body_small', color: 'secondary', children: tokenBalance.symbol })] }) })] })] }, tokenBalance.address));
118
+ return (jsxs("div", { className: 'token-balance-item', children: [jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsx(Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsx("div", { children: jsx(Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxs("div", { className: 'flex', children: [showFiat ? (jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsx("div", { className: 'token-balance-item__value', children: jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: tokenBalance.balance }), jsx(Typography, { variant: 'body_small', color: 'secondary', children: tokenBalance.symbol })] }) })] })] }, tokenBalance.address));
126
119
  };
127
120
 
128
121
  export { TokenBalanceItem };
@@ -119,7 +119,10 @@ const SwitchOrUseActiveAccountView = ({ connectedWallet, selectedWalletToSwitchT
119
119
  }
120
120
  setSelectedWalletWithAction({ action: 'select', wallet: connectedWallet });
121
121
  setPrimaryWallet(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.id);
122
- setSelectedWalletConnectorKey(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.connector.key);
122
+ setSelectedWalletConnectorKey({
123
+ chain: connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.connector.connectedChain,
124
+ key: connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.connector.key,
125
+ });
123
126
  }), [
124
127
  connectedWallet,
125
128
  setSelectedWalletWithAction,