@dynamic-labs/sdk-react-core 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/Main.cjs +3 -3
- package/src/lib/Main.js +3 -3
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -3
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +2 -2
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +2 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +2 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/utils.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/utils.d.ts +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/utils.js +2 -2
- package/src/lib/context/CaptchaContext/CaptchaContext.cjs +3 -3
- package/src/lib/context/CaptchaContext/CaptchaContext.js +3 -3
- package/src/lib/context/MockContext/MockContext.cjs +0 -2
- package/src/lib/context/MockContext/MockContext.js +0 -2
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +5 -5
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +5 -5
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +8 -9
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +8 -9
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +8 -3
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +8 -3
- package/src/lib/context/ViewContext/ViewContext.cjs +0 -2
- package/src/lib/context/ViewContext/ViewContext.d.ts +0 -10
- package/src/lib/context/ViewContext/ViewContext.js +0 -2
- package/src/lib/context/WalletGroupContext/WalletGroupContext.cjs +3 -3
- package/src/lib/context/WalletGroupContext/WalletGroupContext.js +3 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +4 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +4 -4
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +4 -0
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +4 -0
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +3 -3
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.d.ts +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +8 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +7 -7
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +7 -7
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +2 -2
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +3 -3
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +3 -3
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +3 -3
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +4 -4
- package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.cjs +3 -3
- package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.js +3 -3
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +6 -6
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +6 -6
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +2 -2
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +2 -2
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +11 -11
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +11 -11
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +5 -7
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +5 -7
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +38 -24
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +3 -2
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +38 -24
- package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.cjs +3 -3
- package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.js +3 -3
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +5 -5
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +5 -5
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +5 -5
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +5 -5
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +9 -9
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +9 -9
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +6 -6
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +6 -6
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +12 -12
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +12 -12
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +7 -7
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +7 -7
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +4 -4
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -4
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +3 -3
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +3 -3
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +2 -2
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +2 -2
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +2 -2
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +2 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +3 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +3 -3
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -2
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +4 -4
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +4 -4
- package/src/lib/views/LoginView/LoginView.cjs +2 -2
- package/src/lib/views/LoginView/LoginView.js +2 -2
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +4 -4
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +4 -4
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -3
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +3 -3
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +5 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +5 -5
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +3 -3
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +3 -3
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +4 -4
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +4 -4
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +5 -5
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +5 -5
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +5 -5
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
- package/src/lib/views/NoAccess/NoAccess.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +2 -4
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +2 -4
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs +2 -2
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +2 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +1 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -4
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs
CHANGED
|
@@ -93,7 +93,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
93
93
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
94
94
|
|
|
95
95
|
/** Saves the values updated by the user */
|
|
96
|
-
const saveUserValues = (_a, setShowAuthFlow_1,
|
|
96
|
+
const saveUserValues = (_a, setShowAuthFlow_1, pushView_1, resolve_1, reject_1) => _tslib.__awaiter(void 0, [_a, setShowAuthFlow_1, pushView_1, resolve_1, reject_1], void 0, function* ({ fields: newValues, updateUserResult: { isEmailVerificationRequired, isSmsVerificationRequired, }, }, setShowAuthFlow, pushView, resolve, reject) {
|
|
97
97
|
// If no verification is needed, we are done
|
|
98
98
|
if (!isEmailVerificationRequired && !isSmsVerificationRequired) {
|
|
99
99
|
resolve(newValues);
|
|
@@ -105,7 +105,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
105
105
|
performMultiWalletChecks: false,
|
|
106
106
|
});
|
|
107
107
|
if (isEmailVerificationRequired) {
|
|
108
|
-
|
|
108
|
+
pushView('verify-email');
|
|
109
109
|
// Subscribe to email verification result
|
|
110
110
|
dynamicEvents.dynamicEvents.once('emailVerificationResult', (wasSuccessful, newEmail) => {
|
|
111
111
|
// Make sure we're using the correct, updated email. User might have changed it mid-OTP
|
|
@@ -116,7 +116,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
116
116
|
});
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
pushView('verify-sms');
|
|
120
120
|
// Subscribe to sms verification result
|
|
121
121
|
dynamicEvents.dynamicEvents.once('smsVerificationResult', (wasSuccessful, { phone: newPhone }) => {
|
|
122
122
|
// Make sure we're using the correct, updated phone number. User might have changed it mid-OTP
|
|
@@ -132,7 +132,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
132
132
|
*/
|
|
133
133
|
const useUpdateUserWithModal = (updateUser) => {
|
|
134
134
|
const { user, projectSettings, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
135
|
-
const {
|
|
135
|
+
const { pushView } = ViewContext.useViewContext();
|
|
136
136
|
const editorContext = React.useContext(UserFieldEditorContext.UserFieldEditorContext);
|
|
137
137
|
if (!editorContext)
|
|
138
138
|
throw new utils.DynamicError('useUserUpdateRequest can only be used inside the context of DynamicContextProvider');
|
|
@@ -151,7 +151,7 @@ const useUpdateUserWithModal = (updateUser) => {
|
|
|
151
151
|
subtitle: options === null || options === void 0 ? void 0 : options.subtitle,
|
|
152
152
|
title: options === null || options === void 0 ? void 0 : options.title,
|
|
153
153
|
}, updateUser)
|
|
154
|
-
.then((updateValues) => saveUserValues(updateValues, setShowAuthFlow,
|
|
154
|
+
.then((updateValues) => saveUserValues(updateValues, setShowAuthFlow, pushView, resolve, reject))
|
|
155
155
|
.catch((error) => {
|
|
156
156
|
if (/email already exists/gi.test(error))
|
|
157
157
|
throw error;
|
|
@@ -163,7 +163,7 @@ const useUpdateUserWithModal = (updateUser) => {
|
|
|
163
163
|
promptUserForValues,
|
|
164
164
|
updateUser,
|
|
165
165
|
setShowAuthFlow,
|
|
166
|
-
|
|
166
|
+
pushView,
|
|
167
167
|
]);
|
|
168
168
|
return updateUserWithModal;
|
|
169
169
|
};
|
package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js
CHANGED
|
@@ -89,7 +89,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
89
89
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
90
90
|
|
|
91
91
|
/** Saves the values updated by the user */
|
|
92
|
-
const saveUserValues = (_a, setShowAuthFlow_1,
|
|
92
|
+
const saveUserValues = (_a, setShowAuthFlow_1, pushView_1, resolve_1, reject_1) => __awaiter(void 0, [_a, setShowAuthFlow_1, pushView_1, resolve_1, reject_1], void 0, function* ({ fields: newValues, updateUserResult: { isEmailVerificationRequired, isSmsVerificationRequired, }, }, setShowAuthFlow, pushView, resolve, reject) {
|
|
93
93
|
// If no verification is needed, we are done
|
|
94
94
|
if (!isEmailVerificationRequired && !isSmsVerificationRequired) {
|
|
95
95
|
resolve(newValues);
|
|
@@ -101,7 +101,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
101
101
|
performMultiWalletChecks: false,
|
|
102
102
|
});
|
|
103
103
|
if (isEmailVerificationRequired) {
|
|
104
|
-
|
|
104
|
+
pushView('verify-email');
|
|
105
105
|
// Subscribe to email verification result
|
|
106
106
|
dynamicEvents.once('emailVerificationResult', (wasSuccessful, newEmail) => {
|
|
107
107
|
// Make sure we're using the correct, updated email. User might have changed it mid-OTP
|
|
@@ -112,7 +112,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
112
112
|
});
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
pushView('verify-sms');
|
|
116
116
|
// Subscribe to sms verification result
|
|
117
117
|
dynamicEvents.once('smsVerificationResult', (wasSuccessful, { phone: newPhone }) => {
|
|
118
118
|
// Make sure we're using the correct, updated phone number. User might have changed it mid-OTP
|
|
@@ -128,7 +128,7 @@ const saveUserValues = (_a, setShowAuthFlow_1, setView_1, resolve_1, reject_1) =
|
|
|
128
128
|
*/
|
|
129
129
|
const useUpdateUserWithModal = (updateUser) => {
|
|
130
130
|
const { user, projectSettings, setShowAuthFlow } = useInternalDynamicContext();
|
|
131
|
-
const {
|
|
131
|
+
const { pushView } = useViewContext();
|
|
132
132
|
const editorContext = useContext(UserFieldEditorContext);
|
|
133
133
|
if (!editorContext)
|
|
134
134
|
throw new DynamicError('useUserUpdateRequest can only be used inside the context of DynamicContextProvider');
|
|
@@ -147,7 +147,7 @@ const useUpdateUserWithModal = (updateUser) => {
|
|
|
147
147
|
subtitle: options === null || options === void 0 ? void 0 : options.subtitle,
|
|
148
148
|
title: options === null || options === void 0 ? void 0 : options.title,
|
|
149
149
|
}, updateUser)
|
|
150
|
-
.then((updateValues) => saveUserValues(updateValues, setShowAuthFlow,
|
|
150
|
+
.then((updateValues) => saveUserValues(updateValues, setShowAuthFlow, pushView, resolve, reject))
|
|
151
151
|
.catch((error) => {
|
|
152
152
|
if (/email already exists/gi.test(error))
|
|
153
153
|
throw error;
|
|
@@ -159,7 +159,7 @@ const useUpdateUserWithModal = (updateUser) => {
|
|
|
159
159
|
promptUserForValues,
|
|
160
160
|
updateUser,
|
|
161
161
|
setShowAuthFlow,
|
|
162
|
-
|
|
162
|
+
pushView,
|
|
163
163
|
]);
|
|
164
164
|
return updateUserWithModal;
|
|
165
165
|
};
|
|
@@ -106,7 +106,7 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
106
106
|
const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, }) => {
|
|
107
107
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
108
108
|
const { setDeniedAddress, setDeniedOauthProvider } = AccessDeniedContext.useAccessDeniedContext();
|
|
109
|
-
const {
|
|
109
|
+
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
110
110
|
const { setErrorMessage, setError } = ErrorContext.useErrorContext();
|
|
111
111
|
const { multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setShowAuthFlow, siweStatement, connectedWallets, authMode, user, setAuthMode, removeConnectedWalletsInfo, events, primaryWallet, enableConnectOnlyFallback, selectedWalletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
112
112
|
const { addedWalletsIds } = UserWalletsContext.useInternalUserWallets();
|
|
@@ -169,11 +169,11 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
169
169
|
// This is a special case where the user is trying to link a wallet
|
|
170
170
|
// and the wallet is already linked and we don't want to kill the session.
|
|
171
171
|
setShowAuthFlow(true);
|
|
172
|
-
|
|
172
|
+
pushView('wallet-used');
|
|
173
173
|
setIsSingleWalletAccount(false);
|
|
174
174
|
if (e.code === 'reassign_wallet_error') {
|
|
175
175
|
if ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.preventOrphanedAccounts) {
|
|
176
|
-
|
|
176
|
+
pushView('wallet-cannot-be-transferred');
|
|
177
177
|
}
|
|
178
178
|
setIsSingleWalletAccount(true);
|
|
179
179
|
}
|
|
@@ -199,7 +199,7 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
199
199
|
type: 'wallet',
|
|
200
200
|
}, { error: e });
|
|
201
201
|
if (e instanceof utils.EmbeddedWalletExistsError) {
|
|
202
|
-
|
|
202
|
+
pushView('embedded-wallet-exists');
|
|
203
203
|
setShowAuthFlow(true);
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
@@ -208,24 +208,24 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
208
208
|
return handleWalletUsedError(e);
|
|
209
209
|
}
|
|
210
210
|
if (e instanceof utils.MergeAccountsConfirmationError) {
|
|
211
|
-
|
|
211
|
+
pushView('merge-user-accounts', Object.assign({}, e));
|
|
212
212
|
setShowAuthFlow(true);
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
if (e instanceof utils.ChainalysisError) {
|
|
216
216
|
handleDisconnectWallet({ walletConnector });
|
|
217
217
|
setDeniedAddress(address);
|
|
218
|
-
|
|
218
|
+
pushView('chainalysis-blocked-wallet');
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
if (e instanceof utils.GateBlockedError) {
|
|
222
222
|
handleDisconnectWallet({ walletConnector });
|
|
223
223
|
setDeniedAddress(address);
|
|
224
|
-
|
|
224
|
+
pushView('gate-blocked-wallet');
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
227
|
if (e instanceof utils.SandboxMaximumThresholdReachedError) {
|
|
228
|
-
|
|
228
|
+
pushView('sandbox-maximum-threshold-reached');
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
if (e instanceof utils.NoAccessError) {
|
|
@@ -235,13 +235,13 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
235
235
|
if (walletConnectorCore.isSocialWalletConnector(walletConnector)) {
|
|
236
236
|
setDeniedOauthProvider(oauth === null || oauth === void 0 ? void 0 : oauth.provider);
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
pushView('no-access');
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
241
|
if (e instanceof utils.AccountExistsError) {
|
|
242
242
|
handleDisconnectWallet({ walletConnector });
|
|
243
243
|
setExistentAccountData(e.errorPayload);
|
|
244
|
-
|
|
244
|
+
pushView('account-exists');
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
247
|
if (connectedWallets.length && authMode === 'connect-only') {
|
|
@@ -253,12 +253,12 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
253
253
|
logger.logger.warn('Verification failed, changing to connect-only');
|
|
254
254
|
// verification failed for unknown reason, set authmode to connect-only and show wallet list
|
|
255
255
|
setAuthMode('connect-only');
|
|
256
|
-
|
|
256
|
+
pushView('wallet-list');
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
else {
|
|
260
260
|
handleDisconnectWallet({ walletConnector });
|
|
261
|
-
|
|
261
|
+
clearStackAndPushInitialView();
|
|
262
262
|
}
|
|
263
263
|
logger.logger.error(e);
|
|
264
264
|
if (debugError) {
|
|
@@ -102,7 +102,7 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
102
102
|
const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, }) => {
|
|
103
103
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
104
104
|
const { setDeniedAddress, setDeniedOauthProvider } = useAccessDeniedContext();
|
|
105
|
-
const {
|
|
105
|
+
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
106
106
|
const { setErrorMessage, setError } = useErrorContext();
|
|
107
107
|
const { multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setShowAuthFlow, siweStatement, connectedWallets, authMode, user, setAuthMode, removeConnectedWalletsInfo, events, primaryWallet, enableConnectOnlyFallback, selectedWalletConnector, } = useInternalDynamicContext();
|
|
108
108
|
const { addedWalletsIds } = useInternalUserWallets();
|
|
@@ -165,11 +165,11 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
165
165
|
// This is a special case where the user is trying to link a wallet
|
|
166
166
|
// and the wallet is already linked and we don't want to kill the session.
|
|
167
167
|
setShowAuthFlow(true);
|
|
168
|
-
|
|
168
|
+
pushView('wallet-used');
|
|
169
169
|
setIsSingleWalletAccount(false);
|
|
170
170
|
if (e.code === 'reassign_wallet_error') {
|
|
171
171
|
if ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.preventOrphanedAccounts) {
|
|
172
|
-
|
|
172
|
+
pushView('wallet-cannot-be-transferred');
|
|
173
173
|
}
|
|
174
174
|
setIsSingleWalletAccount(true);
|
|
175
175
|
}
|
|
@@ -195,7 +195,7 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
195
195
|
type: 'wallet',
|
|
196
196
|
}, { error: e });
|
|
197
197
|
if (e instanceof EmbeddedWalletExistsError) {
|
|
198
|
-
|
|
198
|
+
pushView('embedded-wallet-exists');
|
|
199
199
|
setShowAuthFlow(true);
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
@@ -204,24 +204,24 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
204
204
|
return handleWalletUsedError(e);
|
|
205
205
|
}
|
|
206
206
|
if (e instanceof MergeAccountsConfirmationError) {
|
|
207
|
-
|
|
207
|
+
pushView('merge-user-accounts', Object.assign({}, e));
|
|
208
208
|
setShowAuthFlow(true);
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
if (e instanceof ChainalysisError) {
|
|
212
212
|
handleDisconnectWallet({ walletConnector });
|
|
213
213
|
setDeniedAddress(address);
|
|
214
|
-
|
|
214
|
+
pushView('chainalysis-blocked-wallet');
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
217
|
if (e instanceof GateBlockedError) {
|
|
218
218
|
handleDisconnectWallet({ walletConnector });
|
|
219
219
|
setDeniedAddress(address);
|
|
220
|
-
|
|
220
|
+
pushView('gate-blocked-wallet');
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
if (e instanceof SandboxMaximumThresholdReachedError) {
|
|
224
|
-
|
|
224
|
+
pushView('sandbox-maximum-threshold-reached');
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
227
|
if (e instanceof NoAccessError) {
|
|
@@ -231,13 +231,13 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
231
231
|
if (isSocialWalletConnector(walletConnector)) {
|
|
232
232
|
setDeniedOauthProvider(oauth === null || oauth === void 0 ? void 0 : oauth.provider);
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
pushView('no-access');
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
if (e instanceof AccountExistsError) {
|
|
238
238
|
handleDisconnectWallet({ walletConnector });
|
|
239
239
|
setExistentAccountData(e.errorPayload);
|
|
240
|
-
|
|
240
|
+
pushView('account-exists');
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
if (connectedWallets.length && authMode === 'connect-only') {
|
|
@@ -249,12 +249,12 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
249
249
|
logger.warn('Verification failed, changing to connect-only');
|
|
250
250
|
// verification failed for unknown reason, set authmode to connect-only and show wallet list
|
|
251
251
|
setAuthMode('connect-only');
|
|
252
|
-
|
|
252
|
+
pushView('wallet-list');
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
255
|
else {
|
|
256
256
|
handleDisconnectWallet({ walletConnector });
|
|
257
|
-
|
|
257
|
+
clearStackAndPushInitialView();
|
|
258
258
|
}
|
|
259
259
|
logger.error(e);
|
|
260
260
|
if (debugError) {
|
package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs
CHANGED
|
@@ -98,7 +98,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
98
98
|
const { setMultiWalletWidgetState, setShowAuthFlow, setSelectedWalletConnectorKey, walletConnectorOptions, setQrcodeUri, setDesktopUri, user, linkedWallets, setLegacyIsVerifying, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
99
|
const { mockedSDK } = MockContext.useMockContext();
|
|
100
100
|
const { setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
101
|
-
const {
|
|
101
|
+
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
102
102
|
const handleCustodialWalletClick = (walletConnector) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
103
103
|
logger.logger.debug('handleCustodialWalletClick', walletConnector);
|
|
104
104
|
const twoStepAuthentication = requiresTwoStepAuthentication.requiresTwoStepAuthentication(walletConnector);
|
|
@@ -133,7 +133,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
133
133
|
const attemptConnection = () => {
|
|
134
134
|
onConnectOnly({ shouldShowPendingConnectView: false, walletConnector });
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
pushView('mobile-wallet-redirect-view', { onRetry: attemptConnection });
|
|
137
137
|
attemptConnection();
|
|
138
138
|
});
|
|
139
139
|
const handleInstalledExtensionClick = (walletConnector) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -145,7 +145,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
145
145
|
logger.logger.debug('handleUninstalledClick', walletConnector);
|
|
146
146
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
147
147
|
if (!walletConnector.canConnectViaQrCode) {
|
|
148
|
-
|
|
148
|
+
pushView('no-qr-not-installed');
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
onQrCodeConnect({
|
|
@@ -159,7 +159,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
159
159
|
},
|
|
160
160
|
walletConnector,
|
|
161
161
|
});
|
|
162
|
-
|
|
162
|
+
pushView('qr-code');
|
|
163
163
|
}
|
|
164
164
|
setError(undefined);
|
|
165
165
|
});
|
|
@@ -224,13 +224,13 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
224
224
|
if (authMode !== 'connect-only' && isMetamask) {
|
|
225
225
|
try {
|
|
226
226
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
227
|
-
|
|
227
|
+
pushView('pending-connect');
|
|
228
228
|
yield walletConnector.chooseAccountsToConnect();
|
|
229
229
|
}
|
|
230
230
|
catch (error) {
|
|
231
231
|
if (error instanceof utils.UserRejectedRequestError) {
|
|
232
232
|
setErrorMessage('connection_rejected');
|
|
233
|
-
|
|
233
|
+
clearStackAndPushInitialView();
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
@@ -248,7 +248,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
248
248
|
else if (utils.isMobile()) {
|
|
249
249
|
// mobile wallets
|
|
250
250
|
if (walletConnector.key === 'walletconnect') {
|
|
251
|
-
|
|
251
|
+
pushView('wallet-connect-mobile-wallets-list');
|
|
252
252
|
}
|
|
253
253
|
else {
|
|
254
254
|
handleMobileWalletClick(walletConnector);
|
|
@@ -94,7 +94,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
94
94
|
const { setMultiWalletWidgetState, setShowAuthFlow, setSelectedWalletConnectorKey, walletConnectorOptions, setQrcodeUri, setDesktopUri, user, linkedWallets, setLegacyIsVerifying, authMode, } = useInternalDynamicContext();
|
|
95
95
|
const { mockedSDK } = useMockContext();
|
|
96
96
|
const { setError, setErrorMessage } = useErrorContext();
|
|
97
|
-
const {
|
|
97
|
+
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
98
98
|
const handleCustodialWalletClick = (walletConnector) => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
99
|
logger.debug('handleCustodialWalletClick', walletConnector);
|
|
100
100
|
const twoStepAuthentication = requiresTwoStepAuthentication(walletConnector);
|
|
@@ -129,7 +129,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
129
129
|
const attemptConnection = () => {
|
|
130
130
|
onConnectOnly({ shouldShowPendingConnectView: false, walletConnector });
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
pushView('mobile-wallet-redirect-view', { onRetry: attemptConnection });
|
|
133
133
|
attemptConnection();
|
|
134
134
|
});
|
|
135
135
|
const handleInstalledExtensionClick = (walletConnector) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -141,7 +141,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
141
141
|
logger.debug('handleUninstalledClick', walletConnector);
|
|
142
142
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
143
143
|
if (!walletConnector.canConnectViaQrCode) {
|
|
144
|
-
|
|
144
|
+
pushView('no-qr-not-installed');
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
onQrCodeConnect({
|
|
@@ -155,7 +155,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
155
155
|
},
|
|
156
156
|
walletConnector,
|
|
157
157
|
});
|
|
158
|
-
|
|
158
|
+
pushView('qr-code');
|
|
159
159
|
}
|
|
160
160
|
setError(undefined);
|
|
161
161
|
});
|
|
@@ -220,13 +220,13 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
220
220
|
if (authMode !== 'connect-only' && isMetamask) {
|
|
221
221
|
try {
|
|
222
222
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
223
|
-
|
|
223
|
+
pushView('pending-connect');
|
|
224
224
|
yield walletConnector.chooseAccountsToConnect();
|
|
225
225
|
}
|
|
226
226
|
catch (error) {
|
|
227
227
|
if (error instanceof UserRejectedRequestError) {
|
|
228
228
|
setErrorMessage('connection_rejected');
|
|
229
|
-
|
|
229
|
+
clearStackAndPushInitialView();
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -244,7 +244,7 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
244
244
|
else if (isMobile()) {
|
|
245
245
|
// mobile wallets
|
|
246
246
|
if (walletConnector.key === 'walletconnect') {
|
|
247
|
-
|
|
247
|
+
pushView('wallet-connect-mobile-wallets-list');
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
250
|
handleMobileWalletClick(walletConnector);
|
|
@@ -95,10 +95,10 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
95
95
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
96
96
|
|
|
97
97
|
const useWalletItemActions = () => {
|
|
98
|
+
const { setMultiWalletWidgetState, authMode } = useInternalDynamicContext.useInternalDynamicContext();
|
|
98
99
|
const { onlyConnectUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
99
100
|
const connectAndSignWallet = useConnectAndSign.useConnectAndSign();
|
|
100
|
-
const {
|
|
101
|
-
const { setView } = ViewContext.useViewContext();
|
|
101
|
+
const { pushView } = ViewContext.useViewContext();
|
|
102
102
|
return useHandleWalletItem.useHandleWalletItem({
|
|
103
103
|
allowAlreadyConnectedWallet: false,
|
|
104
104
|
onConnectOnly: onlyConnectUser,
|
|
@@ -111,11 +111,11 @@ const useWalletItemActions = () => {
|
|
|
111
111
|
else {
|
|
112
112
|
setMultiWalletWidgetState('awaiting_signature', undefined, 'linking_new_wallet');
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
pushView('pending-signature');
|
|
115
115
|
}),
|
|
116
116
|
onInstalledExtension: (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ walletConnector }) {
|
|
117
117
|
if (authMode === 'connect-only') {
|
|
118
|
-
|
|
118
|
+
pushView('pending-connect');
|
|
119
119
|
onlyConnectUser({ walletConnector });
|
|
120
120
|
}
|
|
121
121
|
else {
|
|
@@ -91,10 +91,10 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
91
91
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
92
92
|
|
|
93
93
|
const useWalletItemActions = () => {
|
|
94
|
+
const { setMultiWalletWidgetState, authMode } = useInternalDynamicContext();
|
|
94
95
|
const { onlyConnectUser } = useConnectAndSignSplitSteps();
|
|
95
96
|
const connectAndSignWallet = useConnectAndSign();
|
|
96
|
-
const {
|
|
97
|
-
const { setView } = useViewContext();
|
|
97
|
+
const { pushView } = useViewContext();
|
|
98
98
|
return useHandleWalletItem({
|
|
99
99
|
allowAlreadyConnectedWallet: false,
|
|
100
100
|
onConnectOnly: onlyConnectUser,
|
|
@@ -107,11 +107,11 @@ const useWalletItemActions = () => {
|
|
|
107
107
|
else {
|
|
108
108
|
setMultiWalletWidgetState('awaiting_signature', undefined, 'linking_new_wallet');
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
pushView('pending-signature');
|
|
111
111
|
}),
|
|
112
112
|
onInstalledExtension: (_b) => __awaiter(void 0, [_b], void 0, function* ({ walletConnector }) {
|
|
113
113
|
if (authMode === 'connect-only') {
|
|
114
|
-
|
|
114
|
+
pushView('pending-connect');
|
|
115
115
|
onlyConnectUser({ walletConnector });
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
@@ -106,7 +106,7 @@ const embeddedWalletsKeys = [
|
|
|
106
106
|
const useWalletOptions = () => {
|
|
107
107
|
const { walletConnectorOptions, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
108
108
|
const walletGroups = walletOptions.useWalletGroups();
|
|
109
|
-
const {
|
|
109
|
+
const { pushView } = ViewContext.useViewContext();
|
|
110
110
|
const { navigateToWalletGroup } = WalletGroupContext.useWalletGroupContext();
|
|
111
111
|
const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
|
|
112
112
|
const getFilteredWalletOptions = React.useCallback((filter) => {
|
|
@@ -143,7 +143,7 @@ const useWalletOptions = () => {
|
|
|
143
143
|
}
|
|
144
144
|
else if (walletConnectorCore.isHardwareWalletConnector(walletOption.walletConnector) &&
|
|
145
145
|
walletOption.walletConnector.canConnectWithHardwareWallet()) {
|
|
146
|
-
|
|
146
|
+
pushView('select-hardware-wallet', {
|
|
147
147
|
onSelectWallet: handleWalletItemClick,
|
|
148
148
|
wallet: walletOption,
|
|
149
149
|
});
|
|
@@ -156,7 +156,7 @@ const useWalletOptions = () => {
|
|
|
156
156
|
handleWalletItemClick,
|
|
157
157
|
navigateToWalletGroup,
|
|
158
158
|
setShowAuthFlow,
|
|
159
|
-
|
|
159
|
+
pushView,
|
|
160
160
|
walletConnectorOptions,
|
|
161
161
|
walletGroups,
|
|
162
162
|
]);
|
|
@@ -102,7 +102,7 @@ const embeddedWalletsKeys = [
|
|
|
102
102
|
const useWalletOptions = () => {
|
|
103
103
|
const { walletConnectorOptions, setShowAuthFlow } = useInternalDynamicContext();
|
|
104
104
|
const walletGroups = useWalletGroups();
|
|
105
|
-
const {
|
|
105
|
+
const { pushView } = useViewContext();
|
|
106
106
|
const { navigateToWalletGroup } = useWalletGroupContext();
|
|
107
107
|
const { handleWalletItemClick } = useWalletItemActions();
|
|
108
108
|
const getFilteredWalletOptions = useCallback((filter) => {
|
|
@@ -139,7 +139,7 @@ const useWalletOptions = () => {
|
|
|
139
139
|
}
|
|
140
140
|
else if (isHardwareWalletConnector(walletOption.walletConnector) &&
|
|
141
141
|
walletOption.walletConnector.canConnectWithHardwareWallet()) {
|
|
142
|
-
|
|
142
|
+
pushView('select-hardware-wallet', {
|
|
143
143
|
onSelectWallet: handleWalletItemClick,
|
|
144
144
|
wallet: walletOption,
|
|
145
145
|
});
|
|
@@ -152,7 +152,7 @@ const useWalletOptions = () => {
|
|
|
152
152
|
handleWalletItemClick,
|
|
153
153
|
navigateToWalletGroup,
|
|
154
154
|
setShowAuthFlow,
|
|
155
|
-
|
|
155
|
+
pushView,
|
|
156
156
|
walletConnectorOptions,
|
|
157
157
|
walletGroups,
|
|
158
158
|
]);
|
|
@@ -95,7 +95,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
95
95
|
|
|
96
96
|
const BridgeNextWalletConnectionView = () => {
|
|
97
97
|
const { setShowAuthFlow, bridgeChainsToConnect } = useInternalDynamicContext.useInternalDynamicContext();
|
|
98
|
-
const {
|
|
98
|
+
const { pushView } = ViewContext.useViewContext();
|
|
99
99
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)) {
|
|
100
100
|
throw new utils.DynamicError('No wallets to connect');
|
|
101
101
|
}
|
|
@@ -106,7 +106,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
106
106
|
if (!chainInfo) {
|
|
107
107
|
throw new utils.DynamicError('No chain info found for chain', chain);
|
|
108
108
|
}
|
|
109
|
-
return (jsxRuntime.jsx(BridgeNextWalletToConnectLayout.BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsxRuntime.jsx(ChainIcon, {}), onClickAction: () =>
|
|
109
|
+
return (jsxRuntime.jsx(BridgeNextWalletToConnectLayout.BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsxRuntime.jsx(ChainIcon, {}), onClickAction: () => pushView('wallet-list'), onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }) }));
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
exports.BridgeNextWalletConnectionView = BridgeNextWalletConnectionView;
|
|
@@ -91,7 +91,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
91
91
|
|
|
92
92
|
const BridgeNextWalletConnectionView = () => {
|
|
93
93
|
const { setShowAuthFlow, bridgeChainsToConnect } = useInternalDynamicContext();
|
|
94
|
-
const {
|
|
94
|
+
const { pushView } = useViewContext();
|
|
95
95
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)) {
|
|
96
96
|
throw new DynamicError('No wallets to connect');
|
|
97
97
|
}
|
|
@@ -102,7 +102,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
102
102
|
if (!chainInfo) {
|
|
103
103
|
throw new DynamicError('No chain info found for chain', chain);
|
|
104
104
|
}
|
|
105
|
-
return (jsx(BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsx(ChainIcon, {}), onClickAction: () =>
|
|
105
|
+
return (jsx(BridgeNextWalletToConnectLayout, { chainName: chainInfo.blockchainName, chainIcon: jsx(ChainIcon, {}), onClickAction: () => pushView('wallet-list'), onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }) }));
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
export { BridgeNextWalletConnectionView };
|
|
@@ -96,7 +96,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
96
96
|
const isChainInfoDefined = (chainInfo) => chainInfo !== undefined;
|
|
97
97
|
const BridgeWelcomeView = () => {
|
|
98
98
|
const { appName, bridgeChains = [], setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
|
-
const {
|
|
99
|
+
const { pushView } = ViewContext.useViewContext();
|
|
100
100
|
const { t } = reactI18next.useTranslation();
|
|
101
101
|
const body = React.useMemo(() => {
|
|
102
102
|
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
@@ -120,7 +120,7 @@ const BridgeWelcomeView = () => {
|
|
|
120
120
|
return undefined;
|
|
121
121
|
})
|
|
122
122
|
.filter(isChainInfoDefined), [bridgeChains]);
|
|
123
|
-
return (jsxRuntime.jsx(BridgeWelcomeLayout.BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () =>
|
|
123
|
+
return (jsxRuntime.jsx(BridgeWelcomeLayout.BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () => pushView('wallet-list') }));
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
exports.BridgeWelcomeView = BridgeWelcomeView;
|
|
@@ -92,7 +92,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
92
92
|
const isChainInfoDefined = (chainInfo) => chainInfo !== undefined;
|
|
93
93
|
const BridgeWelcomeView = () => {
|
|
94
94
|
const { appName, bridgeChains = [], setShowAuthFlow, } = useInternalDynamicContext();
|
|
95
|
-
const {
|
|
95
|
+
const { pushView } = useViewContext();
|
|
96
96
|
const { t } = useTranslation();
|
|
97
97
|
const body = useMemo(() => {
|
|
98
98
|
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
@@ -116,7 +116,7 @@ const BridgeWelcomeView = () => {
|
|
|
116
116
|
return undefined;
|
|
117
117
|
})
|
|
118
118
|
.filter(isChainInfoDefined), [bridgeChains]);
|
|
119
|
-
return (jsx(BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () =>
|
|
119
|
+
return (jsx(BridgeWelcomeLayout, { onClickClose: () => setShowAuthFlow(false, { emitCancelAuth: true }), title: t('dyn_bridge.welcome_view.title', { appName }), copykey: 'dyn_bridge.welcome_view.title', body: body, chains: chains, actionButtonText: t('dyn_bridge.welcome_view.button'), onClickAction: () => pushView('wallet-list') }));
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
export { BridgeWelcomeView };
|
|
@@ -100,13 +100,13 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
100
100
|
|
|
101
101
|
const CoinbaseMPCClaimIntro = () => {
|
|
102
102
|
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
103
|
-
const {
|
|
103
|
+
const { pushView } = ViewContext.useViewContext();
|
|
104
104
|
const { t } = reactI18next.useTranslation();
|
|
105
105
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowAuthFlow(false), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
106
106
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_create_password.intro.title', children: t('dyn_create_password.intro.title') }) }), jsxRuntime.jsx("div", { className: 'mpc-claim-intro', children: jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__description', children: jsxRuntime.jsx(walletClaimHero.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'confirm-password-description', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_create_password.intro.description', children: t('dyn_create_password.intro.description.title') }) }), jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card', children: [jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsxRuntime.jsx(lock.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.additional_protection.title', children: t('dyn_create_password.intro.description.additional_protection.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.additional_protection.description', children: t('dyn_create_password.intro.description.additional_protection.description') })] })] }), jsxRuntime.jsxs("div", { className: 'mpc-claim-intro__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'mpc-claim-intro__body__card__icon', children: jsxRuntime.jsx(altKey.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_create_password.intro.description.restore_access.title', children: t('dyn_create_password.intro.description.restore_access.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_create_password.intro.description.restore_access.description', children: t('dyn_create_password.intro.description.restore_access.description') })] })] })] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
|
|
107
107
|
color: 'inherit',
|
|
108
108
|
}, onClick: () => {
|
|
109
|
-
|
|
109
|
+
pushView('create-password-view', {
|
|
110
110
|
notCalledFromWalletUtils: true,
|
|
111
111
|
});
|
|
112
112
|
}, copykey: 'dyn_create_password.intro.continue', children: t('dyn_create_password.intro.continue') })] }) })] }));
|