@dynamic-labs/sdk-react-core 4.9.2-preview.0 → 4.9.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 +28 -1
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -2
- package/src/index.js +2 -2
- package/src/lib/components/Portal/ModalComponent/ModalComponent.cjs +32 -0
- package/src/lib/components/Portal/ModalComponent/ModalComponent.d.ts +9 -0
- package/src/lib/components/Portal/ModalComponent/ModalComponent.js +24 -0
- package/src/lib/components/Portal/ModalComponent/index.d.ts +1 -0
- package/src/lib/components/Portal/Portal.cjs +3 -119
- package/src/lib/components/Portal/Portal.d.ts +3 -8
- package/src/lib/components/Portal/Portal.js +3 -115
- package/src/lib/components/TosAndPp/TosAndPp.cjs +3 -1
- package/src/lib/components/TosAndPp/TosAndPp.js +3 -1
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.cjs +1 -1
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.js +1 -1
- package/src/lib/components/TransactionCard/TransactionCard.cjs +1 -1
- package/src/lib/components/TransactionCard/TransactionCard.js +1 -1
- package/src/lib/components/Typography/Typography.cjs +1 -0
- package/src/lib/components/Typography/Typography.js +1 -0
- package/src/lib/components/Typography/Typography.types.d.ts +1 -1
- package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.cjs +10 -2
- package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.js +10 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +13 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +15 -11
- package/src/lib/context/DynamicContext/helpers/helpers.cjs +0 -12
- package/src/lib/context/DynamicContext/helpers/helpers.d.ts +1 -9
- package/src/lib/context/DynamicContext/helpers/helpers.js +1 -12
- package/src/lib/context/DynamicContext/hooks/useInitialViewType/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useInitialViewType/useInitialViewType.cjs +18 -0
- package/src/lib/context/DynamicContext/hooks/useInitialViewType/useInitialViewType.d.ts +10 -0
- package/src/lib/context/DynamicContext/hooks/useInitialViewType/useInitialViewType.js +14 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.js +1 -1
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +6 -2
- package/src/lib/context/ErrorContext/hooks/useErrorText/useErrorText.cjs +1 -0
- package/src/lib/context/ErrorContext/hooks/useErrorText/useErrorText.js +1 -0
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +1 -0
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +1 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +1 -1
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +1 -1
- package/src/lib/context/ViewContext/ViewContext.cjs +1 -1
- package/src/lib/context/ViewContext/ViewContext.js +1 -1
- package/src/lib/locale/en/translation.cjs +3 -2
- package/src/lib/locale/en/translation.d.ts +2 -1
- package/src/lib/locale/en/translation.js +3 -2
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +135 -0
- package/src/lib/utils/constants/authViewLayoutChecks.d.ts +21 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +123 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.cjs +36 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.d.ts +11 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.js +32 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +20 -93
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +19 -92
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +7 -4
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +5 -2
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +7 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +8 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +8 -8
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +2 -1
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +2 -1
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +3 -2
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +3 -2
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -3
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +1 -2
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -3
- package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.cjs +3 -5
- package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.d.ts +1 -2
- package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.js +3 -5
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +37 -0
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +9 -0
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +33 -0
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/index.d.ts +1 -0
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +2 -0
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +4 -1
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +4 -1
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +1 -4
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +1 -4
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +4 -10
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +4 -10
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +7 -5
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +7 -5
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +164 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.d.ts +3 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +160 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +11 -50
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +11 -50
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.js +1 -1
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceItem/TokenBalanceItem.cjs +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceItem/TokenBalanceItem.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceItem/TokenBalanceItem.js +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceItem/index.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceList/TokenBalanceList.cjs +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceList/TokenBalanceList.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceList/TokenBalanceList.js +0 -0
- /package/src/lib/widgets/DynamicWidget/components/{ActiveWalletInformation → ActiveWalletBalance}/TokenBalanceList/index.d.ts +0 -0
|
@@ -181,11 +181,19 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
181
181
|
React.useEffect(() => {
|
|
182
182
|
const handleConnectorInitStarted = (key) => {
|
|
183
183
|
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitStarted', { key });
|
|
184
|
-
|
|
184
|
+
// need to add the timeout to ensure the setConnectorInitializing call is not
|
|
185
|
+
// made in the same tick to avoid a bad setState call error from React
|
|
186
|
+
setTimeout(() => {
|
|
187
|
+
connectorsInitializing.setConnectorInitializing(key, true);
|
|
188
|
+
}, 0);
|
|
185
189
|
};
|
|
186
190
|
const handleConnectorInitCompleted = (key) => {
|
|
187
191
|
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitCompleted', { key });
|
|
188
|
-
|
|
192
|
+
// need to add the timeout to ensure the setConnectorInitializing call is not
|
|
193
|
+
// made in the same tick to avoid a bad setState call error from React
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
connectorsInitializing.setConnectorInitializing(key, false);
|
|
196
|
+
}, 0);
|
|
189
197
|
};
|
|
190
198
|
walletConnectorCore.walletConnectorEvents.on('connectorInitStarted', handleConnectorInitStarted);
|
|
191
199
|
walletConnectorCore.walletConnectorEvents.on('connectorInitCompleted', handleConnectorInitCompleted);
|
|
@@ -177,11 +177,19 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
177
177
|
useEffect(() => {
|
|
178
178
|
const handleConnectorInitStarted = (key) => {
|
|
179
179
|
logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitStarted', { key });
|
|
180
|
-
setConnectorInitializing
|
|
180
|
+
// need to add the timeout to ensure the setConnectorInitializing call is not
|
|
181
|
+
// made in the same tick to avoid a bad setState call error from React
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
setConnectorInitializing(key, true);
|
|
184
|
+
}, 0);
|
|
181
185
|
};
|
|
182
186
|
const handleConnectorInitCompleted = (key) => {
|
|
183
187
|
logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleConnectorInitCompleted', { key });
|
|
184
|
-
setConnectorInitializing
|
|
188
|
+
// need to add the timeout to ensure the setConnectorInitializing call is not
|
|
189
|
+
// made in the same tick to avoid a bad setState call error from React
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
setConnectorInitializing(key, false);
|
|
192
|
+
}, 0);
|
|
185
193
|
};
|
|
186
194
|
walletConnectorEvents.on('connectorInitStarted', handleConnectorInitStarted);
|
|
187
195
|
walletConnectorEvents.on('connectorInitCompleted', handleConnectorInitCompleted);
|
|
@@ -137,7 +137,6 @@ var PhantomRedirectContext = require('../PhantomRedirectContext/PhantomRedirectC
|
|
|
137
137
|
var ReinitializeContextProvider = require('../ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
138
138
|
var SendBalanceContext = require('../SendBalanceContext/SendBalanceContext.cjs');
|
|
139
139
|
var UseNetworkValidation = require('../UseNetworkValidation/UseNetworkValidation.cjs');
|
|
140
|
-
var useRemoveWallet = require('./hooks/useRemoveWallet/useRemoveWallet.cjs');
|
|
141
140
|
var onReinitialize = require('./functions/onReinitialize/onReinitialize.cjs');
|
|
142
141
|
var useDisplayOrderState = require('./hooks/useDisplayOrderState/useDisplayOrderState.cjs');
|
|
143
142
|
var useEmailLoginState = require('./hooks/useEmailLoginState/useEmailLoginState.cjs');
|
|
@@ -148,9 +147,11 @@ var useShowAuthFlow = require('./hooks/useShowAuthFlow/useShowAuthFlow.cjs');
|
|
|
148
147
|
var usePasskeySuccessPopup = require('./hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.cjs');
|
|
149
148
|
var useTieCallbacksToEvents = require('./hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs');
|
|
150
149
|
var useMultiWallet = require('./hooks/useMultiWallet/useMultiWallet.cjs');
|
|
150
|
+
var useInitialViewType = require('./hooks/useInitialViewType/useInitialViewType.cjs');
|
|
151
151
|
var useMultiAsset = require('./hooks/useMultiAsset/useMultiAsset.cjs');
|
|
152
152
|
var useParentDynamicContextGuard = require('./hooks/useParentDynamicContextGuard/useParentDynamicContextGuard.cjs');
|
|
153
153
|
var useRegisterStorageService = require('./hooks/useRegisterStorageService/useRegisterStorageService.cjs');
|
|
154
|
+
var useRemoveWallet = require('./hooks/useRemoveWallet/useRemoveWallet.cjs');
|
|
154
155
|
var useShowDynamicUserProfile = require('./hooks/useShowDynamicUserProfile/useShowDynamicUserProfile.cjs');
|
|
155
156
|
var useShowEmbeddedWalletActionsUI = require('./hooks/useShowEmbeddedWalletActionsUI/useShowEmbeddedWalletActionsUI.cjs');
|
|
156
157
|
var useShowFiat = require('./hooks/useShowFiat/useShowFiat.cjs');
|
|
@@ -291,7 +292,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
291
292
|
// which are only available further down and have would have circular dependencies
|
|
292
293
|
const [requiredWalletsConnected, setRequiredWalletsConnected] = React.useState(false);
|
|
293
294
|
const isUserAuthenticated = Boolean(authMode === 'connect-and-sign' ? user$1 : requiredWalletsConnected);
|
|
294
|
-
const isRenderingEmbeddedAuthFlow = React.
|
|
295
|
+
const [isRenderingEmbeddedAuthFlow, setIsRenderingEmbeddedAuthFlow] = React.useState(false);
|
|
295
296
|
const [showAuthFlow, setShowAuthFlow] = useShowAuthFlow.useShowAuthFlow({
|
|
296
297
|
isAuthenticated: isUserAuthenticated,
|
|
297
298
|
isMultiWalletEnabled: multiWallet,
|
|
@@ -560,6 +561,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
560
561
|
setBridgeOnboardingCompleted,
|
|
561
562
|
setCallback,
|
|
562
563
|
setDesktopUri,
|
|
564
|
+
setIsRenderingEmbeddedAuthFlow,
|
|
563
565
|
setIsSingleWalletAccount,
|
|
564
566
|
setLegacyIsVerifying,
|
|
565
567
|
setLogInWithEmail,
|
|
@@ -636,6 +638,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
636
638
|
handlers,
|
|
637
639
|
i18nSDKInstance,
|
|
638
640
|
isBridgeFlow,
|
|
641
|
+
isRenderingEmbeddedAuthFlow,
|
|
639
642
|
isSingleWalletAccount,
|
|
640
643
|
legacyIsVerifying,
|
|
641
644
|
linkedWallets,
|
|
@@ -722,13 +725,14 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
722
725
|
id: `project-settings-${environmentId}`,
|
|
723
726
|
type: 'application/json',
|
|
724
727
|
});
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
728
|
+
const initialViewType = useInitialViewType.useInitialViewType({
|
|
729
|
+
bridgeOnboardingCompleted,
|
|
730
|
+
connectedWallets,
|
|
731
|
+
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
732
|
+
isBridgeFlow,
|
|
733
|
+
isMultiWalletEnabled: multiWallet,
|
|
734
|
+
});
|
|
735
|
+
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_q = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.design) === null || _q === void 0 ? void 0 : _q.modal) || undefined), designSettings: projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
732
736
|
};
|
|
733
737
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
734
738
|
const DynamicContextProvider = (props) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { createContext, useState, useMemo,
|
|
4
|
+
import { createContext, useState, useMemo, useEffect, useCallback } from 'react';
|
|
5
5
|
import { I18nextProvider } from 'react-i18next';
|
|
6
6
|
import { getIconicSpriteUrl } from '@dynamic-labs/iconic';
|
|
7
7
|
import { Logger } from '@dynamic-labs/logger';
|
|
@@ -25,7 +25,7 @@ import '../../shared/consts/index.js';
|
|
|
25
25
|
import { CaptchaContextProvider } from '../CaptchaContext/CaptchaContext.js';
|
|
26
26
|
import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
|
|
27
27
|
import '@dynamic-labs/multi-wallet';
|
|
28
|
-
import { resolveNetworkValidationMode, initExpirationTime,
|
|
28
|
+
import { resolveNetworkValidationMode, initExpirationTime, getDeepLinkPreference } from './helpers/helpers.js';
|
|
29
29
|
import 'react-international-phone';
|
|
30
30
|
import { useFetchNonce, useNonce } from '../../store/state/nonce/nonce.js';
|
|
31
31
|
import { useProjectSettings, useFetchProjectSettings } from '../../store/state/projectSettings/projectSettings.js';
|
|
@@ -133,7 +133,6 @@ import { PhantomRedirectContextProvider } from '../PhantomRedirectContext/Phanto
|
|
|
133
133
|
import { ReinitializeContextProvider } from '../ReinitializeContext/ReinitializeContextProvider.js';
|
|
134
134
|
import { SendBalanceContextProvider } from '../SendBalanceContext/SendBalanceContext.js';
|
|
135
135
|
import { UseNetworkValidation } from '../UseNetworkValidation/UseNetworkValidation.js';
|
|
136
|
-
import { useRemoveWallet } from './hooks/useRemoveWallet/useRemoveWallet.js';
|
|
137
136
|
import { onReinitialize } from './functions/onReinitialize/onReinitialize.js';
|
|
138
137
|
import { useDisplayOrderState } from './hooks/useDisplayOrderState/useDisplayOrderState.js';
|
|
139
138
|
import { useEmailLoginState } from './hooks/useEmailLoginState/useEmailLoginState.js';
|
|
@@ -144,9 +143,11 @@ import { useShowAuthFlow } from './hooks/useShowAuthFlow/useShowAuthFlow.js';
|
|
|
144
143
|
import { usePasskeySuccessPopup } from './hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.js';
|
|
145
144
|
import { useTieCallbacksToEvents } from './hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js';
|
|
146
145
|
import { useMultiWallet } from './hooks/useMultiWallet/useMultiWallet.js';
|
|
146
|
+
import { useInitialViewType } from './hooks/useInitialViewType/useInitialViewType.js';
|
|
147
147
|
import { useMultiAsset } from './hooks/useMultiAsset/useMultiAsset.js';
|
|
148
148
|
import { useParentDynamicContextGuard } from './hooks/useParentDynamicContextGuard/useParentDynamicContextGuard.js';
|
|
149
149
|
import { useRegisterStorageService } from './hooks/useRegisterStorageService/useRegisterStorageService.js';
|
|
150
|
+
import { useRemoveWallet } from './hooks/useRemoveWallet/useRemoveWallet.js';
|
|
150
151
|
import { useShowDynamicUserProfile } from './hooks/useShowDynamicUserProfile/useShowDynamicUserProfile.js';
|
|
151
152
|
import { useShowEmbeddedWalletActionsUI } from './hooks/useShowEmbeddedWalletActionsUI/useShowEmbeddedWalletActionsUI.js';
|
|
152
153
|
import { useShowFiat } from './hooks/useShowFiat/useShowFiat.js';
|
|
@@ -287,7 +288,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
287
288
|
// which are only available further down and have would have circular dependencies
|
|
288
289
|
const [requiredWalletsConnected, setRequiredWalletsConnected] = useState(false);
|
|
289
290
|
const isUserAuthenticated = Boolean(authMode === 'connect-and-sign' ? user : requiredWalletsConnected);
|
|
290
|
-
const isRenderingEmbeddedAuthFlow =
|
|
291
|
+
const [isRenderingEmbeddedAuthFlow, setIsRenderingEmbeddedAuthFlow] = useState(false);
|
|
291
292
|
const [showAuthFlow, setShowAuthFlow] = useShowAuthFlow({
|
|
292
293
|
isAuthenticated: isUserAuthenticated,
|
|
293
294
|
isMultiWalletEnabled: multiWallet,
|
|
@@ -556,6 +557,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
556
557
|
setBridgeOnboardingCompleted,
|
|
557
558
|
setCallback,
|
|
558
559
|
setDesktopUri,
|
|
560
|
+
setIsRenderingEmbeddedAuthFlow,
|
|
559
561
|
setIsSingleWalletAccount,
|
|
560
562
|
setLegacyIsVerifying,
|
|
561
563
|
setLogInWithEmail,
|
|
@@ -632,6 +634,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
632
634
|
handlers,
|
|
633
635
|
i18nSDKInstance,
|
|
634
636
|
isBridgeFlow,
|
|
637
|
+
isRenderingEmbeddedAuthFlow,
|
|
635
638
|
isSingleWalletAccount,
|
|
636
639
|
legacyIsVerifying,
|
|
637
640
|
linkedWallets,
|
|
@@ -718,13 +721,14 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
718
721
|
id: `project-settings-${environmentId}`,
|
|
719
722
|
type: 'application/json',
|
|
720
723
|
});
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
724
|
+
const initialViewType = useInitialViewType({
|
|
725
|
+
bridgeOnboardingCompleted,
|
|
726
|
+
connectedWallets,
|
|
727
|
+
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
728
|
+
isBridgeFlow,
|
|
729
|
+
isMultiWalletEnabled: multiWallet,
|
|
730
|
+
});
|
|
731
|
+
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _q === void 0 ? void 0 : _q.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
728
732
|
};
|
|
729
733
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
730
734
|
const DynamicContextProvider = (props) => {
|
|
@@ -52,17 +52,6 @@ const initExpirationTime = (logout) => {
|
|
|
52
52
|
const expiryTimeout = Math.min(expirationTimeInMs, 2147483647);
|
|
53
53
|
logoutTimer = setTimeout(logout, expiryTimeout);
|
|
54
54
|
};
|
|
55
|
-
const getInitialViewType = ({ connectedWallets, isBridgeFlow, bridgeOnboardingCompleted, isAuthenticated, isMultiWalletEnabled, }) => {
|
|
56
|
-
// when multiwallet enabled, and user wants to link wallet
|
|
57
|
-
// show wallet-list view
|
|
58
|
-
if (isAuthenticated || bridgeOnboardingCompleted) {
|
|
59
|
-
return isMultiWalletEnabled ? 'multi-wallet-wallet-list' : 'wallet-list';
|
|
60
|
-
}
|
|
61
|
-
if (isBridgeFlow && !connectedWallets.length) {
|
|
62
|
-
return 'bridge-welcome';
|
|
63
|
-
}
|
|
64
|
-
return 'login-with-email-or-wallet';
|
|
65
|
-
};
|
|
66
55
|
const setDynamicContextSessionSettings = () => {
|
|
67
56
|
setSessionSettings(localStorage.DYNAMIC_CONTEXT_LAST_SESSION_SETTINGS);
|
|
68
57
|
dynamicContextSettingsTimer = setTimeout(isDynamicContextSessionSettingExpired, sdkSettingsTimeout);
|
|
@@ -110,7 +99,6 @@ const getDeepLinkPreference = (deepLinkPreferenceProp, isBridgeFlow) => {
|
|
|
110
99
|
};
|
|
111
100
|
|
|
112
101
|
exports.getDeepLinkPreference = getDeepLinkPreference;
|
|
113
|
-
exports.getInitialViewType = getInitialViewType;
|
|
114
102
|
exports.initExpirationTime = initExpirationTime;
|
|
115
103
|
exports.isAuthTokenExpired = isAuthTokenExpired;
|
|
116
104
|
exports.isDynamicContextSessionSettingExpired = isDynamicContextSessionSettingExpired;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { DeepLinkVariant
|
|
2
|
-
import { ViewType } from '../../ViewContext';
|
|
1
|
+
import { DeepLinkVariant } from '@dynamic-labs/wallet-connector-core';
|
|
3
2
|
import { ChainsToConnect, NetworkValidationMode } from '../types';
|
|
4
3
|
export declare const sdkSettingsTimeout: number;
|
|
5
4
|
export declare const isMinAuthTokenExpired: (token: string) => boolean;
|
|
6
5
|
export declare const isAuthTokenExpired: (token: string) => boolean;
|
|
7
6
|
export declare const initExpirationTime: (logout: VoidFunction) => void;
|
|
8
|
-
export declare const getInitialViewType: ({ connectedWallets, isBridgeFlow, bridgeOnboardingCompleted, isAuthenticated, isMultiWalletEnabled, }: {
|
|
9
|
-
connectedWallets: Wallet[];
|
|
10
|
-
isBridgeFlow: boolean;
|
|
11
|
-
isAuthenticated: boolean;
|
|
12
|
-
bridgeOnboardingCompleted: boolean;
|
|
13
|
-
isMultiWalletEnabled: boolean;
|
|
14
|
-
}) => ViewType;
|
|
15
7
|
export declare const setDynamicContextSessionSettings: () => void;
|
|
16
8
|
export declare const setWagmiSessionSettings: () => void;
|
|
17
9
|
export declare const isDynamicContextSessionSettingExpired: () => boolean;
|
|
@@ -48,17 +48,6 @@ const initExpirationTime = (logout) => {
|
|
|
48
48
|
const expiryTimeout = Math.min(expirationTimeInMs, 2147483647);
|
|
49
49
|
logoutTimer = setTimeout(logout, expiryTimeout);
|
|
50
50
|
};
|
|
51
|
-
const getInitialViewType = ({ connectedWallets, isBridgeFlow, bridgeOnboardingCompleted, isAuthenticated, isMultiWalletEnabled, }) => {
|
|
52
|
-
// when multiwallet enabled, and user wants to link wallet
|
|
53
|
-
// show wallet-list view
|
|
54
|
-
if (isAuthenticated || bridgeOnboardingCompleted) {
|
|
55
|
-
return isMultiWalletEnabled ? 'multi-wallet-wallet-list' : 'wallet-list';
|
|
56
|
-
}
|
|
57
|
-
if (isBridgeFlow && !connectedWallets.length) {
|
|
58
|
-
return 'bridge-welcome';
|
|
59
|
-
}
|
|
60
|
-
return 'login-with-email-or-wallet';
|
|
61
|
-
};
|
|
62
51
|
const setDynamicContextSessionSettings = () => {
|
|
63
52
|
setSessionSettings(DYNAMIC_CONTEXT_LAST_SESSION_SETTINGS);
|
|
64
53
|
dynamicContextSettingsTimer = setTimeout(isDynamicContextSessionSettingExpired, sdkSettingsTimeout);
|
|
@@ -105,4 +94,4 @@ const getDeepLinkPreference = (deepLinkPreferenceProp, isBridgeFlow) => {
|
|
|
105
94
|
return deepLinkPreferenceProp;
|
|
106
95
|
};
|
|
107
96
|
|
|
108
|
-
export { getDeepLinkPreference,
|
|
97
|
+
export { getDeepLinkPreference, initExpirationTime, isAuthTokenExpired, isDynamicContextSessionSettingExpired, isMinAuthTokenExpired, isWagmiSessionSettingExpired, resolveNetworkValidationMode, sdkSettingsTimeout, setDynamicContextSessionSettings, setWagmiSessionSettings };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useInitialViewType';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const useInitialViewType = ({ isAuthenticated, bridgeOnboardingCompleted, isMultiWalletEnabled, isBridgeFlow, connectedWallets, }) => {
|
|
7
|
+
// when multiwallet enabled, and user wants to link wallet
|
|
8
|
+
// show wallet-list view
|
|
9
|
+
if (isAuthenticated || bridgeOnboardingCompleted) {
|
|
10
|
+
return isMultiWalletEnabled ? 'multi-wallet-wallet-list' : 'wallet-list';
|
|
11
|
+
}
|
|
12
|
+
if (isBridgeFlow && !connectedWallets.length) {
|
|
13
|
+
return 'bridge-welcome';
|
|
14
|
+
}
|
|
15
|
+
return 'login-with-email-or-wallet';
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.useInitialViewType = useInitialViewType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
type UseInitialViewTypeProps = {
|
|
3
|
+
isAuthenticated: boolean;
|
|
4
|
+
bridgeOnboardingCompleted: boolean;
|
|
5
|
+
isMultiWalletEnabled: boolean;
|
|
6
|
+
isBridgeFlow: boolean;
|
|
7
|
+
connectedWallets: Wallet[];
|
|
8
|
+
};
|
|
9
|
+
export declare const useInitialViewType: ({ isAuthenticated, bridgeOnboardingCompleted, isMultiWalletEnabled, isBridgeFlow, connectedWallets, }: UseInitialViewTypeProps) => "multi-wallet-wallet-list" | "wallet-list" | "bridge-welcome" | "login-with-email-or-wallet";
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const useInitialViewType = ({ isAuthenticated, bridgeOnboardingCompleted, isMultiWalletEnabled, isBridgeFlow, connectedWallets, }) => {
|
|
3
|
+
// when multiwallet enabled, and user wants to link wallet
|
|
4
|
+
// show wallet-list view
|
|
5
|
+
if (isAuthenticated || bridgeOnboardingCompleted) {
|
|
6
|
+
return isMultiWalletEnabled ? 'multi-wallet-wallet-list' : 'wallet-list';
|
|
7
|
+
}
|
|
8
|
+
if (isBridgeFlow && !connectedWallets.length) {
|
|
9
|
+
return 'bridge-welcome';
|
|
10
|
+
}
|
|
11
|
+
return 'login-with-email-or-wallet';
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useInitialViewType };
|
|
@@ -43,7 +43,7 @@ const useShowAuthFlow = ({ isAuthenticated, isRenderingEmbeddedAuthFlow, isMulti
|
|
|
43
43
|
dynamicEvents.dynamicEvents.emit('authFlowClose');
|
|
44
44
|
}
|
|
45
45
|
if (value) {
|
|
46
|
-
if (ignoreIfIsEmbeddedWidget && isRenderingEmbeddedAuthFlow
|
|
46
|
+
if (ignoreIfIsEmbeddedWidget && isRenderingEmbeddedAuthFlow)
|
|
47
47
|
return;
|
|
48
48
|
if (performMultiWalletChecks && isAuthenticated) {
|
|
49
49
|
if (!isMultiWalletEnabled) {
|
|
@@ -39,7 +39,7 @@ const useShowAuthFlow = ({ isAuthenticated, isRenderingEmbeddedAuthFlow, isMulti
|
|
|
39
39
|
dynamicEvents.emit('authFlowClose');
|
|
40
40
|
}
|
|
41
41
|
if (value) {
|
|
42
|
-
if (ignoreIfIsEmbeddedWidget && isRenderingEmbeddedAuthFlow
|
|
42
|
+
if (ignoreIfIsEmbeddedWidget && isRenderingEmbeddedAuthFlow)
|
|
43
43
|
return;
|
|
44
44
|
if (performMultiWalletChecks && isAuthenticated) {
|
|
45
45
|
if (!isMultiWalletEnabled) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch,
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { changeLanguage } from 'i18next';
|
|
3
3
|
import { CountryIso2 } from 'react-international-phone';
|
|
4
4
|
import { NameServiceData, ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
@@ -64,7 +64,7 @@ export interface IDynamicContext {
|
|
|
64
64
|
handlers?: DynamicHandlers;
|
|
65
65
|
isBridgeFlow: boolean;
|
|
66
66
|
/** Whether there is an instance of DynamicEmbeddedAuthFlow being rendered */
|
|
67
|
-
isRenderingEmbeddedAuthFlow:
|
|
67
|
+
isRenderingEmbeddedAuthFlow: boolean;
|
|
68
68
|
isSingleWalletAccount: boolean;
|
|
69
69
|
/**
|
|
70
70
|
* Legacy boolean flag used in useVerifyOnAwaitingSignature. Used to be called "isVerifying"
|
|
@@ -80,6 +80,7 @@ export interface IDynamicContext {
|
|
|
80
80
|
loginWithEmail: boolean;
|
|
81
81
|
selectedTabIndex: number;
|
|
82
82
|
selectedTabSettings: WalletListViewTabItem | undefined;
|
|
83
|
+
setIsRenderingEmbeddedAuthFlow: Dispatch<SetStateAction<boolean>>;
|
|
83
84
|
tabsItems: WalletListViewTabItem[] | undefined;
|
|
84
85
|
setSelectedTabIndex: Dispatch<SetStateAction<number>>;
|
|
85
86
|
multiAsset: boolean;
|
|
@@ -159,6 +160,9 @@ export interface IDynamicContext {
|
|
|
159
160
|
termsOfServiceUrl?: string;
|
|
160
161
|
theme?: ThemeData | ThemeSetting;
|
|
161
162
|
toolkitEnabled?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated fetch from store instead. Try `getUser` / `useUser` or `useUserCoalesced`.
|
|
165
|
+
*/
|
|
162
166
|
user: UserProfile | undefined;
|
|
163
167
|
userWithMissingInfo: UserProfile | undefined;
|
|
164
168
|
/**
|
|
@@ -19,6 +19,7 @@ const mapErrorCodeToTranslation = {
|
|
|
19
19
|
[utils.ErrorCode.ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_PROFILE]: 'dyn_error.account_already_linked_to_different_profile',
|
|
20
20
|
[utils.ErrorCode.CONNECTION_REJECTED]: 'dyn_error.connection_rejected',
|
|
21
21
|
[utils.ErrorCode.MISSING_PUBLIC_ADDRESS]: 'dyn_error.missing_public_address',
|
|
22
|
+
[utils.ErrorCode.CONNECTION_PROPOSAL_EXPIRED]: 'dyn_error.connection_proposal_expired',
|
|
22
23
|
};
|
|
23
24
|
/** A hook that listens to the error context and returns a translated value */
|
|
24
25
|
const useErrorText = () => {
|
|
@@ -15,6 +15,7 @@ const mapErrorCodeToTranslation = {
|
|
|
15
15
|
[ErrorCode.ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_PROFILE]: 'dyn_error.account_already_linked_to_different_profile',
|
|
16
16
|
[ErrorCode.CONNECTION_REJECTED]: 'dyn_error.connection_rejected',
|
|
17
17
|
[ErrorCode.MISSING_PUBLIC_ADDRESS]: 'dyn_error.missing_public_address',
|
|
18
|
+
[ErrorCode.CONNECTION_PROPOSAL_EXPIRED]: 'dyn_error.connection_proposal_expired',
|
|
18
19
|
};
|
|
19
20
|
/** A hook that listens to the error context and returns a translated value */
|
|
20
21
|
const useErrorText = () => {
|
|
@@ -54,6 +54,7 @@ require('../FieldsStateContext/FieldsStateContext.cjs');
|
|
|
54
54
|
require('../UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
55
55
|
require('@dynamic-labs/rpc-providers');
|
|
56
56
|
require('../../store/state/loadingAndLifecycle.cjs');
|
|
57
|
+
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
57
58
|
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
58
59
|
require('react-i18next');
|
|
59
60
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
@@ -50,6 +50,7 @@ import '../FieldsStateContext/FieldsStateContext.js';
|
|
|
50
50
|
import '../UserFieldEditorContext/UserFieldEditorContext.js';
|
|
51
51
|
import '@dynamic-labs/rpc-providers';
|
|
52
52
|
import '../../store/state/loadingAndLifecycle.js';
|
|
53
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
53
54
|
import '../../store/state/walletOptions/walletOptions.js';
|
|
54
55
|
import 'react-i18next';
|
|
55
56
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
@@ -54,6 +54,7 @@ require('../UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
54
54
|
require('@dynamic-labs/rpc-providers');
|
|
55
55
|
require('../../store/state/loadingAndLifecycle.cjs');
|
|
56
56
|
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
57
|
+
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
57
58
|
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
58
59
|
require('react-i18next');
|
|
59
60
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
@@ -50,6 +50,7 @@ import '../UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
50
50
|
import '@dynamic-labs/rpc-providers';
|
|
51
51
|
import '../../store/state/loadingAndLifecycle.js';
|
|
52
52
|
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
53
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
53
54
|
import '../../store/state/walletOptions/walletOptions.js';
|
|
54
55
|
import 'react-i18next';
|
|
55
56
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
@@ -112,7 +112,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
112
112
|
setSocialProvider(socialSignInProvider);
|
|
113
113
|
clearStackAndPush('social-redirect-view');
|
|
114
114
|
// Only open the auth flow when the embedded widget is not rendered
|
|
115
|
-
if (!isRenderingEmbeddedAuthFlow
|
|
115
|
+
if (!isRenderingEmbeddedAuthFlow) {
|
|
116
116
|
setShowAuthFlow(true);
|
|
117
117
|
}
|
|
118
118
|
}, [
|
|
@@ -108,7 +108,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
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
|
-
if (!isRenderingEmbeddedAuthFlow
|
|
111
|
+
if (!isRenderingEmbeddedAuthFlow) {
|
|
112
112
|
setShowAuthFlow(true);
|
|
113
113
|
}
|
|
114
114
|
}, [
|
|
@@ -55,7 +55,7 @@ const ViewContextProvider = ({ children, initialViewType }) => {
|
|
|
55
55
|
}, [clearError]);
|
|
56
56
|
useDynamicEvents.useInternalDynamicEvents('logout', clearStackAndPushInitialView);
|
|
57
57
|
// Wait for the auth flow animation transition to finish before clearing the stack
|
|
58
|
-
useDynamicEvents.useInternalDynamicEvents('authFlowClose', () => setTimeout(clearStackAndPushInitialView,
|
|
58
|
+
useDynamicEvents.useInternalDynamicEvents('authFlowClose', () => setTimeout(clearStackAndPushInitialView, 100));
|
|
59
59
|
const value = React.useMemo(() => ({
|
|
60
60
|
canGoBack: stack.length > 1,
|
|
61
61
|
clearStackAndPush,
|
|
@@ -51,7 +51,7 @@ const ViewContextProvider = ({ children, initialViewType }) => {
|
|
|
51
51
|
}, [clearError]);
|
|
52
52
|
useInternalDynamicEvents('logout', clearStackAndPushInitialView);
|
|
53
53
|
// Wait for the auth flow animation transition to finish before clearing the stack
|
|
54
|
-
useInternalDynamicEvents('authFlowClose', () => setTimeout(clearStackAndPushInitialView,
|
|
54
|
+
useInternalDynamicEvents('authFlowClose', () => setTimeout(clearStackAndPushInitialView, 100));
|
|
55
55
|
const value = useMemo(() => ({
|
|
56
56
|
canGoBack: stack.length > 1,
|
|
57
57
|
clearStackAndPush,
|
|
@@ -36,7 +36,7 @@ const translation = {
|
|
|
36
36
|
testnet_warning: 'A testnet network has been selected. Please only use testnet funds or they will be lost.',
|
|
37
37
|
ordinals_address: 'Ordinals address',
|
|
38
38
|
payment_address: 'Payment address',
|
|
39
|
-
balance: '
|
|
39
|
+
balance: 'Total balance',
|
|
40
40
|
options: {
|
|
41
41
|
copy_ens: 'Copy ENS',
|
|
42
42
|
view_address: 'View address',
|
|
@@ -50,7 +50,7 @@ const translation = {
|
|
|
50
50
|
testnet_warning: 'A testnet network has been selected. Please only use testnet funds or they will be lost.',
|
|
51
51
|
ordinals_address: 'Ordinals address',
|
|
52
52
|
payment_address: 'Payment address',
|
|
53
|
-
balance: '
|
|
53
|
+
balance: 'Total balance',
|
|
54
54
|
options: {
|
|
55
55
|
copy_ens: 'Copy ENS',
|
|
56
56
|
view_address: 'View address',
|
|
@@ -2479,6 +2479,7 @@ const translation = {
|
|
|
2479
2479
|
account_already_linked_to_different_profile: 'This social account is already linked to a different profile.',
|
|
2480
2480
|
connection_rejected: 'Connection rejected. Please try again.',
|
|
2481
2481
|
missing_public_address: 'Connection cancelled. Please try again',
|
|
2482
|
+
connection_proposal_expired: 'Connection proposal expired. Please try again.',
|
|
2482
2483
|
},
|
|
2483
2484
|
};
|
|
2484
2485
|
|
|
@@ -30,7 +30,7 @@ export declare const translation: {
|
|
|
30
30
|
testnet_warning: 'A testnet network has been selected. Please only use testnet funds or they will be lost.',
|
|
31
31
|
ordinals_address: 'Ordinals address',
|
|
32
32
|
payment_address: 'Payment address',
|
|
33
|
-
balance: '
|
|
33
|
+
balance: 'Total balance',
|
|
34
34
|
options: {
|
|
35
35
|
copy_ens: 'Copy ENS',
|
|
36
36
|
view_address: 'View address',
|
|
@@ -2475,5 +2475,6 @@ export declare const translation: {
|
|
|
2475
2475
|
account_already_linked_to_different_profile: string;
|
|
2476
2476
|
connection_rejected: string;
|
|
2477
2477
|
missing_public_address: string;
|
|
2478
|
+
connection_proposal_expired: string;
|
|
2478
2479
|
};
|
|
2479
2480
|
};
|
|
@@ -32,7 +32,7 @@ const translation = {
|
|
|
32
32
|
testnet_warning: 'A testnet network has been selected. Please only use testnet funds or they will be lost.',
|
|
33
33
|
ordinals_address: 'Ordinals address',
|
|
34
34
|
payment_address: 'Payment address',
|
|
35
|
-
balance: '
|
|
35
|
+
balance: 'Total balance',
|
|
36
36
|
options: {
|
|
37
37
|
copy_ens: 'Copy ENS',
|
|
38
38
|
view_address: 'View address',
|
|
@@ -46,7 +46,7 @@ const translation = {
|
|
|
46
46
|
testnet_warning: 'A testnet network has been selected. Please only use testnet funds or they will be lost.',
|
|
47
47
|
ordinals_address: 'Ordinals address',
|
|
48
48
|
payment_address: 'Payment address',
|
|
49
|
-
balance: '
|
|
49
|
+
balance: 'Total balance',
|
|
50
50
|
options: {
|
|
51
51
|
copy_ens: 'Copy ENS',
|
|
52
52
|
view_address: 'View address',
|
|
@@ -2475,6 +2475,7 @@ const translation = {
|
|
|
2475
2475
|
account_already_linked_to_different_profile: 'This social account is already linked to a different profile.',
|
|
2476
2476
|
connection_rejected: 'Connection rejected. Please try again.',
|
|
2477
2477
|
missing_public_address: 'Connection cancelled. Please try again',
|
|
2478
|
+
connection_proposal_expired: 'Connection proposal expired. Please try again.',
|
|
2478
2479
|
},
|
|
2479
2480
|
};
|
|
2480
2481
|
|