@dynamic-labs/sdk-react-core 4.4.2 → 4.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/lib/Main.cjs +3 -3
  6. package/src/lib/Main.js +3 -3
  7. package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -3
  8. package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -3
  9. package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +2 -2
  10. package/src/lib/components/NeedHelpSection/NeedHelpSection.js +2 -2
  11. package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +2 -2
  12. package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +2 -2
  13. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
  14. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
  15. package/src/lib/components/TransactionConfirmationPageLayout/utils.cjs +2 -2
  16. package/src/lib/components/TransactionConfirmationPageLayout/utils.d.ts +1 -1
  17. package/src/lib/components/TransactionConfirmationPageLayout/utils.js +2 -2
  18. package/src/lib/context/CaptchaContext/CaptchaContext.cjs +3 -3
  19. package/src/lib/context/CaptchaContext/CaptchaContext.js +3 -3
  20. package/src/lib/context/MockContext/MockContext.cjs +0 -2
  21. package/src/lib/context/MockContext/MockContext.js +0 -2
  22. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +5 -5
  23. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +5 -5
  24. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +8 -9
  25. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +8 -9
  26. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +8 -3
  27. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +8 -3
  28. package/src/lib/context/ViewContext/ViewContext.cjs +0 -2
  29. package/src/lib/context/ViewContext/ViewContext.d.ts +0 -10
  30. package/src/lib/context/ViewContext/ViewContext.js +0 -2
  31. package/src/lib/context/WalletGroupContext/WalletGroupContext.cjs +3 -3
  32. package/src/lib/context/WalletGroupContext/WalletGroupContext.js +3 -3
  33. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +4 -4
  34. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +4 -4
  35. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +4 -0
  36. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +4 -0
  37. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +3 -3
  38. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.d.ts +1 -1
  39. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +3 -3
  40. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -8
  41. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +8 -8
  42. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +7 -7
  43. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +7 -7
  44. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +2 -2
  45. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +2 -2
  46. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +3 -3
  47. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +3 -3
  48. package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +3 -3
  49. package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +3 -3
  50. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +3 -3
  51. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +3 -3
  52. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +3 -3
  53. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +3 -3
  54. package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs +2 -2
  55. package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js +2 -2
  56. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +4 -4
  57. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +4 -4
  58. package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.cjs +3 -3
  59. package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.js +3 -3
  60. package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +6 -6
  61. package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +6 -6
  62. package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +2 -2
  63. package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +2 -2
  64. package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +11 -11
  65. package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +11 -11
  66. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +5 -7
  67. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +5 -7
  68. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +38 -24
  69. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +3 -2
  70. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +38 -24
  71. package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.cjs +3 -3
  72. package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.js +3 -3
  73. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +5 -5
  74. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +5 -5
  75. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +5 -5
  76. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +5 -5
  77. package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +9 -9
  78. package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +9 -9
  79. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +6 -6
  80. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +6 -6
  81. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +12 -12
  82. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +12 -12
  83. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +7 -7
  84. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +7 -7
  85. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +4 -4
  86. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -4
  87. package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +3 -3
  88. package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +3 -3
  89. package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +2 -2
  90. package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
  91. package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
  92. package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +2 -2
  93. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +2 -2
  94. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +2 -2
  95. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +3 -3
  96. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +3 -3
  97. package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
  98. package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
  99. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -2
  100. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -2
  101. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +4 -4
  102. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +4 -4
  103. package/src/lib/views/LoginView/LoginView.cjs +2 -2
  104. package/src/lib/views/LoginView/LoginView.js +2 -2
  105. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +4 -4
  106. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +4 -4
  107. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -3
  108. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +3 -3
  109. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +5 -5
  110. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +5 -5
  111. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +3 -3
  112. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +3 -3
  113. package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +4 -4
  114. package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +4 -4
  115. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +5 -5
  116. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +5 -5
  117. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +5 -5
  118. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +5 -5
  119. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
  120. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
  121. package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
  122. package/src/lib/views/NoAccess/NoAccess.js +2 -2
  123. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +2 -4
  124. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +2 -4
  125. package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs +2 -2
  126. package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js +2 -2
  127. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +2 -2
  128. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +2 -2
  129. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
  130. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
  131. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -2
  132. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -2
  133. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
  134. package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
  135. package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +3 -3
  136. package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +3 -3
  137. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +1 -4
  138. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -4
  139. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +3 -3
  140. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +3 -3
  141. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +4 -4
  142. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +4 -4
  143. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +2 -2
  144. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +2 -2
  145. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
  146. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
@@ -97,23 +97,23 @@ import '../../components/Popper/PopperContext/PopperContext.js';
97
97
  const MfaChooseDeviceView = ({ isInitialSetup = true, }) => {
98
98
  const { handleLogOut } = useDynamicContext();
99
99
  const { t } = useTranslation();
100
- const { setView } = useViewContext();
100
+ const { pushView } = useViewContext();
101
101
  const mfaOptions = getMfaOptions(isInitialSetup);
102
102
  const handleClick = (option) => {
103
103
  if (option.type === 'backupCode') {
104
- setView('mfa-recovery', undefined, {
104
+ pushView('mfa-recovery', undefined, {
105
105
  onBackClick: () => {
106
- setView('mfa-choose-device', { isInitialSetup: false });
106
+ pushView('mfa-choose-device', { isInitialSetup: false });
107
107
  return 'override';
108
108
  },
109
109
  });
110
110
  return;
111
111
  }
112
112
  if (isInitialSetup) {
113
- setView('mfa-secure-device', { type: option.type });
113
+ pushView('mfa-secure-device', { type: option.type });
114
114
  return;
115
115
  }
116
- setView('mfa-verification', {
116
+ pushView('mfa-verification', {
117
117
  isInitialSetup,
118
118
  showBackButton: true,
119
119
  type: option.type,
@@ -101,24 +101,24 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
101
101
  const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
102
102
  const { t } = reactI18next.useTranslation();
103
103
  const { handleLogOut } = useDynamicContext.useDynamicContext();
104
- const { setView } = ViewContext.useViewContext();
104
+ const { pushView } = ViewContext.useViewContext();
105
105
  const { addDevice } = useMfa.useMfa();
106
106
  const { data, isLoading } = usePromise.usePromise(() => addDevice(type));
107
107
  const onContinue = () => {
108
108
  // back button on mfa verification view should go back to this view
109
109
  const onMfaVerificationBackClick = () => {
110
- setView('mfa-secure-device', { type });
110
+ pushView('mfa-secure-device', { type });
111
111
  return 'override';
112
112
  };
113
- setView('mfa-verification', { deviceId: data === null || data === void 0 ? void 0 : data.id, isInitialSetup, showBackButton: true, type }, {
113
+ pushView('mfa-verification', { deviceId: data === null || data === void 0 ? void 0 : data.id, isInitialSetup, showBackButton: true, type }, {
114
114
  onBackClick: onMfaVerificationBackClick,
115
115
  });
116
116
  };
117
117
  const onHelpClick = ({ secret, uri }) => {
118
118
  const onMfaSecureDeviceHelpBackClick = () => {
119
- setView('mfa-secure-device', { isInitialSetup, type });
119
+ pushView('mfa-secure-device', { isInitialSetup, type });
120
120
  };
121
- setView('mfa-secure-device-help', {
121
+ pushView('mfa-secure-device-help', {
122
122
  secret,
123
123
  uri,
124
124
  }, { onBackClick: onMfaSecureDeviceHelpBackClick });
@@ -97,24 +97,24 @@ import '../../components/Popper/PopperContext/PopperContext.js';
97
97
  const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
98
98
  const { t } = useTranslation();
99
99
  const { handleLogOut } = useDynamicContext();
100
- const { setView } = useViewContext();
100
+ const { pushView } = useViewContext();
101
101
  const { addDevice } = useMfa();
102
102
  const { data, isLoading } = usePromise(() => addDevice(type));
103
103
  const onContinue = () => {
104
104
  // back button on mfa verification view should go back to this view
105
105
  const onMfaVerificationBackClick = () => {
106
- setView('mfa-secure-device', { type });
106
+ pushView('mfa-secure-device', { type });
107
107
  return 'override';
108
108
  };
109
- setView('mfa-verification', { deviceId: data === null || data === void 0 ? void 0 : data.id, isInitialSetup, showBackButton: true, type }, {
109
+ pushView('mfa-verification', { deviceId: data === null || data === void 0 ? void 0 : data.id, isInitialSetup, showBackButton: true, type }, {
110
110
  onBackClick: onMfaVerificationBackClick,
111
111
  });
112
112
  };
113
113
  const onHelpClick = ({ secret, uri }) => {
114
114
  const onMfaSecureDeviceHelpBackClick = () => {
115
- setView('mfa-secure-device', { isInitialSetup, type });
115
+ pushView('mfa-secure-device', { isInitialSetup, type });
116
116
  };
117
- setView('mfa-secure-device-help', {
117
+ pushView('mfa-secure-device-help', {
118
118
  secret,
119
119
  uri,
120
120
  }, { onBackClick: onMfaSecureDeviceHelpBackClick });
@@ -97,7 +97,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
97
97
 
98
98
  const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, deviceId, }) => {
99
99
  const { t } = reactI18next.useTranslation();
100
- const { setView } = ViewContext.useViewContext();
100
+ const { pushView } = ViewContext.useViewContext();
101
101
  const { authDevice } = useMfa.useMfa();
102
102
  const [code, setCode] = React.useState('');
103
103
  const [error, setError] = React.useState();
@@ -119,7 +119,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
119
119
  const user$1 = user.getUser();
120
120
  if ((user$1 === null || user$1 === void 0 ? void 0 : user$1.mfaBackupCodeAcknowledgement) !==
121
121
  sdkApiCore.MfaBackupCodeAcknowledgement.Complete) {
122
- setView('mfa-display-backup-codes');
122
+ pushView('mfa-display-backup-codes');
123
123
  }
124
124
  }),
125
125
  });
@@ -132,12 +132,12 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
132
132
  };
133
133
  const onClickBack = () => {
134
134
  if (!isInitialSetup) {
135
- setView('mfa-choose-device', { isInitialSetup });
135
+ pushView('mfa-choose-device', { isInitialSetup });
136
136
  return;
137
137
  }
138
- setView('mfa-secure-device', { isInitialSetup, type });
138
+ pushView('mfa-secure-device', { isInitialSetup, type });
139
139
  };
140
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: passwordHero.ReactComponent, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(isValid), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: showBackButton ? onClickBack : undefined, disabled: isRateLimited }), !isInitialSetup && (jsxRuntime.jsx("div", { className: 'mfa-verification-view__choose-another-method', children: jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => setView('mfa-choose-device', { isInitialSetup }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) }))] }));
140
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: passwordHero.ReactComponent, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(isValid), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: showBackButton ? onClickBack : undefined, disabled: isRateLimited }), !isInitialSetup && (jsxRuntime.jsx("div", { className: 'mfa-verification-view__choose-another-method', children: jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', { isInitialSetup }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) }))] }));
141
141
  };
142
142
 
143
143
  exports.MfaVerificationView = MfaVerificationView;
@@ -93,7 +93,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
93
93
 
94
94
  const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, deviceId, }) => {
95
95
  const { t } = useTranslation();
96
- const { setView } = useViewContext();
96
+ const { pushView } = useViewContext();
97
97
  const { authDevice } = useMfa();
98
98
  const [code, setCode] = useState('');
99
99
  const [error, setError] = useState();
@@ -115,7 +115,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
115
115
  const user = getUser();
116
116
  if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
117
117
  MfaBackupCodeAcknowledgement.Complete) {
118
- setView('mfa-display-backup-codes');
118
+ pushView('mfa-display-backup-codes');
119
119
  }
120
120
  }),
121
121
  });
@@ -128,12 +128,12 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
128
128
  };
129
129
  const onClickBack = () => {
130
130
  if (!isInitialSetup) {
131
- setView('mfa-choose-device', { isInitialSetup });
131
+ pushView('mfa-choose-device', { isInitialSetup });
132
132
  return;
133
133
  }
134
- setView('mfa-secure-device', { isInitialSetup, type });
134
+ pushView('mfa-secure-device', { isInitialSetup, type });
135
135
  };
136
- return (jsxs(Fragment, { children: [jsx(OTPVerificationView, { MainIcon: SvgPasswordHero, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(isValid), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: showBackButton ? onClickBack : undefined, disabled: isRateLimited }), !isInitialSetup && (jsx("div", { className: 'mfa-verification-view__choose-another-method', children: jsx(TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => setView('mfa-choose-device', { isInitialSetup }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) }))] }));
136
+ return (jsxs(Fragment, { children: [jsx(OTPVerificationView, { MainIcon: SvgPasswordHero, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(isValid), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: showBackButton ? onClickBack : undefined, disabled: isRateLimited }), !isInitialSetup && (jsx("div", { className: 'mfa-verification-view__choose-another-method', children: jsx(TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', { isInitialSetup }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) }))] }));
137
137
  };
138
138
 
139
139
  export { MfaVerificationView };
@@ -110,10 +110,10 @@ const NoAccess = () => {
110
110
  : undefined;
111
111
  const { selectedWalletConnector: walletConnector, socialMediaIconUrl, notInTheListImageUrl, accessDeniedButton, } = useInternalDynamicContext.useInternalDynamicContext();
112
112
  const { displayedDestination: email } = VerificationContext.useVerification();
113
- const { goToInitialView } = ViewContext.useViewContext();
113
+ const { clearStackAndPushInitialView } = ViewContext.useViewContext();
114
114
  const { _socialMediaLinkText, _socialMediaUrl, isAccessListView, isGateBlockedView, subtitle, title, buttonTitle: _buttonTitle, } = useNoAccessText.useNoAccessText();
115
115
  const handleChangeWallet = () => {
116
- goToInitialView();
116
+ clearStackAndPushInitialView();
117
117
  setDeniedAddress('');
118
118
  setDeniedOauthProvider(undefined);
119
119
  walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.endSession();
@@ -106,10 +106,10 @@ const NoAccess = () => {
106
106
  : undefined;
107
107
  const { selectedWalletConnector: walletConnector, socialMediaIconUrl, notInTheListImageUrl, accessDeniedButton, } = useInternalDynamicContext();
108
108
  const { displayedDestination: email } = useVerification();
109
- const { goToInitialView } = useViewContext();
109
+ const { clearStackAndPushInitialView } = useViewContext();
110
110
  const { _socialMediaLinkText, _socialMediaUrl, isAccessListView, isGateBlockedView, subtitle, title, buttonTitle: _buttonTitle, } = useNoAccessText();
111
111
  const handleChangeWallet = () => {
112
- goToInitialView();
112
+ clearStackAndPushInitialView();
113
113
  setDeniedAddress('');
114
114
  setDeniedOauthProvider(undefined);
115
115
  walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.endSession();
@@ -115,7 +115,7 @@ const PasskeyBundleRecovery = ({ authenticatorType, currentAction, }) => {
115
115
  const [resendingCode, setResendingCode] = React.useState(false);
116
116
  const [isValid, setIsValid] = React.useState(false);
117
117
  const { t } = reactI18next.useTranslation();
118
- const { setView } = ViewContext.useViewContext();
118
+ const { pushView } = ViewContext.useViewContext();
119
119
  const { mutate, isLoading, error: error$1 } = useMutation.useMutation((bundleInput) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
120
120
  var _a;
121
121
  const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
@@ -136,9 +136,7 @@ const PasskeyBundleRecovery = ({ authenticatorType, currentAction, }) => {
136
136
  : setShowAuthFlow(false);
137
137
  };
138
138
  if (authenticatorType === 'passkey') {
139
- return setView('passkey-recovery-complete', {
140
- goBack: () => goBack(),
141
- });
139
+ return pushView('passkey-recovery-complete', { goBack });
142
140
  }
143
141
  if ((currentAction === null || currentAction === void 0 ? void 0 : currentAction.type) === 'reveal') {
144
142
  return;
@@ -111,7 +111,7 @@ const PasskeyBundleRecovery = ({ authenticatorType, currentAction, }) => {
111
111
  const [resendingCode, setResendingCode] = useState(false);
112
112
  const [isValid, setIsValid] = useState(false);
113
113
  const { t } = useTranslation();
114
- const { setView } = useViewContext();
114
+ const { pushView } = useViewContext();
115
115
  const { mutate, isLoading, error } = useMutation((bundleInput) => __awaiter(void 0, void 0, void 0, function* () {
116
116
  var _a;
117
117
  const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
@@ -132,9 +132,7 @@ const PasskeyBundleRecovery = ({ authenticatorType, currentAction, }) => {
132
132
  : setShowAuthFlow(false);
133
133
  };
134
134
  if (authenticatorType === 'passkey') {
135
- return setView('passkey-recovery-complete', {
136
- goBack: () => goBack(),
137
- });
135
+ return pushView('passkey-recovery-complete', { goBack });
138
136
  }
139
137
  if ((currentAction === null || currentAction === void 0 ? void 0 : currentAction.type) === 'reveal') {
140
138
  return;
@@ -94,9 +94,9 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
94
94
 
95
95
  const SandboxMaximumThresholdReached = () => {
96
96
  const { t } = reactI18next.useTranslation();
97
- const { goToInitialView } = ViewContext.useViewContext();
97
+ const { clearStackAndPushInitialView } = ViewContext.useViewContext();
98
98
  const handleGoBack = () => {
99
- goToInitialView();
99
+ clearStackAndPushInitialView();
100
100
  };
101
101
  return (jsxRuntime.jsxs("div", { className: 'sandbox-threshold__main', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sandbox-threshold__title', children: t('dyn_sandbox_maximum_threshold.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'sandbox-threshold__description', children: t('dyn_sandbox_maximum_threshold.description') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleGoBack, className: 'sandbox-threshold__button', expanded: true, buttonPadding: 'large', children: t('dyn_sandbox_maximum_threshold.button') })] }));
102
102
  };
@@ -90,9 +90,9 @@ import '../../components/Popper/PopperContext/PopperContext.js';
90
90
 
91
91
  const SandboxMaximumThresholdReached = () => {
92
92
  const { t } = useTranslation();
93
- const { goToInitialView } = useViewContext();
93
+ const { clearStackAndPushInitialView } = useViewContext();
94
94
  const handleGoBack = () => {
95
- goToInitialView();
95
+ clearStackAndPushInitialView();
96
96
  };
97
97
  return (jsxs("div", { className: 'sandbox-threshold__main', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sandbox-threshold__title', children: t('dyn_sandbox_maximum_threshold.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'sandbox-threshold__description', children: t('dyn_sandbox_maximum_threshold.description') }), jsx(TypographyButton, { onClick: handleGoBack, className: 'sandbox-threshold__button', expanded: true, buttonPadding: 'large', children: t('dyn_sandbox_maximum_threshold.button') })] }));
98
98
  };
@@ -96,7 +96,7 @@ require('../../components/Popper/Popper/Popper.cjs');
96
96
  require('../../components/Popper/PopperContext/PopperContext.cjs');
97
97
 
98
98
  const WalletCannotBeTransferredView = () => {
99
- const { goToInitialView } = ViewContext.useViewContext();
99
+ const { clearStackAndPushInitialView } = ViewContext.useViewContext();
100
100
  const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
101
101
  const { t } = reactI18next.useTranslation();
102
102
  const { data: walletAddress } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
@@ -105,7 +105,7 @@ const WalletCannotBeTransferredView = () => {
105
105
  }), {
106
106
  deps: [walletConnector],
107
107
  });
108
- return (jsxRuntime.jsxs("div", { className: 'wallet-cannot-be-transferred-view__container', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium', copykey: 'dyn_wallet_link.cannot_link.title', children: t('dyn_wallet_link.cannot_link.title') }), jsxRuntime.jsx("div", { className: 'wallet-cannot-be-transferred-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary', children: walletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.cannot_link.description', children: t('dyn_wallet_link.cannot_link.description') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-cannot-be-transferred-view__transfer-alt-wallet-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: goToInitialView, dataTestId: 'wallet-cannot-be-transferred-view-transfer-alt-wallet', copykey: 'dyn_wallet_link.cannot_link.link_other_button', children: t('dyn_wallet_link.cannot_link.link_other_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-cannot-be-transferred-view-cancel', buttonPadding: 'small', buttonClassName: 'wallet-cannot-be-transferred-view__cancel', onClick: goToInitialView, copykey: 'dyn_wallet_link.cannot_link.cancel_button', children: t('dyn_wallet_link.cannot_link.cancel_button') })] }));
108
+ return (jsxRuntime.jsxs("div", { className: 'wallet-cannot-be-transferred-view__container', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium', copykey: 'dyn_wallet_link.cannot_link.title', children: t('dyn_wallet_link.cannot_link.title') }), jsxRuntime.jsx("div", { className: 'wallet-cannot-be-transferred-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary', children: walletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-cannot-be-transferred-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.cannot_link.description', children: t('dyn_wallet_link.cannot_link.description') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-cannot-be-transferred-view__transfer-alt-wallet-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: clearStackAndPushInitialView, dataTestId: 'wallet-cannot-be-transferred-view-transfer-alt-wallet', copykey: 'dyn_wallet_link.cannot_link.link_other_button', children: t('dyn_wallet_link.cannot_link.link_other_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-cannot-be-transferred-view-cancel', buttonPadding: 'small', buttonClassName: 'wallet-cannot-be-transferred-view__cancel', onClick: clearStackAndPushInitialView, copykey: 'dyn_wallet_link.cannot_link.cancel_button', children: t('dyn_wallet_link.cannot_link.cancel_button') })] }));
109
109
  };
110
110
 
111
111
  exports.WalletCannotBeTransferredView = WalletCannotBeTransferredView;
@@ -92,7 +92,7 @@ import '../../components/Popper/Popper/Popper.js';
92
92
  import '../../components/Popper/PopperContext/PopperContext.js';
93
93
 
94
94
  const WalletCannotBeTransferredView = () => {
95
- const { goToInitialView } = useViewContext();
95
+ const { clearStackAndPushInitialView } = useViewContext();
96
96
  const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
97
97
  const { t } = useTranslation();
98
98
  const { data: walletAddress } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
@@ -101,7 +101,7 @@ const WalletCannotBeTransferredView = () => {
101
101
  }), {
102
102
  deps: [walletConnector],
103
103
  });
104
- return (jsxs("div", { className: 'wallet-cannot-be-transferred-view__container', children: [jsx(Typography, { className: 'wallet-cannot-be-transferred-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium', copykey: 'dyn_wallet_link.cannot_link.title', children: t('dyn_wallet_link.cannot_link.title') }), jsx("div", { className: 'wallet-cannot-be-transferred-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-cannot-be-transferred-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary', children: walletAddress }), jsx(Typography, { className: 'wallet-cannot-be-transferred-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.cannot_link.description', children: t('dyn_wallet_link.cannot_link.description') }), jsx(TypographyButton, { buttonClassName: 'wallet-cannot-be-transferred-view__transfer-alt-wallet-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: goToInitialView, dataTestId: 'wallet-cannot-be-transferred-view-transfer-alt-wallet', copykey: 'dyn_wallet_link.cannot_link.link_other_button', children: t('dyn_wallet_link.cannot_link.link_other_button') }), jsx(TypographyButton, { dataTestId: 'wallet-cannot-be-transferred-view-cancel', buttonPadding: 'small', buttonClassName: 'wallet-cannot-be-transferred-view__cancel', onClick: goToInitialView, copykey: 'dyn_wallet_link.cannot_link.cancel_button', children: t('dyn_wallet_link.cannot_link.cancel_button') })] }));
104
+ return (jsxs("div", { className: 'wallet-cannot-be-transferred-view__container', children: [jsx(Typography, { className: 'wallet-cannot-be-transferred-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium', copykey: 'dyn_wallet_link.cannot_link.title', children: t('dyn_wallet_link.cannot_link.title') }), jsx("div", { className: 'wallet-cannot-be-transferred-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-cannot-be-transferred-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary', children: walletAddress }), jsx(Typography, { className: 'wallet-cannot-be-transferred-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.cannot_link.description', children: t('dyn_wallet_link.cannot_link.description') }), jsx(TypographyButton, { buttonClassName: 'wallet-cannot-be-transferred-view__transfer-alt-wallet-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: clearStackAndPushInitialView, dataTestId: 'wallet-cannot-be-transferred-view-transfer-alt-wallet', copykey: 'dyn_wallet_link.cannot_link.link_other_button', children: t('dyn_wallet_link.cannot_link.link_other_button') }), jsx(TypographyButton, { dataTestId: 'wallet-cannot-be-transferred-view-cancel', buttonPadding: 'small', buttonClassName: 'wallet-cannot-be-transferred-view__cancel', onClick: clearStackAndPushInitialView, copykey: 'dyn_wallet_link.cannot_link.cancel_button', children: t('dyn_wallet_link.cannot_link.cancel_button') })] }));
105
105
  };
106
106
 
107
107
  export { WalletCannotBeTransferredView };
@@ -103,7 +103,7 @@ const DefaultTile = ({ leading, name, onClick, trailing, }) => (jsxRuntime.jsx(L
103
103
  const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommendedWallets, tile = DefaultTile, onSelectWallet, }) => {
104
104
  var _a, _b, _c, _d, _e;
105
105
  const { navigateToWalletGroup } = WalletGroupContext.useWalletGroupContext();
106
- const { setView } = ViewContext.useViewContext();
106
+ const { pushView } = ViewContext.useViewContext();
107
107
  const _isWalletGroup = isWalletGroup.isWalletGroup(wallet);
108
108
  const walletGroups = walletOptions.useWalletGroups();
109
109
  const labelSettings = getWalletListItemLabel.getWalletListItemLabel({
@@ -121,7 +121,7 @@ const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommen
121
121
  }
122
122
  if (walletConnectorCore.isHardwareWalletConnector(wallet.walletConnector) &&
123
123
  wallet.walletConnector.canConnectWithHardwareWallet()) {
124
- setView('select-hardware-wallet', { onSelectWallet, wallet });
124
+ pushView('select-hardware-wallet', { onSelectWallet, wallet });
125
125
  return;
126
126
  }
127
127
  onSelectWallet(wallet);
@@ -99,7 +99,7 @@ const DefaultTile = ({ leading, name, onClick, trailing, }) => (jsx(ListTile, {
99
99
  const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommendedWallets, tile = DefaultTile, onSelectWallet, }) => {
100
100
  var _a, _b, _c, _d, _e;
101
101
  const { navigateToWalletGroup } = useWalletGroupContext();
102
- const { setView } = useViewContext();
102
+ const { pushView } = useViewContext();
103
103
  const _isWalletGroup = isWalletGroup(wallet);
104
104
  const walletGroups = useWalletGroups();
105
105
  const labelSettings = getWalletListItemLabel({
@@ -117,7 +117,7 @@ const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommen
117
117
  }
118
118
  if (isHardwareWalletConnector(wallet.walletConnector) &&
119
119
  wallet.walletConnector.canConnectWithHardwareWallet()) {
120
- setView('select-hardware-wallet', { onSelectWallet, wallet });
120
+ pushView('select-hardware-wallet', { onSelectWallet, wallet });
121
121
  return;
122
122
  }
123
123
  onSelectWallet(wallet);
@@ -97,7 +97,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
97
97
  var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
98
98
 
99
99
  const WalletSignSpinnerView = () => {
100
- const { goToInitialView } = ViewContext.useViewContext();
100
+ const { clearStackAndPushInitialView } = ViewContext.useViewContext();
101
101
  const { t } = reactI18next.useTranslation();
102
102
  const { setMultiWalletWidgetState, setSelectedWalletConnectorKey, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
103
103
  if (!walletConnector) {
@@ -106,7 +106,7 @@ const WalletSignSpinnerView = () => {
106
106
  const { key, metadata } = walletConnector;
107
107
  const iconSize = 96;
108
108
  const handleClose = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
109
- goToInitialView();
109
+ clearStackAndPushInitialView();
110
110
  setMultiWalletWidgetState('idle');
111
111
  setSelectedWalletConnectorKey(null);
112
112
  yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.endSession());
@@ -93,7 +93,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
93
93
  import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
94
94
 
95
95
  const WalletSignSpinnerView = () => {
96
- const { goToInitialView } = useViewContext();
96
+ const { clearStackAndPushInitialView } = useViewContext();
97
97
  const { t } = useTranslation();
98
98
  const { setMultiWalletWidgetState, setSelectedWalletConnectorKey, selectedWalletConnector: walletConnector, } = useInternalDynamicContext();
99
99
  if (!walletConnector) {
@@ -102,7 +102,7 @@ const WalletSignSpinnerView = () => {
102
102
  const { key, metadata } = walletConnector;
103
103
  const iconSize = 96;
104
104
  const handleClose = () => __awaiter(void 0, void 0, void 0, function* () {
105
- goToInitialView();
105
+ clearStackAndPushInitialView();
106
106
  setMultiWalletWidgetState('idle');
107
107
  setSelectedWalletConnectorKey(null);
108
108
  yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.endSession());
@@ -103,7 +103,7 @@ const WalletUsedView = () => {
103
103
  const [isChecked, setIsChecked] = React.useState(false);
104
104
  const { t } = reactI18next.useTranslation();
105
105
  const { loading, setLoading } = LoadingContext.useLoadingContext();
106
- const { setView } = ViewContext.useViewContext();
106
+ const { pushView } = ViewContext.useViewContext();
107
107
  const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOut, } = useInternalDynamicContext.useInternalDynamicContext();
108
108
  const { data: walletAddress } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
109
109
  const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
@@ -118,7 +118,7 @@ const WalletUsedView = () => {
118
118
  return;
119
119
  setMultiWalletWidgetState('awaiting_signature', undefined, 'transferring_wallet');
120
120
  setLoading(true);
121
- setView('wallet-sign');
121
+ pushView('wallet-sign');
122
122
  const siweStatementToUse = getSiweStatement.getSiweStatement({ appName, siweStatement });
123
123
  // TODO refactor this block
124
124
  try {
@@ -99,7 +99,7 @@ const WalletUsedView = () => {
99
99
  const [isChecked, setIsChecked] = useState(false);
100
100
  const { t } = useTranslation();
101
101
  const { loading, setLoading } = useLoadingContext();
102
- const { setView } = useViewContext();
102
+ const { pushView } = useViewContext();
103
103
  const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOut, } = useInternalDynamicContext();
104
104
  const { data: walletAddress } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
105
105
  const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
@@ -114,7 +114,7 @@ const WalletUsedView = () => {
114
114
  return;
115
115
  setMultiWalletWidgetState('awaiting_signature', undefined, 'transferring_wallet');
116
116
  setLoading(true);
117
- setView('wallet-sign');
117
+ pushView('wallet-sign');
118
118
  const siweStatementToUse = getSiweStatement({ appName, siweStatement });
119
119
  // TODO refactor this block
120
120
  try {
@@ -95,7 +95,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
95
95
  var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
96
96
 
97
97
  const EditProfileView = () => {
98
- const { setView } = ViewContext.useViewContext();
98
+ const { pushView } = ViewContext.useViewContext();
99
99
  const { goToProfileView } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
100
100
  const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
101
101
  const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
@@ -109,9 +109,9 @@ const EditProfileView = () => {
109
109
  ignoreIfIsEmbeddedWidget: false,
110
110
  performMultiWalletChecks: false,
111
111
  });
112
- setView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
112
+ pushView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
113
113
  }
114
- }), [goToProfileView, setShowAuthFlow, setView, updateUser]);
114
+ }), [goToProfileView, setShowAuthFlow, pushView, updateUser]);
115
115
  return (jsxRuntime.jsx(UserProfileForm.UserProfileForm, { onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView }));
116
116
  };
117
117
 
@@ -91,7 +91,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
91
91
  import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
92
92
 
93
93
  const EditProfileView = () => {
94
- const { setView } = useViewContext();
94
+ const { pushView } = useViewContext();
95
95
  const { goToProfileView } = useDynamicBridgeWidgetContext();
96
96
  const { setShowAuthFlow } = useInternalDynamicContext();
97
97
  const { updateUser } = useUserUpdateRequestInternal({
@@ -105,9 +105,9 @@ const EditProfileView = () => {
105
105
  ignoreIfIsEmbeddedWidget: false,
106
106
  performMultiWalletChecks: false,
107
107
  });
108
- setView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
108
+ pushView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
109
109
  }
110
- }), [goToProfileView, setShowAuthFlow, setView, updateUser]);
110
+ }), [goToProfileView, setShowAuthFlow, pushView, updateUser]);
111
111
  return (jsx(UserProfileForm, { onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView }));
112
112
  };
113
113
 
@@ -9,17 +9,14 @@ var Icon = require('../../../../components/Icon/Icon.cjs');
9
9
  var IconButton = require('../../../../components/IconButton/IconButton.cjs');
10
10
  var Dropdown = require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
11
11
  var DotsMenuDropdown = require('../DotsMenuDropdown/DotsMenuDropdown.cjs');
12
- var index = require('../../../../shared/utils/hooks/useOnClickOutside/index.cjs');
13
12
  var threeDots = require('../../../../shared/assets/three-dots.cjs');
14
13
  require('@dynamic-labs/iconic');
15
14
  require('../../../../context/ViewContext/ViewContext.cjs');
16
15
 
17
16
  const DotsMenu = ({ options, buttonClassName, buttonClassNameWithOpenMenu, direction = 'right', iconOverride, }) => {
18
17
  const dotsMenuRef = React.useRef(null);
19
- const popperContentRef = React.useRef(null);
20
18
  const [showMenu, setShowMenu] = React.useState(false);
21
- index.useOnClickOutside(popperContentRef, () => setShowMenu(false));
22
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(IconButton.IconButton, { ref: dotsMenuRef, onClick: () => setShowMenu(true), "data-testid": 'dotsMenu', className: showMenu ? buttonClassNameWithOpenMenu : buttonClassName, children: iconOverride ? (iconOverride) : (jsxRuntime.jsx(Icon.Icon, { children: jsxRuntime.jsx(threeDots.ReactComponent, {}) })) }), jsxRuntime.jsx(Dropdown.Dropdown, { isOpen: showMenu, onClickOutside: () => setShowMenu(false), onScroll: () => setShowMenu(false), anchorRef: dotsMenuRef, ref: popperContentRef, anchorOrigin: direction === 'right' ? 'bottom-left' : 'top-right', transformOrigin: direction === 'right' ? 'top-left' : 'bottom-right', children: jsxRuntime.jsx(DotsMenuDropdown.DotsMenuDropdown, { options: options, setShowMenu: setShowMenu }) })] }));
19
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(IconButton.IconButton, { ref: dotsMenuRef, onClick: () => setShowMenu(true), "data-testid": 'dotsMenu', className: showMenu ? buttonClassNameWithOpenMenu : buttonClassName, children: iconOverride ? (iconOverride) : (jsxRuntime.jsx(Icon.Icon, { children: jsxRuntime.jsx(threeDots.ReactComponent, {}) })) }), jsxRuntime.jsx(Dropdown.Dropdown, { isOpen: showMenu, onClickOutside: () => setShowMenu(false), onScroll: () => setShowMenu(false), anchorRef: dotsMenuRef, anchorOrigin: direction === 'right' ? 'bottom-left' : 'top-right', transformOrigin: direction === 'right' ? 'top-left' : 'bottom-right', children: jsxRuntime.jsx(DotsMenuDropdown.DotsMenuDropdown, { options: options, setShowMenu: setShowMenu }) })] }));
23
20
  };
24
21
 
25
22
  exports.DotsMenu = DotsMenu;
@@ -5,17 +5,14 @@ import { Icon } from '../../../../components/Icon/Icon.js';
5
5
  import { IconButton } from '../../../../components/IconButton/IconButton.js';
6
6
  import { Dropdown } from '../../../../components/MenuList/Dropdown/Dropdown.js';
7
7
  import { DotsMenuDropdown } from '../DotsMenuDropdown/DotsMenuDropdown.js';
8
- import { useOnClickOutside } from '../../../../shared/utils/hooks/useOnClickOutside/index.js';
9
8
  import { ReactComponent as SvgThreeDots } from '../../../../shared/assets/three-dots.js';
10
9
  import '@dynamic-labs/iconic';
11
10
  import '../../../../context/ViewContext/ViewContext.js';
12
11
 
13
12
  const DotsMenu = ({ options, buttonClassName, buttonClassNameWithOpenMenu, direction = 'right', iconOverride, }) => {
14
13
  const dotsMenuRef = useRef(null);
15
- const popperContentRef = useRef(null);
16
14
  const [showMenu, setShowMenu] = useState(false);
17
- useOnClickOutside(popperContentRef, () => setShowMenu(false));
18
- return (jsxs(Fragment, { children: [jsx(IconButton, { ref: dotsMenuRef, onClick: () => setShowMenu(true), "data-testid": 'dotsMenu', className: showMenu ? buttonClassNameWithOpenMenu : buttonClassName, children: iconOverride ? (iconOverride) : (jsx(Icon, { children: jsx(SvgThreeDots, {}) })) }), jsx(Dropdown, { isOpen: showMenu, onClickOutside: () => setShowMenu(false), onScroll: () => setShowMenu(false), anchorRef: dotsMenuRef, ref: popperContentRef, anchorOrigin: direction === 'right' ? 'bottom-left' : 'top-right', transformOrigin: direction === 'right' ? 'top-left' : 'bottom-right', children: jsx(DotsMenuDropdown, { options: options, setShowMenu: setShowMenu }) })] }));
15
+ return (jsxs(Fragment, { children: [jsx(IconButton, { ref: dotsMenuRef, onClick: () => setShowMenu(true), "data-testid": 'dotsMenu', className: showMenu ? buttonClassNameWithOpenMenu : buttonClassName, children: iconOverride ? (iconOverride) : (jsx(Icon, { children: jsx(SvgThreeDots, {}) })) }), jsx(Dropdown, { isOpen: showMenu, onClickOutside: () => setShowMenu(false), onScroll: () => setShowMenu(false), anchorRef: dotsMenuRef, anchorOrigin: direction === 'right' ? 'bottom-left' : 'top-right', transformOrigin: direction === 'right' ? 'top-left' : 'bottom-right', children: jsx(DotsMenuDropdown, { options: options, setShowMenu: setShowMenu }) })] }));
19
16
  };
20
17
 
21
18
  export { DotsMenu };
@@ -96,7 +96,7 @@ require('../../../../components/Popper/Popper/Popper.cjs');
96
96
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
97
97
 
98
98
  const EditProfileView = ({ rootClassName, }) => {
99
- const { setView } = ViewContext.useViewContext();
99
+ const { pushView } = ViewContext.useViewContext();
100
100
  const { setShowAuthFlow, multiWallet, user } = useInternalDynamicContext.useInternalDynamicContext();
101
101
  const { goToProfileView } = DynamicWidgetContext.useWidgetContext();
102
102
  const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
@@ -111,9 +111,9 @@ const EditProfileView = ({ rootClassName, }) => {
111
111
  initializeWalletConnect: false,
112
112
  performMultiWalletChecks: false,
113
113
  });
114
- setView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
114
+ pushView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
115
115
  }
116
- }), [goToProfileView, setShowAuthFlow, setView, updateUser]);
116
+ }), [goToProfileView, setShowAuthFlow, pushView, updateUser]);
117
117
  const isKYCEnabled = useKYCFlag.useKYCFlag();
118
118
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!multiWallet && isKYCEnabled && (jsxRuntime.jsx(Typography.Typography, { weight: 'regular', color: 'secondary', variant: 'body_normal', className: 'dynamic-widget-edit-profile-view__profile-title', children: "My information" })), jsxRuntime.jsx(UserProfileForm.UserProfileForm, { formClassName: rootClassName, onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView })] }));
119
119
  };
@@ -92,7 +92,7 @@ import '../../../../components/Popper/Popper/Popper.js';
92
92
  import '../../../../components/Popper/PopperContext/PopperContext.js';
93
93
 
94
94
  const EditProfileView = ({ rootClassName, }) => {
95
- const { setView } = useViewContext();
95
+ const { pushView } = useViewContext();
96
96
  const { setShowAuthFlow, multiWallet, user } = useInternalDynamicContext();
97
97
  const { goToProfileView } = useWidgetContext();
98
98
  const { updateUser } = useUserUpdateRequestInternal({
@@ -107,9 +107,9 @@ const EditProfileView = ({ rootClassName, }) => {
107
107
  initializeWalletConnect: false,
108
108
  performMultiWalletChecks: false,
109
109
  });
110
- setView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
110
+ pushView(isEmailVerificationRequired ? 'verify-email' : 'verify-sms');
111
111
  }
112
- }), [goToProfileView, setShowAuthFlow, setView, updateUser]);
112
+ }), [goToProfileView, setShowAuthFlow, pushView, updateUser]);
113
113
  const isKYCEnabled = useKYCFlag();
114
114
  return (jsxs(Fragment, { children: [!multiWallet && isKYCEnabled && (jsx(Typography, { weight: 'regular', color: 'secondary', variant: 'body_normal', className: 'dynamic-widget-edit-profile-view__profile-title', children: "My information" })), jsx(UserProfileForm, { formClassName: rootClassName, onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView })] }));
115
115
  };
@@ -103,7 +103,7 @@ const GlobalWalletView = () => {
103
103
  var _a;
104
104
  const { t } = reactI18next.useTranslation();
105
105
  const { setDynamicWidgetView, goToInitialDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
106
- const { setView } = ViewContext.useViewContext();
106
+ const { pushView } = ViewContext.useViewContext();
107
107
  const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
108
108
  const { primaryWallet } = useDynamicContext.useDynamicContext();
109
109
  const [walletConnectUri, setWalletConnectUri] = React.useState('');
@@ -125,7 +125,7 @@ const GlobalWalletView = () => {
125
125
  // eslint-disable-next-line react-hooks/exhaustive-deps
126
126
  []);
127
127
  const handleConfirmView = (pairingInfo) => {
128
- setView('global-wallet-confirm', {
128
+ pushView('global-wallet-confirm', {
129
129
  onCancel: () => {
130
130
  setDynamicWidgetView('global-wallet');
131
131
  setShowAuthFlow(false, {
@@ -166,7 +166,7 @@ const GlobalWalletView = () => {
166
166
  const pairingInfo = { icons, name, url };
167
167
  const isDefinitelyMalicious = yield blockaid.isMaliciousUrl({ environmentId, url });
168
168
  if (isDefinitelyMalicious || isDefinitelyMalicious === undefined) {
169
- setView('global-wallet-malicious', {
169
+ pushView('global-wallet-malicious', {
170
170
  maliciousSiteInfo: {
171
171
  isDefinitelyMalicious: isDefinitelyMalicious !== null && isDefinitelyMalicious !== void 0 ? isDefinitelyMalicious : false,
172
172
  proceedFlow: () => handleConfirmView(pairingInfo),
@@ -222,7 +222,7 @@ const GlobalWalletView = () => {
222
222
  // eslint-disable-next-line react-hooks/exhaustive-deps
223
223
  }, [walletConnectUri]);
224
224
  const renderHeader = () => (jsxRuntime.jsxs("div", { className: 'header', children: [jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: goToInitialDynamicWidgetView, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'title', weight: 'medium', color: 'primary', as: 'h1', copykey: 'global_wallet.connect_to_apps', children: t('global_wallet.connect_to_apps') }), utils.isMobile() && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => {
225
- setView('global-wallet-info');
225
+ pushView('global-wallet-info');
226
226
  setShowAuthFlow(true, {
227
227
  ignoreIfIsEmbeddedWidget: false,
228
228
  performMultiWalletChecks: false,