@dynamic-labs/sdk-react-core 4.4.2 → 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/lib/Main.cjs +3 -3
- package/src/lib/Main.js +3 -3
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -3
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -3
- package/src/lib/components/HardwareWalletToggle/HardwareWalletToggle.cjs +12 -11
- package/src/lib/components/HardwareWalletToggle/HardwareWalletToggle.js +12 -11
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +2 -2
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +2 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +2 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +2 -2
- package/src/lib/components/Toggle/Toggle.cjs +1 -5
- package/src/lib/components/Toggle/Toggle.d.ts +6 -2
- package/src/lib/components/Toggle/Toggle.js +1 -5
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/utils.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/utils.d.ts +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/utils.js +2 -2
- package/src/lib/context/CaptchaContext/CaptchaContext.cjs +3 -3
- package/src/lib/context/CaptchaContext/CaptchaContext.js +3 -3
- 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/DynamicContext.cjs +7 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -2
- package/src/lib/context/MockContext/MockContext.cjs +0 -2
- package/src/lib/context/MockContext/MockContext.js +0 -2
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +5 -5
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +5 -5
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +8 -9
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +8 -9
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +8 -3
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +8 -3
- package/src/lib/context/ViewContext/ViewContext.cjs +0 -2
- package/src/lib/context/ViewContext/ViewContext.d.ts +0 -10
- package/src/lib/context/ViewContext/ViewContext.js +0 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -2
- package/src/lib/context/WalletGroupContext/WalletGroupContext.cjs +3 -3
- package/src/lib/context/WalletGroupContext/WalletGroupContext.js +3 -3
- package/src/lib/data/api/exchangeRates/exchangeRates.cjs +9 -5
- package/src/lib/data/api/exchangeRates/exchangeRates.js +9 -5
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -6
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -6
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +4 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +4 -4
- package/src/lib/store/internalImplementation/store.cjs +1 -0
- package/src/lib/store/internalImplementation/store.d.ts +5 -1
- package/src/lib/store/internalImplementation/store.js +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +4 -0
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +4 -0
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +3 -3
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.d.ts +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +8 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +7 -7
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +7 -7
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +2 -2
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +5 -0
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +5 -0
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +3 -3
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +3 -3
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +3 -3
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +4 -4
- package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.cjs +28 -10
- package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.js +25 -7
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +6 -6
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +6 -6
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +2 -2
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +2 -2
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +12 -12
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +12 -12
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +5 -7
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +5 -7
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +38 -24
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +3 -2
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +38 -24
- package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.cjs +3 -3
- package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.js +3 -3
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +5 -5
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +5 -5
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +5 -5
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +5 -5
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +9 -9
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +9 -9
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +6 -6
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +6 -6
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.cjs +12 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.d.ts +7 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.js +8 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/index.d.ts +1 -0
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +5 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +5 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +12 -12
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +12 -12
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +8 -8
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +8 -8
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +14 -22
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.d.ts +6 -5
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +14 -22
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +3 -3
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +3 -3
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +2 -2
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +2 -2
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +2 -2
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +2 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +3 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +3 -3
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -2
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +4 -4
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +4 -4
- package/src/lib/views/LoginView/LoginView.cjs +2 -2
- package/src/lib/views/LoginView/LoginView.js +2 -2
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +4 -4
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +4 -4
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -3
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +3 -3
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +5 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +5 -5
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +3 -3
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +3 -3
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +4 -4
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +4 -4
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +4 -9
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +4 -9
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +8 -10
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +8 -10
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
- package/src/lib/views/NoAccess/NoAccess.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +2 -4
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +2 -4
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs +2 -2
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +2 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +9 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +10 -5
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.cjs +0 -17
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.js +0 -17
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
|
@@ -102,7 +102,7 @@ const embeddedWalletsKeys = [
|
|
|
102
102
|
const useWalletOptions = () => {
|
|
103
103
|
const { walletConnectorOptions, setShowAuthFlow } = useInternalDynamicContext();
|
|
104
104
|
const walletGroups = useWalletGroups();
|
|
105
|
-
const {
|
|
105
|
+
const { pushView } = useViewContext();
|
|
106
106
|
const { navigateToWalletGroup } = useWalletGroupContext();
|
|
107
107
|
const { handleWalletItemClick } = useWalletItemActions();
|
|
108
108
|
const getFilteredWalletOptions = useCallback((filter) => {
|
|
@@ -139,7 +139,7 @@ const useWalletOptions = () => {
|
|
|
139
139
|
}
|
|
140
140
|
else if (isHardwareWalletConnector(walletOption.walletConnector) &&
|
|
141
141
|
walletOption.walletConnector.canConnectWithHardwareWallet()) {
|
|
142
|
-
|
|
142
|
+
pushView('select-hardware-wallet', {
|
|
143
143
|
onSelectWallet: handleWalletItemClick,
|
|
144
144
|
wallet: walletOption,
|
|
145
145
|
});
|
|
@@ -152,7 +152,7 @@ const useWalletOptions = () => {
|
|
|
152
152
|
handleWalletItemClick,
|
|
153
153
|
navigateToWalletGroup,
|
|
154
154
|
setShowAuthFlow,
|
|
155
|
-
|
|
155
|
+
pushView,
|
|
156
156
|
walletConnectorOptions,
|
|
157
157
|
walletGroups,
|
|
158
158
|
]);
|
|
@@ -95,7 +95,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
95
95
|
|
|
96
96
|
const BridgeNextWalletConnectionView = () => {
|
|
97
97
|
const { setShowAuthFlow, bridgeChainsToConnect } = useInternalDynamicContext.useInternalDynamicContext();
|
|
98
|
-
const {
|
|
98
|
+
const { pushView } = ViewContext.useViewContext();
|
|
99
99
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)) {
|
|
100
100
|
throw new utils.DynamicError('No wallets to connect');
|
|
101
101
|
}
|
|
@@ -106,7 +106,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
106
106
|
if (!chainInfo) {
|
|
107
107
|
throw new utils.DynamicError('No chain info found for chain', chain);
|
|
108
108
|
}
|
|
109
|
-
return (jsxRuntime.jsx(BridgeNextWalletToConnectLayout.BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsxRuntime.jsx(ChainIcon, {}), onClickAction: () =>
|
|
109
|
+
return (jsxRuntime.jsx(BridgeNextWalletToConnectLayout.BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsxRuntime.jsx(ChainIcon, {}), onClickAction: () => pushView('wallet-list'), onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }) }));
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
exports.BridgeNextWalletConnectionView = BridgeNextWalletConnectionView;
|
|
@@ -91,7 +91,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
91
91
|
|
|
92
92
|
const BridgeNextWalletConnectionView = () => {
|
|
93
93
|
const { setShowAuthFlow, bridgeChainsToConnect } = useInternalDynamicContext();
|
|
94
|
-
const {
|
|
94
|
+
const { pushView } = useViewContext();
|
|
95
95
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)) {
|
|
96
96
|
throw new DynamicError('No wallets to connect');
|
|
97
97
|
}
|
|
@@ -102,7 +102,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
102
102
|
if (!chainInfo) {
|
|
103
103
|
throw new DynamicError('No chain info found for chain', chain);
|
|
104
104
|
}
|
|
105
|
-
return (jsx(BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsx(ChainIcon, {}), onClickAction: () =>
|
|
105
|
+
return (jsx(BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsx(ChainIcon, {}), onClickAction: () => pushView('wallet-list'), onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }) }));
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
export { BridgeNextWalletConnectionView };
|
|
@@ -96,7 +96,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
96
96
|
const isChainInfoDefined = (chainInfo) => chainInfo !== undefined;
|
|
97
97
|
const BridgeWelcomeView = () => {
|
|
98
98
|
const { appName, bridgeChains = [], setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
|
-
const {
|
|
99
|
+
const { pushView } = ViewContext.useViewContext();
|
|
100
100
|
const { t } = reactI18next.useTranslation();
|
|
101
101
|
const body = React.useMemo(() => {
|
|
102
102
|
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
@@ -120,7 +120,7 @@ const BridgeWelcomeView = () => {
|
|
|
120
120
|
return undefined;
|
|
121
121
|
})
|
|
122
122
|
.filter(isChainInfoDefined), [bridgeChains]);
|
|
123
|
-
return (jsxRuntime.jsx(BridgeWelcomeLayout.BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () =>
|
|
123
|
+
return (jsxRuntime.jsx(BridgeWelcomeLayout.BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () => pushView('wallet-list') }));
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
exports.BridgeWelcomeView = BridgeWelcomeView;
|
|
@@ -92,7 +92,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
92
92
|
const isChainInfoDefined = (chainInfo) => chainInfo !== undefined;
|
|
93
93
|
const BridgeWelcomeView = () => {
|
|
94
94
|
const { appName, bridgeChains = [], setShowAuthFlow, } = useInternalDynamicContext();
|
|
95
|
-
const {
|
|
95
|
+
const { pushView } = useViewContext();
|
|
96
96
|
const { t } = useTranslation();
|
|
97
97
|
const body = useMemo(() => {
|
|
98
98
|
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
@@ -116,7 +116,7 @@ const BridgeWelcomeView = () => {
|
|
|
116
116
|
return undefined;
|
|
117
117
|
})
|
|
118
118
|
.filter(isChainInfoDefined), [bridgeChains]);
|
|
119
|
-
return (jsx(BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () =>
|
|
119
|
+
return (jsx(BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () => pushView('wallet-list') }));
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
export { BridgeWelcomeView };
|
|
@@ -100,13 +100,13 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
100
100
|
|
|
101
101
|
const CoinbaseMPCClaimIntro = () => {
|
|
102
102
|
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
103
|
-
const {
|
|
103
|
+
const { pushView } = ViewContext.useViewContext();
|
|
104
104
|
const { t } = reactI18next.useTranslation();
|
|
105
105
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowAuthFlow(false), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
106
106
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_create_password.intro.title', children: t('dyn_create_password.intro.title') }) }), jsxRuntime.jsx("div", { className: 'mpc-claim-intro', children: jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__description', children: jsxRuntime.jsx(walletClaimHero.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'confirm-password-description', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_create_password.intro.description', children: t('dyn_create_password.intro.description.title') }) }), jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card', children: [jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsxRuntime.jsx(lock.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.additional_protection.title', children: t('dyn_create_password.intro.description.additional_protection.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.additional_protection.description', children: t('dyn_create_password.intro.description.additional_protection.description') })] })] }), jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsxRuntime.jsx(altKey.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.restore_access.title', children: t('dyn_create_password.intro.description.restore_access.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.restore_access.description', children: t('dyn_create_password.intro.description.restore_access.description') })] })] })] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
|
|
107
107
|
color: 'inherit',
|
|
108
108
|
}, onClick: () => {
|
|
109
|
-
|
|
109
|
+
pushView('create-password-view', {
|
|
110
110
|
notCalledFromWalletUtils: true,
|
|
111
111
|
});
|
|
112
112
|
}, copykey: 'dyn_create_password.intro.continue', children: t('dyn_create_password.intro.continue') })] }) })] }));
|
|
@@ -96,13 +96,13 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
96
96
|
|
|
97
97
|
const CoinbaseMPCClaimIntro = () => {
|
|
98
98
|
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
99
|
-
const {
|
|
99
|
+
const { pushView } = useViewContext();
|
|
100
100
|
const { t } = useTranslation();
|
|
101
101
|
const closeButton = (jsx(IconButton, { onClick: () => setShowAuthFlow(false), type: 'button', children: jsx(SvgClose, {}) }));
|
|
102
102
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_create_password.intro.title', children: t('dyn_create_password.intro.title') }) }), jsx("div", { className: 'mpc-claim-intro', children: jsxs("div", { className: 'mpc-claim-intro__body', children: [jsx("div", { className: 'mpc-claim-intro__body__description', children: jsx(SvgWalletClaimHero, {}) }), jsx("div", { className: 'confirm-password-description', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_create_password.intro.description', children: t('dyn_create_password.intro.description.title') }) }), jsxs("div", { className: 'mpc-claim-intro__body__card', children: [jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsx(SvgLock, {}) }), jsxs("div", { children: [jsx(Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.additional_protection.title', children: t('dyn_create_password.intro.description.additional_protection.title') }), jsx(Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.additional_protection.description', children: t('dyn_create_password.intro.description.additional_protection.description') })] })] }), jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsx(SvgAltKey, {}) }), jsxs("div", { children: [jsx(Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.restore_access.title', children: t('dyn_create_password.intro.description.restore_access.title') }), jsx(Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.restore_access.description', children: t('dyn_create_password.intro.description.restore_access.description') })] })] })] }), jsx(TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
|
|
103
103
|
color: 'inherit',
|
|
104
104
|
}, onClick: () => {
|
|
105
|
-
|
|
105
|
+
pushView('create-password-view', {
|
|
106
106
|
notCalledFromWalletUtils: true,
|
|
107
107
|
});
|
|
108
108
|
}, copykey: 'dyn_create_password.intro.continue', children: t('dyn_create_password.intro.continue') })] }) })] }));
|
|
@@ -97,7 +97,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
97
97
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
98
98
|
|
|
99
99
|
const EmailConfirmationWaitingView = () => {
|
|
100
|
-
const {
|
|
100
|
+
const { pushView } = ViewContext.useViewContext();
|
|
101
101
|
const { clearStatesOnBackClick, selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
102
102
|
const { t } = reactI18next.useTranslation();
|
|
103
103
|
if (walletConnector && !walletConnectorCore.isEmailWalletConnector(walletConnector)) {
|
|
@@ -106,9 +106,9 @@ const EmailConfirmationWaitingView = () => {
|
|
|
106
106
|
const emailConnector = walletConnector;
|
|
107
107
|
const onClickResetEmail = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
108
108
|
yield (emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.endSession());
|
|
109
|
-
|
|
109
|
+
pushView('login-with-email-or-wallet');
|
|
110
110
|
clearStatesOnBackClick();
|
|
111
|
-
}), [
|
|
111
|
+
}), [pushView, emailConnector, clearStatesOnBackClick]);
|
|
112
112
|
return (jsxRuntime.jsxs("div", { className: 'email-confirmation-waiting-view', children: [jsxRuntime.jsx("div", { className: 'email-confirmation-waiting-view__header-icon', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title', copykey: 'dyn_email_confirmation.title', children: t('dyn_email_confirmation.title') }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_email_confirmation.description', children: t('dyn_email_confirmation.description') }), jsxRuntime.jsxs("div", { className: 'email-confirmation-waiting-view__email-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span', children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email }), jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) }) })] }), jsxRuntime.jsx("div", { className: 'email-confirmation-waiting-view__note', children: jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_small', color: 'secondary', copykey: 'dyn_email_confirmation.note', children: t('dyn_email_confirmation.note') }) }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] }));
|
|
113
113
|
};
|
|
114
114
|
|
|
@@ -93,7 +93,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
93
93
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
94
94
|
|
|
95
95
|
const EmailConfirmationWaitingView = () => {
|
|
96
|
-
const {
|
|
96
|
+
const { pushView } = useViewContext();
|
|
97
97
|
const { clearStatesOnBackClick, selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
98
98
|
const { t } = useTranslation();
|
|
99
99
|
if (walletConnector && !isEmailWalletConnector(walletConnector)) {
|
|
@@ -102,9 +102,9 @@ const EmailConfirmationWaitingView = () => {
|
|
|
102
102
|
const emailConnector = walletConnector;
|
|
103
103
|
const onClickResetEmail = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
104
|
yield (emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.endSession());
|
|
105
|
-
|
|
105
|
+
pushView('login-with-email-or-wallet');
|
|
106
106
|
clearStatesOnBackClick();
|
|
107
|
-
}), [
|
|
107
|
+
}), [pushView, emailConnector, clearStatesOnBackClick]);
|
|
108
108
|
return (jsxs("div", { className: 'email-confirmation-waiting-view', children: [jsx("div", { className: 'email-confirmation-waiting-view__header-icon', children: jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true }) }), jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title', copykey: 'dyn_email_confirmation.title', children: t('dyn_email_confirmation.title') }), jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_email_confirmation.description', children: t('dyn_email_confirmation.description') }), jsxs("div", { className: 'email-confirmation-waiting-view__email-container', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span', children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email }), jsx(IconButton, { onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button', children: jsx(Icon, { color: 'text-tertiary', children: jsx(SvgPencilAltIcon, {}) }) })] }), jsx("div", { className: 'email-confirmation-waiting-view__note', children: jsx(Typography, { weight: 'regular', variant: 'body_small', color: 'secondary', copykey: 'dyn_email_confirmation.note', children: t('dyn_email_confirmation.note') }) }), jsx(PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] }));
|
|
109
109
|
};
|
|
110
110
|
|
|
@@ -122,7 +122,7 @@ const SECONDS_TO_RETRY = 15;
|
|
|
122
122
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
123
123
|
var _a, _b, _c, _d;
|
|
124
124
|
const { environmentId, handleLogOut, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
125
|
-
const {
|
|
125
|
+
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
126
126
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
127
127
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
128
128
|
const [showRetryButton, setShowRetryButton] = React.useState(_showRetryButton);
|
|
@@ -167,7 +167,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
167
167
|
setShowTransferMessage === null || setShowTransferMessage === void 0 ? void 0 : setShowTransferMessage(true);
|
|
168
168
|
}
|
|
169
169
|
if (isEmailRecoveryFlow) {
|
|
170
|
-
|
|
170
|
+
pushView('passkey-recovery-add-email', {
|
|
171
171
|
canSkipAddingEmail: false,
|
|
172
172
|
isFromEmailVerification: true,
|
|
173
173
|
});
|
|
@@ -234,7 +234,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
234
234
|
hasTurnkeyVerifiedCredentialAuthenticator,
|
|
235
235
|
hasRecoveryEmail,
|
|
236
236
|
isTurnkeyProviderEnabled,
|
|
237
|
-
|
|
237
|
+
pushView,
|
|
238
238
|
addRecoveryEmail,
|
|
239
239
|
setShowAuthFlow,
|
|
240
240
|
(_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation,
|
|
@@ -332,7 +332,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
332
332
|
setShowRetryButton(false);
|
|
333
333
|
}
|
|
334
334
|
if (error.code === 'invalid_email_verification') {
|
|
335
|
-
|
|
335
|
+
clearStackAndPushInitialView();
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
finally {
|
|
@@ -118,7 +118,7 @@ const SECONDS_TO_RETRY = 15;
|
|
|
118
118
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
119
119
|
var _a, _b, _c, _d;
|
|
120
120
|
const { environmentId, handleLogOut, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext();
|
|
121
|
-
const {
|
|
121
|
+
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
122
122
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
123
123
|
const { loading, setLoading } = useLoadingContext();
|
|
124
124
|
const [showRetryButton, setShowRetryButton] = useState(_showRetryButton);
|
|
@@ -163,7 +163,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
163
163
|
setShowTransferMessage === null || setShowTransferMessage === void 0 ? void 0 : setShowTransferMessage(true);
|
|
164
164
|
}
|
|
165
165
|
if (isEmailRecoveryFlow) {
|
|
166
|
-
|
|
166
|
+
pushView('passkey-recovery-add-email', {
|
|
167
167
|
canSkipAddingEmail: false,
|
|
168
168
|
isFromEmailVerification: true,
|
|
169
169
|
});
|
|
@@ -230,7 +230,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
230
230
|
hasTurnkeyVerifiedCredentialAuthenticator,
|
|
231
231
|
hasRecoveryEmail,
|
|
232
232
|
isTurnkeyProviderEnabled,
|
|
233
|
-
|
|
233
|
+
pushView,
|
|
234
234
|
addRecoveryEmail,
|
|
235
235
|
setShowAuthFlow,
|
|
236
236
|
(_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation,
|
|
@@ -328,7 +328,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
328
328
|
setShowRetryButton(false);
|
|
329
329
|
}
|
|
330
330
|
if (error.code === 'invalid_email_verification') {
|
|
331
|
-
|
|
331
|
+
clearStackAndPushInitialView();
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
finally {
|
|
@@ -96,7 +96,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
96
96
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
97
97
|
|
|
98
98
|
const EmailWalletOTPVerificationView = () => {
|
|
99
|
-
const {
|
|
99
|
+
const { pushView } = ViewContext.useViewContext();
|
|
100
100
|
const [error, setError] = React.useState();
|
|
101
101
|
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
102
102
|
if (!emailWalletConnector ||
|
|
@@ -110,7 +110,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
110
110
|
const handleBackClick = () => {
|
|
111
111
|
emailWalletConnector.clearEmail();
|
|
112
112
|
clearStatesOnBackClick();
|
|
113
|
-
|
|
113
|
+
pushView('login-with-email-or-wallet');
|
|
114
114
|
dynamicEvents.dynamicEvents.emit('authFailure', {
|
|
115
115
|
email,
|
|
116
116
|
option: email,
|
|
@@ -92,7 +92,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
92
92
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
93
93
|
|
|
94
94
|
const EmailWalletOTPVerificationView = () => {
|
|
95
|
-
const {
|
|
95
|
+
const { pushView } = useViewContext();
|
|
96
96
|
const [error, setError] = useState();
|
|
97
97
|
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext();
|
|
98
98
|
if (!emailWalletConnector ||
|
|
@@ -106,7 +106,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
106
106
|
const handleBackClick = () => {
|
|
107
107
|
emailWalletConnector.clearEmail();
|
|
108
108
|
clearStatesOnBackClick();
|
|
109
|
-
|
|
109
|
+
pushView('login-with-email-or-wallet');
|
|
110
110
|
dynamicEvents.emit('authFailure', {
|
|
111
111
|
email,
|
|
112
112
|
option: email,
|
|
@@ -118,7 +118,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
118
118
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
119
119
|
const { shadowRoot } = ShadowDOM.useShadowDOMContext();
|
|
120
120
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
121
|
-
const {
|
|
121
|
+
const { pushView } = ViewContext.useViewContext();
|
|
122
122
|
const { getEOAWallet, isSmartWallet } = useSmartWallets.useSmartWallets();
|
|
123
123
|
const [acknowledgement1, setAcknowledgement1] = React.useState(false);
|
|
124
124
|
const [hasRevealedCoinbaseMpcKey, setHasRevealedCoinbaseMpcKey] = React.useState(false);
|
|
@@ -216,11 +216,11 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
216
216
|
}
|
|
217
217
|
catch (e) {
|
|
218
218
|
if (e instanceof utils.AccessBlockedError) {
|
|
219
|
-
|
|
219
|
+
pushView('access-blocked');
|
|
220
220
|
}
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
}, [error,
|
|
223
|
+
}, [error, pushView]);
|
|
224
224
|
const { t } = reactI18next.useTranslation();
|
|
225
225
|
const contentHeader = (jsxRuntime.jsxs("div", { children: [primaryWallet &&
|
|
226
226
|
isSmartWallet(primaryWallet) &&
|
|
@@ -261,7 +261,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
261
261
|
borderRadius: '0.75rem',
|
|
262
262
|
}, allow: 'clipboard-write' }));
|
|
263
263
|
const handleClickUnlink = () => {
|
|
264
|
-
|
|
264
|
+
pushView('embedded-delete-view');
|
|
265
265
|
};
|
|
266
266
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view', children: jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body', children: [contentHeader, isCoinbaseMpcWallet && coinbaseWaasKeyExportIframe, isTurnkeyWallet ? (jsxRuntime.jsx("div", { id: constants.iframeContainerId, style: { display: data ? 'block' : 'none' }, ref: iframeContainerRef })) : null, hasInjectedCredential ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', onClick: () => setShowAuthFlow(false), loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
267
267
|
color: 'inherit',
|
|
@@ -114,7 +114,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
114
114
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
115
115
|
const { shadowRoot } = useShadowDOMContext();
|
|
116
116
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
117
|
-
const {
|
|
117
|
+
const { pushView } = useViewContext();
|
|
118
118
|
const { getEOAWallet, isSmartWallet } = useSmartWallets();
|
|
119
119
|
const [acknowledgement1, setAcknowledgement1] = useState(false);
|
|
120
120
|
const [hasRevealedCoinbaseMpcKey, setHasRevealedCoinbaseMpcKey] = useState(false);
|
|
@@ -212,11 +212,11 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
212
212
|
}
|
|
213
213
|
catch (e) {
|
|
214
214
|
if (e instanceof AccessBlockedError) {
|
|
215
|
-
|
|
215
|
+
pushView('access-blocked');
|
|
216
216
|
}
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
}, [error,
|
|
219
|
+
}, [error, pushView]);
|
|
220
220
|
const { t } = useTranslation();
|
|
221
221
|
const contentHeader = (jsxs("div", { children: [primaryWallet &&
|
|
222
222
|
isSmartWallet(primaryWallet) &&
|
|
@@ -257,7 +257,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
257
257
|
borderRadius: '0.75rem',
|
|
258
258
|
}, allow: 'clipboard-write' }));
|
|
259
259
|
const handleClickUnlink = () => {
|
|
260
|
-
|
|
260
|
+
pushView('embedded-delete-view');
|
|
261
261
|
};
|
|
262
262
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsx("div", { className: 'embedded-reveal-view', children: jsxs("div", { className: 'embedded-reveal-view__body', children: [contentHeader, isCoinbaseMpcWallet && coinbaseWaasKeyExportIframe, isTurnkeyWallet ? (jsx("div", { id: iframeContainerId, style: { display: data ? 'block' : 'none' }, ref: iframeContainerRef })) : null, hasInjectedCredential ? (jsxs(Fragment, { children: [jsx(TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', onClick: () => setShowAuthFlow(false), loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
263
263
|
color: 'inherit',
|
|
@@ -24,13 +24,13 @@ var showFarcasterQrCodeView = require('./utils/showFarcasterQrCodeView/showFarca
|
|
|
24
24
|
const LoginView = () => {
|
|
25
25
|
var _a;
|
|
26
26
|
const { error } = ErrorContext.useErrorContext();
|
|
27
|
-
const {
|
|
27
|
+
const { pushView } = ViewContext.useViewContext();
|
|
28
28
|
const { isWalletOnly, loginViewSections } = useLoginView.useLoginView();
|
|
29
29
|
const { enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
|
|
30
30
|
const { showDefaultFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
31
31
|
const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
|
|
32
32
|
const numOfWallets = ((_a = loginViewSections.find((section) => section.type === sdkApiCore.SdkViewSectionType.Wallet)) === null || _a === void 0 ? void 0 : _a.numOfItemsToDisplay) || 0;
|
|
33
|
-
const renderViewSections = React.useMemo(() => loginViewSections.map((viewSection, index) => (jsxRuntime.jsx("div", { className: classNames.classNames('login-view__scroll__section', `login-view__scroll__section--${viewSection.type}`), children: jsxRuntime.jsx(LoginViewSection.LoginViewSection, { gotToWalletList: () =>
|
|
33
|
+
const renderViewSections = React.useMemo(() => loginViewSections.map((viewSection, index) => (jsxRuntime.jsx("div", { className: classNames.classNames('login-view__scroll__section', `login-view__scroll__section--${viewSection.type}`), children: jsxRuntime.jsx(LoginViewSection.LoginViewSection, { gotToWalletList: () => pushView('login-with-email-or-wallet-full-wallet-list'), index: index, viewSection: viewSection, walletCount: numOfWallets }) }, `${viewSection.type}__${index}`))), [loginViewSections, numOfWallets]);
|
|
34
34
|
const errorElement = error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { className: 'login-view__error-container', withIcon: false, children: error }));
|
|
35
35
|
if (showFarcasterQrCodeView.showFarcasterQrCodeView(loginViewSections, enabledSocialProviders)) {
|
|
36
36
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [errorElement, jsxRuntime.jsx(FarcasterQrCodeView.FarcasterQrCodeView, {})] }));
|
|
@@ -20,13 +20,13 @@ import { showFarcasterQrCodeView } from './utils/showFarcasterQrCodeView/showFar
|
|
|
20
20
|
const LoginView = () => {
|
|
21
21
|
var _a;
|
|
22
22
|
const { error } = useErrorContext();
|
|
23
|
-
const {
|
|
23
|
+
const { pushView } = useViewContext();
|
|
24
24
|
const { isWalletOnly, loginViewSections } = useLoginView();
|
|
25
25
|
const { enabledSocialProviders } = useSocialRedirectContext();
|
|
26
26
|
const { showDefaultFooter } = useAuthLayoutChecks();
|
|
27
27
|
const { handleWalletItemClick } = useWalletItemActions();
|
|
28
28
|
const numOfWallets = ((_a = loginViewSections.find((section) => section.type === SdkViewSectionType.Wallet)) === null || _a === void 0 ? void 0 : _a.numOfItemsToDisplay) || 0;
|
|
29
|
-
const renderViewSections = useMemo(() => loginViewSections.map((viewSection, index) => (jsx("div", { className: classNames('login-view__scroll__section', `login-view__scroll__section--${viewSection.type}`), children: jsx(LoginViewSection, { gotToWalletList: () =>
|
|
29
|
+
const renderViewSections = useMemo(() => loginViewSections.map((viewSection, index) => (jsx("div", { className: classNames('login-view__scroll__section', `login-view__scroll__section--${viewSection.type}`), children: jsx(LoginViewSection, { gotToWalletList: () => pushView('login-with-email-or-wallet-full-wallet-list'), index: index, viewSection: viewSection, walletCount: numOfWallets }) }, `${viewSection.type}__${index}`))), [loginViewSections, numOfWallets]);
|
|
30
30
|
const errorElement = error && (jsx(ErrorContainer, { className: 'login-view__error-container', withIcon: false, children: error }));
|
|
31
31
|
if (showFarcasterQrCodeView(loginViewSections, enabledSocialProviders)) {
|
|
32
32
|
return (jsxs(Fragment, { children: [errorElement, jsx(FarcasterQrCodeView, {})] }));
|
|
@@ -97,7 +97,7 @@ var EmailForm = require('../../../../components/EmailForm/EmailForm.cjs');
|
|
|
97
97
|
const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, className, style, }) => {
|
|
98
98
|
var _a;
|
|
99
99
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
100
|
-
const { view,
|
|
100
|
+
const { view, pushView } = ViewContext.useViewContext();
|
|
101
101
|
const { setVerificationUUID, setDisplayedDestination } = VerificationContext.useVerification();
|
|
102
102
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
103
103
|
const [invalidEmail, setInvalidEmail] = React.useState(false);
|
|
@@ -120,18 +120,18 @@ const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, clas
|
|
|
120
120
|
// Pass verification info to [EmailVerification]
|
|
121
121
|
setVerificationUUID(undefined);
|
|
122
122
|
setDisplayedDestination(emailInput);
|
|
123
|
-
|
|
123
|
+
pushView('login-with-email-verification');
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
catch (error) {
|
|
127
127
|
handleEmailSubmitError(error);
|
|
128
|
-
|
|
128
|
+
pushView(view.type);
|
|
129
129
|
}
|
|
130
130
|
}), [
|
|
131
131
|
connectWithEmail,
|
|
132
132
|
onSubmit,
|
|
133
133
|
handleEmailSubmitError,
|
|
134
|
-
|
|
134
|
+
pushView,
|
|
135
135
|
view,
|
|
136
136
|
setVerificationUUID,
|
|
137
137
|
setDisplayedDestination,
|
|
@@ -93,7 +93,7 @@ import { EmailForm } from '../../../../components/EmailForm/EmailForm.js';
|
|
|
93
93
|
const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, className, style, }) => {
|
|
94
94
|
var _a;
|
|
95
95
|
const { projectSettings } = useInternalDynamicContext();
|
|
96
|
-
const { view,
|
|
96
|
+
const { view, pushView } = useViewContext();
|
|
97
97
|
const { setVerificationUUID, setDisplayedDestination } = useVerification();
|
|
98
98
|
const { setErrorMessage } = useErrorContext();
|
|
99
99
|
const [invalidEmail, setInvalidEmail] = useState(false);
|
|
@@ -116,18 +116,18 @@ const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, clas
|
|
|
116
116
|
// Pass verification info to [EmailVerification]
|
|
117
117
|
setVerificationUUID(undefined);
|
|
118
118
|
setDisplayedDestination(emailInput);
|
|
119
|
-
|
|
119
|
+
pushView('login-with-email-verification');
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
catch (error) {
|
|
123
123
|
handleEmailSubmitError(error);
|
|
124
|
-
|
|
124
|
+
pushView(view.type);
|
|
125
125
|
}
|
|
126
126
|
}), [
|
|
127
127
|
connectWithEmail,
|
|
128
128
|
onSubmit,
|
|
129
129
|
handleEmailSubmitError,
|
|
130
|
-
|
|
130
|
+
pushView,
|
|
131
131
|
view,
|
|
132
132
|
setVerificationUUID,
|
|
133
133
|
setDisplayedDestination,
|
|
@@ -96,7 +96,7 @@ var useInternalDynamicContext = require('../../../../../context/DynamicContext/u
|
|
|
96
96
|
|
|
97
97
|
const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInvalidNumberMessage, }) => {
|
|
98
98
|
const { engageCaptcha } = CaptchaContext.useCaptchaContext();
|
|
99
|
-
const { view,
|
|
99
|
+
const { view, pushView } = ViewContext.useViewContext();
|
|
100
100
|
const { environmentId, projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
101
101
|
const { setDisplayedDestination, setVerificationUUID, setRetryData } = VerificationContext.useVerification();
|
|
102
102
|
const { fieldsConfig } = useFields.useFields();
|
|
@@ -123,7 +123,7 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
123
123
|
});
|
|
124
124
|
// we can safely assume phone number always requires verification here
|
|
125
125
|
// because this hook is only used for SMS sign in.
|
|
126
|
-
|
|
126
|
+
pushView('login-with-sms-verification');
|
|
127
127
|
setDisplayedDestination(formatPhone.formatPhone(phone));
|
|
128
128
|
setVerificationUUID(verificationUUID);
|
|
129
129
|
const phoneData = {
|
|
@@ -139,7 +139,7 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
139
139
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
140
140
|
}
|
|
141
141
|
catch (error) {
|
|
142
|
-
|
|
142
|
+
pushView(view.type);
|
|
143
143
|
if (error instanceof utils.SmsVerificationError) {
|
|
144
144
|
let message = t('dyn_login.helper.phone_number_form.invalid_phone');
|
|
145
145
|
if (error.code === 'too_many_sms_verification_attempts') {
|
|
@@ -92,7 +92,7 @@ import { useInternalDynamicContext } from '../../../../../context/DynamicContext
|
|
|
92
92
|
|
|
93
93
|
const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInvalidNumberMessage, }) => {
|
|
94
94
|
const { engageCaptcha } = useCaptchaContext();
|
|
95
|
-
const { view,
|
|
95
|
+
const { view, pushView } = useViewContext();
|
|
96
96
|
const { environmentId, projectSettings } = useInternalDynamicContext();
|
|
97
97
|
const { setDisplayedDestination, setVerificationUUID, setRetryData } = useVerification();
|
|
98
98
|
const { fieldsConfig } = useFields();
|
|
@@ -119,7 +119,7 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
119
119
|
});
|
|
120
120
|
// we can safely assume phone number always requires verification here
|
|
121
121
|
// because this hook is only used for SMS sign in.
|
|
122
|
-
|
|
122
|
+
pushView('login-with-sms-verification');
|
|
123
123
|
setDisplayedDestination(formatPhone(phone));
|
|
124
124
|
setVerificationUUID(verificationUUID);
|
|
125
125
|
const phoneData = {
|
|
@@ -135,7 +135,7 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
135
135
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
136
136
|
}
|
|
137
137
|
catch (error) {
|
|
138
|
-
|
|
138
|
+
pushView(view.type);
|
|
139
139
|
if (error instanceof SmsVerificationError) {
|
|
140
140
|
let message = t('dyn_login.helper.phone_number_form.invalid_phone');
|
|
141
141
|
if (error.code === 'too_many_sms_verification_attempts') {
|
|
@@ -97,13 +97,13 @@ var SocialSignIn = require('../../../../../components/SocialSignIn/SocialSignIn.
|
|
|
97
97
|
const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
|
|
98
98
|
const { setShowAuthFlow, projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
99
|
const { setSocialProvider, socialProvider, enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
|
|
100
|
-
const {
|
|
100
|
+
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
101
101
|
const { engageCaptcha } = CaptchaContext.useCaptchaContext();
|
|
102
102
|
const { isProcessing, connectSocialAccount } = useSocialAuth.useSocialAuth({
|
|
103
103
|
onError: () => {
|
|
104
|
-
|
|
104
|
+
clearStackAndPushInitialView();
|
|
105
105
|
},
|
|
106
|
-
onFarcasterUrl: (url) =>
|
|
106
|
+
onFarcasterUrl: (url) => pushView('farcaster-connect-view', { url }, {
|
|
107
107
|
onBackClick: () => {
|
|
108
108
|
setSocialProvider(undefined);
|
|
109
109
|
dynamicEvents.dynamicEvents.emit('farcasterConnectCancelled');
|
|
@@ -127,7 +127,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
127
127
|
engageCaptcha({
|
|
128
128
|
authMethod: 'social',
|
|
129
129
|
onCaptchaSuccess: (captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
-
|
|
130
|
+
pushView('social-redirect-view');
|
|
131
131
|
setShowAuthFlow(true);
|
|
132
132
|
connectSocialAccount({
|
|
133
133
|
authMode: 'signin',
|
|
@@ -139,7 +139,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
// No Captcha enabled
|
|
142
|
-
|
|
142
|
+
pushView('social-redirect-view');
|
|
143
143
|
setShowAuthFlow(true);
|
|
144
144
|
connectSocialAccount({
|
|
145
145
|
authMode: 'signin',
|
|
@@ -93,13 +93,13 @@ import { SocialSignIn } from '../../../../../components/SocialSignIn/SocialSignI
|
|
|
93
93
|
const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
|
|
94
94
|
const { setShowAuthFlow, projectSettings } = useInternalDynamicContext();
|
|
95
95
|
const { setSocialProvider, socialProvider, enabledSocialProviders } = useSocialRedirectContext();
|
|
96
|
-
const {
|
|
96
|
+
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
97
97
|
const { engageCaptcha } = useCaptchaContext();
|
|
98
98
|
const { isProcessing, connectSocialAccount } = useSocialAuth({
|
|
99
99
|
onError: () => {
|
|
100
|
-
|
|
100
|
+
clearStackAndPushInitialView();
|
|
101
101
|
},
|
|
102
|
-
onFarcasterUrl: (url) =>
|
|
102
|
+
onFarcasterUrl: (url) => pushView('farcaster-connect-view', { url }, {
|
|
103
103
|
onBackClick: () => {
|
|
104
104
|
setSocialProvider(undefined);
|
|
105
105
|
dynamicEvents.emit('farcasterConnectCancelled');
|
|
@@ -123,7 +123,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
123
123
|
engageCaptcha({
|
|
124
124
|
authMethod: 'social',
|
|
125
125
|
onCaptchaSuccess: (captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
-
|
|
126
|
+
pushView('social-redirect-view');
|
|
127
127
|
setShowAuthFlow(true);
|
|
128
128
|
connectSocialAccount({
|
|
129
129
|
authMode: 'signin',
|
|
@@ -135,7 +135,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
// No Captcha enabled
|
|
138
|
-
|
|
138
|
+
pushView('social-redirect-view');
|
|
139
139
|
setShowAuthFlow(true);
|
|
140
140
|
connectSocialAccount({
|
|
141
141
|
authMode: 'signin',
|