@dynamic-labs/sdk-react-core 2.0.0-alpha.6 → 2.0.0-alpha.8

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 (166) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.cjs +4 -4
  3. package/package.js +4 -4
  4. package/package.json +16 -16
  5. package/src/index.cjs +3 -7
  6. package/src/index.d.ts +1 -2
  7. package/src/index.js +2 -2
  8. package/src/lib/components/Alert/Alert.cjs +1 -0
  9. package/src/lib/components/Alert/Alert.js +1 -0
  10. package/src/lib/components/Alert/Alert.types.d.ts +1 -1
  11. package/src/lib/components/ErrorContainer/ErrorContainer.cjs +1 -1
  12. package/src/lib/components/ErrorContainer/ErrorContainer.js +1 -1
  13. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +4 -2
  14. package/src/lib/components/NetworkPicker/NetworkPicker.js +4 -2
  15. package/src/lib/components/ShadowDOM/ShadowDOM.cjs +2 -0
  16. package/src/lib/components/ShadowDOM/ShadowDOM.js +2 -1
  17. package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.cjs +26 -10
  18. package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.js +27 -11
  19. package/src/lib/components/index.d.ts +1 -0
  20. package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -17
  21. package/src/lib/context/DynamicContext/DynamicContext.d.ts +3 -4
  22. package/src/lib/context/DynamicContext/DynamicContext.js +17 -18
  23. package/src/lib/context/DynamicContext/helpers/helpers.cjs +10 -0
  24. package/src/lib/context/DynamicContext/helpers/helpers.d.ts +5 -0
  25. package/src/lib/context/DynamicContext/helpers/helpers.js +10 -1
  26. package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +0 -1
  27. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -1
  28. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -1
  29. package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.cjs +1 -0
  30. package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.d.ts +8 -7
  31. package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.js +1 -0
  32. package/src/lib/context/DynamicContext/types/index.d.ts +14 -2
  33. package/src/lib/context/ErrorContext/ErrorContext.cjs +4 -0
  34. package/src/lib/context/ErrorContext/ErrorContext.d.ts +1 -0
  35. package/src/lib/context/ErrorContext/ErrorContext.js +4 -0
  36. package/src/lib/context/FundingContext/FundingContext.cjs +3 -1
  37. package/src/lib/context/FundingContext/FundingContext.js +3 -1
  38. package/src/lib/context/PasskeyContext/PasskeyContext.cjs +1 -0
  39. package/src/lib/context/PasskeyContext/PasskeyContext.js +1 -0
  40. package/src/lib/context/ViewContext/ViewContext.cjs +7 -0
  41. package/src/lib/context/ViewContext/ViewContext.js +7 -0
  42. package/src/lib/context/ViewContext/types/index.d.ts +5 -3
  43. package/src/lib/locale/en/translation.cjs +30 -16
  44. package/src/lib/locale/en/translation.d.ts +22 -8
  45. package/src/lib/locale/en/translation.js +30 -16
  46. package/src/lib/shared/types/localStorage.d.ts +1 -1
  47. package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +10 -28
  48. package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.d.ts +1 -5
  49. package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js +10 -28
  50. package/src/lib/styles/index.shadow.cjs +1 -1
  51. package/src/lib/styles/index.shadow.js +1 -1
  52. package/src/lib/utils/functions/index.d.ts +1 -0
  53. package/src/lib/utils/functions/mergeNetworks/index.d.ts +1 -0
  54. package/src/lib/utils/functions/mergeNetworks/mergeNetworks.cjs +26 -0
  55. package/src/lib/utils/functions/mergeNetworks/mergeNetworks.d.ts +13 -0
  56. package/src/lib/utils/functions/mergeNetworks/mergeNetworks.js +22 -0
  57. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +4 -2
  58. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -2
  59. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
  60. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
  61. package/src/lib/utils/hooks/index.d.ts +1 -0
  62. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +3 -13
  63. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +1 -2
  64. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +3 -13
  65. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
  66. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
  67. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +1 -0
  68. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +1 -0
  69. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +33 -8
  70. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +33 -8
  71. package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -0
  72. package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +1 -0
  73. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +27 -5
  74. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +27 -5
  75. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +7 -6
  76. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.d.ts +1 -1
  77. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +7 -6
  78. package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +2 -6
  79. package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +2 -6
  80. package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.cjs +20 -54
  81. package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.d.ts +5 -3
  82. package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.js +20 -54
  83. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/index.d.ts +1 -0
  84. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +38 -0
  85. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.d.ts +2 -0
  86. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +34 -0
  87. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +1 -0
  88. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +1 -0
  89. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -11
  90. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +8 -11
  91. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +1 -0
  92. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +1 -0
  93. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -0
  94. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -0
  95. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +4 -7
  96. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +4 -7
  97. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
  98. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
  99. package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
  100. package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
  101. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +1 -1
  102. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +1 -1
  103. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -8
  104. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -8
  105. package/src/lib/views/{CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs → CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs} +5 -4
  106. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.d.ts +13 -0
  107. package/src/lib/views/{CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js → CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js} +5 -4
  108. package/src/lib/views/CollectUserDataViewNoWallet/index.d.ts +1 -0
  109. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +17 -2
  110. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +17 -2
  111. package/src/lib/views/CreatePasswordView/CreatePasswordView.cjs +12 -13
  112. package/src/lib/views/CreatePasswordView/CreatePasswordView.d.ts +2 -0
  113. package/src/lib/views/CreatePasswordView/CreatePasswordView.js +12 -13
  114. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
  115. package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
  116. package/src/lib/views/EmailVerification/EmailVerification.cjs +10 -17
  117. package/src/lib/views/EmailVerification/EmailVerification.js +10 -17
  118. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +40 -13
  119. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -3
  120. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +40 -13
  121. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +1 -1
  122. package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +8 -1
  123. package/src/lib/views/EnterPasswordView/EnterPasswordView.js +8 -1
  124. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs +1 -0
  125. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js +1 -0
  126. package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +11 -5
  127. package/src/lib/views/LoginView/useLoginView/useLoginView.js +11 -5
  128. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -0
  129. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -0
  130. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.d.ts +2 -3
  131. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.d.ts +2 -3
  132. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.d.ts +2 -3
  133. package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +1 -0
  134. package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +1 -0
  135. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +31 -7
  136. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +31 -7
  137. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
  138. package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
  139. package/src/lib/views/viewToComponentMap.cjs +4 -4
  140. package/src/lib/views/viewToComponentMap.d.ts +60 -2
  141. package/src/lib/views/viewToComponentMap.js +4 -4
  142. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
  143. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +1 -1
  144. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +6 -4
  145. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +6 -4
  146. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +5 -2
  147. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +5 -2
  148. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +2 -14
  149. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +2 -14
  150. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +3 -1
  151. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +4 -2
  152. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +2 -14
  153. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +2 -14
  154. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +18 -9
  155. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +18 -9
  156. package/src/lib/utils/functions/isSameWalletName/index.d.ts +0 -1
  157. package/src/lib/utils/functions/isSameWalletName/isSameWalletName.cjs +0 -9
  158. package/src/lib/utils/functions/isSameWalletName/isSameWalletName.d.ts +0 -1
  159. package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +0 -5
  160. package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/index.d.ts +0 -1
  161. package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/index.d.ts +0 -1
  162. package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.cjs +0 -16
  163. package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.d.ts +0 -2
  164. package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.js +0 -12
  165. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.d.ts +0 -2
  166. package/src/lib/views/CollectUserDataViewLoginWithEmail/index.d.ts +0 -1
@@ -64,6 +64,7 @@ require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Se
64
64
  require('i18next');
65
65
  require('@hcaptcha/react-hcaptcha');
66
66
  require('../../../../context/LoadingContext/LoadingContext.cjs');
67
+ require('../../../../config/ApiEndpoint.cjs');
67
68
  require('../../../../context/FooterAnimationContext/index.cjs');
68
69
  require('../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
69
70
  require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
@@ -60,6 +60,7 @@ import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Sec
60
60
  import 'i18next';
61
61
  import '@hcaptcha/react-hcaptcha';
62
62
  import '../../../../context/LoadingContext/LoadingContext.js';
63
+ import '../../../../config/ApiEndpoint.js';
63
64
  import '../../../../context/FooterAnimationContext/index.js';
64
65
  import '../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
65
66
  import '../../../../context/WalletGroupContext/WalletGroupContext.js';
@@ -69,6 +69,7 @@ require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secon
69
69
  require('i18next');
70
70
  require('@hcaptcha/react-hcaptcha');
71
71
  require('../../../context/LoadingContext/LoadingContext.cjs');
72
+ require('../../../config/ApiEndpoint.cjs');
72
73
  require('../../../context/FooterAnimationContext/index.cjs');
73
74
  require('../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
74
75
  require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
@@ -65,6 +65,7 @@ import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Second
65
65
  import 'i18next';
66
66
  import '@hcaptcha/react-hcaptcha';
67
67
  import '../../../context/LoadingContext/LoadingContext.js';
68
+ import '../../../config/ApiEndpoint.js';
68
69
  import '../../../context/FooterAnimationContext/index.js';
69
70
  import '../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
70
71
  import '../../../context/WalletGroupContext/WalletGroupContext.js';
@@ -2,21 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
6
5
  var values = require('../../../../constants/values.cjs');
7
6
 
8
- // remaining normalizeWalletName until QNTM-846 is complete due to us still passing the walletname to redcoast:
9
- // https://linear.app/dynamic-labs/issue/QNTM-846/remove-usage-of-walletwalletconnectorwname-to-instead-use
10
7
  const findWallet = (account, walletOptions) => {
11
- const normalizedWalletName = account.walletName && walletConnectorCore.normalizeWalletName(account.walletName);
12
- if (normalizedWalletName === 'turnkeyhd') {
8
+ const walletKey = account.walletName;
9
+ if (walletKey === 'turnkeyhd') {
13
10
  const chain = account.chain
14
11
  ? values.VerifiedCredentialNameToChainEnum[account.chain]
15
12
  : undefined;
16
- return walletOptions.find((wallet) => normalizedWalletName === wallet.key &&
13
+ return walletOptions.find((wallet) => walletKey === wallet.key &&
17
14
  wallet.walletConnector.connectedChain === chain);
18
15
  }
19
- return walletOptions.find((wallet) => normalizedWalletName === wallet.key);
16
+ return walletOptions.find((wallet) => walletKey === wallet.key);
20
17
  };
21
18
 
22
19
  exports.findWallet = findWallet;
@@ -1,18 +1,15 @@
1
- import { normalizeWalletName } from '@dynamic-labs/wallet-connector-core';
2
1
  import { VerifiedCredentialNameToChainEnum } from '../../../../constants/values.js';
3
2
 
4
- // remaining normalizeWalletName until QNTM-846 is complete due to us still passing the walletname to redcoast:
5
- // https://linear.app/dynamic-labs/issue/QNTM-846/remove-usage-of-walletwalletconnectorwname-to-instead-use
6
3
  const findWallet = (account, walletOptions) => {
7
- const normalizedWalletName = account.walletName && normalizeWalletName(account.walletName);
8
- if (normalizedWalletName === 'turnkeyhd') {
4
+ const walletKey = account.walletName;
5
+ if (walletKey === 'turnkeyhd') {
9
6
  const chain = account.chain
10
7
  ? VerifiedCredentialNameToChainEnum[account.chain]
11
8
  : undefined;
12
- return walletOptions.find((wallet) => normalizedWalletName === wallet.key &&
9
+ return walletOptions.find((wallet) => walletKey === wallet.key &&
13
10
  wallet.walletConnector.connectedChain === chain);
14
11
  }
15
- return walletOptions.find((wallet) => normalizedWalletName === wallet.key);
12
+ return walletOptions.find((wallet) => walletKey === wallet.key);
16
13
  };
17
14
 
18
15
  export { findWallet };
@@ -115,7 +115,7 @@ const useWalletUiUtils = ({ appLogoUrl, appName, getAppOrigin, hideEmbeddedWalle
115
115
  return openSendTransaction((resolve, reject) => (jsxRuntime.jsx(TransactionConfirmationModal.TransactionConfirmationModal, { copykey: 'dyn_send_transaction.confirmation.title', title: t('dyn_send_transaction.confirmation.title'), transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
116
116
  }), [openSendTransaction, shouldConfirmAction, t]);
117
117
  const enterPassword = React.useCallback(({ handler, closeView = true }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
118
- return openEnterPassword((resolve, reject) => (jsxRuntime.jsx(EnterPasswordModal.EnterPasswordModal, { handler: handler || (() => Promise.resolve()), onResolve: resolve, onReject: reject, closeView: closeView })));
118
+ return openEnterPassword((resolve, reject) => (jsxRuntime.jsx(EnterPasswordModal.EnterPasswordModal, { handler: handler, onResolve: resolve, onReject: reject, closeView: closeView })));
119
119
  }), [openEnterPassword]);
120
120
  const createPassword = React.useCallback(({ closeView = true }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
121
121
  return openCreatePassword((resolve, reject) => (jsxRuntime.jsx(CreatePasswordModal.CreatePasswordModal, { onResolve: resolve, onReject: reject, closeView: closeView })));
@@ -111,7 +111,7 @@ const useWalletUiUtils = ({ appLogoUrl, appName, getAppOrigin, hideEmbeddedWalle
111
111
  return openSendTransaction((resolve, reject) => (jsx(TransactionConfirmationModal, { copykey: 'dyn_send_transaction.confirmation.title', title: t('dyn_send_transaction.confirmation.title'), transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
112
112
  }), [openSendTransaction, shouldConfirmAction, t]);
113
113
  const enterPassword = useCallback(({ handler, closeView = true }) => __awaiter(void 0, void 0, void 0, function* () {
114
- return openEnterPassword((resolve, reject) => (jsx(EnterPasswordModal, { handler: handler || (() => Promise.resolve()), onResolve: resolve, onReject: reject, closeView: closeView })));
114
+ return openEnterPassword((resolve, reject) => (jsx(EnterPasswordModal, { handler: handler, onResolve: resolve, onReject: reject, closeView: closeView })));
115
115
  }), [openEnterPassword]);
116
116
  const createPassword = useCallback(({ closeView = true }) => __awaiter(void 0, void 0, void 0, function* () {
117
117
  return openCreatePassword((resolve, reject) => (jsx(CreatePasswordModal, { onResolve: resolve, onReject: reject, closeView: closeView })));
@@ -65,12 +65,12 @@ var DynamicBridgeWalletCardBody = require('../../widgets/DynamicBridgeWidget/com
65
65
  var SecondaryWallets = require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
66
66
  var Balance = require('../../widgets/DynamicWidget/components/Balance/Balance.cjs');
67
67
  require('@hcaptcha/react-hcaptcha');
68
+ require('i18next');
68
69
  require('../../context/LoadingContext/LoadingContext.cjs');
69
70
  require('../../context/FooterAnimationContext/index.cjs');
70
71
  require('../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
71
72
  require('../../context/WalletGroupContext/WalletGroupContext.cjs');
72
73
  require('../../context/PasskeyContext/PasskeyContext.cjs');
73
- require('i18next');
74
74
  require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
75
75
  require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
76
76
  require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
@@ -61,12 +61,12 @@ import { DynamicBridgeWalletCardBody } from '../../widgets/DynamicBridgeWidget/c
61
61
  import { MemoSecondaryWallets } from '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
62
62
  import { Balance } from '../../widgets/DynamicWidget/components/Balance/Balance.js';
63
63
  import '@hcaptcha/react-hcaptcha';
64
+ import 'i18next';
64
65
  import '../../context/LoadingContext/LoadingContext.js';
65
66
  import '../../context/FooterAnimationContext/index.js';
66
67
  import '../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
67
68
  import '../../context/WalletGroupContext/WalletGroupContext.js';
68
69
  import '../../context/PasskeyContext/PasskeyContext.js';
69
- import 'i18next';
70
70
  import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
71
71
  import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
72
72
  import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
@@ -84,7 +84,7 @@ const CoinbaseMPCClaimIntro = () => {
84
84
  const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
85
85
  const { setView } = ViewContext.useViewContext();
86
86
  const { t } = reactI18next.useTranslation();
87
- const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowAuthFlow(false, { emitCancelAuth: true }), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
87
+ const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowAuthFlow(false), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
88
88
  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(Button.Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
89
89
  color: 'inherit',
90
90
  }, onClick: () => {
@@ -80,7 +80,7 @@ const CoinbaseMPCClaimIntro = () => {
80
80
  const { setShowAuthFlow } = useInternalDynamicContext();
81
81
  const { setView } = useViewContext();
82
82
  const { t } = useTranslation();
83
- const closeButton = (jsx(IconButton, { onClick: () => setShowAuthFlow(false, { emitCancelAuth: true }), type: 'button', children: jsx(SvgClose, {}) }));
83
+ const closeButton = (jsx(IconButton, { onClick: () => setShowAuthFlow(false), type: 'button', children: jsx(SvgClose, {}) }));
84
84
  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(Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
85
85
  color: 'inherit',
86
86
  }, onClick: () => {
@@ -106,14 +106,9 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
106
106
  setShowAuthFlow(false);
107
107
  return;
108
108
  }
109
- try {
110
- // this function will check turnkey wallet enabled and create wallet if needed
111
- // if not enabled, it will throw an error.
112
- yield createEmbeddedWallet();
113
- }
114
- catch (e) {
115
- setShowAuthFlow(false);
116
- }
109
+ // this function will check turnkey wallet enabled and create wallet if needed
110
+ // if not enabled, it will throw an error.
111
+ yield createEmbeddedWallet().catch(() => setShowAuthFlow(false));
117
112
  }), [
118
113
  updateUser,
119
114
  setCallback,
@@ -102,14 +102,9 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
102
102
  setShowAuthFlow(false);
103
103
  return;
104
104
  }
105
- try {
106
- // this function will check turnkey wallet enabled and create wallet if needed
107
- // if not enabled, it will throw an error.
108
- yield createEmbeddedWallet();
109
- }
110
- catch (e) {
111
- setShowAuthFlow(false);
112
- }
105
+ // this function will check turnkey wallet enabled and create wallet if needed
106
+ // if not enabled, it will throw an error.
107
+ yield createEmbeddedWallet().catch(() => setShowAuthFlow(false));
113
108
  }), [
114
109
  updateUser,
115
110
  setCallback,
@@ -80,16 +80,17 @@ require('@hcaptcha/react-hcaptcha');
80
80
  var UserAvatar = require('../../components/UserAvatar/UserAvatar.cjs');
81
81
  require('../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
82
82
 
83
- const CollectUserDataViewLoginWithEmail = () => {
83
+ const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
84
+ var _a;
84
85
  const { appName, handleLogOut, projectSettings, onboardingImageUrl, decodedOnboardingOnlyToken, } = useInternalDynamicContext.useInternalDynamicContext();
85
86
  const { t } = reactI18next.useTranslation();
86
87
  if (!decodedOnboardingOnlyToken) {
87
88
  return null;
88
89
  }
89
90
  const userProfile = createUserProfile.createUserProfile(decodedOnboardingOnlyToken);
90
- return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userProfile }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-with-email__email-address', children: userProfile.email })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-with-email__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userProfile, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
91
+ return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userProfile }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userProfile[userIdentification]) !== null && _a !== void 0 ? _a : 'My profile' })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userProfile, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
91
92
  t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
92
- t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-with-email__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
93
+ t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
93
94
  };
94
95
 
95
- exports.CollectUserDataViewLoginWithEmail = CollectUserDataViewLoginWithEmail;
96
+ exports.CollectUserDataViewNoWallet = CollectUserDataViewNoWallet;
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { UserProfile } from '../../shared';
3
+ type CollectUserDataViewNoWalletProps = {
4
+ /**
5
+ * Which user field we should display as the user's identification.
6
+ * Ex: we can show his email when logging in with email or number when logging through sms.
7
+ */
8
+ userIdentification: keyof UserProfile;
9
+ /** When passed, is shown instead of a user profile field as the user identification. */
10
+ userIdentificationOverride?: string;
11
+ };
12
+ export declare const CollectUserDataViewNoWallet: FC<CollectUserDataViewNoWalletProps>;
13
+ export {};
@@ -76,16 +76,17 @@ import '@hcaptcha/react-hcaptcha';
76
76
  import { UserAvatar } from '../../components/UserAvatar/UserAvatar.js';
77
77
  import '../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
78
78
 
79
- const CollectUserDataViewLoginWithEmail = () => {
79
+ const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
80
+ var _a;
80
81
  const { appName, handleLogOut, projectSettings, onboardingImageUrl, decodedOnboardingOnlyToken, } = useInternalDynamicContext();
81
82
  const { t } = useTranslation();
82
83
  if (!decodedOnboardingOnlyToken) {
83
84
  return null;
84
85
  }
85
86
  const userProfile = createUserProfile(decodedOnboardingOnlyToken);
86
- return (jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-with-email__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsx(UserAvatar, { user: userProfile }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-with-email__email-address', children: userProfile.email })] }), jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsx("div", { className: 'collect-user-data-login-with-email__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userProfile, children: jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
87
+ return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: userProfile }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userProfile[userIdentification]) !== null && _a !== void 0 ? _a : 'My profile' })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userProfile, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
87
88
  t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
88
- t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-with-email__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
89
+ t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
89
90
  };
90
91
 
91
- export { CollectUserDataViewLoginWithEmail };
92
+ export { CollectUserDataViewNoWallet };
@@ -0,0 +1 @@
1
+ export * from './CollectUserDataViewNoWallet';
@@ -99,7 +99,8 @@ const CreatePasswordStep = ({ password, setPassword, currentPassword, setCurrent
99
99
  const canContinue = Boolean((password === null || password === void 0 ? void 0 : password.length) >= 6 &&
100
100
  passwordStrength >= 5 &&
101
101
  confirmPassword === password &&
102
- (!isChangingPassword || currentPassword));
102
+ (!isChangingPassword ||
103
+ (currentPassword && currentPassword !== password)));
103
104
  const closeButton = onClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => onClose(), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
104
105
  const inputSuffix = (inputType, setInputType, includeCopy = true) => (jsxRuntime.jsxs("div", { className: 'create-password__password-input__suffix', children: [includeCopy && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: password, copykey: 'dyn_qr_code.copy_button', className: 'create-password__password-input__suffix__icon', children: jsxRuntime.jsx(copy.ReactComponent, { className: 'create-password__password-input__suffix__icon', onClick: (e) => {
105
106
  e.preventDefault();
@@ -133,7 +134,21 @@ const CreatePasswordStep = ({ password, setPassword, currentPassword, setCurrent
133
134
  const { strength } = validatePassword.validatePassword(newPassword);
134
135
  setPasswordStrength(strength);
135
136
  setPassword(newPassword);
136
- if (!isChangingPassword && !(newPassword === null || newPassword === void 0 ? void 0 : newPassword.length)) {
137
+ if (isChangingPassword) {
138
+ if (currentPassword === newPassword) {
139
+ setError(t('dyn_create_password.errors.new_password_same_as_old'));
140
+ }
141
+ else if (newPassword &&
142
+ confirmPassword &&
143
+ newPassword !== confirmPassword) {
144
+ setError(t('dyn_create_password.errors.password_mismatch'));
145
+ }
146
+ else {
147
+ setError('');
148
+ }
149
+ return;
150
+ }
151
+ if (!(newPassword === null || newPassword === void 0 ? void 0 : newPassword.length)) {
137
152
  setError('');
138
153
  }
139
154
  };
@@ -95,7 +95,8 @@ const CreatePasswordStep = ({ password, setPassword, currentPassword, setCurrent
95
95
  const canContinue = Boolean((password === null || password === void 0 ? void 0 : password.length) >= 6 &&
96
96
  passwordStrength >= 5 &&
97
97
  confirmPassword === password &&
98
- (!isChangingPassword || currentPassword));
98
+ (!isChangingPassword ||
99
+ (currentPassword && currentPassword !== password)));
99
100
  const closeButton = onClose && (jsx(IconButton, { onClick: () => onClose(), type: 'button', children: jsx(SvgClose, {}) }));
100
101
  const inputSuffix = (inputType, setInputType, includeCopy = true) => (jsxs("div", { className: 'create-password__password-input__suffix', children: [includeCopy && (jsx("div", { children: jsx(CopyButton, { textToCopy: password, copykey: 'dyn_qr_code.copy_button', className: 'create-password__password-input__suffix__icon', children: jsx(SvgCopy, { className: 'create-password__password-input__suffix__icon', onClick: (e) => {
101
102
  e.preventDefault();
@@ -129,7 +130,21 @@ const CreatePasswordStep = ({ password, setPassword, currentPassword, setCurrent
129
130
  const { strength } = validatePassword(newPassword);
130
131
  setPasswordStrength(strength);
131
132
  setPassword(newPassword);
132
- if (!isChangingPassword && !(newPassword === null || newPassword === void 0 ? void 0 : newPassword.length)) {
133
+ if (isChangingPassword) {
134
+ if (currentPassword === newPassword) {
135
+ setError(t('dyn_create_password.errors.new_password_same_as_old'));
136
+ }
137
+ else if (newPassword &&
138
+ confirmPassword &&
139
+ newPassword !== confirmPassword) {
140
+ setError(t('dyn_create_password.errors.password_mismatch'));
141
+ }
142
+ else {
143
+ setError('');
144
+ }
145
+ return;
146
+ }
147
+ if (!(newPassword === null || newPassword === void 0 ? void 0 : newPassword.length)) {
133
148
  setError('');
134
149
  }
135
150
  };
@@ -11,7 +11,7 @@ require('../../context/DynamicContext/DynamicContext.cjs');
11
11
  require('@dynamic-labs/sdk-api');
12
12
  var logger = require('../../shared/logger.cjs');
13
13
  require('@dynamic-labs/iconic');
14
- var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
14
+ require('../../context/ViewContext/ViewContext.cjs');
15
15
  require('@dynamic-labs/wallet-book');
16
16
  require('../../utils/constants/colors.cjs');
17
17
  require('../../utils/constants/values.cjs');
@@ -64,13 +64,13 @@ require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
64
64
  require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
65
65
  require('i18next');
66
66
  require('@hcaptcha/react-hcaptcha');
67
+ var CreatePasswordStep = require('./CreatePasswordStep/CreatePasswordStep.cjs');
68
+ var SavePasswordStep = require('./SavePasswordStep/SavePasswordStep.cjs');
67
69
  require('../../context/LoadingContext/LoadingContext.cjs');
68
70
  require('../../context/FooterAnimationContext/index.cjs');
69
71
  require('../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
70
72
  require('../../context/WalletGroupContext/WalletGroupContext.cjs');
71
73
  require('../../context/PasskeyContext/PasskeyContext.cjs');
72
- var SavePasswordStep = require('./SavePasswordStep/SavePasswordStep.cjs');
73
- var CreatePasswordStep = require('./CreatePasswordStep/CreatePasswordStep.cjs');
74
74
  require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
75
75
  require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
76
76
  require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
@@ -78,16 +78,13 @@ require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
78
78
  require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
79
79
  var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
80
80
 
81
- const CreatePasswordView = ({ onSuccess, onError, closeView, }) => {
82
- var _a, _b, _c;
81
+ const CreatePasswordView = ({ onSuccess, onError, closeView, notCalledFromWalletUtils, isSignUp, }) => {
82
+ var _a;
83
83
  const { setShowAuthFlow, user, projectSettings, primaryWallet, handleLogOut: onLogout, walletConnectorOptions, } = useInternalDynamicContext.useInternalDynamicContext();
84
- const { view } = ViewContext.useViewContext();
85
84
  const { t } = reactI18next.useTranslation();
86
- const { changePassword } = useEmbeddedWalletPassword.useEmbeddedWalletPassword();
85
+ const { claimWallet } = useEmbeddedWalletPassword.useEmbeddedWalletPassword();
87
86
  const [curStep, setCurStep] = React.useState('create-password');
88
87
  const cbVcWalletProperties = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => vc.walletName === 'coinbasempc')) === null || _a === void 0 ? void 0 : _a.walletProperties;
89
- const notCalledFromWalletUtils = (_b = view === null || view === void 0 ? void 0 : view.props) === null || _b === void 0 ? void 0 : _b.notCalledFromWalletUtils;
90
- const isSignUp = (_c = view === null || view === void 0 ? void 0 : view.props) === null || _c === void 0 ? void 0 : _c.isSignUp;
91
88
  const isChangingPassword = Boolean(cbVcWalletProperties === null || cbVcWalletProperties === void 0 ? void 0 : cbVcWalletProperties.claimed);
92
89
  const closeViewOnCreate = closeView !== null && closeView !== void 0 ? closeView : true;
93
90
  const [currentPassword, setCurrentPassword] = React.useState('');
@@ -100,18 +97,20 @@ const CreatePasswordView = ({ onSuccess, onError, closeView, }) => {
100
97
  setCurStep('save-password');
101
98
  });
102
99
  const handleSavePassword = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
103
- var _d, _e, _f;
100
+ var _b, _c, _d;
104
101
  setIsLoading(true);
105
102
  try {
106
103
  if (!isSignUp) {
107
- const connector = (_f = (_d = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _d !== void 0 ? _d : (_e = findCoinbaseMPCWallet.findCoinbaseMPCWallet(walletConnectorOptions)) === null || _e === void 0 ? void 0 : _e.walletConnector) !== null && _f !== void 0 ? _f : undefined;
104
+ const connector = (_d = (_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _b !== void 0 ? _b : (_c = findCoinbaseMPCWallet.findCoinbaseMPCWallet(walletConnectorOptions)) === null || _c === void 0 ? void 0 : _c.walletConnector) !== null && _d !== void 0 ? _d : undefined;
108
105
  // notCalledFromWalletUtils = true means the user triggered password flow, not the connector
109
106
  if (notCalledFromWalletUtils &&
110
107
  walletConnectorCore.isCoinbaseMpcWalletConnector(connector)) {
111
108
  yield connector.changePasscode(password, currentPassword);
112
109
  }
113
- // change password in api
114
- yield changePassword(password, currentPassword);
110
+ if (!isChangingPassword) {
111
+ // if creating password for the first time, set wallet as claimed
112
+ yield claimWallet();
113
+ }
115
114
  }
116
115
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(password);
117
116
  if (closeViewOnCreate) {
@@ -3,5 +3,7 @@ export type CreatePasswordViewProps = {
3
3
  onSuccess?: (password: string) => void;
4
4
  onError?: (error: unknown, closePortal?: boolean) => void;
5
5
  closeView?: boolean;
6
+ notCalledFromWalletUtils?: boolean;
7
+ isSignUp?: boolean;
6
8
  };
7
9
  export declare const CreatePasswordView: FC<CreatePasswordViewProps>;
@@ -7,7 +7,7 @@ import '../../context/DynamicContext/DynamicContext.js';
7
7
  import '@dynamic-labs/sdk-api';
8
8
  import { logger } from '../../shared/logger.js';
9
9
  import '@dynamic-labs/iconic';
10
- import { useViewContext } from '../../context/ViewContext/ViewContext.js';
10
+ import '../../context/ViewContext/ViewContext.js';
11
11
  import '@dynamic-labs/wallet-book';
12
12
  import '../../utils/constants/colors.js';
13
13
  import '../../utils/constants/values.js';
@@ -60,13 +60,13 @@ import '../../context/SocialRedirectContext/SocialRedirectContext.js';
60
60
  import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
61
61
  import 'i18next';
62
62
  import '@hcaptcha/react-hcaptcha';
63
+ import { CreatePasswordStep } from './CreatePasswordStep/CreatePasswordStep.js';
64
+ import { SavePasswordStep } from './SavePasswordStep/SavePasswordStep.js';
63
65
  import '../../context/LoadingContext/LoadingContext.js';
64
66
  import '../../context/FooterAnimationContext/index.js';
65
67
  import '../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
66
68
  import '../../context/WalletGroupContext/WalletGroupContext.js';
67
69
  import '../../context/PasskeyContext/PasskeyContext.js';
68
- import { SavePasswordStep } from './SavePasswordStep/SavePasswordStep.js';
69
- import { CreatePasswordStep } from './CreatePasswordStep/CreatePasswordStep.js';
70
70
  import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
71
71
  import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
72
72
  import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
@@ -74,16 +74,13 @@ import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
74
74
  import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
75
75
  import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
76
76
 
77
- const CreatePasswordView = ({ onSuccess, onError, closeView, }) => {
78
- var _a, _b, _c;
77
+ const CreatePasswordView = ({ onSuccess, onError, closeView, notCalledFromWalletUtils, isSignUp, }) => {
78
+ var _a;
79
79
  const { setShowAuthFlow, user, projectSettings, primaryWallet, handleLogOut: onLogout, walletConnectorOptions, } = useInternalDynamicContext();
80
- const { view } = useViewContext();
81
80
  const { t } = useTranslation();
82
- const { changePassword } = useEmbeddedWalletPassword();
81
+ const { claimWallet } = useEmbeddedWalletPassword();
83
82
  const [curStep, setCurStep] = useState('create-password');
84
83
  const cbVcWalletProperties = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => vc.walletName === 'coinbasempc')) === null || _a === void 0 ? void 0 : _a.walletProperties;
85
- const notCalledFromWalletUtils = (_b = view === null || view === void 0 ? void 0 : view.props) === null || _b === void 0 ? void 0 : _b.notCalledFromWalletUtils;
86
- const isSignUp = (_c = view === null || view === void 0 ? void 0 : view.props) === null || _c === void 0 ? void 0 : _c.isSignUp;
87
84
  const isChangingPassword = Boolean(cbVcWalletProperties === null || cbVcWalletProperties === void 0 ? void 0 : cbVcWalletProperties.claimed);
88
85
  const closeViewOnCreate = closeView !== null && closeView !== void 0 ? closeView : true;
89
86
  const [currentPassword, setCurrentPassword] = useState('');
@@ -96,18 +93,20 @@ const CreatePasswordView = ({ onSuccess, onError, closeView, }) => {
96
93
  setCurStep('save-password');
97
94
  });
98
95
  const handleSavePassword = () => __awaiter(void 0, void 0, void 0, function* () {
99
- var _d, _e, _f;
96
+ var _b, _c, _d;
100
97
  setIsLoading(true);
101
98
  try {
102
99
  if (!isSignUp) {
103
- const connector = (_f = (_d = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _d !== void 0 ? _d : (_e = findCoinbaseMPCWallet(walletConnectorOptions)) === null || _e === void 0 ? void 0 : _e.walletConnector) !== null && _f !== void 0 ? _f : undefined;
100
+ const connector = (_d = (_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _b !== void 0 ? _b : (_c = findCoinbaseMPCWallet(walletConnectorOptions)) === null || _c === void 0 ? void 0 : _c.walletConnector) !== null && _d !== void 0 ? _d : undefined;
104
101
  // notCalledFromWalletUtils = true means the user triggered password flow, not the connector
105
102
  if (notCalledFromWalletUtils &&
106
103
  isCoinbaseMpcWalletConnector(connector)) {
107
104
  yield connector.changePasscode(password, currentPassword);
108
105
  }
109
- // change password in api
110
- yield changePassword(password, currentPassword);
106
+ if (!isChangingPassword) {
107
+ // if creating password for the first time, set wallet as claimed
108
+ yield claimWallet();
109
+ }
111
110
  }
112
111
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(password);
113
112
  if (closeViewOnCreate) {
@@ -75,6 +75,7 @@ require('../WalletList/WalletList.cjs');
75
75
  require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
76
76
  require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
77
77
  require('@hcaptcha/react-hcaptcha');
78
+ require('../../config/ApiEndpoint.cjs');
78
79
  require('../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
79
80
 
80
81
  const EmailUpdate = () => {
@@ -71,6 +71,7 @@ import '../WalletList/WalletList.js';
71
71
  import '../../context/SocialRedirectContext/SocialRedirectContext.js';
72
72
  import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
73
73
  import '@hcaptcha/react-hcaptcha';
74
+ import '../../config/ApiEndpoint.js';
74
75
  import '../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
75
76
 
76
77
  const EmailUpdate = () => {
@@ -90,6 +90,7 @@ require('../WalletList/WalletList.cjs');
90
90
  require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
91
91
  require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
92
92
  require('@hcaptcha/react-hcaptcha');
93
+ require('../../config/ApiEndpoint.cjs');
93
94
  require('../LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
94
95
 
95
96
  const SECONDS_TO_RETRY = 15;
@@ -153,14 +154,9 @@ const EmailVerification = () => {
153
154
  setShowAuthFlow(false);
154
155
  return;
155
156
  }
156
- try {
157
- // this function will check turnkey wallet enabled and create wallet if needed
158
- // if not enabled, it will throw an error.
159
- yield createEmbeddedWallet();
160
- }
161
- catch (e) {
162
- setShowAuthFlow(false, { emitCancelAuth: true });
163
- }
157
+ // this function will check turnkey wallet enabled and create wallet if needed
158
+ // if not enabled, it will throw an error.
159
+ yield createEmbeddedWallet().catch(() => setShowAuthFlow(false));
164
160
  }
165
161
  catch (error) {
166
162
  logger.logger.debug(error);
@@ -216,7 +212,9 @@ const EmailVerification = () => {
216
212
  if (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields.length) {
217
213
  setOnboardingOnlyJwt(jwt);
218
214
  yield sleepToShowSuccessMessage();
219
- setView('collect-user-data-login-with-email');
215
+ setView('collect-user-data-login-no-wallet', {
216
+ userIdentification: 'email',
217
+ });
220
218
  return;
221
219
  }
222
220
  setCallback('authSuccess');
@@ -228,14 +226,9 @@ const EmailVerification = () => {
228
226
  setShowAuthFlow(false);
229
227
  return;
230
228
  }
231
- try {
232
- // this function will check turnkey wallet enabled and create wallet if needed
233
- // if not enabled, it will throw an error.
234
- yield createEmbeddedWallet();
235
- }
236
- catch (e) {
237
- setShowAuthFlow(false);
238
- }
229
+ // this function will check turnkey wallet enabled and create wallet if needed
230
+ // if not enabled, it will throw an error.
231
+ yield createEmbeddedWallet().catch(() => setShowAuthFlow(false));
239
232
  }
240
233
  catch (error) {
241
234
  if (error instanceof utils.NoAccessError) {