@dynamic-labs/sdk-react-core 4.22.8 → 4.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +13 -13
- package/src/index.cjs +2 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -1
- package/src/lib/client/client.cjs +2 -0
- package/src/lib/client/client.d.ts +1 -0
- package/src/lib/client/client.js +2 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.js +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +24 -6
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.d.ts +1 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +26 -8
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.cjs +1 -1
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.js +1 -1
- package/src/lib/components/Search/Search.cjs +5 -1
- package/src/lib/components/Search/Search.js +5 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -1
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +9 -2
- package/src/lib/events/dynamicEvents.cjs +1 -0
- package/src/lib/events/dynamicEvents.d.ts +2 -2
- package/src/lib/events/dynamicEvents.js +1 -0
- package/src/lib/events/wallets.d.ts +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -1
- package/src/lib/locale/en/translation.cjs +30 -0
- package/src/lib/locale/en/translation.d.ts +30 -0
- package/src/lib/locale/en/translation.js +30 -0
- package/src/lib/shared/logger.cjs +1 -1
- package/src/lib/shared/logger.js +2 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +1 -1
- package/src/lib/utils/functions/getTimeSince/index.d.ts +1 -0
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/index.d.ts +3 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.cjs +15 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.d.ts +6 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.js +11 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +13 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +13 -6
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.cjs +1 -1
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.js +1 -1
- package/src/lib/utils/hooks/useIsMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -1
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +33 -18
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.d.ts +4 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +33 -18
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.cjs +1 -1
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.js +1 -1
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.d.ts +2 -2
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.cjs +11 -2
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.js +11 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +1 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +43 -6
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +43 -6
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +17 -8
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +17 -8
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +8 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +8 -2
- package/src/lib/views/ExchangeList/ExchangeList.cjs +9 -14
- package/src/lib/views/ExchangeList/ExchangeList.js +10 -15
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +1 -1
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +4 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +4 -2
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +4 -4
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -2
- package/src/lib/widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs +0 -6
- package/src/lib/widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js +1 -6
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +0 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +42 -106
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +43 -107
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +119 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +115 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.cjs +170 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.js +166 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.cjs → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs} +8 -7
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.js → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js} +7 -6
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +5 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/index.d.ts +0 -1
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.cjs +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.d.ts +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.js +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/index.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.cjs +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.js +0 -0
|
@@ -15,7 +15,7 @@ import { ConnectedAppsView } from '../../views/ConnectedAppsView/ConnectedAppsVi
|
|
|
15
15
|
import { DepositedExchangeView } from '../../views/DepositedExchangeView/DepositedExchangeView.js';
|
|
16
16
|
import { DepositView } from '../../views/DepositView/DepositView.js';
|
|
17
17
|
import { GlobalWalletView } from '../../views/GlobalWalletView/GlobalWalletView.js';
|
|
18
|
-
import {
|
|
18
|
+
import { ManageTotpMfaWidgetView } from '../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js';
|
|
19
19
|
import { ReceiveWalletFunds } from '../../views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
20
20
|
import { RevokeAccessView } from '../../views/SessionManagementView/RevokeAccessView/RevokeAccessView.js';
|
|
21
21
|
import { SessionManagementInfoView } from '../../views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.js';
|
|
@@ -31,9 +31,9 @@ const mapViewToComponent = {
|
|
|
31
31
|
'deposited-exchange': DepositedExchangeView,
|
|
32
32
|
'edit-profile': EditProfileView,
|
|
33
33
|
'global-wallet': GlobalWalletView,
|
|
34
|
-
'manage-mfa': ManageMfaWidgetView,
|
|
35
|
-
'manage-mfa-no-footer': ManageMfaWidgetView,
|
|
36
34
|
'manage-passkeys': ManagePasskeysWidgetView,
|
|
35
|
+
'manage-totp-mfa': ManageTotpMfaWidgetView,
|
|
36
|
+
'manage-totp-mfa-no-footer': ManageTotpMfaWidgetView,
|
|
37
37
|
profile: ProfileView,
|
|
38
38
|
'receive-exchange-funds': ReceiveWalletFunds,
|
|
39
39
|
'receive-wallet-funds': ReceiveWalletFunds,
|
package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs
CHANGED
|
@@ -118,13 +118,13 @@ const DynamicWidgetWallets = () => {
|
|
|
118
118
|
setShowLinkNewWalletModal(true);
|
|
119
119
|
setSelectedWalletConnectorKey(null);
|
|
120
120
|
};
|
|
121
|
-
const
|
|
122
|
-
?
|
|
123
|
-
:
|
|
121
|
+
const newWalletActionCopyKey = authMode$1 === 'connect-only'
|
|
122
|
+
? 'dyn_secondary_wallet.connect_new'
|
|
123
|
+
: 'dyn_secondary_wallet.link_new';
|
|
124
124
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'dynamic-widget-wallets-header', children: [jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', className: 'dynamic-widget-wallets-header__title', copykey: 'dyn_widget.other_wallets', children: t('dyn_widget.other_wallets') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'dynamic-widget-wallets-header__add_wallet', buttonVariant: 'primary', buttonPadding: 'small', onClick: addNewWallet, typographyProps: {
|
|
125
125
|
color: 'primary',
|
|
126
126
|
variant: 'button_secondary',
|
|
127
|
-
}, startSlot: jsxRuntime.jsx(add.ReactComponent, {}), copykey:
|
|
127
|
+
}, startSlot: jsxRuntime.jsx(add.ReactComponent, {}), copykey: newWalletActionCopyKey, children: t(newWalletActionCopyKey) })] }), jsxRuntime.jsx("div", { ref: availableWalletsContainerRef, className: 'dynamic-widget-wallets', "data-testid": 'dynamicWidgetWallets', children: jsxRuntime.jsx("div", { className: classNames.classNames('dynamic-widget-wallets__body', {
|
|
128
128
|
'dynamic-widget-wallets__body--apply-height': !isEmpty,
|
|
129
129
|
}), children: isEmpty ? (jsxRuntime.jsx(EmptyWallets.EmptyWallets, { copykey: 'dyn_widget.empty_wallets', text: t('dyn_widget.empty_wallets', {
|
|
130
130
|
action: authMode$1 === 'connect-and-sign'
|
package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js
CHANGED
|
@@ -114,13 +114,13 @@ const DynamicWidgetWallets = () => {
|
|
|
114
114
|
setShowLinkNewWalletModal(true);
|
|
115
115
|
setSelectedWalletConnectorKey(null);
|
|
116
116
|
};
|
|
117
|
-
const
|
|
118
|
-
?
|
|
119
|
-
:
|
|
117
|
+
const newWalletActionCopyKey = authMode === 'connect-only'
|
|
118
|
+
? 'dyn_secondary_wallet.connect_new'
|
|
119
|
+
: 'dyn_secondary_wallet.link_new';
|
|
120
120
|
return (jsxs(Fragment, { children: [jsxs("div", { className: 'dynamic-widget-wallets-header', children: [jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', className: 'dynamic-widget-wallets-header__title', copykey: 'dyn_widget.other_wallets', children: t('dyn_widget.other_wallets') }), jsx(TypographyButton, { buttonClassName: 'dynamic-widget-wallets-header__add_wallet', buttonVariant: 'primary', buttonPadding: 'small', onClick: addNewWallet, typographyProps: {
|
|
121
121
|
color: 'primary',
|
|
122
122
|
variant: 'button_secondary',
|
|
123
|
-
}, startSlot: jsx(SvgAdd, {}), copykey:
|
|
123
|
+
}, startSlot: jsx(SvgAdd, {}), copykey: newWalletActionCopyKey, children: t(newWalletActionCopyKey) })] }), jsx("div", { ref: availableWalletsContainerRef, className: 'dynamic-widget-wallets', "data-testid": 'dynamicWidgetWallets', children: jsx("div", { className: classNames('dynamic-widget-wallets__body', {
|
|
124
124
|
'dynamic-widget-wallets__body--apply-height': !isEmpty,
|
|
125
125
|
}), children: isEmpty ? (jsx(EmptyWallets, { copykey: 'dyn_widget.empty_wallets', text: t('dyn_widget.empty_wallets', {
|
|
126
126
|
action: authMode === 'connect-and-sign'
|
|
@@ -137,7 +137,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
137
137
|
}, [isKYCEnabled, setDynamicWidgetView]);
|
|
138
138
|
const overridenWidgetView = React.useMemo(() => {
|
|
139
139
|
if (dynamicWidgetView === 'manage-passkeys' ||
|
|
140
|
-
dynamicWidgetView === 'manage-mfa' ||
|
|
140
|
+
dynamicWidgetView === 'manage-totp-mfa' ||
|
|
141
141
|
dynamicWidgetView === 'account-and-security-settings')
|
|
142
142
|
return 'settings';
|
|
143
143
|
if (!isKYCEnabled &&
|
|
@@ -133,7 +133,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
133
133
|
}, [isKYCEnabled, setDynamicWidgetView]);
|
|
134
134
|
const overridenWidgetView = useMemo(() => {
|
|
135
135
|
if (dynamicWidgetView === 'manage-passkeys' ||
|
|
136
|
-
dynamicWidgetView === 'manage-mfa' ||
|
|
136
|
+
dynamicWidgetView === 'manage-totp-mfa' ||
|
|
137
137
|
dynamicWidgetView === 'account-and-security-settings')
|
|
138
138
|
return 'settings';
|
|
139
139
|
if (!isKYCEnabled &&
|
|
@@ -13,8 +13,8 @@ const DynamicGlobalWalletViews = [
|
|
|
13
13
|
];
|
|
14
14
|
const DynamicPasskeyWidgetViews = ['manage-passkeys'];
|
|
15
15
|
const DynamicMfaWidgetViews = [
|
|
16
|
-
'manage-mfa',
|
|
17
|
-
'manage-mfa-no-footer',
|
|
16
|
+
'manage-totp-mfa',
|
|
17
|
+
'manage-totp-mfa-no-footer',
|
|
18
18
|
];
|
|
19
19
|
const DynamicTransactionsWidgetViews = ['send-balance'];
|
|
20
20
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ComponentProps, Dispatch, FC, RefObject, SetStateAction } from 'react';
|
|
2
|
-
import { mapViewToComponent } from '../components/DynamicWidgetViews/mapViewToComponent';
|
|
3
2
|
import { AlertProps } from '../../../components/Alert';
|
|
3
|
+
import { mapViewToComponent } from '../components/DynamicWidgetViews/mapViewToComponent';
|
|
4
4
|
export declare const DynamicSettingsViews: readonly ["settings", "account-and-security-settings"];
|
|
5
5
|
export type DynamicSettingsType = typeof DynamicSettingsViews[number];
|
|
6
6
|
export declare const DynamicGlobalWalletViews: readonly ["global-wallet", "connected-apps"];
|
|
7
7
|
export type DynamicGlobalWalletType = typeof DynamicGlobalWalletViews[number];
|
|
8
8
|
export declare const DynamicPasskeyWidgetViews: readonly ["manage-passkeys"];
|
|
9
|
-
export declare const DynamicMfaWidgetViews: readonly ["manage-mfa", "manage-mfa-no-footer"];
|
|
9
|
+
export declare const DynamicMfaWidgetViews: readonly ["manage-totp-mfa", "manage-totp-mfa-no-footer"];
|
|
10
10
|
export type DynamicPasskeyWidgetViewsType = typeof DynamicPasskeyWidgetViews[number];
|
|
11
11
|
export type DynamicMfaWidgetViewsType = typeof DynamicMfaWidgetViews[number];
|
|
12
12
|
export declare const DynamicSessionManagementViews: readonly ["session-management", "session-management-info", "session-management-revoke-access"];
|
|
@@ -9,8 +9,8 @@ const DynamicGlobalWalletViews = [
|
|
|
9
9
|
];
|
|
10
10
|
const DynamicPasskeyWidgetViews = ['manage-passkeys'];
|
|
11
11
|
const DynamicMfaWidgetViews = [
|
|
12
|
-
'manage-mfa',
|
|
13
|
-
'manage-mfa-no-footer',
|
|
12
|
+
'manage-totp-mfa',
|
|
13
|
+
'manage-totp-mfa-no-footer',
|
|
14
14
|
];
|
|
15
15
|
const DynamicTransactionsWidgetViews = ['send-balance'];
|
|
16
16
|
|
|
@@ -31,12 +31,6 @@ const convertProviderToExchangeKeyEnum = (provider) => {
|
|
|
31
31
|
return exchange;
|
|
32
32
|
throw new Error(`convertProviderToExchangeKeyEnum: No ExchangeKeyEnum value found for ProviderEnum.${provider}`);
|
|
33
33
|
};
|
|
34
|
-
const isProviderExchange = (provider) => {
|
|
35
|
-
if (provider in PROVIDER_TO_EXCHANGE_OVERRIDES)
|
|
36
|
-
return true;
|
|
37
|
-
return Boolean(sdkApiCore.ExchangeKeyEnum[provider]);
|
|
38
|
-
};
|
|
39
34
|
|
|
40
35
|
exports.convertExchangeKeytoProviderEnum = convertExchangeKeytoProviderEnum;
|
|
41
36
|
exports.convertProviderToExchangeKeyEnum = convertProviderToExchangeKeyEnum;
|
|
42
|
-
exports.isProviderExchange = isProviderExchange;
|
|
@@ -27,10 +27,5 @@ const convertProviderToExchangeKeyEnum = (provider) => {
|
|
|
27
27
|
return exchange;
|
|
28
28
|
throw new Error(`convertProviderToExchangeKeyEnum: No ExchangeKeyEnum value found for ProviderEnum.${provider}`);
|
|
29
29
|
};
|
|
30
|
-
const isProviderExchange = (provider) => {
|
|
31
|
-
if (provider in PROVIDER_TO_EXCHANGE_OVERRIDES)
|
|
32
|
-
return true;
|
|
33
|
-
return Boolean(ExchangeKeyEnum[provider]);
|
|
34
|
-
};
|
|
35
30
|
|
|
36
|
-
export { convertExchangeKeytoProviderEnum, convertProviderToExchangeKeyEnum
|
|
31
|
+
export { convertExchangeKeytoProviderEnum, convertProviderToExchangeKeyEnum };
|
|
@@ -15,7 +15,6 @@ require('@dynamic-labs/wallet-book');
|
|
|
15
15
|
require('../../../utils/constants/colors.cjs');
|
|
16
16
|
require('../../../utils/constants/values.cjs');
|
|
17
17
|
require('../../../shared/consts/index.cjs');
|
|
18
|
-
require('../../../locale/locale.cjs');
|
|
19
18
|
|
|
20
19
|
const replaceAll = (text, char, replace) => {
|
|
21
20
|
const re = new RegExp(char, 'g');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Provider } from '@dynamic-labs/sdk-api-core';
|
|
2
2
|
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
export * from './getPasskeyProviderFromUserAgent';
|
|
4
|
-
export * from './getTimeSince';
|
|
5
4
|
export declare const replaceAll: (text: string, char: string, replace: string) => string;
|
|
6
5
|
export declare const copyToClipboard: (textToCopy: string) => void;
|
|
7
6
|
export declare const roundBalance: (balanceString: string, decimals?: number) => string;
|
|
@@ -11,7 +11,6 @@ import '@dynamic-labs/wallet-book';
|
|
|
11
11
|
import '../../../utils/constants/colors.js';
|
|
12
12
|
import '../../../utils/constants/values.js';
|
|
13
13
|
import '../../../shared/consts/index.js';
|
|
14
|
-
import '../../../locale/locale.js';
|
|
15
14
|
|
|
16
15
|
const replaceAll = (text, char, replace) => {
|
|
17
16
|
const re = new RegExp(char, 'g');
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
9
9
|
require('@dynamic-labs-sdk/client');
|
|
10
10
|
require('../../../../client/client.cjs');
|
|
11
11
|
require('../../../../../../_virtual/_tslib.cjs');
|
|
12
|
-
require('../../../../utils/constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../../utils/constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../../shared/logger.cjs');
|
|
16
16
|
require('../../../../utils/constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
5
5
|
import '@dynamic-labs-sdk/client';
|
|
6
6
|
import '../../../../client/client.js';
|
|
7
7
|
import '../../../../../../_virtual/_tslib.js';
|
|
8
|
-
import '../../../../utils/constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../../utils/constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../../shared/logger.js';
|
|
12
12
|
import '../../../../utils/constants/colors.js';
|
|
@@ -3,34 +3,27 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var reactI18next = require('react-i18next');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('../../../../components/
|
|
13
|
-
var add = require('../../../../shared/assets/add.cjs');
|
|
14
|
-
var androidTouchId = require('../../../../shared/assets/android-touch-id.cjs');
|
|
15
|
-
var checkCircle = require('../../../../shared/assets/check-circle.cjs');
|
|
16
|
-
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
17
|
-
var shield = require('../../../../shared/assets/shield.cjs');
|
|
18
|
-
require('@dynamic-labs/iconic');
|
|
19
|
-
var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
|
|
20
|
-
var spinner = require('../../../../components/Spinner/spinner.cjs');
|
|
21
|
-
require('../../../../components/Alert/Alert.cjs');
|
|
22
|
-
require('../../../../events/dynamicEvents.cjs');
|
|
23
|
-
require('@dynamic-labs/utils');
|
|
9
|
+
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
10
|
+
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
11
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
24
12
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
25
13
|
require('../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
26
14
|
require('@dynamic-labs/sdk-api-core');
|
|
27
|
-
|
|
15
|
+
require('../../../../shared/logger.cjs');
|
|
16
|
+
require('@dynamic-labs/iconic');
|
|
17
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
18
|
+
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
19
|
+
var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
|
|
28
20
|
require('@dynamic-labs/wallet-book');
|
|
21
|
+
require('@dynamic-labs/utils');
|
|
29
22
|
require('../../../../utils/constants/colors.cjs');
|
|
30
23
|
require('../../../../utils/constants/values.cjs');
|
|
31
24
|
require('../../../../shared/consts/index.cjs');
|
|
32
|
-
require('../../../../
|
|
33
|
-
|
|
25
|
+
require('../../../../events/dynamicEvents.cjs');
|
|
26
|
+
require('../../../../../../_virtual/_tslib.cjs');
|
|
34
27
|
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
35
28
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
36
29
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -39,7 +32,7 @@ require('../../../../store/state/nonce/nonce.cjs');
|
|
|
39
32
|
require('@dynamic-labs-sdk/client/core');
|
|
40
33
|
require('@dynamic-labs-sdk/client');
|
|
41
34
|
require('../../../../client/client.cjs');
|
|
42
|
-
|
|
35
|
+
require('../../../../store/state/projectSettings/projectSettings.cjs');
|
|
43
36
|
require('../../../../config/ApiEndpoint.cjs');
|
|
44
37
|
require('../../../../locale/locale.cjs');
|
|
45
38
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
@@ -48,20 +41,18 @@ require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs')
|
|
|
48
41
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
49
42
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
50
43
|
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
+
require('../../../../store/state/authMode/authMode.cjs');
|
|
51
45
|
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
52
46
|
require('react-dom');
|
|
53
47
|
require('../../../../utils/functions/compareChains/compareChains.cjs');
|
|
54
48
|
require('../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
55
49
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
56
|
-
var useSmartWallets = require('../../../../utils/hooks/useSmartWallets/useSmartWallets.cjs');
|
|
57
50
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
58
|
-
var usePasskeyRecovery = require('../../../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
59
51
|
require('bs58');
|
|
60
52
|
require('@dynamic-labs/types');
|
|
61
53
|
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
62
54
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
63
55
|
require('../../../../context/WalletContext/WalletContext.cjs');
|
|
64
|
-
var useIsTurnkeyWallet = require('../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
65
56
|
require('../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
66
57
|
require('yup');
|
|
67
58
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
@@ -70,96 +61,59 @@ require('../../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
|
70
61
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
71
62
|
require('@dynamic-labs/rpc-providers');
|
|
72
63
|
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
73
|
-
|
|
74
|
-
require('../../../../
|
|
64
|
+
require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
65
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
75
66
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
67
|
+
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
68
|
+
require('../../../../components/Input/Input.cjs');
|
|
69
|
+
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
70
|
+
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
71
|
+
require('../../../../components/OverlayCard/OverlayCard.cjs');
|
|
76
72
|
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
77
73
|
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
78
74
|
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
79
|
-
require('../../../../components/
|
|
80
|
-
require('../../../../
|
|
81
|
-
require('
|
|
75
|
+
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
76
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
77
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
82
78
|
require('react-focus-lock');
|
|
83
|
-
|
|
84
|
-
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
85
|
-
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
86
|
-
var Badge = require('../../../../components/Badge/Badge.cjs');
|
|
87
|
-
var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
|
|
79
|
+
require('qrcode');
|
|
88
80
|
require('formik');
|
|
89
81
|
require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
90
|
-
|
|
82
|
+
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
83
|
+
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
84
|
+
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
85
|
+
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
86
|
+
require('@hcaptcha/react-hcaptcha');
|
|
87
|
+
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
88
|
+
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
89
|
+
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
90
|
+
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
91
|
+
require('../../helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
91
92
|
require('../../../../store/state/sendBalances.cjs');
|
|
92
|
-
require('../../../../
|
|
93
|
-
require('../../../../components/
|
|
93
|
+
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
94
|
+
require('../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
95
|
+
require('../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
94
96
|
require('../../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
95
|
-
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
96
97
|
require('../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
97
|
-
var PasskeyDeviceIcon = require('../../../../views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs');
|
|
98
98
|
var EmbeddedWalletExportSection = require('./EmbeddedWalletExportSection/EmbeddedWalletExportSection.cjs');
|
|
99
99
|
var EmbeddedWalletRecoveryEmailSection = require('./EmbeddedWalletRecoveryEmailSection/EmbeddedWalletRecoveryEmailSection.cjs');
|
|
100
|
+
var MfaSection = require('./MfaSection/MfaSection.cjs');
|
|
101
|
+
var WalletSecuritySection = require('./WalletSecuritySection/WalletSecuritySection.cjs');
|
|
100
102
|
var ZKSyncSessionsSection = require('./ZKSyncSessionsSection/ZKSyncSessionsSection.cjs');
|
|
101
103
|
require('../../../../context/OnrampContext/OnrampContext.cjs');
|
|
102
|
-
require('../../helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
103
|
-
require('qrcode');
|
|
104
104
|
require('../ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
105
105
|
require('../../../../../index.cjs');
|
|
106
|
-
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
107
|
-
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
108
|
-
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
109
|
-
require('@hcaptcha/react-hcaptcha');
|
|
110
|
-
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
111
|
-
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
112
|
-
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
113
106
|
require('../../../../store/state/tokenBalances.cjs');
|
|
114
107
|
require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
115
|
-
require('../../../../
|
|
116
|
-
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
117
|
-
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
118
|
-
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
108
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
119
109
|
|
|
120
110
|
const AccountAndSecuritySettingsView = () => {
|
|
121
|
-
var _a, _b, _c, _d, _e, _f;
|
|
122
111
|
const { t } = reactI18next.useTranslation();
|
|
123
112
|
const { clearStackAndPush } = ViewContext.useViewContext();
|
|
124
113
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
125
|
-
const {
|
|
126
|
-
const projectSettings$1 = projectSettings.useProjectSettings();
|
|
127
|
-
const { isTurnkeyWallet, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
128
|
-
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
129
|
-
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
114
|
+
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
130
115
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
131
|
-
const isPasskeyEnabled = Boolean((_d = (_c = (_b = (_a = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.supportedSecurityMethods) === null || _c === void 0 ? void 0 : _c.passkey) === null || _d === void 0 ? void 0 : _d.isEnabled);
|
|
132
|
-
const isTurnkeyWalletWithAuthenticator = isTurnkeyWallet && !isTurnkeyWalletWithoutAuthenticator;
|
|
133
|
-
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
134
|
-
const isMfaEnabled = Boolean((_f = (_e = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.security) === null || _e === void 0 ? void 0 : _e.mfa) === null || _f === void 0 ? void 0 : _f.enabled);
|
|
135
|
-
const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
136
|
-
(eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
|
|
137
|
-
const shouldShowPasskeyMFA = isPasskeyEnabled && isTurnkeyWallet && !isSessionKeyCompatible;
|
|
138
|
-
const handlePasskeyClick = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
139
|
-
if (isTurnkeyWalletWithoutAuthenticator) {
|
|
140
|
-
try {
|
|
141
|
-
setIsLoading(true);
|
|
142
|
-
yield initPasskeyRecoveryProcess('passkey');
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
logger.logger.error('Failed to init passkey recovery:', error);
|
|
146
|
-
}
|
|
147
|
-
finally {
|
|
148
|
-
setIsLoading(false);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
setDynamicWidgetView('manage-passkeys');
|
|
153
|
-
}
|
|
154
|
-
}), [
|
|
155
|
-
isTurnkeyWalletWithoutAuthenticator,
|
|
156
|
-
setIsLoading,
|
|
157
|
-
initPasskeyRecoveryProcess,
|
|
158
|
-
setDynamicWidgetView,
|
|
159
|
-
]);
|
|
160
116
|
const handleBackClick = React.useCallback(() => setDynamicWidgetView('settings'), [setDynamicWidgetView]);
|
|
161
|
-
const handleMfaClick = React.useCallback(() => setDynamicWidgetView('manage-mfa'), [setDynamicWidgetView]);
|
|
162
|
-
const handlePasskeyButtonClick = React.useCallback(() => handlePasskeyClick(), [handlePasskeyClick]);
|
|
163
117
|
const handleDeleteAccountClick = React.useCallback(() => {
|
|
164
118
|
clearStackAndPush('user-delete-account', {}, {
|
|
165
119
|
onBackClick: () => {
|
|
@@ -168,26 +122,8 @@ const AccountAndSecuritySettingsView = () => {
|
|
|
168
122
|
});
|
|
169
123
|
setShowAuthFlow(true);
|
|
170
124
|
}, [clearStackAndPush, setShowAuthFlow]);
|
|
171
|
-
const renderPasskeysButtonEndSlot = () => {
|
|
172
|
-
if (isTurnkeyWalletWithAuthenticator)
|
|
173
|
-
return (jsxRuntime.jsx(checkCircle.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--success' }));
|
|
174
|
-
if (isLoading)
|
|
175
|
-
return jsxRuntime.jsx(spinner.Spinner, {});
|
|
176
|
-
return jsxRuntime.jsx(add.ReactComponent, {});
|
|
177
|
-
};
|
|
178
125
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
179
|
-
|
|
180
|
-
'settings-view__body__section__title__info-icon': !isTurnkeyWalletWithAuthenticator,
|
|
181
|
-
}), [isTurnkeyWalletWithAuthenticator]);
|
|
182
|
-
const passkeyButtonClasses = React.useMemo(() => classNames.classNames('settings-view__body__section__button', {
|
|
183
|
-
'settings-view__body__section__button__badge': !isTurnkeyWalletWithAuthenticator,
|
|
184
|
-
}), [isTurnkeyWalletWithAuthenticator]);
|
|
185
|
-
return (jsxRuntime.jsxs("div", { className: 'account-and-security-settings-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') }) }) }), jsxRuntime.jsx("div", { className: 'account-wrap', children: jsxRuntime.jsxs("div", { className: 'settings-view__body', children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [shouldShowPasskeyMFA ||
|
|
186
|
-
(isMfaEnabled && (jsxRuntime.jsx("div", { className: securitySectionTitleClasses, children: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.security_section.title', children: t('dyn_settings.security_section.title') }) }))), shouldShowPasskeyMFA && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'manage-passkeys-button', onClick: handlePasskeyButtonClick, buttonClassName: passkeyButtonClasses, startSlot:
|
|
187
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
188
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { className: 'settings-view__body__section__button__icon', defaultIcon: jsxRuntime.jsx(androidTouchId.ReactComponent, { "data-testid": 'default-icon' }) }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.security_section.passkey_button', children: t('dyn_settings.security_section.passkey_button') }), !isTurnkeyWalletWithAuthenticator && (jsxRuntime.jsx(Badge.Badge, { text: t('dyn_settings.tags.recommended'), copykey: 'dyn_settings.tags.recommended', variant: 'secondary' }))] }), endSlot: renderPasskeysButtonEndSlot(), disabled: isLoading, showInternalLoading: false })), isMfaEnabled && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'manage-mfa-button', onClick: handleMfaClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
189
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
190
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(shield.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.security_section.mfa_button', children: t('dyn_settings.security_section.mfa_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), disabled: isLoading, showInternalLoading: false }))] }), jsxRuntime.jsx(ZKSyncSessionsSection.ZKSyncSessionsSection, { isLoading: isLoading }), jsxRuntime.jsx(EmbeddedWalletRecoveryEmailSection.EmbeddedWalletRecoveryEmailSection, {}), jsxRuntime.jsx(EmbeddedWalletExportSection.EmbeddedWalletExportSection, {})] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', copykey: 'dyn_settings.delete_account.title', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
126
|
+
return (jsxRuntime.jsxs("div", { className: 'account-and-security-settings-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') }) }) }), jsxRuntime.jsx("div", { className: 'account-wrap', children: jsxRuntime.jsxs("div", { className: 'settings-view__body', children: [jsxRuntime.jsx(MfaSection.MfaSection, { isLoading: isLoading }), jsxRuntime.jsx(ZKSyncSessionsSection.ZKSyncSessionsSection, { isLoading: isLoading }), jsxRuntime.jsx(EmbeddedWalletRecoveryEmailSection.EmbeddedWalletRecoveryEmailSection, {}), jsxRuntime.jsx(EmbeddedWalletExportSection.EmbeddedWalletExportSection, {}), jsxRuntime.jsx(WalletSecuritySection.WalletSecuritySection, { isLoading: isLoading, setIsLoading: setIsLoading })] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', copykey: 'dyn_settings.delete_account.title', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
191
127
|
};
|
|
192
128
|
|
|
193
129
|
exports.AccountAndSecuritySettingsView = AccountAndSecuritySettingsView;
|