@dynamic-labs/sdk-react-core 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +13 -13
- package/src/lib/components/Alert/Alert.types.d.ts +2 -1
- package/src/lib/components/Button/Button.cjs +2 -2
- package/src/lib/components/Button/Button.d.ts +2 -1
- package/src/lib/components/Button/Button.js +2 -2
- package/src/lib/components/CopyButton/CopyButton.d.ts +2 -1
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -2
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.d.ts +3 -2
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -2
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.cjs +1 -1
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.d.ts +2 -1
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.js +1 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +2 -2
- package/src/lib/components/ErrorContainer/ErrorContainer.d.ts +2 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +2 -2
- package/src/lib/components/Input/Input.types.d.ts +2 -1
- package/src/lib/components/ListTile/ListTile.cjs +1 -1
- package/src/lib/components/ListTile/ListTile.js +1 -1
- package/src/lib/components/ListTile/ListTile.types.d.ts +2 -1
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.cjs +9 -5
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.d.ts +1 -1
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.js +9 -5
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +3 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +3 -3
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +7 -6
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +7 -6
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +1 -1
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +1 -1
- package/src/lib/components/Search/Search.cjs +1 -1
- package/src/lib/components/Search/Search.d.ts +2 -1
- package/src/lib/components/Search/Search.js +1 -1
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs +2 -2
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +3 -3
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +3 -3
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +1 -1
- package/src/lib/components/TextButton/TextButton.d.ts +2 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +2 -2
- package/src/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/src/lib/components/Tooltip/Tooltip.js +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +3 -3
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +2 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +3 -3
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +2 -1
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Typography/Typography.types.d.ts +2 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +2 -2
- package/src/lib/components/UserProfile/UserProfile.d.ts +1 -0
- package/src/lib/components/UserProfile/UserProfile.js +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +3 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -2
- package/src/lib/data/api.cjs +0 -13
- package/src/lib/data/api.d.ts +1 -2
- package/src/lib/data/api.js +1 -13
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.d.ts +2 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +2 -2
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.d.ts +2 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +2 -2
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +2 -2
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.d.ts +2 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +2 -2
- package/src/lib/locale/en/translation.cjs +124 -1
- package/src/lib/locale/en/translation.d.ts +124 -1
- package/src/lib/locale/en/translation.js +124 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +2 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +2 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +2 -1
- package/src/lib/shared/types/index.d.ts +3 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +16 -9
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +16 -9
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +28 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +28 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +2 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +2 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +2 -4
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +51 -7
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.d.ts +3 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +51 -7
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +3 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +3 -0
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs → useProcessNetworkConfigurations/useProcessNetworkConfigurations.cjs} +53 -67
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts → useProcessNetworkConfigurations/useProcessNetworkConfigurations.d.ts} +3 -2
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.js → useProcessNetworkConfigurations/useProcessNetworkConfigurations.js} +53 -67
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +20 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +20 -14
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +26 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +26 -4
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +1 -1
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +3 -2
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +3 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +4 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +4 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +9 -8
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +9 -8
- package/src/lib/views/CollectUserDataView/useFields.cjs +11 -0
- package/src/lib/views/CollectUserDataView/useFields.d.ts +11 -0
- package/src/lib/views/CollectUserDataView/useFields.js +11 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +3 -3
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +3 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +35 -24
- package/src/lib/views/EmailVerification/EmailVerification.js +35 -24
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -3
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.d.ts +3 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +1 -1
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +3 -3
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +3 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +3 -1
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +3 -1
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +6 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +6 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +10 -5
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +10 -5
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +3 -3
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +3 -3
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +7 -4
- package/src/lib/views/PendingConnectView/PendingConnectView.js +7 -4
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +8 -5
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +8 -5
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +11 -8
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +11 -8
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.d.ts +2 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +4 -3
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +4 -3
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +8 -6
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +2 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +8 -6
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +6 -9
- package/src/lib/views/WalletList/WalletList.js +6 -9
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +3 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +3 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +4 -3
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +4 -3
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +5 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +5 -3
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.d.ts +3 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +65 -21
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +66 -22
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/index.d.ts +0 -1
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.cjs +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { MissingPublicAddressError, isMobile } from '@dynamic-labs/utils';
|
|
2
3
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
3
4
|
import { useErrorContext } from '../../../../context/ErrorContext/ErrorContext.js';
|
|
4
5
|
import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
|
|
@@ -16,7 +17,6 @@ import { LAST_USED_WALLET } from '../../../constants/localStorage.js';
|
|
|
16
17
|
import '../../../constants/colors.js';
|
|
17
18
|
import { LocalStorage } from '../../../../shared/utils/classes/storage/localStorage.js';
|
|
18
19
|
import 'viem';
|
|
19
|
-
import '@dynamic-labs/utils';
|
|
20
20
|
import '../../../../shared/consts/index.js';
|
|
21
21
|
import { useCaptchaContext } from '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
22
22
|
import { useHandleWalletsToConnect } from '../../useHandleWalletsToConnect/useHandleWalletsToConnect.js';
|
|
@@ -34,6 +34,19 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
34
34
|
projectSettings,
|
|
35
35
|
setIsSingleWalletAccount,
|
|
36
36
|
});
|
|
37
|
+
const onErrorHandler = (err) => {
|
|
38
|
+
logger.debug(err);
|
|
39
|
+
goToInitialView();
|
|
40
|
+
setIsVerificationInProgress(false);
|
|
41
|
+
/**
|
|
42
|
+
* On mobile we don't want to show error message because the user
|
|
43
|
+
* is redirected to the wallet mobile app
|
|
44
|
+
*/
|
|
45
|
+
const isMissingPublicAddressErrorExpected = err instanceof MissingPublicAddressError && isMobile();
|
|
46
|
+
if (!isMissingPublicAddressErrorExpected) {
|
|
47
|
+
setErrorMessage(err.toString());
|
|
48
|
+
}
|
|
49
|
+
};
|
|
37
50
|
// This method is similar to useConnectAndSign, but it skips signing for now
|
|
38
51
|
// It's used when we want to connect and sign in two separate steps
|
|
39
52
|
// For example on mobile when we want to sign on button click
|
|
@@ -67,10 +80,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
67
80
|
setView('pending-signature');
|
|
68
81
|
}
|
|
69
82
|
catch (err) {
|
|
70
|
-
|
|
71
|
-
setErrorMessage(err.toString());
|
|
72
|
-
goToInitialView();
|
|
73
|
-
setIsVerificationInProgress(false);
|
|
83
|
+
onErrorHandler(err);
|
|
74
84
|
return;
|
|
75
85
|
}
|
|
76
86
|
});
|
|
@@ -91,10 +101,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
91
101
|
});
|
|
92
102
|
}
|
|
93
103
|
catch (err) {
|
|
94
|
-
|
|
95
|
-
setErrorMessage(err.toString());
|
|
96
|
-
goToInitialView();
|
|
97
|
-
setIsVerificationInProgress(false);
|
|
104
|
+
onErrorHandler(err);
|
|
98
105
|
return;
|
|
99
106
|
}
|
|
100
107
|
});
|
|
@@ -8,14 +8,31 @@ var useInternalDynamicContext = require('../../../../context/DynamicContext/useI
|
|
|
8
8
|
var api = require('../../../../data/api.cjs');
|
|
9
9
|
var useUpdateUserProfileByJWTCallback = require('../../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs');
|
|
10
10
|
var EmailVerificationContext = require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
11
|
+
require('@dynamic-labs/sdk-api');
|
|
12
|
+
require('../../../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
require('react/jsx-runtime');
|
|
16
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
require('@dynamic-labs/wallet-book');
|
|
18
|
+
require('../../../constants/colors.cjs');
|
|
19
|
+
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
require('viem');
|
|
21
|
+
require('@dynamic-labs/utils');
|
|
22
|
+
require('../../../../shared/consts/index.cjs');
|
|
23
|
+
require('@dynamic-labs/multi-wallet');
|
|
24
|
+
var isTurnkeyEnabled = require('../../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
11
25
|
|
|
12
26
|
// Hook exposed to the public as a scoped function in useUserUpdateRequest result
|
|
13
27
|
const useEmailVerificationRequest = () => {
|
|
14
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
const { onboardingOnlyJwt, authToken, environmentId, projectSettings, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
15
30
|
const jwtToken = onboardingOnlyJwt || authToken;
|
|
31
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled.isTurnkeyEnabled(projectSettings);
|
|
16
32
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
17
33
|
const { verificationUUID: emailVerificationContextVerificationUUID } = EmailVerificationContext.useEmailVerificationContext();
|
|
18
34
|
const verifyEmail = React.useCallback((verificationToken, verificationUUID) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
var _b;
|
|
19
36
|
if (!jwtToken)
|
|
20
37
|
throw new Error('No JWT token provided');
|
|
21
38
|
// VerificationUUID is saved in the context in case the view changes
|
|
@@ -27,12 +44,22 @@ const useEmailVerificationRequest = () => {
|
|
|
27
44
|
verificationToken,
|
|
28
45
|
verificationUUID: String(verificationUUID || emailVerificationContextVerificationUUID),
|
|
29
46
|
}, jwtToken);
|
|
47
|
+
if (isTurnkeyProviderEnabled &&
|
|
48
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) &&
|
|
49
|
+
!primaryWallet) {
|
|
50
|
+
// Don't create the user right now
|
|
51
|
+
// It will be done after the wallet creation
|
|
52
|
+
return verifyEmailResponse;
|
|
53
|
+
}
|
|
30
54
|
yield updateUserProfileByJWT(verifyEmailResponse.jwt);
|
|
31
55
|
return verifyEmailResponse;
|
|
32
56
|
}), [
|
|
33
57
|
emailVerificationContextVerificationUUID,
|
|
34
58
|
environmentId,
|
|
59
|
+
isTurnkeyProviderEnabled,
|
|
35
60
|
jwtToken,
|
|
61
|
+
primaryWallet,
|
|
62
|
+
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
36
63
|
updateUserProfileByJWT,
|
|
37
64
|
]);
|
|
38
65
|
return { verifyEmail };
|
|
@@ -4,14 +4,31 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
|
|
|
4
4
|
import { verifyEmail } from '../../../../data/api.js';
|
|
5
5
|
import { useUpdateUserProfileByJWTCallback } from '../../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
|
|
6
6
|
import { useEmailVerificationContext } from '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
7
|
+
import '@dynamic-labs/sdk-api';
|
|
8
|
+
import '../../../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import 'react/jsx-runtime';
|
|
12
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
13
|
+
import '@dynamic-labs/wallet-book';
|
|
14
|
+
import '../../../constants/colors.js';
|
|
15
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import 'viem';
|
|
17
|
+
import '@dynamic-labs/utils';
|
|
18
|
+
import '../../../../shared/consts/index.js';
|
|
19
|
+
import '@dynamic-labs/multi-wallet';
|
|
20
|
+
import { isTurnkeyEnabled } from '../../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
7
21
|
|
|
8
22
|
// Hook exposed to the public as a scoped function in useUserUpdateRequest result
|
|
9
23
|
const useEmailVerificationRequest = () => {
|
|
10
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
const { onboardingOnlyJwt, authToken, environmentId, projectSettings, primaryWallet, } = useInternalDynamicContext();
|
|
11
26
|
const jwtToken = onboardingOnlyJwt || authToken;
|
|
27
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled(projectSettings);
|
|
12
28
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
13
29
|
const { verificationUUID: emailVerificationContextVerificationUUID } = useEmailVerificationContext();
|
|
14
30
|
const verifyEmail$1 = useCallback((verificationToken, verificationUUID) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
var _b;
|
|
15
32
|
if (!jwtToken)
|
|
16
33
|
throw new Error('No JWT token provided');
|
|
17
34
|
// VerificationUUID is saved in the context in case the view changes
|
|
@@ -23,12 +40,22 @@ const useEmailVerificationRequest = () => {
|
|
|
23
40
|
verificationToken,
|
|
24
41
|
verificationUUID: String(verificationUUID || emailVerificationContextVerificationUUID),
|
|
25
42
|
}, jwtToken);
|
|
43
|
+
if (isTurnkeyProviderEnabled &&
|
|
44
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) &&
|
|
45
|
+
!primaryWallet) {
|
|
46
|
+
// Don't create the user right now
|
|
47
|
+
// It will be done after the wallet creation
|
|
48
|
+
return verifyEmailResponse;
|
|
49
|
+
}
|
|
26
50
|
yield updateUserProfileByJWT(verifyEmailResponse.jwt);
|
|
27
51
|
return verifyEmailResponse;
|
|
28
52
|
}), [
|
|
29
53
|
emailVerificationContextVerificationUUID,
|
|
30
54
|
environmentId,
|
|
55
|
+
isTurnkeyProviderEnabled,
|
|
31
56
|
jwtToken,
|
|
57
|
+
primaryWallet,
|
|
58
|
+
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
32
59
|
updateUserProfileByJWT,
|
|
33
60
|
]);
|
|
34
61
|
return { verifyEmail: verifyEmail$1 };
|
|
@@ -94,12 +94,14 @@ const useAuthLayoutChecks = (walletConnector) => {
|
|
|
94
94
|
view === 'passkey-intro' ||
|
|
95
95
|
(view === 'merge-user-accounts' && !user);
|
|
96
96
|
const showQrCodePreHeader = view === 'qr-code' && showQrCodeMessage && !showQrCodeImage;
|
|
97
|
+
const showDefaultFooter = !showDynamicFooter && !showToSFooter;
|
|
97
98
|
return {
|
|
98
99
|
displayBorderBelowHeader,
|
|
99
100
|
isWalletListTypeView,
|
|
100
101
|
showBackButton,
|
|
101
102
|
showCloseButton,
|
|
102
103
|
showConnectedWalletProgress,
|
|
104
|
+
showDefaultFooter,
|
|
103
105
|
showDynamicFooter,
|
|
104
106
|
showHeader,
|
|
105
107
|
showHelpContent,
|
|
@@ -5,6 +5,7 @@ export declare const useAuthLayoutChecks: (walletConnector?: WalletConnector | n
|
|
|
5
5
|
showBackButton: boolean;
|
|
6
6
|
showCloseButton: boolean;
|
|
7
7
|
showConnectedWalletProgress: boolean;
|
|
8
|
+
showDefaultFooter: boolean;
|
|
8
9
|
showDynamicFooter: boolean;
|
|
9
10
|
showHeader: boolean;
|
|
10
11
|
showHelpContent: boolean;
|
|
@@ -90,12 +90,14 @@ const useAuthLayoutChecks = (walletConnector) => {
|
|
|
90
90
|
view === 'passkey-intro' ||
|
|
91
91
|
(view === 'merge-user-accounts' && !user);
|
|
92
92
|
const showQrCodePreHeader = view === 'qr-code' && showQrCodeMessage && !showQrCodeImage;
|
|
93
|
+
const showDefaultFooter = !showDynamicFooter && !showToSFooter;
|
|
93
94
|
return {
|
|
94
95
|
displayBorderBelowHeader,
|
|
95
96
|
isWalletListTypeView,
|
|
96
97
|
showBackButton,
|
|
97
98
|
showCloseButton,
|
|
98
99
|
showConnectedWalletProgress,
|
|
100
|
+
showDefaultFooter,
|
|
99
101
|
showDynamicFooter,
|
|
100
102
|
showHeader,
|
|
101
103
|
showHelpContent,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
9
|
var UserWalletsContext = require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
9
10
|
var api = require('../../../data/api.cjs');
|
|
10
11
|
require('@dynamic-labs/sdk-api');
|
|
@@ -18,7 +19,6 @@ require('../../constants/colors.cjs');
|
|
|
18
19
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
19
20
|
require('viem');
|
|
20
21
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
21
|
-
require('@dynamic-labs/utils');
|
|
22
22
|
require('../../../shared/consts/index.cjs');
|
|
23
23
|
require('@dynamic-labs/multi-wallet');
|
|
24
24
|
var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
@@ -166,9 +166,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
166
166
|
const connectWallet = (walletConnector, fetchPublicAddressOpts, shouldCallCallback = true) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
167
167
|
const walletAddress = yield walletConnector.fetchPublicAddress(fetchPublicAddressOpts);
|
|
168
168
|
if (!walletAddress) {
|
|
169
|
-
|
|
170
|
-
error.code = 'missing-public-address';
|
|
171
|
-
throw error;
|
|
169
|
+
throw new utils.MissingPublicAddressError();
|
|
172
170
|
}
|
|
173
171
|
if (onBeforeConnectSuccessConfirmation && shouldCallCallback) {
|
|
174
172
|
const shouldProceedWithConnection = yield onBeforeConnectSuccessConfirmation({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { getWalletConnectorByKey, logger } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { MissingPublicAddressError } from '@dynamic-labs/utils';
|
|
4
5
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
5
6
|
import { createVisit } from '../../../data/api.js';
|
|
6
7
|
import '@dynamic-labs/sdk-api';
|
|
@@ -14,7 +15,6 @@ import '../../constants/colors.js';
|
|
|
14
15
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
15
16
|
import 'viem';
|
|
16
17
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
17
|
-
import '@dynamic-labs/utils';
|
|
18
18
|
import '../../../shared/consts/index.js';
|
|
19
19
|
import '@dynamic-labs/multi-wallet';
|
|
20
20
|
import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
@@ -162,9 +162,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
162
162
|
const connectWallet = (walletConnector, fetchPublicAddressOpts, shouldCallCallback = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
163
|
const walletAddress = yield walletConnector.fetchPublicAddress(fetchPublicAddressOpts);
|
|
164
164
|
if (!walletAddress) {
|
|
165
|
-
|
|
166
|
-
error.code = 'missing-public-address';
|
|
167
|
-
throw error;
|
|
165
|
+
throw new MissingPublicAddressError();
|
|
168
166
|
}
|
|
169
167
|
if (onBeforeConnectSuccessConfirmation && shouldCallCallback) {
|
|
170
168
|
const shouldProceedWithConnection = yield onBeforeConnectSuccessConfirmation({
|
|
@@ -12,101 +12,145 @@ const useDynamicLayoutData = ({ view, authMode, }) => {
|
|
|
12
12
|
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
13
13
|
if (view === 'no-access') {
|
|
14
14
|
const headerData = {
|
|
15
|
+
copykey: 'dyn_no_access.title',
|
|
15
16
|
heading: t('dyn_no_access.title'),
|
|
16
17
|
};
|
|
17
18
|
return { headerData };
|
|
18
19
|
}
|
|
19
20
|
const helpHeaderMap = {
|
|
20
21
|
'login-with-email-or-wallet-full-wallet-list': {
|
|
22
|
+
copykey: 'dyn_login.helper.all_wallet_list',
|
|
21
23
|
heading: t('dyn_login.helper.all_wallet_list'),
|
|
22
24
|
},
|
|
23
25
|
'login-with-wallet-only': {
|
|
26
|
+
copykey: 'dyn_login.helper.wallet_only',
|
|
24
27
|
heading: t('dyn_login.helper.wallet_only'),
|
|
25
28
|
},
|
|
26
29
|
'passkey-intro': {
|
|
30
|
+
copykey: 'dyn_passkey_intro.helper.title',
|
|
27
31
|
heading: t('dyn_passkey_intro.helper.title'),
|
|
28
32
|
},
|
|
29
33
|
'pending-connect': {
|
|
34
|
+
copykey: 'dyn_login.helper.pending_connect.title',
|
|
30
35
|
heading: t('dyn_login.helper.pending_connect.title'),
|
|
31
36
|
},
|
|
32
37
|
'pending-signature': {
|
|
38
|
+
copykey: 'dyn_login.helper.pending_signature.title',
|
|
33
39
|
heading: t('dyn_login.helper.pending_signature.title'),
|
|
34
40
|
},
|
|
35
41
|
'pending-signature-without-back-button': {
|
|
42
|
+
copykey: 'dyn_login.helper.pending_signature_without_back_button.title',
|
|
36
43
|
heading: t('dyn_login.helper.pending_signature_without_back_button.title'),
|
|
37
44
|
},
|
|
38
45
|
'qr-code': {
|
|
46
|
+
copykey: 'dyn_login.helper.qr_code.title',
|
|
39
47
|
heading: t('dyn_login.helper.qr_code.title'),
|
|
40
48
|
},
|
|
41
49
|
'wallet-connect-mobile-wallets-list': {
|
|
50
|
+
copykey: 'dyn_wallet_conect.mobile.wallet_list.helper',
|
|
42
51
|
heading: t('dyn_wallet_conect.mobile.wallet_list.helper'),
|
|
43
52
|
},
|
|
44
53
|
'wallet-list': {
|
|
54
|
+
copykey: 'dyn_wallet_list.helper',
|
|
45
55
|
heading: t('dyn_wallet_list.helper'),
|
|
46
56
|
},
|
|
47
57
|
};
|
|
48
58
|
const headerMap = {
|
|
49
|
-
'account-exists': {
|
|
59
|
+
'account-exists': {
|
|
60
|
+
copykey: 'dyn_account_exists.title',
|
|
61
|
+
heading: t('dyn_account_exists.title'),
|
|
62
|
+
},
|
|
50
63
|
'chainalysis-blocked-wallet': {
|
|
64
|
+
copykey: 'dyn_chainalysis_blocked_wallet.title',
|
|
51
65
|
heading: t('dyn_chainalysis_blocked_wallet.title'),
|
|
52
66
|
},
|
|
53
|
-
'login-with-email-or-wallet': {
|
|
67
|
+
'login-with-email-or-wallet': {
|
|
68
|
+
copykey: 'dyn_login.title.all',
|
|
69
|
+
heading: t('dyn_login.title.all'),
|
|
70
|
+
},
|
|
54
71
|
'login-with-email-or-wallet-full-wallet-list': {
|
|
72
|
+
copykey: 'dyn_login.title.all_wallet_list',
|
|
55
73
|
heading: t('dyn_login.title.all_wallet_list'),
|
|
56
74
|
},
|
|
57
75
|
'login-with-email-verification': {
|
|
58
|
-
|
|
76
|
+
copykey: 'dyn_otp_verification.title',
|
|
77
|
+
heading: t('dyn_otp_verification.title'),
|
|
59
78
|
},
|
|
60
79
|
'login-with-wallet-only': {
|
|
80
|
+
copykey: 'dyn_login.title.wallet_only',
|
|
61
81
|
heading: t('dyn_login.title.wallet_only'),
|
|
62
82
|
},
|
|
63
83
|
'multi-wallet-wallet-list': {
|
|
84
|
+
copykey: authMode === 'connect-only'
|
|
85
|
+
? 'dyn_wallet_list.title.connect'
|
|
86
|
+
: 'dyn_wallet_list.title.link',
|
|
64
87
|
heading: authMode === 'connect-only'
|
|
65
88
|
? t('dyn_wallet_list.title.connect')
|
|
66
89
|
: t('dyn_wallet_list.title.link'),
|
|
67
90
|
},
|
|
68
91
|
'network-not-supported': {
|
|
69
|
-
|
|
92
|
+
copykey: 'dyn_network_not_supported.title',
|
|
93
|
+
heading: t('dyn_network_not_supported.title'),
|
|
70
94
|
},
|
|
71
95
|
'passkey-recovery-bundle': {
|
|
96
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
97
|
+
? 'dyn_passkey_secure_modal.code.title'
|
|
98
|
+
: 'dyn_passkey_recovery.code.title',
|
|
72
99
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
73
100
|
? t('dyn_passkey_secure_modal.code.title')
|
|
74
101
|
: t('dyn_passkey_recovery.code.title'),
|
|
75
102
|
},
|
|
76
103
|
'passkey-recovery-complete': {
|
|
104
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
105
|
+
? 'dyn_passkey_secure_modal.complete.title'
|
|
106
|
+
: 'dyn_passkey_recovery.complete.title',
|
|
77
107
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
78
108
|
? t('dyn_passkey_secure_modal.complete.title')
|
|
79
109
|
: t('dyn_passkey_recovery.complete.title'),
|
|
80
110
|
},
|
|
81
111
|
'passkey-recovery-start': {
|
|
112
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
113
|
+
? 'dyn_passkey_secure_modal.start.title'
|
|
114
|
+
: 'dyn_passkey_recovery.start.title',
|
|
82
115
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
83
116
|
? t('dyn_passkey_secure_modal.start.title')
|
|
84
117
|
: t('dyn_passkey_recovery.start.title'),
|
|
85
118
|
},
|
|
86
119
|
'pending-connect': {
|
|
120
|
+
copykey: 'dyn_login.connect_wallet.title',
|
|
87
121
|
heading: t('dyn_login.connect_wallet.title'),
|
|
88
122
|
},
|
|
89
123
|
'pending-signature': {
|
|
124
|
+
copykey: 'dyn_login.sign_wallet.title',
|
|
90
125
|
heading: t('dyn_login.sign_wallet.title'),
|
|
91
126
|
},
|
|
92
127
|
'qr-code': {
|
|
128
|
+
copykey: 'dyn_login.qr_code.title',
|
|
93
129
|
heading: t('dyn_login.qr_code.title'),
|
|
94
130
|
},
|
|
95
131
|
'verify-email': {
|
|
96
|
-
|
|
132
|
+
copykey: 'dyn_otp_verification.title',
|
|
133
|
+
heading: t('dyn_otp_verification.title'),
|
|
97
134
|
},
|
|
98
135
|
'wallet-connect-mobile-wallets-list': {
|
|
136
|
+
copykey: 'dyn_wallet_conect.mobile.wallet_list.title',
|
|
99
137
|
heading: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(iconic.WalletConnectIcon, { style: { height: '1.5rem', width: '1.5rem' } }), ' ', t('dyn_wallet_conect.mobile.wallet_list.title')] })),
|
|
100
138
|
},
|
|
101
139
|
'wallet-group': {
|
|
140
|
+
copykey: 'dyn_login.wallet_group.title',
|
|
102
141
|
heading: t('dyn_login.wallet_group.title'),
|
|
103
142
|
},
|
|
104
143
|
'wallet-list': {
|
|
144
|
+
copykey: 'dyn_wallet_list.title.select',
|
|
105
145
|
heading: t('dyn_wallet_list.title.select'),
|
|
106
146
|
},
|
|
107
|
-
'wallet-sign': {
|
|
147
|
+
'wallet-sign': {
|
|
148
|
+
copykey: 'dyn_wallet_transfer.sign.title',
|
|
149
|
+
heading: t('dyn_wallet_transfer.sign.title'),
|
|
150
|
+
},
|
|
108
151
|
'wallet-used': {
|
|
109
|
-
|
|
152
|
+
copykey: 'dyn_wallet_link.title',
|
|
153
|
+
heading: t('dyn_wallet_link.title'),
|
|
110
154
|
},
|
|
111
155
|
};
|
|
112
156
|
const helpHeaderData = helpHeaderMap[view];
|
|
@@ -3,9 +3,11 @@ import { ViewType } from '../../../context/ViewContext';
|
|
|
3
3
|
import { AuthModeType } from '../../../shared';
|
|
4
4
|
interface FooterContentProps {
|
|
5
5
|
heading: string;
|
|
6
|
+
copykey: string;
|
|
6
7
|
}
|
|
7
8
|
interface HeaderContentProps {
|
|
8
9
|
heading: string | JSX.Element;
|
|
10
|
+
copykey: string;
|
|
9
11
|
}
|
|
10
12
|
interface DynamicLayoutProps {
|
|
11
13
|
view: ViewType;
|
|
@@ -13,6 +15,7 @@ interface DynamicLayoutProps {
|
|
|
13
15
|
}
|
|
14
16
|
export declare const useDynamicLayoutData: ({ view, authMode, }: DynamicLayoutProps) => {
|
|
15
17
|
headerData: {
|
|
18
|
+
copykey: string;
|
|
16
19
|
heading: string;
|
|
17
20
|
};
|
|
18
21
|
helpHeaderData?: undefined;
|
|
@@ -8,101 +8,145 @@ const useDynamicLayoutData = ({ view, authMode, }) => {
|
|
|
8
8
|
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
9
9
|
if (view === 'no-access') {
|
|
10
10
|
const headerData = {
|
|
11
|
+
copykey: 'dyn_no_access.title',
|
|
11
12
|
heading: t('dyn_no_access.title'),
|
|
12
13
|
};
|
|
13
14
|
return { headerData };
|
|
14
15
|
}
|
|
15
16
|
const helpHeaderMap = {
|
|
16
17
|
'login-with-email-or-wallet-full-wallet-list': {
|
|
18
|
+
copykey: 'dyn_login.helper.all_wallet_list',
|
|
17
19
|
heading: t('dyn_login.helper.all_wallet_list'),
|
|
18
20
|
},
|
|
19
21
|
'login-with-wallet-only': {
|
|
22
|
+
copykey: 'dyn_login.helper.wallet_only',
|
|
20
23
|
heading: t('dyn_login.helper.wallet_only'),
|
|
21
24
|
},
|
|
22
25
|
'passkey-intro': {
|
|
26
|
+
copykey: 'dyn_passkey_intro.helper.title',
|
|
23
27
|
heading: t('dyn_passkey_intro.helper.title'),
|
|
24
28
|
},
|
|
25
29
|
'pending-connect': {
|
|
30
|
+
copykey: 'dyn_login.helper.pending_connect.title',
|
|
26
31
|
heading: t('dyn_login.helper.pending_connect.title'),
|
|
27
32
|
},
|
|
28
33
|
'pending-signature': {
|
|
34
|
+
copykey: 'dyn_login.helper.pending_signature.title',
|
|
29
35
|
heading: t('dyn_login.helper.pending_signature.title'),
|
|
30
36
|
},
|
|
31
37
|
'pending-signature-without-back-button': {
|
|
38
|
+
copykey: 'dyn_login.helper.pending_signature_without_back_button.title',
|
|
32
39
|
heading: t('dyn_login.helper.pending_signature_without_back_button.title'),
|
|
33
40
|
},
|
|
34
41
|
'qr-code': {
|
|
42
|
+
copykey: 'dyn_login.helper.qr_code.title',
|
|
35
43
|
heading: t('dyn_login.helper.qr_code.title'),
|
|
36
44
|
},
|
|
37
45
|
'wallet-connect-mobile-wallets-list': {
|
|
46
|
+
copykey: 'dyn_wallet_conect.mobile.wallet_list.helper',
|
|
38
47
|
heading: t('dyn_wallet_conect.mobile.wallet_list.helper'),
|
|
39
48
|
},
|
|
40
49
|
'wallet-list': {
|
|
50
|
+
copykey: 'dyn_wallet_list.helper',
|
|
41
51
|
heading: t('dyn_wallet_list.helper'),
|
|
42
52
|
},
|
|
43
53
|
};
|
|
44
54
|
const headerMap = {
|
|
45
|
-
'account-exists': {
|
|
55
|
+
'account-exists': {
|
|
56
|
+
copykey: 'dyn_account_exists.title',
|
|
57
|
+
heading: t('dyn_account_exists.title'),
|
|
58
|
+
},
|
|
46
59
|
'chainalysis-blocked-wallet': {
|
|
60
|
+
copykey: 'dyn_chainalysis_blocked_wallet.title',
|
|
47
61
|
heading: t('dyn_chainalysis_blocked_wallet.title'),
|
|
48
62
|
},
|
|
49
|
-
'login-with-email-or-wallet': {
|
|
63
|
+
'login-with-email-or-wallet': {
|
|
64
|
+
copykey: 'dyn_login.title.all',
|
|
65
|
+
heading: t('dyn_login.title.all'),
|
|
66
|
+
},
|
|
50
67
|
'login-with-email-or-wallet-full-wallet-list': {
|
|
68
|
+
copykey: 'dyn_login.title.all_wallet_list',
|
|
51
69
|
heading: t('dyn_login.title.all_wallet_list'),
|
|
52
70
|
},
|
|
53
71
|
'login-with-email-verification': {
|
|
54
|
-
|
|
72
|
+
copykey: 'dyn_otp_verification.title',
|
|
73
|
+
heading: t('dyn_otp_verification.title'),
|
|
55
74
|
},
|
|
56
75
|
'login-with-wallet-only': {
|
|
76
|
+
copykey: 'dyn_login.title.wallet_only',
|
|
57
77
|
heading: t('dyn_login.title.wallet_only'),
|
|
58
78
|
},
|
|
59
79
|
'multi-wallet-wallet-list': {
|
|
80
|
+
copykey: authMode === 'connect-only'
|
|
81
|
+
? 'dyn_wallet_list.title.connect'
|
|
82
|
+
: 'dyn_wallet_list.title.link',
|
|
60
83
|
heading: authMode === 'connect-only'
|
|
61
84
|
? t('dyn_wallet_list.title.connect')
|
|
62
85
|
: t('dyn_wallet_list.title.link'),
|
|
63
86
|
},
|
|
64
87
|
'network-not-supported': {
|
|
65
|
-
|
|
88
|
+
copykey: 'dyn_network_not_supported.title',
|
|
89
|
+
heading: t('dyn_network_not_supported.title'),
|
|
66
90
|
},
|
|
67
91
|
'passkey-recovery-bundle': {
|
|
92
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
93
|
+
? 'dyn_passkey_secure_modal.code.title'
|
|
94
|
+
: 'dyn_passkey_recovery.code.title',
|
|
68
95
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
69
96
|
? t('dyn_passkey_secure_modal.code.title')
|
|
70
97
|
: t('dyn_passkey_recovery.code.title'),
|
|
71
98
|
},
|
|
72
99
|
'passkey-recovery-complete': {
|
|
100
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
101
|
+
? 'dyn_passkey_secure_modal.complete.title'
|
|
102
|
+
: 'dyn_passkey_recovery.complete.title',
|
|
73
103
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
74
104
|
? t('dyn_passkey_secure_modal.complete.title')
|
|
75
105
|
: t('dyn_passkey_recovery.complete.title'),
|
|
76
106
|
},
|
|
77
107
|
'passkey-recovery-start': {
|
|
108
|
+
copykey: isTurnkeyWalletWithoutAuthenticator
|
|
109
|
+
? 'dyn_passkey_secure_modal.start.title'
|
|
110
|
+
: 'dyn_passkey_recovery.start.title',
|
|
78
111
|
heading: isTurnkeyWalletWithoutAuthenticator
|
|
79
112
|
? t('dyn_passkey_secure_modal.start.title')
|
|
80
113
|
: t('dyn_passkey_recovery.start.title'),
|
|
81
114
|
},
|
|
82
115
|
'pending-connect': {
|
|
116
|
+
copykey: 'dyn_login.connect_wallet.title',
|
|
83
117
|
heading: t('dyn_login.connect_wallet.title'),
|
|
84
118
|
},
|
|
85
119
|
'pending-signature': {
|
|
120
|
+
copykey: 'dyn_login.sign_wallet.title',
|
|
86
121
|
heading: t('dyn_login.sign_wallet.title'),
|
|
87
122
|
},
|
|
88
123
|
'qr-code': {
|
|
124
|
+
copykey: 'dyn_login.qr_code.title',
|
|
89
125
|
heading: t('dyn_login.qr_code.title'),
|
|
90
126
|
},
|
|
91
127
|
'verify-email': {
|
|
92
|
-
|
|
128
|
+
copykey: 'dyn_otp_verification.title',
|
|
129
|
+
heading: t('dyn_otp_verification.title'),
|
|
93
130
|
},
|
|
94
131
|
'wallet-connect-mobile-wallets-list': {
|
|
132
|
+
copykey: 'dyn_wallet_conect.mobile.wallet_list.title',
|
|
95
133
|
heading: (jsxs(Fragment, { children: [jsx(WalletConnectIcon, { style: { height: '1.5rem', width: '1.5rem' } }), ' ', t('dyn_wallet_conect.mobile.wallet_list.title')] })),
|
|
96
134
|
},
|
|
97
135
|
'wallet-group': {
|
|
136
|
+
copykey: 'dyn_login.wallet_group.title',
|
|
98
137
|
heading: t('dyn_login.wallet_group.title'),
|
|
99
138
|
},
|
|
100
139
|
'wallet-list': {
|
|
140
|
+
copykey: 'dyn_wallet_list.title.select',
|
|
101
141
|
heading: t('dyn_wallet_list.title.select'),
|
|
102
142
|
},
|
|
103
|
-
'wallet-sign': {
|
|
143
|
+
'wallet-sign': {
|
|
144
|
+
copykey: 'dyn_wallet_transfer.sign.title',
|
|
145
|
+
heading: t('dyn_wallet_transfer.sign.title'),
|
|
146
|
+
},
|
|
104
147
|
'wallet-used': {
|
|
105
|
-
|
|
148
|
+
copykey: 'dyn_wallet_link.title',
|
|
149
|
+
heading: t('dyn_wallet_link.title'),
|
|
106
150
|
},
|
|
107
151
|
};
|
|
108
152
|
const helpHeaderData = helpHeaderMap[view];
|
|
@@ -27,12 +27,14 @@ var isEmbeddedWalletPresent = require('../../functions/isEmbeddedWalletPresent/i
|
|
|
27
27
|
var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
28
28
|
var smartWallet = require('../useWalletConnectors/utils/smartWallet/smartWallet.cjs');
|
|
29
29
|
var useCreateDynamicEmbeddedWalletMutation = require('../useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs');
|
|
30
|
+
var useCreateUserProfileByJWTCallback = require('../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs');
|
|
30
31
|
|
|
31
32
|
// Hook exposed to customers and used internally to trigger embedded wallet creation
|
|
32
33
|
const useEmbeddedWallet = () => {
|
|
33
34
|
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, primaryWallet, environmentId, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
34
35
|
const { setView } = ViewContext.useViewContext();
|
|
35
36
|
const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
|
|
37
|
+
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback.useCreateUserProfileByJWTCallback();
|
|
36
38
|
const userHasEmbeddedWallet = () => {
|
|
37
39
|
var _a;
|
|
38
40
|
const jwt = (_a = getAuthToken.getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
@@ -85,6 +87,7 @@ const useEmbeddedWallet = () => {
|
|
|
85
87
|
// if user already has embedded wallet, set it as primary wallet
|
|
86
88
|
if (decodedJwt) {
|
|
87
89
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
90
|
+
yield createUserProfileByJWT(jwt);
|
|
88
91
|
const smartWallet$1 = smartWallet.findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
89
92
|
if (smartWallet$1) {
|
|
90
93
|
yield smartWallet.initializeSmartWallet({
|
|
@@ -23,12 +23,14 @@ import { isEmbeddedWalletPresent } from '../../functions/isEmbeddedWalletPresent
|
|
|
23
23
|
import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
24
24
|
import { findSmartWallet, initializeSmartWallet } from '../useWalletConnectors/utils/smartWallet/smartWallet.js';
|
|
25
25
|
import { useCreateDynamicEmbeddedWalletMutation } from '../useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js';
|
|
26
|
+
import { useCreateUserProfileByJWTCallback } from '../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js';
|
|
26
27
|
|
|
27
28
|
// Hook exposed to customers and used internally to trigger embedded wallet creation
|
|
28
29
|
const useEmbeddedWallet = () => {
|
|
29
30
|
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, primaryWallet, environmentId, } = useInternalDynamicContext();
|
|
30
31
|
const { setView } = useViewContext();
|
|
31
32
|
const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation();
|
|
33
|
+
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback();
|
|
32
34
|
const userHasEmbeddedWallet = () => {
|
|
33
35
|
var _a;
|
|
34
36
|
const jwt = (_a = getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
@@ -81,6 +83,7 @@ const useEmbeddedWallet = () => {
|
|
|
81
83
|
// if user already has embedded wallet, set it as primary wallet
|
|
82
84
|
if (decodedJwt) {
|
|
83
85
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
86
|
+
yield createUserProfileByJWT(jwt);
|
|
84
87
|
const smartWallet = findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
85
88
|
if (smartWallet) {
|
|
86
89
|
yield initializeSmartWallet({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useProcessNetworkConfigurations } from './useProcessNetworkConfigurations';
|