@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/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.4.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.2...v4.4.3) (2025-01-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* remove extra useOnClickOutside hook ([#7910](https://github.com/dynamic-labs/dynamic-auth/issues/7910)) ([42fce2e](https://github.com/dynamic-labs/dynamic-auth/commit/42fce2e91e814514a72c97b3ea06930db805a200))
|
|
8
|
+
|
|
2
9
|
### [4.4.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.1...v4.4.2) (2025-01-30)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.599",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"react-i18next": "13.5.0",
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
|
-
"@dynamic-labs/assert-package-version": "4.4.
|
|
17
|
-
"@dynamic-labs/iconic": "4.4.
|
|
18
|
-
"@dynamic-labs/logger": "4.4.
|
|
19
|
-
"@dynamic-labs/multi-wallet": "4.4.
|
|
20
|
-
"@dynamic-labs/rpc-providers": "4.4.
|
|
21
|
-
"@dynamic-labs/store": "4.4.
|
|
22
|
-
"@dynamic-labs/types": "4.4.
|
|
23
|
-
"@dynamic-labs/utils": "4.4.
|
|
24
|
-
"@dynamic-labs/wallet-book": "4.4.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "4.4.
|
|
16
|
+
"@dynamic-labs/assert-package-version": "4.4.3",
|
|
17
|
+
"@dynamic-labs/iconic": "4.4.3",
|
|
18
|
+
"@dynamic-labs/logger": "4.4.3",
|
|
19
|
+
"@dynamic-labs/multi-wallet": "4.4.3",
|
|
20
|
+
"@dynamic-labs/rpc-providers": "4.4.3",
|
|
21
|
+
"@dynamic-labs/store": "4.4.3",
|
|
22
|
+
"@dynamic-labs/types": "4.4.3",
|
|
23
|
+
"@dynamic-labs/utils": "4.4.3",
|
|
24
|
+
"@dynamic-labs/wallet-book": "4.4.3",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "4.4.3",
|
|
26
26
|
"bs58": "5.0.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
package/src/lib/Main.cjs
CHANGED
|
@@ -103,7 +103,7 @@ const viewsToDisableCloseOnOverlayClick = [
|
|
|
103
103
|
];
|
|
104
104
|
const Main = () => {
|
|
105
105
|
const { selectedWalletConnector, linkedWallets, projectSettings, setShowAuthFlow, showAuthFlow, walletConnectorOptions, clearStatesOnBackClick, user, disconnectWallet, authMode, connectedWallets, handleLogOut, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
106
|
-
const { view,
|
|
106
|
+
const { view, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
107
107
|
const { setDeniedAddress, setDeniedOauthProvider } = AccessDeniedContext.useAccessDeniedContext();
|
|
108
108
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
109
109
|
const { setSocialProvider } = SocialRedirectContext.useSocialRedirectContext();
|
|
@@ -167,8 +167,8 @@ const Main = () => {
|
|
|
167
167
|
const handleOnPortalUnmount = React.useCallback(() => {
|
|
168
168
|
// IMPORTANT: we need to reset the view because we reset state that the view depends on
|
|
169
169
|
// so if the previous view renders when the user reopens the widget, it will crash
|
|
170
|
-
|
|
171
|
-
}, [
|
|
170
|
+
clearStackAndPushInitialView();
|
|
171
|
+
}, [clearStackAndPushInitialView]);
|
|
172
172
|
useVerifyOnAwaitingSignature.useVerifyOnAwaitingSignature();
|
|
173
173
|
const { handleAlreadyConnectedWallet, handleCustodialWalletClick, handleInstalledExtensionClick, handleMobileWalletClick, handleUninstalledClick, } = useWalletItemActions.useWalletItemActions();
|
|
174
174
|
/* istanbul ignore next */
|
package/src/lib/Main.js
CHANGED
|
@@ -99,7 +99,7 @@ const viewsToDisableCloseOnOverlayClick = [
|
|
|
99
99
|
];
|
|
100
100
|
const Main = () => {
|
|
101
101
|
const { selectedWalletConnector, linkedWallets, projectSettings, setShowAuthFlow, showAuthFlow, walletConnectorOptions, clearStatesOnBackClick, user, disconnectWallet, authMode, connectedWallets, handleLogOut, } = useInternalDynamicContext();
|
|
102
|
-
const { view,
|
|
102
|
+
const { view, clearStackAndPushInitialView } = useViewContext();
|
|
103
103
|
const { setDeniedAddress, setDeniedOauthProvider } = useAccessDeniedContext();
|
|
104
104
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
105
105
|
const { setSocialProvider } = useSocialRedirectContext();
|
|
@@ -163,8 +163,8 @@ const Main = () => {
|
|
|
163
163
|
const handleOnPortalUnmount = useCallback(() => {
|
|
164
164
|
// IMPORTANT: we need to reset the view because we reset state that the view depends on
|
|
165
165
|
// so if the previous view renders when the user reopens the widget, it will crash
|
|
166
|
-
|
|
167
|
-
}, [
|
|
166
|
+
clearStackAndPushInitialView();
|
|
167
|
+
}, [clearStackAndPushInitialView]);
|
|
168
168
|
useVerifyOnAwaitingSignature();
|
|
169
169
|
const { handleAlreadyConnectedWallet, handleCustodialWalletClick, handleInstalledExtensionClick, handleMobileWalletClick, handleUninstalledClick, } = useWalletItemActions();
|
|
170
170
|
/* istanbul ignore next */
|
|
@@ -11,7 +11,7 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
11
11
|
require('../../shared/logger.cjs');
|
|
12
12
|
require('@dynamic-labs/iconic');
|
|
13
13
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
|
-
|
|
14
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
15
15
|
require('@dynamic-labs/wallet-book');
|
|
16
16
|
require('@dynamic-labs/utils');
|
|
17
17
|
require('../../utils/constants/colors.cjs');
|
|
@@ -94,7 +94,6 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
94
94
|
|
|
95
95
|
const DynamicConnectButton = ({ buttonContainerClassName = '', buttonClassName = '', children, copykey, }) => {
|
|
96
96
|
const { projectSettings, setShowAuthFlow, setSelectedWalletConnectorKey } = useInternalDynamicContext.useInternalDynamicContext();
|
|
97
|
-
const { setView } = ViewContext.useViewContext();
|
|
98
97
|
const [didUserClick, setUserClicked] = React.useState(false);
|
|
99
98
|
const handleOnClick = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
100
99
|
if (!didUserClick) {
|
|
@@ -102,7 +101,7 @@ const DynamicConnectButton = ({ buttonContainerClassName = '', buttonClassName =
|
|
|
102
101
|
}
|
|
103
102
|
setSelectedWalletConnectorKey(null);
|
|
104
103
|
setShowAuthFlow(true);
|
|
105
|
-
}), [didUserClick, setSelectedWalletConnectorKey, setShowAuthFlow
|
|
104
|
+
}), [didUserClick, setSelectedWalletConnectorKey, setShowAuthFlow]);
|
|
106
105
|
return (jsxRuntime.jsx(ConnectButton.ConnectButton, { isLoading: !projectSettings, isActive: didUserClick, onClick: handleOnClick, buttonContainerClassName: buttonContainerClassName, buttonClassName: buttonClassName, copykey: copykey, children: children }));
|
|
107
106
|
};
|
|
108
107
|
|
|
@@ -7,7 +7,7 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
7
7
|
import '../../shared/logger.js';
|
|
8
8
|
import '@dynamic-labs/iconic';
|
|
9
9
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
|
-
import
|
|
10
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
11
11
|
import '@dynamic-labs/wallet-book';
|
|
12
12
|
import '@dynamic-labs/utils';
|
|
13
13
|
import '../../utils/constants/colors.js';
|
|
@@ -90,7 +90,6 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
90
90
|
|
|
91
91
|
const DynamicConnectButton = ({ buttonContainerClassName = '', buttonClassName = '', children, copykey, }) => {
|
|
92
92
|
const { projectSettings, setShowAuthFlow, setSelectedWalletConnectorKey } = useInternalDynamicContext();
|
|
93
|
-
const { setView } = useViewContext();
|
|
94
93
|
const [didUserClick, setUserClicked] = useState(false);
|
|
95
94
|
const handleOnClick = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
95
|
if (!didUserClick) {
|
|
@@ -98,7 +97,7 @@ const DynamicConnectButton = ({ buttonContainerClassName = '', buttonClassName =
|
|
|
98
97
|
}
|
|
99
98
|
setSelectedWalletConnectorKey(null);
|
|
100
99
|
setShowAuthFlow(true);
|
|
101
|
-
}), [didUserClick, setSelectedWalletConnectorKey, setShowAuthFlow
|
|
100
|
+
}), [didUserClick, setSelectedWalletConnectorKey, setShowAuthFlow]);
|
|
102
101
|
return (jsx(ConnectButton, { isLoading: !projectSettings, isActive: didUserClick, onClick: handleOnClick, buttonContainerClassName: buttonContainerClassName, buttonClassName: buttonClassName, copykey: copykey, children: children }));
|
|
103
102
|
};
|
|
104
103
|
|
|
@@ -100,7 +100,7 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
100
100
|
var _a, _b, _c, _d, _e;
|
|
101
101
|
const { projectSettings, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
102
102
|
const { t } = reactI18next.useTranslation();
|
|
103
|
-
const {
|
|
103
|
+
const { pushView } = ViewContext.useViewContext();
|
|
104
104
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
105
105
|
const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
106
106
|
const supportUrls = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
|
|
@@ -119,7 +119,7 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
119
119
|
settings: isExport
|
|
120
120
|
? {
|
|
121
121
|
goBack: () => {
|
|
122
|
-
|
|
122
|
+
pushView('embedded-reveal-view');
|
|
123
123
|
},
|
|
124
124
|
}
|
|
125
125
|
: undefined,
|
|
@@ -96,7 +96,7 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
96
96
|
var _a, _b, _c, _d, _e;
|
|
97
97
|
const { projectSettings, user } = useInternalDynamicContext();
|
|
98
98
|
const { t } = useTranslation();
|
|
99
|
-
const {
|
|
99
|
+
const { pushView } = useViewContext();
|
|
100
100
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
101
101
|
const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
102
102
|
const supportUrls = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
|
|
@@ -115,7 +115,7 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
115
115
|
settings: isExport
|
|
116
116
|
? {
|
|
117
117
|
goBack: () => {
|
|
118
|
-
|
|
118
|
+
pushView('embedded-reveal-view');
|
|
119
119
|
},
|
|
120
120
|
}
|
|
121
121
|
: undefined,
|
|
@@ -101,7 +101,7 @@ var LoadingQrCode = require('../../LoadingQrCode/LoadingQrCode.cjs');
|
|
|
101
101
|
|
|
102
102
|
const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: MainIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, showQrCodeImage, }) => {
|
|
103
103
|
const { t } = reactI18next.useTranslation();
|
|
104
|
-
const {
|
|
104
|
+
const { pushView } = ViewContext.useViewContext();
|
|
105
105
|
const downloadLinks = useWalletDownloadLinks.useWalletDownloadLinks(walletConnector);
|
|
106
106
|
const renderAppOrExtensionButton = () => {
|
|
107
107
|
if (desktopUri) {
|
|
@@ -110,7 +110,7 @@ const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: Main
|
|
|
110
110
|
jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), children: t('dyn_qr_code.open_button') }));
|
|
111
111
|
}
|
|
112
112
|
if (downloadLinks === null || downloadLinks === void 0 ? void 0 : downloadLinks.length) {
|
|
113
|
-
return (jsxRuntime.jsx(TypographyButton.TypographyButton, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () =>
|
|
113
|
+
return (jsxRuntime.jsx(TypographyButton.TypographyButton, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => pushView('no-qr-not-installed'), copykey: 'dyn_qr_code.get_extension_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
114
114
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
115
115
|
jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), children: t('dyn_qr_code.get_extension_button') }));
|
|
116
116
|
}
|
|
@@ -97,7 +97,7 @@ import { LoadingQrCode } from '../../LoadingQrCode/LoadingQrCode.js';
|
|
|
97
97
|
|
|
98
98
|
const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: MainIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, showQrCodeImage, }) => {
|
|
99
99
|
const { t } = useTranslation();
|
|
100
|
-
const {
|
|
100
|
+
const { pushView } = useViewContext();
|
|
101
101
|
const downloadLinks = useWalletDownloadLinks(walletConnector);
|
|
102
102
|
const renderAppOrExtensionButton = () => {
|
|
103
103
|
if (desktopUri) {
|
|
@@ -106,7 +106,7 @@ const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: Main
|
|
|
106
106
|
jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), children: t('dyn_qr_code.open_button') }));
|
|
107
107
|
}
|
|
108
108
|
if (downloadLinks === null || downloadLinks === void 0 ? void 0 : downloadLinks.length) {
|
|
109
|
-
return (jsx(TypographyButton, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () =>
|
|
109
|
+
return (jsx(TypographyButton, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => pushView('no-qr-not-installed'), copykey: 'dyn_qr_code.get_extension_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
110
110
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
111
111
|
jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), children: t('dyn_qr_code.get_extension_button') }));
|
|
112
112
|
}
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -115,7 +115,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
115
115
|
const { t } = reactI18next.useTranslation();
|
|
116
116
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
117
117
|
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
118
|
-
const {
|
|
118
|
+
const { pushView } = ViewContext.useViewContext();
|
|
119
119
|
const { userNeedsCrossDomainPasskey } = PasskeyContext.usePasskeyContext();
|
|
120
120
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
121
121
|
const { currency } = useFetchCurrency.useFetchCurrency(walletConnector);
|
|
@@ -128,7 +128,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
128
128
|
userNeedsCrossDomainPasskey,
|
|
129
129
|
usingSessionKey: usingSessionKeys.usingSessionKey,
|
|
130
130
|
walletConnector,
|
|
131
|
-
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, {
|
|
131
|
+
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, { pushView, setShowAuthFlow });
|
|
132
132
|
const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
133
133
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
134
134
|
const gasFiatValue = fiatUtils.getGasFiatValue(currentToken, transaction, nativePrice);
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -111,7 +111,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
111
111
|
const { t } = useTranslation();
|
|
112
112
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
113
113
|
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
114
|
-
const {
|
|
114
|
+
const { pushView } = useViewContext();
|
|
115
115
|
const { userNeedsCrossDomainPasskey } = usePasskeyContext();
|
|
116
116
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery();
|
|
117
117
|
const { currency } = useFetchCurrency(walletConnector);
|
|
@@ -124,7 +124,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
124
124
|
userNeedsCrossDomainPasskey,
|
|
125
125
|
usingSessionKey,
|
|
126
126
|
walletConnector,
|
|
127
|
-
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, {
|
|
127
|
+
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, { pushView, setShowAuthFlow });
|
|
128
128
|
const closeButton = onClickClose && (jsx(IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
|
|
129
129
|
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
130
130
|
const gasFiatValue = getGasFiatValue(currentToken, transaction, nativePrice);
|
|
@@ -67,7 +67,7 @@ const useHandleRecovery = (walletConnector, usingSessionKey, onSuccess, shouldIn
|
|
|
67
67
|
const useHandleSubmitWithChecks = (config, recoveryHandlers, viewHandlers) => (e) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
68
68
|
const { walletConnector, usingSessionKey, onClickSend, isTurnkeyWallet, userNeedsCrossDomainPasskey, } = config;
|
|
69
69
|
const { shouldInitRecovery, initPasskeyRecoveryProcess } = recoveryHandlers;
|
|
70
|
-
const {
|
|
70
|
+
const { pushView, setShowAuthFlow } = viewHandlers;
|
|
71
71
|
if (walletConnector && usingSessionKey(walletConnector)) {
|
|
72
72
|
onClickSend(e);
|
|
73
73
|
return;
|
|
@@ -78,7 +78,7 @@ const useHandleSubmitWithChecks = (config, recoveryHandlers, viewHandlers) => (e
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
if (isTurnkeyWallet && userNeedsCrossDomainPasskey) {
|
|
81
|
-
|
|
81
|
+
pushView('passkey-new-domain-detected');
|
|
82
82
|
setShowAuthFlow(true, {
|
|
83
83
|
ignoreIfIsEmbeddedWidget: false,
|
|
84
84
|
performMultiWalletChecks: false,
|
|
@@ -20,7 +20,7 @@ interface RecoveryHandlers {
|
|
|
20
20
|
initPasskeyRecoveryProcess: (authenticatorType?: AuthenticatorType, currentAction?: EmbeddedWalletCurrentAction) => Promise<Wallet>;
|
|
21
21
|
}
|
|
22
22
|
interface ViewHandlers {
|
|
23
|
-
|
|
23
|
+
pushView: (view: ViewType) => void;
|
|
24
24
|
setShowAuthFlow: (show: boolean, options: AuthFlowOptions) => void;
|
|
25
25
|
}
|
|
26
26
|
export declare const useCurrencySymbol: (currentToken: TokenBalance | undefined, currency: string | undefined) => string | undefined;
|
|
@@ -63,7 +63,7 @@ const useHandleRecovery = (walletConnector, usingSessionKey, onSuccess, shouldIn
|
|
|
63
63
|
const useHandleSubmitWithChecks = (config, recoveryHandlers, viewHandlers) => (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
64
|
const { walletConnector, usingSessionKey, onClickSend, isTurnkeyWallet, userNeedsCrossDomainPasskey, } = config;
|
|
65
65
|
const { shouldInitRecovery, initPasskeyRecoveryProcess } = recoveryHandlers;
|
|
66
|
-
const {
|
|
66
|
+
const { pushView, setShowAuthFlow } = viewHandlers;
|
|
67
67
|
if (walletConnector && usingSessionKey(walletConnector)) {
|
|
68
68
|
onClickSend(e);
|
|
69
69
|
return;
|
|
@@ -74,7 +74,7 @@ const useHandleSubmitWithChecks = (config, recoveryHandlers, viewHandlers) => (e
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
if (isTurnkeyWallet && userNeedsCrossDomainPasskey) {
|
|
77
|
-
|
|
77
|
+
pushView('passkey-new-domain-detected');
|
|
78
78
|
setShowAuthFlow(true, {
|
|
79
79
|
ignoreIfIsEmbeddedWidget: false,
|
|
80
80
|
performMultiWalletChecks: false,
|
|
@@ -20,13 +20,13 @@ require('../../shared/consts/index.cjs');
|
|
|
20
20
|
|
|
21
21
|
const CaptchaContext = React.createContext(undefined);
|
|
22
22
|
const CaptchaContextProvider = ({ children, }) => {
|
|
23
|
-
const {
|
|
23
|
+
const { pushView } = ViewContext.useViewContext();
|
|
24
24
|
const [captchaToken, setCaptchaToken, removeCaptchaToken] = useLocalStorage.useLocalStorage(localStorage.CAPTCHA_TOKEN, undefined);
|
|
25
25
|
const [captchaAuthState, setCaptchaAuthState] = React.useState();
|
|
26
26
|
const engageCaptcha = React.useCallback(({ authMethod, onCaptchaSuccess, }) => {
|
|
27
27
|
setCaptchaAuthState({ authMethod, onCaptchaSuccess });
|
|
28
|
-
|
|
29
|
-
}, [
|
|
28
|
+
pushView('captcha');
|
|
29
|
+
}, [pushView, setCaptchaAuthState]);
|
|
30
30
|
const getCaptchaToken = React.useCallback(() => {
|
|
31
31
|
const token = captchaToken;
|
|
32
32
|
removeCaptchaToken();
|
|
@@ -16,13 +16,13 @@ import '../../shared/consts/index.js';
|
|
|
16
16
|
|
|
17
17
|
const CaptchaContext = createContext(undefined);
|
|
18
18
|
const CaptchaContextProvider = ({ children, }) => {
|
|
19
|
-
const {
|
|
19
|
+
const { pushView } = useViewContext();
|
|
20
20
|
const [captchaToken, setCaptchaToken, removeCaptchaToken] = useLocalStorage(CAPTCHA_TOKEN, undefined);
|
|
21
21
|
const [captchaAuthState, setCaptchaAuthState] = useState();
|
|
22
22
|
const engageCaptcha = useCallback(({ authMethod, onCaptchaSuccess, }) => {
|
|
23
23
|
setCaptchaAuthState({ authMethod, onCaptchaSuccess });
|
|
24
|
-
|
|
25
|
-
}, [
|
|
24
|
+
pushView('captcha');
|
|
25
|
+
}, [pushView, setCaptchaAuthState]);
|
|
26
26
|
const getCaptchaToken = useCallback(() => {
|
|
27
27
|
const token = captchaToken;
|
|
28
28
|
removeCaptchaToken();
|
|
@@ -93,10 +93,8 @@ const MockContextProvider = ({ children, view, customerTheme, dynamicLayoutClass
|
|
|
93
93
|
clearStackAndPush: () => { },
|
|
94
94
|
clearStackAndPushInitialView: () => { },
|
|
95
95
|
goBack: () => { },
|
|
96
|
-
goToInitialView: () => { },
|
|
97
96
|
pushView: () => { },
|
|
98
97
|
replaceView: () => { },
|
|
99
|
-
setView: () => { },
|
|
100
98
|
stack: [],
|
|
101
99
|
view,
|
|
102
100
|
};
|
|
@@ -89,10 +89,8 @@ const MockContextProvider = ({ children, view, customerTheme, dynamicLayoutClass
|
|
|
89
89
|
clearStackAndPush: () => { },
|
|
90
90
|
clearStackAndPushInitialView: () => { },
|
|
91
91
|
goBack: () => { },
|
|
92
|
-
goToInitialView: () => { },
|
|
93
92
|
pushView: () => { },
|
|
94
93
|
replaceView: () => { },
|
|
95
|
-
setView: () => { },
|
|
96
94
|
stack: [],
|
|
97
95
|
view,
|
|
98
96
|
};
|
|
@@ -97,7 +97,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
97
97
|
|
|
98
98
|
const useResponseHandlers = () => {
|
|
99
99
|
const { walletConnectorOptions, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, connectWallet, setShowAuthFlow, setSelectedWalletConnectorKey, siweStatement, appName, user, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
100
|
-
const {
|
|
100
|
+
const { pushView } = ViewContext.useViewContext();
|
|
101
101
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
102
102
|
const { getCaptchaToken } = CaptchaContext.useCaptchaContext();
|
|
103
103
|
const verifyWallet = useVerifyWallet.useVerifyWallet({
|
|
@@ -117,14 +117,14 @@ const useResponseHandlers = () => {
|
|
|
117
117
|
yield phantomRedirectConnector.getSession();
|
|
118
118
|
yield connectWallet(phantomRedirectConnector);
|
|
119
119
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: true });
|
|
120
|
-
|
|
120
|
+
pushView('pending-signature');
|
|
121
121
|
setSelectedWalletConnectorKey('phantom');
|
|
122
122
|
}), [
|
|
123
123
|
connectWallet,
|
|
124
124
|
phantomRedirectConnector,
|
|
125
125
|
setSelectedWalletConnectorKey,
|
|
126
126
|
setShowAuthFlow,
|
|
127
|
-
|
|
127
|
+
pushView,
|
|
128
128
|
]);
|
|
129
129
|
const completeWalletTransfer = useTransferWallet.useTransferWallet();
|
|
130
130
|
const handleUserResponse = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -172,7 +172,7 @@ const useResponseHandlers = () => {
|
|
|
172
172
|
}
|
|
173
173
|
else if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_verification' ||
|
|
174
174
|
!user) {
|
|
175
|
-
|
|
175
|
+
pushView('wallet-redirect-view');
|
|
176
176
|
yield verifyWallet({
|
|
177
177
|
captchaToken: getCaptchaToken(),
|
|
178
178
|
messageToSignOverride: message,
|
|
@@ -196,7 +196,7 @@ const useResponseHandlers = () => {
|
|
|
196
196
|
appName,
|
|
197
197
|
siweStatement,
|
|
198
198
|
completeWalletTransfer,
|
|
199
|
-
|
|
199
|
+
pushView,
|
|
200
200
|
verifyWallet,
|
|
201
201
|
getCaptchaToken,
|
|
202
202
|
]);
|
|
@@ -93,7 +93,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
93
93
|
|
|
94
94
|
const useResponseHandlers = () => {
|
|
95
95
|
const { walletConnectorOptions, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, connectWallet, setShowAuthFlow, setSelectedWalletConnectorKey, siweStatement, appName, user, } = useInternalDynamicContext();
|
|
96
|
-
const {
|
|
96
|
+
const { pushView } = useViewContext();
|
|
97
97
|
const { setErrorMessage } = useErrorContext();
|
|
98
98
|
const { getCaptchaToken } = useCaptchaContext();
|
|
99
99
|
const verifyWallet = useVerifyWallet({
|
|
@@ -113,14 +113,14 @@ const useResponseHandlers = () => {
|
|
|
113
113
|
yield phantomRedirectConnector.getSession();
|
|
114
114
|
yield connectWallet(phantomRedirectConnector);
|
|
115
115
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: true });
|
|
116
|
-
|
|
116
|
+
pushView('pending-signature');
|
|
117
117
|
setSelectedWalletConnectorKey('phantom');
|
|
118
118
|
}), [
|
|
119
119
|
connectWallet,
|
|
120
120
|
phantomRedirectConnector,
|
|
121
121
|
setSelectedWalletConnectorKey,
|
|
122
122
|
setShowAuthFlow,
|
|
123
|
-
|
|
123
|
+
pushView,
|
|
124
124
|
]);
|
|
125
125
|
const completeWalletTransfer = useTransferWallet();
|
|
126
126
|
const handleUserResponse = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -168,7 +168,7 @@ const useResponseHandlers = () => {
|
|
|
168
168
|
}
|
|
169
169
|
else if ((signatureState === null || signatureState === void 0 ? void 0 : signatureState.verificationType) === 'awaiting_verification' ||
|
|
170
170
|
!user) {
|
|
171
|
-
|
|
171
|
+
pushView('wallet-redirect-view');
|
|
172
172
|
yield verifyWallet({
|
|
173
173
|
captchaToken: getCaptchaToken(),
|
|
174
174
|
messageToSignOverride: message,
|
|
@@ -192,7 +192,7 @@ const useResponseHandlers = () => {
|
|
|
192
192
|
appName,
|
|
193
193
|
siweStatement,
|
|
194
194
|
completeWalletTransfer,
|
|
195
|
-
|
|
195
|
+
pushView,
|
|
196
196
|
verifyWallet,
|
|
197
197
|
getCaptchaToken,
|
|
198
198
|
]);
|
|
@@ -100,7 +100,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
100
100
|
var _a, _b, _c, _d;
|
|
101
101
|
const { setShowAuthFlow, walletConnectorOptions, setSelectedWalletConnectorKey, walletUiUtils, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, secondaryWallets, sdkHasLoaded, user, connectWallet, primaryWallet, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
102
102
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
103
|
-
const {
|
|
103
|
+
const { clearStackAndPush, pushView } = ViewContext.useViewContext();
|
|
104
104
|
const { getCaptchaToken } = CaptchaContext.useCaptchaContext();
|
|
105
105
|
const verifyWallet = useVerifyWallet.useVerifyWallet({
|
|
106
106
|
displaySiweStatement,
|
|
@@ -133,7 +133,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
setShowAuthFlow(true);
|
|
136
|
-
|
|
136
|
+
clearStackAndPush('wallet-list');
|
|
137
137
|
setErrorMessage('-1');
|
|
138
138
|
}
|
|
139
139
|
}, [
|
|
@@ -141,16 +141,14 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
141
141
|
setErrorMessage,
|
|
142
142
|
setShowAuthFlow,
|
|
143
143
|
setShowDynamicUserProfile,
|
|
144
|
-
|
|
144
|
+
clearStackAndPush,
|
|
145
145
|
]);
|
|
146
146
|
React.useEffect(() => {
|
|
147
147
|
var _a, _b;
|
|
148
148
|
if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
|
|
149
|
-
// todo: we are competing with the useEffect in ViewContext.
|
|
150
|
-
// once that is cleaned up, we can remove this code
|
|
151
149
|
const params = new URLSearchParams(window.location.search);
|
|
152
150
|
if (params.has('magic_oauth_request_id')) {
|
|
153
|
-
|
|
151
|
+
clearStackAndPush('social-redirect-view');
|
|
154
152
|
setShowAuthFlow(true);
|
|
155
153
|
}
|
|
156
154
|
return;
|
|
@@ -167,7 +165,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
167
165
|
const providerFromParams = params.get('provider');
|
|
168
166
|
setSocialProvider(providerFromParams);
|
|
169
167
|
setRedirectStatus('loading');
|
|
170
|
-
|
|
168
|
+
clearStackAndPush('social-redirect-view');
|
|
171
169
|
setShowAuthFlow(true);
|
|
172
170
|
if (!user) {
|
|
173
171
|
setSelectedWalletConnectorKey(socialWalletConnector.key);
|
|
@@ -213,7 +211,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
213
211
|
}
|
|
214
212
|
else {
|
|
215
213
|
yield socialWalletConnector.endSession();
|
|
216
|
-
|
|
214
|
+
pushView('social-wrong-account');
|
|
217
215
|
}
|
|
218
216
|
}
|
|
219
217
|
else {
|
|
@@ -253,7 +251,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
253
251
|
setSelectedWalletConnectorKey,
|
|
254
252
|
setShowAuthFlow,
|
|
255
253
|
setShowDynamicUserProfile,
|
|
256
|
-
|
|
254
|
+
pushView,
|
|
257
255
|
socialWalletConnector,
|
|
258
256
|
verifyWallet,
|
|
259
257
|
walletUiUtils,
|
|
@@ -262,6 +260,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
262
260
|
connectWallet,
|
|
263
261
|
primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
|
|
264
262
|
getCaptchaToken,
|
|
263
|
+
clearStackAndPush,
|
|
265
264
|
]);
|
|
266
265
|
useRedirectSocialHandler.useRedirectSocialHandler({
|
|
267
266
|
setSocialProvider,
|
|
@@ -96,7 +96,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
96
96
|
var _a, _b, _c, _d;
|
|
97
97
|
const { setShowAuthFlow, walletConnectorOptions, setSelectedWalletConnectorKey, walletUiUtils, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, secondaryWallets, sdkHasLoaded, user, connectWallet, primaryWallet, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext();
|
|
98
98
|
const { setErrorMessage } = useErrorContext();
|
|
99
|
-
const {
|
|
99
|
+
const { clearStackAndPush, pushView } = useViewContext();
|
|
100
100
|
const { getCaptchaToken } = useCaptchaContext();
|
|
101
101
|
const verifyWallet = useVerifyWallet({
|
|
102
102
|
displaySiweStatement,
|
|
@@ -129,7 +129,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
131
131
|
setShowAuthFlow(true);
|
|
132
|
-
|
|
132
|
+
clearStackAndPush('wallet-list');
|
|
133
133
|
setErrorMessage('-1');
|
|
134
134
|
}
|
|
135
135
|
}, [
|
|
@@ -137,16 +137,14 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
137
137
|
setErrorMessage,
|
|
138
138
|
setShowAuthFlow,
|
|
139
139
|
setShowDynamicUserProfile,
|
|
140
|
-
|
|
140
|
+
clearStackAndPush,
|
|
141
141
|
]);
|
|
142
142
|
useEffect(() => {
|
|
143
143
|
var _a, _b;
|
|
144
144
|
if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
|
|
145
|
-
// todo: we are competing with the useEffect in ViewContext.
|
|
146
|
-
// once that is cleaned up, we can remove this code
|
|
147
145
|
const params = new URLSearchParams(window.location.search);
|
|
148
146
|
if (params.has('magic_oauth_request_id')) {
|
|
149
|
-
|
|
147
|
+
clearStackAndPush('social-redirect-view');
|
|
150
148
|
setShowAuthFlow(true);
|
|
151
149
|
}
|
|
152
150
|
return;
|
|
@@ -163,7 +161,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
163
161
|
const providerFromParams = params.get('provider');
|
|
164
162
|
setSocialProvider(providerFromParams);
|
|
165
163
|
setRedirectStatus('loading');
|
|
166
|
-
|
|
164
|
+
clearStackAndPush('social-redirect-view');
|
|
167
165
|
setShowAuthFlow(true);
|
|
168
166
|
if (!user) {
|
|
169
167
|
setSelectedWalletConnectorKey(socialWalletConnector.key);
|
|
@@ -209,7 +207,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
209
207
|
}
|
|
210
208
|
else {
|
|
211
209
|
yield socialWalletConnector.endSession();
|
|
212
|
-
|
|
210
|
+
pushView('social-wrong-account');
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
else {
|
|
@@ -249,7 +247,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
249
247
|
setSelectedWalletConnectorKey,
|
|
250
248
|
setShowAuthFlow,
|
|
251
249
|
setShowDynamicUserProfile,
|
|
252
|
-
|
|
250
|
+
pushView,
|
|
253
251
|
socialWalletConnector,
|
|
254
252
|
verifyWallet,
|
|
255
253
|
walletUiUtils,
|
|
@@ -258,6 +256,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
258
256
|
connectWallet,
|
|
259
257
|
primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id,
|
|
260
258
|
getCaptchaToken,
|
|
259
|
+
clearStackAndPush,
|
|
261
260
|
]);
|
|
262
261
|
useRedirectSocialHandler({
|
|
263
262
|
setSocialProvider,
|