@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
|
@@ -98,7 +98,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
98
98
|
var useInternalDynamicContext = require('../../../DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
99
99
|
|
|
100
100
|
const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
101
|
-
const {
|
|
101
|
+
const { clearStackAndPush } = ViewContext.useViewContext();
|
|
102
102
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
103
103
|
const [socialStorageItem, setSocialStorageItem] = React.useState(null);
|
|
104
104
|
const { sdkHasLoaded, setShowAuthFlow, isRenderingEmbeddedAuthFlow, setShowDynamicUserProfile, redirectUrl, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -106,12 +106,17 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
106
106
|
const updateInterfaceStateForSignIn = React.useCallback((socialStorageItem) => {
|
|
107
107
|
const socialSignInProvider = getSocialSignInProviderForProviderEnum.getSocialSignInProviderForProviderEnum(socialStorageItem.provider);
|
|
108
108
|
setSocialProvider(socialSignInProvider);
|
|
109
|
-
|
|
109
|
+
clearStackAndPush('social-redirect-view');
|
|
110
110
|
// Only open the auth flow when the embedded widget is not rendered
|
|
111
111
|
if (!isRenderingEmbeddedAuthFlow.current) {
|
|
112
112
|
setShowAuthFlow(true);
|
|
113
113
|
}
|
|
114
|
-
}, [
|
|
114
|
+
}, [
|
|
115
|
+
setSocialProvider,
|
|
116
|
+
clearStackAndPush,
|
|
117
|
+
isRenderingEmbeddedAuthFlow,
|
|
118
|
+
setShowAuthFlow,
|
|
119
|
+
]);
|
|
115
120
|
const updateInterfaceStateForLink = React.useCallback(() => {
|
|
116
121
|
setDynamicWidgetView('profile');
|
|
117
122
|
setShowDynamicUserProfile(true);
|
|
@@ -94,7 +94,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
94
94
|
import { useInternalDynamicContext } from '../../../DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
95
95
|
|
|
96
96
|
const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
97
|
-
const {
|
|
97
|
+
const { clearStackAndPush } = useViewContext();
|
|
98
98
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
99
99
|
const [socialStorageItem, setSocialStorageItem] = useState(null);
|
|
100
100
|
const { sdkHasLoaded, setShowAuthFlow, isRenderingEmbeddedAuthFlow, setShowDynamicUserProfile, redirectUrl, } = useInternalDynamicContext();
|
|
@@ -102,12 +102,17 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
102
102
|
const updateInterfaceStateForSignIn = useCallback((socialStorageItem) => {
|
|
103
103
|
const socialSignInProvider = getSocialSignInProviderForProviderEnum(socialStorageItem.provider);
|
|
104
104
|
setSocialProvider(socialSignInProvider);
|
|
105
|
-
|
|
105
|
+
clearStackAndPush('social-redirect-view');
|
|
106
106
|
// Only open the auth flow when the embedded widget is not rendered
|
|
107
107
|
if (!isRenderingEmbeddedAuthFlow.current) {
|
|
108
108
|
setShowAuthFlow(true);
|
|
109
109
|
}
|
|
110
|
-
}, [
|
|
110
|
+
}, [
|
|
111
|
+
setSocialProvider,
|
|
112
|
+
clearStackAndPush,
|
|
113
|
+
isRenderingEmbeddedAuthFlow,
|
|
114
|
+
setShowAuthFlow,
|
|
115
|
+
]);
|
|
111
116
|
const updateInterfaceStateForLink = useCallback(() => {
|
|
112
117
|
setDynamicWidgetView('profile');
|
|
113
118
|
setShowDynamicUserProfile(true);
|
|
@@ -56,10 +56,8 @@ const ViewContextProvider = ({ children, initialViewType }) => {
|
|
|
56
56
|
clearStackAndPush,
|
|
57
57
|
clearStackAndPushInitialView,
|
|
58
58
|
goBack,
|
|
59
|
-
goToInitialView: clearStackAndPushInitialView,
|
|
60
59
|
pushView,
|
|
61
60
|
replaceView,
|
|
62
|
-
setView: pushView,
|
|
63
61
|
stack,
|
|
64
62
|
view,
|
|
65
63
|
}), [
|
|
@@ -2,12 +2,6 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ViewSetter, ViewState, ViewType } from './types';
|
|
3
3
|
export type ViewContextProps = {
|
|
4
4
|
/**
|
|
5
|
-
* @deprecated Instead, use either:
|
|
6
|
-
* - pushView: if you want "goBack" to go back to current view after this navigation
|
|
7
|
-
* - replaceView: if you want "goBack" to go back to the currently previous view after this navigation
|
|
8
|
-
* - clearStackAndPush: if you want the view stack to be reset and this new view be the only one in the stack
|
|
9
|
-
*/
|
|
10
|
-
setView: ViewSetter;
|
|
11
5
|
/**
|
|
12
6
|
* Replaces the top view of the stack with a new view
|
|
13
7
|
*/
|
|
@@ -20,10 +14,6 @@ export type ViewContextProps = {
|
|
|
20
14
|
* Current view at the top of the stack, or the initial view if the stack is empty
|
|
21
15
|
*/
|
|
22
16
|
view: ViewState<ViewType>;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated use clearStackAndPushInitialView instead
|
|
25
|
-
*/
|
|
26
|
-
goToInitialView: () => void;
|
|
27
17
|
/**
|
|
28
18
|
* Pops the current view from the stack, going back to the previous view
|
|
29
19
|
*/
|
|
@@ -52,10 +52,8 @@ const ViewContextProvider = ({ children, initialViewType }) => {
|
|
|
52
52
|
clearStackAndPush,
|
|
53
53
|
clearStackAndPushInitialView,
|
|
54
54
|
goBack,
|
|
55
|
-
goToInitialView: clearStackAndPushInitialView,
|
|
56
55
|
pushView,
|
|
57
56
|
replaceView,
|
|
58
|
-
setView: pushView,
|
|
59
57
|
stack,
|
|
60
58
|
view,
|
|
61
59
|
}), [
|
|
@@ -23,7 +23,7 @@ const useWalletGroupContext = () => {
|
|
|
23
23
|
};
|
|
24
24
|
const WalletGroupContextProvider = ({ children, }) => {
|
|
25
25
|
const [selectedWalletGroup, setSelectedWalletGroup] = React__default["default"].useState();
|
|
26
|
-
const {
|
|
26
|
+
const { pushView } = ViewContext.useViewContext();
|
|
27
27
|
const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
|
|
28
28
|
const navigateToWalletGroup = React__default["default"].useCallback((walletGroup, { onSelectWallet } = {}) => {
|
|
29
29
|
setSelectedWalletGroup(walletGroup);
|
|
@@ -35,10 +35,10 @@ const WalletGroupContextProvider = ({ children, }) => {
|
|
|
35
35
|
const view = walletGroupType
|
|
36
36
|
? mapGroupTypeToView[walletGroupType]
|
|
37
37
|
: mapGroupTypeToView['multi-chain'];
|
|
38
|
-
|
|
38
|
+
pushView(view, {
|
|
39
39
|
onSelectWallet: onSelectWallet !== null && onSelectWallet !== void 0 ? onSelectWallet : handleWalletItemClick,
|
|
40
40
|
});
|
|
41
|
-
}, [handleWalletItemClick,
|
|
41
|
+
}, [handleWalletItemClick, pushView]);
|
|
42
42
|
const contextValue = {
|
|
43
43
|
navigateToWalletGroup,
|
|
44
44
|
selectedWalletGroup,
|
|
@@ -15,7 +15,7 @@ const useWalletGroupContext = () => {
|
|
|
15
15
|
};
|
|
16
16
|
const WalletGroupContextProvider = ({ children, }) => {
|
|
17
17
|
const [selectedWalletGroup, setSelectedWalletGroup] = React__default.useState();
|
|
18
|
-
const {
|
|
18
|
+
const { pushView } = useViewContext();
|
|
19
19
|
const { handleWalletItemClick } = useWalletItemActions();
|
|
20
20
|
const navigateToWalletGroup = React__default.useCallback((walletGroup, { onSelectWallet } = {}) => {
|
|
21
21
|
setSelectedWalletGroup(walletGroup);
|
|
@@ -27,10 +27,10 @@ const WalletGroupContextProvider = ({ children, }) => {
|
|
|
27
27
|
const view = walletGroupType
|
|
28
28
|
? mapGroupTypeToView[walletGroupType]
|
|
29
29
|
: mapGroupTypeToView['multi-chain'];
|
|
30
|
-
|
|
30
|
+
pushView(view, {
|
|
31
31
|
onSelectWallet: onSelectWallet !== null && onSelectWallet !== void 0 ? onSelectWallet : handleWalletItemClick,
|
|
32
32
|
});
|
|
33
|
-
}, [handleWalletItemClick,
|
|
33
|
+
}, [handleWalletItemClick, pushView]);
|
|
34
34
|
const contextValue = {
|
|
35
35
|
navigateToWalletGroup,
|
|
36
36
|
selectedWalletGroup,
|
|
@@ -121,7 +121,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
121
121
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
122
122
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
123
123
|
const { setShowAuthFlow, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
124
|
-
const {
|
|
124
|
+
const { pushView } = ViewContext.useViewContext();
|
|
125
125
|
const { userNeedsCrossDomainPasskey } = PasskeyContext.usePasskeyContext();
|
|
126
126
|
const { t } = reactI18next.useTranslation();
|
|
127
127
|
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
@@ -148,11 +148,11 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
148
148
|
}
|
|
149
149
|
catch (e) {
|
|
150
150
|
if (e instanceof utils.AccessBlockedError) {
|
|
151
|
-
|
|
151
|
+
pushView('access-blocked');
|
|
152
152
|
}
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
}, [signMessageError,
|
|
155
|
+
}, [signMessageError, pushView]);
|
|
156
156
|
const handleOnModalUnmount = React.useCallback(() => {
|
|
157
157
|
if (signedMessage) {
|
|
158
158
|
return onSignMessage(signedMessage);
|
|
@@ -176,7 +176,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
if (isTurnkeyWallet && userNeedsCrossDomainPasskey) {
|
|
179
|
-
|
|
179
|
+
pushView('passkey-new-domain-detected');
|
|
180
180
|
setShowAuthFlow(true, {
|
|
181
181
|
ignoreIfIsEmbeddedWidget: false,
|
|
182
182
|
performMultiWalletChecks: false,
|
|
@@ -117,7 +117,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
117
117
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery();
|
|
118
118
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
119
119
|
const { setShowAuthFlow, primaryWallet } = useInternalDynamicContext();
|
|
120
|
-
const {
|
|
120
|
+
const { pushView } = useViewContext();
|
|
121
121
|
const { userNeedsCrossDomainPasskey } = usePasskeyContext();
|
|
122
122
|
const { t } = useTranslation();
|
|
123
123
|
const { getEOAWallet } = useSmartWallets();
|
|
@@ -144,11 +144,11 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
144
144
|
}
|
|
145
145
|
catch (e) {
|
|
146
146
|
if (e instanceof AccessBlockedError) {
|
|
147
|
-
|
|
147
|
+
pushView('access-blocked');
|
|
148
148
|
}
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
}, [signMessageError,
|
|
151
|
+
}, [signMessageError, pushView]);
|
|
152
152
|
const handleOnModalUnmount = useCallback(() => {
|
|
153
153
|
if (signedMessage) {
|
|
154
154
|
return onSignMessage(signedMessage);
|
|
@@ -172,7 +172,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
if (isTurnkeyWallet && userNeedsCrossDomainPasskey) {
|
|
175
|
-
|
|
175
|
+
pushView('passkey-new-domain-detected');
|
|
176
176
|
setShowAuthFlow(true, {
|
|
177
177
|
ignoreIfIsEmbeddedWidget: false,
|
|
178
178
|
performMultiWalletChecks: false,
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs
CHANGED
|
@@ -39,6 +39,10 @@ const groupWalletOptions = (walletGroups, walletOptionList) => {
|
|
|
39
39
|
return output.push(currentWalletOption);
|
|
40
40
|
}
|
|
41
41
|
const walletGroupData = walletGroups[currentWalletOption.group];
|
|
42
|
+
// If for some reason this is undefined, ignore it
|
|
43
|
+
if (!walletGroupData) {
|
|
44
|
+
return output.push(currentWalletOption);
|
|
45
|
+
}
|
|
42
46
|
const walletGroup = {
|
|
43
47
|
groupedWallets: [currentWalletOption],
|
|
44
48
|
key: walletGroupData.key,
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js
CHANGED
|
@@ -35,6 +35,10 @@ const groupWalletOptions = (walletGroups, walletOptionList) => {
|
|
|
35
35
|
return output.push(currentWalletOption);
|
|
36
36
|
}
|
|
37
37
|
const walletGroupData = walletGroups[currentWalletOption.group];
|
|
38
|
+
// If for some reason this is undefined, ignore it
|
|
39
|
+
if (!walletGroupData) {
|
|
40
|
+
return output.push(currentWalletOption);
|
|
41
|
+
}
|
|
38
42
|
const walletGroup = {
|
|
39
43
|
groupedWallets: [currentWalletOption],
|
|
40
44
|
key: walletGroupData.key,
|
|
@@ -7,7 +7,7 @@ var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var getWalletProvider = require('../../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
8
8
|
|
|
9
9
|
const specialCareWallets = ['bloctoevm', 'perawallet', 'metamaskstarknet'];
|
|
10
|
-
const showPendingConnectView = (walletConnector,
|
|
10
|
+
const showPendingConnectView = (walletConnector, pushView) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
11
|
const walletProvider = getWalletProvider.getWalletProvider(walletConnector);
|
|
12
12
|
// We don't want to show the pending connect view for qrCode and walletConnect
|
|
13
13
|
// They have their own view with qrCode so we don't need to show the pending connect view
|
|
@@ -19,13 +19,13 @@ const showPendingConnectView = (walletConnector, setView) => _tslib.__awaiter(vo
|
|
|
19
19
|
// bloctoevm and some other wallets works different as Justin mentioned in this commit:
|
|
20
20
|
// https://github.com/dynamic-labs/DynamicAuth/commit/57233d3620611bc91439f3d4587b8516f8d16f99
|
|
21
21
|
// It needs to show the connect view before getting connected accounts
|
|
22
|
-
|
|
22
|
+
pushView('pending-connect');
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
const connectedAccounts = yield walletConnector.getConnectedAccounts();
|
|
26
26
|
/* istanbul ignore else */
|
|
27
27
|
if (connectedAccounts.length === 0) {
|
|
28
|
-
|
|
28
|
+
pushView('pending-connect');
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
import { ViewType } from '../../../../context/ViewContext';
|
|
3
|
-
export declare const showPendingConnectView: (walletConnector: WalletConnector,
|
|
3
|
+
export declare const showPendingConnectView: (walletConnector: WalletConnector, pushView: (view: ViewType) => void) => Promise<void>;
|
|
@@ -3,7 +3,7 @@ import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { getWalletProvider } from '../../../functions/getWalletProvider/getWalletProvider.js';
|
|
4
4
|
|
|
5
5
|
const specialCareWallets = ['bloctoevm', 'perawallet', 'metamaskstarknet'];
|
|
6
|
-
const showPendingConnectView = (walletConnector,
|
|
6
|
+
const showPendingConnectView = (walletConnector, pushView) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7
7
|
const walletProvider = getWalletProvider(walletConnector);
|
|
8
8
|
// We don't want to show the pending connect view for qrCode and walletConnect
|
|
9
9
|
// They have their own view with qrCode so we don't need to show the pending connect view
|
|
@@ -15,13 +15,13 @@ const showPendingConnectView = (walletConnector, setView) => __awaiter(void 0, v
|
|
|
15
15
|
// bloctoevm and some other wallets works different as Justin mentioned in this commit:
|
|
16
16
|
// https://github.com/dynamic-labs/DynamicAuth/commit/57233d3620611bc91439f3d4587b8516f8d16f99
|
|
17
17
|
// It needs to show the connect view before getting connected accounts
|
|
18
|
-
|
|
18
|
+
pushView('pending-connect');
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
const connectedAccounts = yield walletConnector.getConnectedAccounts();
|
|
22
22
|
/* istanbul ignore else */
|
|
23
23
|
if (connectedAccounts.length === 0) {
|
|
24
|
-
|
|
24
|
+
pushView('pending-connect');
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
9
|
var CaptchaContext = require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
10
10
|
require('react');
|
|
11
11
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
@@ -99,7 +99,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
99
99
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
100
100
|
|
|
101
101
|
const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = true, } = {}) => {
|
|
102
|
-
const {
|
|
102
|
+
const { pushView, clearStackAndPushInitialView, replaceView } = ViewContext.useViewContext();
|
|
103
103
|
const { engageCaptcha, getCaptchaToken } = CaptchaContext.useCaptchaContext();
|
|
104
104
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
105
105
|
const { authMode, connectWallet, displaySiweStatement, environmentId, projectSettings, networkValidationMode, setIsSingleWalletAccount, user, walletUiUtils, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -130,18 +130,18 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
130
130
|
if (!userCancelled)
|
|
131
131
|
logger.logger.debug(err);
|
|
132
132
|
setErrorMessage((_a = err === null || err === void 0 ? void 0 : err.code) === null || _a === void 0 ? void 0 : _a.toString());
|
|
133
|
-
|
|
133
|
+
clearStackAndPushInitialView();
|
|
134
134
|
};
|
|
135
135
|
return (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
136
136
|
var _b;
|
|
137
137
|
try {
|
|
138
|
-
yield showPendingConnectView.showPendingConnectView(walletConnector,
|
|
138
|
+
yield showPendingConnectView.showPendingConnectView(walletConnector, pushView);
|
|
139
139
|
if (walletConnectorCore.isEmailWalletConnector(walletConnector)) {
|
|
140
140
|
if (walletConnectorCore.isEmailOTPWalletConnector(walletConnector)) {
|
|
141
|
-
|
|
141
|
+
pushView('email-wallet-otp-verification-view');
|
|
142
142
|
}
|
|
143
143
|
else if (!walletConnectorCore.isBloctoConnector(walletConnector)) {
|
|
144
|
-
|
|
144
|
+
pushView('wait-for-email-confirmation-view');
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
const connectionResult = yield connectWallet(walletConnector, getAddressOpts, {
|
|
@@ -160,9 +160,9 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
160
160
|
networkValidationMode === 'sign-in';
|
|
161
161
|
if (!usesSupportedNetwork && isNetworkValidationEnabledForSignIn) {
|
|
162
162
|
if (!isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
163
|
-
return
|
|
163
|
+
return pushView('network-not-supported-manual');
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return pushView('network-not-supported');
|
|
166
166
|
}
|
|
167
167
|
if (isConnectOnly.isConnectOnly(user, authMode)) {
|
|
168
168
|
utils.StorageService.setItem(localStorage.LAST_USED_WALLET, walletConnector.key);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { isEmailWalletConnector, isEmailOTPWalletConnector, isBloctoConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
import { StorageService } from '@dynamic-labs/utils';
|
|
4
|
+
import { isEmailWalletConnector, isEmailOTPWalletConnector, isBloctoConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { useCaptchaContext } from '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
@@ -95,7 +95,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
95
95
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
96
96
|
|
|
97
97
|
const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = true, } = {}) => {
|
|
98
|
-
const {
|
|
98
|
+
const { pushView, clearStackAndPushInitialView, replaceView } = useViewContext();
|
|
99
99
|
const { engageCaptcha, getCaptchaToken } = useCaptchaContext();
|
|
100
100
|
const { setErrorMessage } = useErrorContext();
|
|
101
101
|
const { authMode, connectWallet, displaySiweStatement, environmentId, projectSettings, networkValidationMode, setIsSingleWalletAccount, user, walletUiUtils, } = useInternalDynamicContext();
|
|
@@ -126,18 +126,18 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
126
126
|
if (!userCancelled)
|
|
127
127
|
logger.debug(err);
|
|
128
128
|
setErrorMessage((_a = err === null || err === void 0 ? void 0 : err.code) === null || _a === void 0 ? void 0 : _a.toString());
|
|
129
|
-
|
|
129
|
+
clearStackAndPushInitialView();
|
|
130
130
|
};
|
|
131
131
|
return (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
132
132
|
var _b;
|
|
133
133
|
try {
|
|
134
|
-
yield showPendingConnectView(walletConnector,
|
|
134
|
+
yield showPendingConnectView(walletConnector, pushView);
|
|
135
135
|
if (isEmailWalletConnector(walletConnector)) {
|
|
136
136
|
if (isEmailOTPWalletConnector(walletConnector)) {
|
|
137
|
-
|
|
137
|
+
pushView('email-wallet-otp-verification-view');
|
|
138
138
|
}
|
|
139
139
|
else if (!isBloctoConnector(walletConnector)) {
|
|
140
|
-
|
|
140
|
+
pushView('wait-for-email-confirmation-view');
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
const connectionResult = yield connectWallet(walletConnector, getAddressOpts, {
|
|
@@ -156,9 +156,9 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
156
156
|
networkValidationMode === 'sign-in';
|
|
157
157
|
if (!usesSupportedNetwork && isNetworkValidationEnabledForSignIn) {
|
|
158
158
|
if (!isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
159
|
-
return
|
|
159
|
+
return pushView('network-not-supported-manual');
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return pushView('network-not-supported');
|
|
162
162
|
}
|
|
163
163
|
if (isConnectOnly(user, authMode)) {
|
|
164
164
|
StorageService.setItem(LAST_USED_WALLET, walletConnector.key);
|
|
@@ -99,7 +99,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
99
99
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
100
100
|
|
|
101
101
|
const useConnectAndSignSplitSteps = () => {
|
|
102
|
-
const {
|
|
102
|
+
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
103
103
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
104
104
|
const { getCaptchaToken, engageCaptcha } = CaptchaContext.useCaptchaContext();
|
|
105
105
|
const { connectWallet, displaySiweStatement, projectSettings, environmentId, networkValidationMode, setIsSingleWalletAccount, setShowAuthFlow, user, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -120,7 +120,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
120
120
|
*/
|
|
121
121
|
if (err instanceof utils.MissingPublicAddressError && utils.isMobile())
|
|
122
122
|
return;
|
|
123
|
-
|
|
123
|
+
clearStackAndPushInitialView();
|
|
124
124
|
setErrorMessage((_a = err.code) !== null && _a !== void 0 ? _a : err.toString());
|
|
125
125
|
};
|
|
126
126
|
// This method is similar to useConnectAndSign, but it skips signing for now
|
|
@@ -130,7 +130,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
130
130
|
const onlyConnectUser = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, shouldShowPendingConnectView = true, }) {
|
|
131
131
|
var _b;
|
|
132
132
|
if (shouldShowPendingConnectView)
|
|
133
|
-
yield showPendingConnectView.showPendingConnectView(walletConnector,
|
|
133
|
+
yield showPendingConnectView.showPendingConnectView(walletConnector, pushView);
|
|
134
134
|
try {
|
|
135
135
|
yield connectWallet(walletConnector, getAddressOpts);
|
|
136
136
|
if (isConnectOnly.isConnectOnly(user, authMode)) {
|
|
@@ -143,13 +143,13 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
143
143
|
authMethod: 'wallet',
|
|
144
144
|
onCaptchaSuccess: (_captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
145
145
|
setShowAuthFlow(true);
|
|
146
|
-
|
|
146
|
+
pushView('pending-signature');
|
|
147
147
|
}),
|
|
148
148
|
});
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
setShowAuthFlow(true);
|
|
152
|
-
|
|
152
|
+
pushView('pending-signature');
|
|
153
153
|
}
|
|
154
154
|
catch (err) {
|
|
155
155
|
onErrorHandler(err);
|
|
@@ -173,9 +173,9 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
173
173
|
networkValidationMode === 'sign-in';
|
|
174
174
|
if (!usesSupportedNetwork && isNetworkValidationEnabledForSignIn) {
|
|
175
175
|
if (!isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
176
|
-
return
|
|
176
|
+
return pushView('network-not-supported-manual');
|
|
177
177
|
}
|
|
178
|
-
return
|
|
178
|
+
return pushView('network-not-supported');
|
|
179
179
|
}
|
|
180
180
|
yield verifyWallet({
|
|
181
181
|
captchaToken: getCaptchaToken(),
|
|
@@ -95,7 +95,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
95
95
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
96
96
|
|
|
97
97
|
const useConnectAndSignSplitSteps = () => {
|
|
98
|
-
const {
|
|
98
|
+
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
99
99
|
const { setErrorMessage } = useErrorContext();
|
|
100
100
|
const { getCaptchaToken, engageCaptcha } = useCaptchaContext();
|
|
101
101
|
const { connectWallet, displaySiweStatement, projectSettings, environmentId, networkValidationMode, setIsSingleWalletAccount, setShowAuthFlow, user, authMode, } = useInternalDynamicContext();
|
|
@@ -116,7 +116,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
116
116
|
*/
|
|
117
117
|
if (err instanceof MissingPublicAddressError && isMobile())
|
|
118
118
|
return;
|
|
119
|
-
|
|
119
|
+
clearStackAndPushInitialView();
|
|
120
120
|
setErrorMessage((_a = err.code) !== null && _a !== void 0 ? _a : err.toString());
|
|
121
121
|
};
|
|
122
122
|
// This method is similar to useConnectAndSign, but it skips signing for now
|
|
@@ -126,7 +126,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
126
126
|
const onlyConnectUser = (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, shouldShowPendingConnectView = true, }) {
|
|
127
127
|
var _b;
|
|
128
128
|
if (shouldShowPendingConnectView)
|
|
129
|
-
yield showPendingConnectView(walletConnector,
|
|
129
|
+
yield showPendingConnectView(walletConnector, pushView);
|
|
130
130
|
try {
|
|
131
131
|
yield connectWallet(walletConnector, getAddressOpts);
|
|
132
132
|
if (isConnectOnly(user, authMode)) {
|
|
@@ -139,13 +139,13 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
139
139
|
authMethod: 'wallet',
|
|
140
140
|
onCaptchaSuccess: (_captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
141
141
|
setShowAuthFlow(true);
|
|
142
|
-
|
|
142
|
+
pushView('pending-signature');
|
|
143
143
|
}),
|
|
144
144
|
});
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
setShowAuthFlow(true);
|
|
148
|
-
|
|
148
|
+
pushView('pending-signature');
|
|
149
149
|
}
|
|
150
150
|
catch (err) {
|
|
151
151
|
onErrorHandler(err);
|
|
@@ -169,9 +169,9 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
169
169
|
networkValidationMode === 'sign-in';
|
|
170
170
|
if (!usesSupportedNetwork && isNetworkValidationEnabledForSignIn) {
|
|
171
171
|
if (!isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
172
|
-
return
|
|
172
|
+
return pushView('network-not-supported-manual');
|
|
173
173
|
}
|
|
174
|
-
return
|
|
174
|
+
return pushView('network-not-supported');
|
|
175
175
|
}
|
|
176
176
|
yield verifyWallet({
|
|
177
177
|
captchaToken: getCaptchaToken(),
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.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
|
const useSignConnectOnlyUser = () => {
|
|
96
|
-
const {
|
|
96
|
+
const { pushView } = ViewContext.useViewContext();
|
|
97
97
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
98
98
|
const { getCaptchaToken } = CaptchaContext.useCaptchaContext();
|
|
99
99
|
const { connectWallet, displaySiweStatement, projectSettings, environmentId, setIsSingleWalletAccount, setShowAuthFlow, setSelectedWalletConnectorKey, walletUiUtils, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -114,7 +114,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
114
114
|
// We don't want to show the back button in the pending signature view
|
|
115
115
|
// because we don't want to go back to the wallet-list
|
|
116
116
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
117
|
-
|
|
117
|
+
pushView('pending-signature-without-back-button');
|
|
118
118
|
setShowAuthFlow(true);
|
|
119
119
|
// Wallet should be already connected at this point
|
|
120
120
|
// We just need to verify it
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.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
|
const useSignConnectOnlyUser = () => {
|
|
92
|
-
const {
|
|
92
|
+
const { pushView } = useViewContext();
|
|
93
93
|
const { setErrorMessage } = useErrorContext();
|
|
94
94
|
const { getCaptchaToken } = useCaptchaContext();
|
|
95
95
|
const { connectWallet, displaySiweStatement, projectSettings, environmentId, setIsSingleWalletAccount, setShowAuthFlow, setSelectedWalletConnectorKey, walletUiUtils, } = useInternalDynamicContext();
|
|
@@ -110,7 +110,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
110
110
|
// We don't want to show the back button in the pending signature view
|
|
111
111
|
// because we don't want to go back to the wallet-list
|
|
112
112
|
setSelectedWalletConnectorKey(walletConnector.key);
|
|
113
|
-
|
|
113
|
+
pushView('pending-signature-without-back-button');
|
|
114
114
|
setShowAuthFlow(true);
|
|
115
115
|
// Wallet should be already connected at this point
|
|
116
116
|
// We just need to verify it
|
|
@@ -97,7 +97,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
97
97
|
|
|
98
98
|
const useConnectedWalletsNetworkValidation = () => {
|
|
99
99
|
const { connectedWallets, selectedWalletConnector, setSelectedWalletConnectorKey, setShowAuthFlow, bridgeChainsToConnect, sdkHasLoaded, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
100
|
-
const {
|
|
100
|
+
const { pushView } = ViewContext.useViewContext();
|
|
101
101
|
const isLoggedIn = useIsLoggedIn.useIsLoggedIn();
|
|
102
102
|
const getConnectedWalletsWithInvalidNetwork = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
103
103
|
const connectedWalletsWithInvalidNetwork = [];
|
|
@@ -133,13 +133,13 @@ const useConnectedWalletsNetworkValidation = () => {
|
|
|
133
133
|
: 'network-not-supported-manual';
|
|
134
134
|
// Doesn't rerender if it's already true
|
|
135
135
|
setShowAuthFlow(true);
|
|
136
|
-
|
|
136
|
+
pushView(networkNotSupportedView);
|
|
137
137
|
}), [
|
|
138
138
|
getConnectedWalletsWithInvalidNetwork,
|
|
139
139
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key,
|
|
140
140
|
setSelectedWalletConnectorKey,
|
|
141
141
|
setShowAuthFlow,
|
|
142
|
-
|
|
142
|
+
pushView,
|
|
143
143
|
]);
|
|
144
144
|
const uniqueConnectors = React.useMemo(() => {
|
|
145
145
|
const connectors = connectedWallets.map(({ connector }) => connector);
|
|
@@ -93,7 +93,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
93
93
|
|
|
94
94
|
const useConnectedWalletsNetworkValidation = () => {
|
|
95
95
|
const { connectedWallets, selectedWalletConnector, setSelectedWalletConnectorKey, setShowAuthFlow, bridgeChainsToConnect, sdkHasLoaded, } = useInternalDynamicContext();
|
|
96
|
-
const {
|
|
96
|
+
const { pushView } = useViewContext();
|
|
97
97
|
const isLoggedIn = useIsLoggedIn();
|
|
98
98
|
const getConnectedWalletsWithInvalidNetwork = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
99
|
const connectedWalletsWithInvalidNetwork = [];
|
|
@@ -129,13 +129,13 @@ const useConnectedWalletsNetworkValidation = () => {
|
|
|
129
129
|
: 'network-not-supported-manual';
|
|
130
130
|
// Doesn't rerender if it's already true
|
|
131
131
|
setShowAuthFlow(true);
|
|
132
|
-
|
|
132
|
+
pushView(networkNotSupportedView);
|
|
133
133
|
}), [
|
|
134
134
|
getConnectedWalletsWithInvalidNetwork,
|
|
135
135
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key,
|
|
136
136
|
setSelectedWalletConnectorKey,
|
|
137
137
|
setShowAuthFlow,
|
|
138
|
-
|
|
138
|
+
pushView,
|
|
139
139
|
]);
|
|
140
140
|
const uniqueConnectors = useMemo(() => {
|
|
141
141
|
const connectors = connectedWallets.map(({ connector }) => connector);
|