@dynamic-labs/sdk-react-core 4.59.1 → 4.60.0
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 +23 -0
- package/package.cjs +2 -1
- package/package.js +2 -1
- package/package.json +13 -12
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.cjs +5 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.d.ts +2 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.js +5 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/events/embeddedWallet.d.ts +15 -3
- package/src/lib/shared/assets/index.d.ts +1 -1
- package/src/lib/shared/assets/setup-password-terms-illustration.cjs +83 -0
- package/src/lib/shared/assets/setup-password-terms-illustration.js +59 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +48 -6
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +8 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +49 -7
- package/src/lib/utils/hooks/useGetPasswordForSigning/index.d.ts +2 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.cjs +16 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.d.ts +5 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.js +12 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.cjs +144 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.d.ts +5 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.js +140 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +14 -14
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +14 -14
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.cjs +13 -100
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.js +13 -100
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +10 -3
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +10 -3
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +2 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +3 -2
- package/src/lib/utils/hooks/useWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/useWalletUnlock/useWalletUnlock.d.ts +15 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.cjs → UnlockWalletView/UnlockWalletView.cjs} +18 -13
- package/src/lib/views/UnlockWalletView/UnlockWalletView.d.ts +6 -0
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.js → UnlockWalletView/UnlockWalletView.js} +18 -13
- package/src/lib/views/UnlockWalletView/index.d.ts +2 -0
- package/src/lib/views/index.d.ts +3 -3
- package/src/lib/views/viewToComponentMap.cjs +3 -3
- package/src/lib/views/viewToComponentMap.d.ts +1 -1
- package/src/lib/views/viewToComponentMap.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +43 -43
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +43 -43
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +33 -19
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +33 -19
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.cjs +61 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.js +57 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/index.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.js +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.cjs +13 -6
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.js +13 -6
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/shared/assets/warning-circle-orange.cjs +0 -57
- package/src/lib/shared/assets/warning-circle-orange.js +0 -33
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.d.ts +0 -2
- package/src/lib/views/SetupPasswordForWalletCreationView/index.d.ts +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { DeferredPromise } from '@dynamic-labs/utils';
|
|
5
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
6
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
7
|
+
import '@dynamic-labs/iconic';
|
|
8
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import '../../../shared/logger.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
13
|
+
import '../../constants/colors.js';
|
|
14
|
+
import '../../constants/values.js';
|
|
15
|
+
import '@dynamic-labs/sdk-api-core';
|
|
16
|
+
import '../../../shared/consts/index.js';
|
|
17
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
18
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
20
|
+
import '@dynamic-labs/multi-wallet';
|
|
21
|
+
import 'react-international-phone';
|
|
22
|
+
import '../../../store/state/nonce/nonce.js';
|
|
23
|
+
import '@dynamic-labs-sdk/client/core';
|
|
24
|
+
import '../../../client/client.js';
|
|
25
|
+
import '@dynamic-labs-sdk/client';
|
|
26
|
+
import '../../../config/ApiEndpoint.js';
|
|
27
|
+
import '@dynamic-labs/locale';
|
|
28
|
+
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
29
|
+
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
30
|
+
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
31
|
+
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
32
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
33
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
34
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
35
|
+
import '../../../store/state/authMode/authMode.js';
|
|
36
|
+
import '../../../context/VerificationContext/VerificationContext.js';
|
|
37
|
+
import 'react-dom';
|
|
38
|
+
import '../../functions/compareChains/compareChains.js';
|
|
39
|
+
import '../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
40
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
41
|
+
import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
42
|
+
import 'bs58';
|
|
43
|
+
import '@dynamic-labs/types';
|
|
44
|
+
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
45
|
+
import '../../../context/LoadingContext/LoadingContext.js';
|
|
46
|
+
import '../../../context/WalletContext/WalletContext.js';
|
|
47
|
+
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
48
|
+
import 'yup';
|
|
49
|
+
import '../../../context/MockContext/MockContext.js';
|
|
50
|
+
import '../../../views/CollectUserDataView/useFields.js';
|
|
51
|
+
import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
52
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
53
|
+
import '@dynamic-labs/rpc-providers';
|
|
54
|
+
import '../../../store/state/walletOptions/walletOptions.js';
|
|
55
|
+
import 'react-i18next';
|
|
56
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
57
|
+
import '../../../components/Alert/Alert.js';
|
|
58
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
59
|
+
import '../../../components/IconButton/IconButton.js';
|
|
60
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
61
|
+
import '../../../components/Input/Input.js';
|
|
62
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
63
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
64
|
+
import '../../../components/OverlayCard/OverlayCard.js';
|
|
65
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
66
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
67
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
68
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
69
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
70
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
71
|
+
import 'react-focus-lock';
|
|
72
|
+
import 'qrcode';
|
|
73
|
+
import 'formik';
|
|
74
|
+
import '../useSubdomainCheck/useSubdomainCheck.js';
|
|
75
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
76
|
+
import '../useWalletBackup/useWalletBackup.js';
|
|
77
|
+
import '../useWalletBackup/types.js';
|
|
78
|
+
import '../useWalletBackup/cloudProviders.js';
|
|
79
|
+
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
80
|
+
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
81
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
82
|
+
import '@hcaptcha/react-hcaptcha';
|
|
83
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
84
|
+
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
85
|
+
import '../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
86
|
+
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
87
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
88
|
+
import '../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
89
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
90
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
91
|
+
import '../../../store/state/sendBalances.js';
|
|
92
|
+
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
93
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
94
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
95
|
+
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
96
|
+
import '../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
|
|
97
|
+
import '../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
|
|
98
|
+
import '../../../../index.js';
|
|
99
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
100
|
+
import '../../../store/state/tokenBalances.js';
|
|
101
|
+
import '../../../store/state/multichainBalances.js';
|
|
102
|
+
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
103
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
104
|
+
|
|
105
|
+
const usePromptWalletUnlock = () => {
|
|
106
|
+
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
107
|
+
const { pushView } = useViewContext();
|
|
108
|
+
const promptWalletUnlock = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ accountAddress, chainName, }) {
|
|
109
|
+
const deferred = new DeferredPromise();
|
|
110
|
+
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: false });
|
|
111
|
+
pushView('unlock-wallet', { accountAddress, chainName });
|
|
112
|
+
const passwordProvidedHandler = (payload) => {
|
|
113
|
+
if (payload.accountAddress === accountAddress &&
|
|
114
|
+
payload.chainName === chainName) {
|
|
115
|
+
deferred.resolve(payload.password);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
dynamicEvents.on('walletUnlockPasswordProvided', passwordProvidedHandler);
|
|
119
|
+
const cancelledHandler = (payload) => {
|
|
120
|
+
if (payload.accountAddress === accountAddress &&
|
|
121
|
+
payload.chainName === chainName) {
|
|
122
|
+
deferred.resolve(undefined);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
dynamicEvents.on('walletUnlockCancelled', cancelledHandler);
|
|
126
|
+
const authFlowCloseHandler = () => {
|
|
127
|
+
deferred.resolve(undefined);
|
|
128
|
+
};
|
|
129
|
+
dynamicEvents.on('authFlowClose', authFlowCloseHandler);
|
|
130
|
+
deferred.promise.finally(() => {
|
|
131
|
+
dynamicEvents.off('walletUnlockPasswordProvided', passwordProvidedHandler);
|
|
132
|
+
dynamicEvents.off('walletUnlockCancelled', cancelledHandler);
|
|
133
|
+
dynamicEvents.off('authFlowClose', authFlowCloseHandler);
|
|
134
|
+
});
|
|
135
|
+
return deferred.promise;
|
|
136
|
+
}), [setShowAuthFlow, pushView]);
|
|
137
|
+
return promptWalletUnlock;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { usePromptWalletUnlock };
|
|
@@ -4,37 +4,37 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
-
require('@dynamic-labs-sdk/client/core');
|
|
8
|
-
require('@dynamic-labs/sdk-api-core');
|
|
9
|
-
require('../../../client/client.cjs');
|
|
10
7
|
require('react');
|
|
11
|
-
require('
|
|
12
|
-
require('
|
|
8
|
+
require('../../../events/dynamicEvents.cjs');
|
|
9
|
+
require('../../../../../_virtual/_tslib.cjs');
|
|
10
|
+
require('@dynamic-labs/utils');
|
|
11
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
12
|
+
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('react/jsx-runtime');
|
|
15
15
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
16
|
require('../../../shared/logger.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-book');
|
|
18
|
-
require('@dynamic-labs/utils');
|
|
19
18
|
require('../../constants/colors.cjs');
|
|
20
19
|
require('../../constants/values.cjs');
|
|
20
|
+
require('@dynamic-labs/sdk-api-core');
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
22
|
-
require('
|
|
22
|
+
require('../../../store/state/authMode/authMode.cjs');
|
|
23
|
+
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
|
+
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
23
25
|
require('@dynamic-labs/multi-wallet');
|
|
24
26
|
require('react-international-phone');
|
|
25
27
|
require('../../../store/state/nonce/nonce.cjs');
|
|
28
|
+
require('@dynamic-labs-sdk/client/core');
|
|
29
|
+
require('../../../client/client.cjs');
|
|
30
|
+
require('@dynamic-labs-sdk/client');
|
|
31
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
32
|
+
var isCookieEnabled = require('../../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
|
|
26
33
|
require('@dynamic-labs/locale');
|
|
27
34
|
var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
28
35
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
29
36
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
30
37
|
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
31
|
-
require('../../../events/dynamicEvents.cjs');
|
|
32
|
-
var isCookieEnabled = require('../../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
|
|
33
|
-
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
34
|
-
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
35
|
-
require('../../../store/state/authMode/authMode.cjs');
|
|
36
|
-
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
37
|
-
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
38
38
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
39
39
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
40
40
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { isSessionKeyCompatibleWalletConnector, isDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
import '@dynamic-labs-sdk/client/core';
|
|
4
|
-
import '@dynamic-labs/sdk-api-core';
|
|
5
|
-
import '../../../client/client.js';
|
|
6
3
|
import 'react';
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
4
|
+
import '../../../events/dynamicEvents.js';
|
|
5
|
+
import '../../../../../_virtual/_tslib.js';
|
|
6
|
+
import '@dynamic-labs/utils';
|
|
7
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
8
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import '../../../context/ViewContext/ViewContext.js';
|
|
12
12
|
import '../../../shared/logger.js';
|
|
13
13
|
import '@dynamic-labs/wallet-book';
|
|
14
|
-
import '@dynamic-labs/utils';
|
|
15
14
|
import '../../constants/colors.js';
|
|
16
15
|
import '../../constants/values.js';
|
|
16
|
+
import '@dynamic-labs/sdk-api-core';
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
18
|
-
import '
|
|
18
|
+
import '../../../store/state/authMode/authMode.js';
|
|
19
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
20
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
19
21
|
import '@dynamic-labs/multi-wallet';
|
|
20
22
|
import 'react-international-phone';
|
|
21
23
|
import '../../../store/state/nonce/nonce.js';
|
|
24
|
+
import '@dynamic-labs-sdk/client/core';
|
|
25
|
+
import '../../../client/client.js';
|
|
26
|
+
import '@dynamic-labs-sdk/client';
|
|
27
|
+
import '../../../config/ApiEndpoint.js';
|
|
28
|
+
import { isCookieEnabled } from '../../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
|
|
22
29
|
import '@dynamic-labs/locale';
|
|
23
30
|
import { useApiBaseUrl } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
24
31
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
25
32
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
26
33
|
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
27
|
-
import '../../../events/dynamicEvents.js';
|
|
28
|
-
import { isCookieEnabled } from '../../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
|
|
29
|
-
import '../../../context/DynamicContext/DynamicContext.js';
|
|
30
|
-
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
31
|
-
import '../../../store/state/authMode/authMode.js';
|
|
32
|
-
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
33
|
-
import '../../../context/ErrorContext/ErrorContext.js';
|
|
34
34
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
35
35
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
36
36
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -13,7 +13,7 @@ require('../../../config/ApiEndpoint.cjs');
|
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('react/jsx-runtime');
|
|
16
|
-
|
|
16
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
17
|
require('../../../shared/logger.cjs');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
19
19
|
require('@dynamic-labs/utils');
|
|
@@ -28,84 +28,9 @@ require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
|
28
28
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
29
29
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
30
30
|
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
31
|
-
|
|
31
|
+
require('../../../events/dynamicEvents.cjs');
|
|
32
32
|
var useProjectSettings = require('../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.cjs');
|
|
33
|
-
require('../../../context/
|
|
34
|
-
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
35
|
-
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
36
|
-
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
37
|
-
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
38
|
-
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
39
|
-
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
40
|
-
require('../../../store/state/authMode/authMode.cjs');
|
|
41
|
-
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
42
|
-
require('react-dom');
|
|
43
|
-
require('../../functions/compareChains/compareChains.cjs');
|
|
44
|
-
require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
45
|
-
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
46
|
-
require('../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
47
|
-
require('bs58');
|
|
48
|
-
require('@dynamic-labs/types');
|
|
49
|
-
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
50
|
-
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
51
|
-
require('../../../context/WalletContext/WalletContext.cjs');
|
|
52
|
-
require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
53
|
-
require('yup');
|
|
54
|
-
require('../../../context/MockContext/MockContext.cjs');
|
|
55
|
-
require('../../../views/CollectUserDataView/useFields.cjs');
|
|
56
|
-
require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
57
|
-
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
58
|
-
require('@dynamic-labs/rpc-providers');
|
|
59
|
-
require('../../../store/state/walletOptions/walletOptions.cjs');
|
|
60
|
-
require('react-i18next');
|
|
61
|
-
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
62
|
-
require('../../../components/Alert/Alert.cjs');
|
|
63
|
-
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
64
|
-
require('../../../components/IconButton/IconButton.cjs');
|
|
65
|
-
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
66
|
-
require('../../../components/Input/Input.cjs');
|
|
67
|
-
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
68
|
-
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
69
|
-
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
70
|
-
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
71
|
-
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
72
|
-
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
73
|
-
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
74
|
-
require('../../../components/Popper/Popper/Popper.cjs');
|
|
75
|
-
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
76
|
-
require('react-focus-lock');
|
|
77
|
-
require('qrcode');
|
|
78
|
-
require('formik');
|
|
79
|
-
require('../useSubdomainCheck/useSubdomainCheck.cjs');
|
|
80
|
-
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
81
|
-
require('../useWalletBackup/useWalletBackup.cjs');
|
|
82
|
-
require('../useWalletBackup/types.cjs');
|
|
83
|
-
require('../useWalletBackup/cloudProviders.cjs');
|
|
84
|
-
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
85
|
-
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
86
|
-
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
87
|
-
require('@hcaptcha/react-hcaptcha');
|
|
88
|
-
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
89
|
-
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
90
|
-
require('../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
91
|
-
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
92
|
-
require('../../../context/FooterAnimationContext/index.cjs');
|
|
93
|
-
require('../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
94
|
-
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
95
|
-
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
96
|
-
require('../../../store/state/sendBalances.cjs');
|
|
97
|
-
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
98
|
-
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
99
|
-
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
100
|
-
require('../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
101
|
-
require('../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
|
|
102
|
-
require('../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
103
|
-
require('../../../../index.cjs');
|
|
104
|
-
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
105
|
-
require('../../../store/state/tokenBalances.cjs');
|
|
106
|
-
require('../../../store/state/multichainBalances.cjs');
|
|
107
|
-
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
108
|
-
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
33
|
+
var DynamicWidgetContext = require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
109
34
|
|
|
110
35
|
const PASSWORD_SETUP_CANCELLED_ERROR = 'Password setup cancelled';
|
|
111
36
|
/**
|
|
@@ -121,35 +46,23 @@ const PASSWORD_SETUP_CANCELLED_ERROR = 'Password setup cancelled';
|
|
|
121
46
|
const useSetupPassword = () => {
|
|
122
47
|
var _a, _b;
|
|
123
48
|
const projectSettings = useProjectSettings.useProjectSettings();
|
|
124
|
-
const {
|
|
125
|
-
const { pushView } = ViewContext.useViewContext();
|
|
49
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
126
50
|
const isPasscodeRequired = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.waas) === null || _a === void 0 ? void 0 : _a.passcodeRequired) !== null && _b !== void 0 ? _b : false;
|
|
127
51
|
const setupPassword = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
128
52
|
if (!isPasscodeRequired) {
|
|
129
53
|
return undefined;
|
|
130
54
|
}
|
|
131
|
-
setShowAuthFlow(true, {
|
|
132
|
-
ignoreIfIsEmbeddedWidget: false,
|
|
133
|
-
performMultiWalletChecks: false,
|
|
134
|
-
});
|
|
135
|
-
pushView('setup-password-for-wallet-creation');
|
|
136
55
|
return new Promise((resolve, reject) => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
const cleanup = () => {
|
|
146
|
-
dynamicEvents.dynamicEvents.off('embeddedWalletPasswordSetupCompleted', handleComplete);
|
|
147
|
-
dynamicEvents.dynamicEvents.off('embeddedWalletPasswordSetupCancelled', handleCancelled);
|
|
148
|
-
};
|
|
149
|
-
dynamicEvents.dynamicEvents.once('embeddedWalletPasswordSetupCompleted', handleComplete);
|
|
150
|
-
dynamicEvents.dynamicEvents.once('embeddedWalletPasswordSetupCancelled', handleCancelled);
|
|
56
|
+
setDynamicWidgetView('setup-password', {
|
|
57
|
+
onCancel: () => {
|
|
58
|
+
reject(new Error(PASSWORD_SETUP_CANCELLED_ERROR));
|
|
59
|
+
},
|
|
60
|
+
onComplete: (password) => {
|
|
61
|
+
resolve(password);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
151
64
|
});
|
|
152
|
-
}), [isPasscodeRequired,
|
|
65
|
+
}), [isPasscodeRequired, setDynamicWidgetView]);
|
|
153
66
|
return { isPasscodeRequired, setupPassword };
|
|
154
67
|
};
|
|
155
68
|
|
|
@@ -9,7 +9,7 @@ import '../../../config/ApiEndpoint.js';
|
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import 'react/jsx-runtime';
|
|
12
|
-
import
|
|
12
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
13
13
|
import '../../../shared/logger.js';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
15
15
|
import '@dynamic-labs/utils';
|
|
@@ -24,84 +24,9 @@ import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
|
24
24
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
25
25
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
26
26
|
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
27
|
-
import
|
|
27
|
+
import '../../../events/dynamicEvents.js';
|
|
28
28
|
import { useProjectSettings } from '../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
|
|
29
|
-
import '../../../context/
|
|
30
|
-
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
31
|
-
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
32
|
-
import '../../../context/ErrorContext/ErrorContext.js';
|
|
33
|
-
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
34
|
-
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
35
|
-
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
36
|
-
import '../../../store/state/authMode/authMode.js';
|
|
37
|
-
import '../../../context/VerificationContext/VerificationContext.js';
|
|
38
|
-
import 'react-dom';
|
|
39
|
-
import '../../functions/compareChains/compareChains.js';
|
|
40
|
-
import '../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
41
|
-
import '../../../context/ThemeContext/ThemeContext.js';
|
|
42
|
-
import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
43
|
-
import 'bs58';
|
|
44
|
-
import '@dynamic-labs/types';
|
|
45
|
-
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
46
|
-
import '../../../context/LoadingContext/LoadingContext.js';
|
|
47
|
-
import '../../../context/WalletContext/WalletContext.js';
|
|
48
|
-
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
49
|
-
import 'yup';
|
|
50
|
-
import '../../../context/MockContext/MockContext.js';
|
|
51
|
-
import '../../../views/CollectUserDataView/useFields.js';
|
|
52
|
-
import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
53
|
-
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
54
|
-
import '@dynamic-labs/rpc-providers';
|
|
55
|
-
import '../../../store/state/walletOptions/walletOptions.js';
|
|
56
|
-
import 'react-i18next';
|
|
57
|
-
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
58
|
-
import '../../../components/Alert/Alert.js';
|
|
59
|
-
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
60
|
-
import '../../../components/IconButton/IconButton.js';
|
|
61
|
-
import '../../../components/InlineWidget/InlineWidget.js';
|
|
62
|
-
import '../../../components/Input/Input.js';
|
|
63
|
-
import '../../../components/IsBrowser/IsBrowser.js';
|
|
64
|
-
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
65
|
-
import '../../../components/OverlayCard/OverlayCard.js';
|
|
66
|
-
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
67
|
-
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
68
|
-
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
69
|
-
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
70
|
-
import '../../../components/Popper/Popper/Popper.js';
|
|
71
|
-
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
72
|
-
import 'react-focus-lock';
|
|
73
|
-
import 'qrcode';
|
|
74
|
-
import 'formik';
|
|
75
|
-
import '../useSubdomainCheck/useSubdomainCheck.js';
|
|
76
|
-
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
77
|
-
import '../useWalletBackup/useWalletBackup.js';
|
|
78
|
-
import '../useWalletBackup/types.js';
|
|
79
|
-
import '../useWalletBackup/cloudProviders.js';
|
|
80
|
-
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
81
|
-
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
82
|
-
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
83
|
-
import '@hcaptcha/react-hcaptcha';
|
|
84
|
-
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
85
|
-
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
86
|
-
import '../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
87
|
-
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
88
|
-
import '../../../context/FooterAnimationContext/index.js';
|
|
89
|
-
import '../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
90
|
-
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
91
|
-
import '../../../context/OnrampContext/OnrampContext.js';
|
|
92
|
-
import '../../../store/state/sendBalances.js';
|
|
93
|
-
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
94
|
-
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
95
|
-
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
96
|
-
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
97
|
-
import '../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
|
|
98
|
-
import '../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
|
|
99
|
-
import '../../../../index.js';
|
|
100
|
-
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
101
|
-
import '../../../store/state/tokenBalances.js';
|
|
102
|
-
import '../../../store/state/multichainBalances.js';
|
|
103
|
-
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
104
|
-
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
29
|
+
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
105
30
|
|
|
106
31
|
const PASSWORD_SETUP_CANCELLED_ERROR = 'Password setup cancelled';
|
|
107
32
|
/**
|
|
@@ -117,35 +42,23 @@ const PASSWORD_SETUP_CANCELLED_ERROR = 'Password setup cancelled';
|
|
|
117
42
|
const useSetupPassword = () => {
|
|
118
43
|
var _a, _b;
|
|
119
44
|
const projectSettings = useProjectSettings();
|
|
120
|
-
const {
|
|
121
|
-
const { pushView } = useViewContext();
|
|
45
|
+
const { setDynamicWidgetView } = useWidgetContext();
|
|
122
46
|
const isPasscodeRequired = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.waas) === null || _a === void 0 ? void 0 : _a.passcodeRequired) !== null && _b !== void 0 ? _b : false;
|
|
123
47
|
const setupPassword = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
48
|
if (!isPasscodeRequired) {
|
|
125
49
|
return undefined;
|
|
126
50
|
}
|
|
127
|
-
setShowAuthFlow(true, {
|
|
128
|
-
ignoreIfIsEmbeddedWidget: false,
|
|
129
|
-
performMultiWalletChecks: false,
|
|
130
|
-
});
|
|
131
|
-
pushView('setup-password-for-wallet-creation');
|
|
132
51
|
return new Promise((resolve, reject) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
};
|
|
141
|
-
const cleanup = () => {
|
|
142
|
-
dynamicEvents.off('embeddedWalletPasswordSetupCompleted', handleComplete);
|
|
143
|
-
dynamicEvents.off('embeddedWalletPasswordSetupCancelled', handleCancelled);
|
|
144
|
-
};
|
|
145
|
-
dynamicEvents.once('embeddedWalletPasswordSetupCompleted', handleComplete);
|
|
146
|
-
dynamicEvents.once('embeddedWalletPasswordSetupCancelled', handleCancelled);
|
|
52
|
+
setDynamicWidgetView('setup-password', {
|
|
53
|
+
onCancel: () => {
|
|
54
|
+
reject(new Error(PASSWORD_SETUP_CANCELLED_ERROR));
|
|
55
|
+
},
|
|
56
|
+
onComplete: (password) => {
|
|
57
|
+
resolve(password);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
147
60
|
});
|
|
148
|
-
}), [isPasscodeRequired,
|
|
61
|
+
}), [isPasscodeRequired, setDynamicWidgetView]);
|
|
149
62
|
return { isPasscodeRequired, setupPassword };
|
|
150
63
|
};
|
|
151
64
|
|
|
@@ -220,7 +220,7 @@ const useWalletSettingsProcessor = () => {
|
|
|
220
220
|
* The hook ensures wallet creation only happens once per session until logout.
|
|
221
221
|
*/
|
|
222
222
|
const useSyncDynamicWaas = () => {
|
|
223
|
-
const {
|
|
223
|
+
const { areWalletsReadyForSettings, clearRecoveredWallets, needsAutoCreateWalletChains, initializeWaas, shouldInitializeWaas, } = useDynamicWaas.useDynamicWaas();
|
|
224
224
|
const validateWalletCreation = useWalletCreationValidation();
|
|
225
225
|
const { mutate: createWallets, isLoading: isCreatingWallets } = useWalletCreation();
|
|
226
226
|
const { mutate: processSettings, isLoading: isProcessingSettings } = useWalletSettingsProcessor();
|
|
@@ -234,6 +234,7 @@ const useSyncDynamicWaas = () => {
|
|
|
234
234
|
useDynamicEvents.useInternalDynamicEvents('logout', () => {
|
|
235
235
|
triggeredCreate.current = false;
|
|
236
236
|
triggeredSettingsProcessing.current = false;
|
|
237
|
+
clearRecoveredWallets();
|
|
237
238
|
});
|
|
238
239
|
const shouldCreateWallets = React.useCallback(() => {
|
|
239
240
|
if (triggeredCreate.current || isCreatingWallets) {
|
|
@@ -249,12 +250,17 @@ const useSyncDynamicWaas = () => {
|
|
|
249
250
|
if (triggeredSettingsProcessing.current || isProcessingSettings) {
|
|
250
251
|
return false;
|
|
251
252
|
}
|
|
252
|
-
|
|
253
|
+
// Settings processing requires wallets to be recovered first
|
|
254
|
+
if (!areWalletsReadyForSettings()) {
|
|
253
255
|
return false;
|
|
254
256
|
}
|
|
255
257
|
const validation = validateWalletCreation();
|
|
256
258
|
return validation.isValid;
|
|
257
|
-
}, [
|
|
259
|
+
}, [
|
|
260
|
+
areWalletsReadyForSettings,
|
|
261
|
+
validateWalletCreation,
|
|
262
|
+
isProcessingSettings,
|
|
263
|
+
]);
|
|
258
264
|
const handleSettingsProcessing = React.useCallback(() => {
|
|
259
265
|
if (!shouldProcessSettings()) {
|
|
260
266
|
return;
|
|
@@ -288,6 +294,7 @@ const useSyncDynamicWaas = () => {
|
|
|
288
294
|
sessionIdRef.current = undefined;
|
|
289
295
|
hasWaasInitializedRef.current = false;
|
|
290
296
|
initializingWaasRef.current = false;
|
|
297
|
+
clearRecoveredWallets();
|
|
291
298
|
}
|
|
292
299
|
if (shouldInitializeWaas && (user === null || user === void 0 ? void 0 : user.sessionId)) {
|
|
293
300
|
const { sessionId, id: userId } = user;
|
|
@@ -216,7 +216,7 @@ const useWalletSettingsProcessor = () => {
|
|
|
216
216
|
* The hook ensures wallet creation only happens once per session until logout.
|
|
217
217
|
*/
|
|
218
218
|
const useSyncDynamicWaas = () => {
|
|
219
|
-
const {
|
|
219
|
+
const { areWalletsReadyForSettings, clearRecoveredWallets, needsAutoCreateWalletChains, initializeWaas, shouldInitializeWaas, } = useDynamicWaas();
|
|
220
220
|
const validateWalletCreation = useWalletCreationValidation();
|
|
221
221
|
const { mutate: createWallets, isLoading: isCreatingWallets } = useWalletCreation();
|
|
222
222
|
const { mutate: processSettings, isLoading: isProcessingSettings } = useWalletSettingsProcessor();
|
|
@@ -230,6 +230,7 @@ const useSyncDynamicWaas = () => {
|
|
|
230
230
|
useInternalDynamicEvents('logout', () => {
|
|
231
231
|
triggeredCreate.current = false;
|
|
232
232
|
triggeredSettingsProcessing.current = false;
|
|
233
|
+
clearRecoveredWallets();
|
|
233
234
|
});
|
|
234
235
|
const shouldCreateWallets = useCallback(() => {
|
|
235
236
|
if (triggeredCreate.current || isCreatingWallets) {
|
|
@@ -245,12 +246,17 @@ const useSyncDynamicWaas = () => {
|
|
|
245
246
|
if (triggeredSettingsProcessing.current || isProcessingSettings) {
|
|
246
247
|
return false;
|
|
247
248
|
}
|
|
248
|
-
|
|
249
|
+
// Settings processing requires wallets to be recovered first
|
|
250
|
+
if (!areWalletsReadyForSettings()) {
|
|
249
251
|
return false;
|
|
250
252
|
}
|
|
251
253
|
const validation = validateWalletCreation();
|
|
252
254
|
return validation.isValid;
|
|
253
|
-
}, [
|
|
255
|
+
}, [
|
|
256
|
+
areWalletsReadyForSettings,
|
|
257
|
+
validateWalletCreation,
|
|
258
|
+
isProcessingSettings,
|
|
259
|
+
]);
|
|
254
260
|
const handleSettingsProcessing = useCallback(() => {
|
|
255
261
|
if (!shouldProcessSettings()) {
|
|
256
262
|
return;
|
|
@@ -284,6 +290,7 @@ const useSyncDynamicWaas = () => {
|
|
|
284
290
|
sessionIdRef.current = undefined;
|
|
285
291
|
hasWaasInitializedRef.current = false;
|
|
286
292
|
initializingWaasRef.current = false;
|
|
293
|
+
clearRecoveredWallets();
|
|
287
294
|
}
|
|
288
295
|
if (shouldInitializeWaas && (user === null || user === void 0 ? void 0 : user.sessionId)) {
|
|
289
296
|
const { sessionId, id: userId } = user;
|
|
@@ -227,7 +227,8 @@ const useWalletDelegation = () => {
|
|
|
227
227
|
return Object.assign(Object.assign({}, wallet), { isDismissedThisSession,
|
|
228
228
|
status });
|
|
229
229
|
})
|
|
230
|
-
.filter((wallet) => wallet !== null)
|
|
230
|
+
.filter((wallet) => wallet !== null)
|
|
231
|
+
.filter((wallet) => wallet.chain === sdkApiCore.ChainEnum.Evm || wallet.chain === sdkApiCore.ChainEnum.Sol);
|
|
231
232
|
}, [user === null || user === void 0 ? void 0 : user.verifiedCredentials, userWallets]);
|
|
232
233
|
const delegateKeyShares = React.useCallback((wallets) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
233
234
|
if (!delegatedAccessEnabled) {
|