@dynamic-labs/sdk-react-core 4.4.2 → 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- 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/HardwareWalletToggle/HardwareWalletToggle.cjs +12 -11
- package/src/lib/components/HardwareWalletToggle/HardwareWalletToggle.js +12 -11
- 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/Toggle/Toggle.cjs +1 -5
- package/src/lib/components/Toggle/Toggle.d.ts +6 -2
- package/src/lib/components/Toggle/Toggle.js +1 -5
- 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/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +7 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -2
- 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/ViewContext/types/index.d.ts +1 -2
- package/src/lib/context/WalletGroupContext/WalletGroupContext.cjs +3 -3
- package/src/lib/context/WalletGroupContext/WalletGroupContext.js +3 -3
- package/src/lib/data/api/exchangeRates/exchangeRates.cjs +9 -5
- package/src/lib/data/api/exchangeRates/exchangeRates.js +9 -5
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -6
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -6
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +4 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +4 -4
- package/src/lib/store/internalImplementation/store.cjs +1 -0
- package/src/lib/store/internalImplementation/store.d.ts +5 -1
- package/src/lib/store/internalImplementation/store.js +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- 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/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +5 -0
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +5 -0
- 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 +28 -10
- package/src/lib/utils/hooks/useFunding/useConnectWalletForFunding/useConnectWalletForFunding.js +25 -7
- 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 +12 -12
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +12 -12
- 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/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.cjs +12 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.d.ts +7 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/handleStoreVersionChanged.js +8 -0
- package/src/lib/utils/hooks/useValidateSession/handleStoreVersionChanged/index.d.ts +1 -0
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +5 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +5 -3
- 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 +8 -8
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +8 -8
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +14 -22
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.d.ts +6 -5
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +14 -22
- 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 +4 -9
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +4 -9
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +8 -10
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +8 -10
- 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 +9 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +10 -5
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.cjs +0 -17
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.js +0 -17
- 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
|
@@ -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,
|
|
@@ -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
|
}), [
|
|
@@ -9,8 +9,7 @@ export type ViewState<T extends ViewType> = {
|
|
|
9
9
|
events?: ViewEvents;
|
|
10
10
|
};
|
|
11
11
|
export type ViewEvents = {
|
|
12
|
-
|
|
13
|
-
onBackClick?: () => 'override' | void;
|
|
12
|
+
onBackClick?: () => void;
|
|
14
13
|
onClose?: () => void;
|
|
15
14
|
};
|
|
16
15
|
export type ViewSetter = <T extends ViewType>(view: T, props?: ViewState<T>['props'], events?: ViewEvents) => void;
|
|
@@ -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,
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
8
|
+
var api = require('../api.cjs');
|
|
7
9
|
|
|
8
10
|
const getExchangeRates = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SOL: 217.37,
|
|
13
|
-
USDC: 1,
|
|
11
|
+
const rates = {};
|
|
12
|
+
const data = yield api.sdkApi().getCurrencyExchangeRates({
|
|
13
|
+
environmentId: dynamicContextProps.getEnvironmentId(),
|
|
14
14
|
});
|
|
15
|
+
data.forEach((currency) => {
|
|
16
|
+
rates[currency.code] = currency.value;
|
|
17
|
+
});
|
|
18
|
+
return rates;
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
exports.getExchangeRates = getExchangeRates;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { getEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
4
|
+
import { sdkApi } from '../api.js';
|
|
3
5
|
|
|
4
6
|
const getExchangeRates = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
SOL: 217.37,
|
|
9
|
-
USDC: 1,
|
|
7
|
+
const rates = {};
|
|
8
|
+
const data = yield sdkApi().getCurrencyExchangeRates({
|
|
9
|
+
environmentId: getEnvironmentId(),
|
|
10
10
|
});
|
|
11
|
+
data.forEach((currency) => {
|
|
12
|
+
rates[currency.code] = currency.value;
|
|
13
|
+
});
|
|
14
|
+
return rates;
|
|
11
15
|
});
|
|
12
16
|
|
|
13
17
|
export { getExchangeRates };
|
|
@@ -106,12 +106,8 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
106
106
|
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
107
107
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
108
108
|
const handleBackClick = React.useCallback(() => {
|
|
109
|
-
var _a;
|
|
110
|
-
|
|
111
|
-
const result = view.events.onBackClick();
|
|
112
|
-
if (result === 'override')
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
109
|
+
var _a, _b;
|
|
110
|
+
(_b = (_a = view.events) === null || _a === void 0 ? void 0 : _a.onBackClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
115
111
|
goBack();
|
|
116
112
|
setExistentAccountData(undefined);
|
|
117
113
|
setError(undefined);
|
|
@@ -102,12 +102,8 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
102
102
|
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks();
|
|
103
103
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
104
104
|
const handleBackClick = useCallback(() => {
|
|
105
|
-
var _a;
|
|
106
|
-
|
|
107
|
-
const result = view.events.onBackClick();
|
|
108
|
-
if (result === 'override')
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
105
|
+
var _a, _b;
|
|
106
|
+
(_b = (_a = view.events) === null || _a === void 0 ? void 0 : _a.onBackClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
111
107
|
goBack();
|
|
112
108
|
setExistentAccountData(undefined);
|
|
113
109
|
setError(undefined);
|
|
@@ -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,
|
|
@@ -36,6 +36,7 @@ const initializeStore = (props) => {
|
|
|
36
36
|
: localStorage$1.STORE_STORAGE_KEY;
|
|
37
37
|
store = syncLegacyStorage.syncLegacyStorage(store$1.persist({
|
|
38
38
|
name: persistName,
|
|
39
|
+
onVersionChanged: props.onPersistedVersionChanged,
|
|
39
40
|
partialize: stateConfig.transformStateForLocalStorage,
|
|
40
41
|
storage: getStorage(),
|
|
41
42
|
// Map each entry to its initialValue
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { StoreApi } from '@dynamic-labs/store';
|
|
2
2
|
import { DynamicContextProps } from '../../context/DynamicContext/types';
|
|
3
3
|
import { SdkStore } from '../types';
|
|
4
|
+
type InitializeStoreProps = {
|
|
5
|
+
onPersistedVersionChanged?: () => void;
|
|
6
|
+
} & DynamicContextProps;
|
|
4
7
|
export declare const getStore: () => StoreApi<SdkStore>;
|
|
5
8
|
export declare const removeStoreInstance: () => void;
|
|
6
|
-
export declare const initializeStore: (props:
|
|
9
|
+
export declare const initializeStore: (props: InitializeStoreProps) => void;
|
|
10
|
+
export {};
|
|
@@ -32,6 +32,7 @@ const initializeStore = (props) => {
|
|
|
32
32
|
: STORE_STORAGE_KEY;
|
|
33
33
|
store = syncLegacyStorage(persist({
|
|
34
34
|
name: persistName,
|
|
35
|
+
onVersionChanged: props.onPersistedVersionChanged,
|
|
35
36
|
partialize: transformStateForLocalStorage,
|
|
36
37
|
storage: getStorage(),
|
|
37
38
|
// Map each entry to its initialValue
|