@dynamic-labs/sdk-react-core 4.22.5 → 4.22.7
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 +15 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +3 -3
- package/src/index.js +2 -2
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/getApiHeaders.cjs +58 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/getApiHeaders.d.ts +1 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/getApiHeaders.js +54 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/index.d.ts +1 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +6 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +6 -1
- package/src/lib/client/extension/hooks/useSyncProjectSettingsWithVanillaClient/index.d.ts +1 -0
- package/src/lib/client/extension/hooks/useSyncProjectSettingsWithVanillaClient/useSyncProjectSettingsWithVanillaClient.cjs +23 -0
- package/src/lib/client/extension/hooks/useSyncProjectSettingsWithVanillaClient/useSyncProjectSettingsWithVanillaClient.d.ts +1 -0
- package/src/lib/client/extension/hooks/useSyncProjectSettingsWithVanillaClient/useSyncProjectSettingsWithVanillaClient.js +19 -0
- package/src/lib/client/extension/index.d.ts +2 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +9 -9
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +9 -9
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +6 -6
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +6 -6
- package/src/lib/context/DynamicContext/DynamicContext.cjs +19 -16
- package/src/lib/context/DynamicContext/DynamicContext.js +19 -16
- package/src/lib/context/DynamicContext/hooks/useAutoselectPrimaryWallet/useAutoselectPrimaryWallet.cjs +2 -2
- package/src/lib/context/DynamicContext/hooks/useAutoselectPrimaryWallet/useAutoselectPrimaryWallet.js +2 -2
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +4 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +4 -4
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +5 -5
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +5 -5
- package/src/lib/data/api/api.cjs +10 -26
- package/src/lib/data/api/api.js +10 -26
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +8 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +8 -0
- package/src/lib/data/api/externalAuth/externalAuth.cjs +19 -2
- package/src/lib/data/api/externalAuth/externalAuth.js +19 -2
- package/src/lib/data/api/oauth/oauth.cjs +12 -4
- package/src/lib/data/api/oauth/oauth.js +12 -4
- package/src/lib/data/api/user/user.cjs +12 -4
- package/src/lib/data/api/user/user.js +12 -4
- package/src/lib/data/api/wallets/wallets.cjs +19 -2
- package/src/lib/data/api/wallets/wallets.js +19 -2
- package/src/lib/store/state/nonce/nonce.cjs +7 -7
- package/src/lib/store/state/nonce/nonce.js +7 -7
- package/src/lib/store/state/projectSettings/projectSettings.cjs +5 -5
- package/src/lib/store/state/projectSettings/projectSettings.js +5 -5
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +7 -7
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +7 -7
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs +18 -2
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.js +18 -2
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +6 -6
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +6 -6
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.cjs +12 -12
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.js +12 -12
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +11 -11
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +11 -11
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +4 -4
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +4 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +5 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +5 -5
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +2 -2
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +2 -2
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +6 -6
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +6 -6
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +12 -12
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +12 -12
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +12 -12
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +12 -12
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +2 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +7 -7
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +7 -7
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +6 -6
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +6 -6
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.cjs +20 -4
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.js +20 -4
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +7 -7
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +7 -7
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +6 -6
- package/src/lib/utils/hooks/useMfa/useMfa.js +6 -6
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +11 -11
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +11 -11
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +5 -5
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +5 -5
- package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.cjs +6 -6
- package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.js +6 -6
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.cjs +6 -6
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.js +6 -6
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +6 -6
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +6 -6
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +12 -12
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +12 -12
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +13 -13
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +13 -13
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +2 -2
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +2 -2
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs +14 -14
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js +14 -14
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +13 -13
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +13 -13
- package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.cjs +20 -4
- package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.js +20 -4
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +18 -4
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +18 -4
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +17 -2
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +17 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +5 -5
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +5 -5
- package/src/lib/views/EmailVerification/EmailVerification.cjs +21 -21
- package/src/lib/views/EmailVerification/EmailVerification.js +21 -21
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +78 -58
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +78 -58
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +7 -7
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +7 -7
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +2 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.d.ts +1 -1
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +2 -2
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +16 -16
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +16 -16
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs +7 -7
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.js +7 -7
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +7 -7
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +7 -7
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +11 -11
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +11 -11
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.cjs +13 -13
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.js +13 -13
- /package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/{inedex.d.ts → index.d.ts} +0 -0
|
@@ -8,21 +8,32 @@ import { isSessionKeyCompatibleWallet } from '@dynamic-labs/wallet-connector-cor
|
|
|
8
8
|
import '@dynamic-labs-sdk/client/core';
|
|
9
9
|
import '@dynamic-labs-sdk/client';
|
|
10
10
|
import '../../client/client.js';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import '../../
|
|
11
|
+
import { findEmbeddedWalletFromVerifiedCredentials } from '../../utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../utils/constants/values.js';
|
|
14
|
+
import '@dynamic-labs/multi-wallet';
|
|
15
|
+
import { logger } from '../../shared/logger.js';
|
|
16
|
+
import '../../utils/constants/colors.js';
|
|
17
|
+
import 'react-international-phone';
|
|
18
|
+
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
19
|
+
import '@dynamic-labs/iconic';
|
|
16
20
|
import { ReactComponent as SvgCheck } from '../../shared/assets/check.js';
|
|
17
21
|
import { ReactComponent as SvgSignInWithEmail } from '../../shared/assets/sign-in-with-email.js';
|
|
18
|
-
import '@dynamic-labs/iconic';
|
|
19
22
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
20
|
-
import { logger } from '../../shared/logger.js';
|
|
21
23
|
import '@dynamic-labs/wallet-book';
|
|
22
|
-
import '@dynamic-labs/utils';
|
|
23
|
-
import '../../utils/constants/colors.js';
|
|
24
|
-
import '../../utils/constants/values.js';
|
|
25
24
|
import '../../shared/consts/index.js';
|
|
25
|
+
import '../../store/state/nonce/nonce.js';
|
|
26
|
+
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
27
|
+
import { updatePrimaryWalletId } from '../../utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js';
|
|
28
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
29
|
+
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
30
|
+
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
31
|
+
import { dynamicEvents } from '../../events/dynamicEvents.js';
|
|
32
|
+
import '../../store/state/projectSettings/projectSettings.js';
|
|
33
|
+
import { storeTokenAndUser } from '../../client/extension/storeTokenAndUser/storeTokenAndUser.js';
|
|
34
|
+
import { convertSdkUserToUserProfile } from '../../client/extension/user/convertSdkUserToUserProfile/convertSdkUserToUserProfile.js';
|
|
35
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
36
|
+
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
26
37
|
import '../../components/Alert/Alert.js';
|
|
27
38
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
28
39
|
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
@@ -30,22 +41,11 @@ import '../../store/state/authMode/authMode.js';
|
|
|
30
41
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
31
42
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
32
43
|
import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
|
|
33
|
-
import { findEmbeddedWalletFromVerifiedCredentials } from '../../utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
|
|
34
|
-
import '@dynamic-labs/multi-wallet';
|
|
35
|
-
import 'react-international-phone';
|
|
36
|
-
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
37
|
-
import '../../store/state/nonce/nonce.js';
|
|
38
|
-
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
39
|
-
import { updatePrimaryWalletId } from '../../utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js';
|
|
40
|
-
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
41
|
-
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
42
|
-
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
43
44
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
44
45
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
45
46
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
46
47
|
import { signInWithEmailVerification, retryEmailVerification } from '../../data/api/email/email.js';
|
|
47
48
|
import '../../config/ApiEndpoint.js';
|
|
48
|
-
import '../../store/state/projectSettings/projectSettings.js';
|
|
49
49
|
import '../../locale/locale.js';
|
|
50
50
|
import { useOtpVerificationRequest } from '../../utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js';
|
|
51
51
|
import 'react-dom';
|
|
@@ -9,29 +9,26 @@ var React = require('react');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var utils = require('@dynamic-labs/utils');
|
|
11
11
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
12
|
-
|
|
13
|
-
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
|
|
14
|
-
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
15
|
-
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
16
|
-
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
17
|
-
var Typography = require('../../../components/Typography/Typography.cjs');
|
|
18
|
-
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
19
|
-
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
20
|
-
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
21
|
-
require('@dynamic-labs/sdk-api-core');
|
|
22
|
-
var logger = require('../../../shared/logger.cjs');
|
|
23
|
-
require('@dynamic-labs/iconic');
|
|
12
|
+
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
24
13
|
var close = require('../../../shared/assets/close.cjs');
|
|
25
14
|
var exportEmbeddedHero = require('../../../shared/assets/export-embedded-hero.cjs');
|
|
26
15
|
var eyeOffIcon = require('../../../shared/assets/eye-off-icon.cjs');
|
|
27
16
|
var info = require('../../../shared/assets/info.cjs');
|
|
28
17
|
var walletV2 = require('../../../shared/assets/wallet-v2.cjs');
|
|
18
|
+
require('@dynamic-labs/iconic');
|
|
29
19
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
20
|
+
require('@dynamic-labs/sdk-api-core');
|
|
21
|
+
var logger = require('../../../shared/logger.cjs');
|
|
30
22
|
require('@dynamic-labs/wallet-book');
|
|
31
23
|
require('../../../utils/constants/colors.cjs');
|
|
32
24
|
require('../../../utils/constants/values.cjs');
|
|
33
25
|
require('../../../shared/consts/index.cjs');
|
|
26
|
+
require('../../../components/Alert/Alert.cjs');
|
|
34
27
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
28
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
29
|
+
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
30
|
+
require('../../../store/state/authMode/authMode.cjs');
|
|
31
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
35
32
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
36
33
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
37
34
|
var errors = require('../../../utils/constants/errors.cjs');
|
|
@@ -50,7 +47,6 @@ require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
|
50
47
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
51
48
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
52
49
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
53
|
-
require('../../../store/state/authMode/authMode.cjs');
|
|
54
50
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
55
51
|
require('react-dom');
|
|
56
52
|
require('../../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -76,51 +72,55 @@ require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
|
76
72
|
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
77
73
|
require('@dynamic-labs/rpc-providers');
|
|
78
74
|
require('../../../store/state/walletOptions/walletOptions.cjs');
|
|
79
|
-
require('../../../components/
|
|
80
|
-
require('../../../
|
|
75
|
+
var Typography = require('../../../components/Typography/Typography.cjs');
|
|
76
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
81
77
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
82
|
-
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
83
|
-
require('../../../components/Input/Input.cjs');
|
|
84
|
-
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
85
|
-
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
86
|
-
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
87
78
|
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
88
79
|
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
89
80
|
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
90
|
-
|
|
91
|
-
require('../../../
|
|
92
|
-
require('../../../components/
|
|
93
|
-
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
81
|
+
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
82
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
83
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
94
84
|
require('react-focus-lock');
|
|
95
|
-
require('
|
|
85
|
+
var DynamicWidgetContext = require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
86
|
+
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
87
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
88
|
+
var Badge = require('../../../components/Badge/Badge.cjs');
|
|
89
|
+
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
90
|
+
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
96
91
|
require('formik');
|
|
97
92
|
require('../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
98
|
-
require('../../../
|
|
93
|
+
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
94
|
+
require('../../../store/state/sendBalances.cjs');
|
|
95
|
+
require('../../../components/Input/Input.cjs');
|
|
96
|
+
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
97
|
+
require('../../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
98
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
99
|
+
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
100
|
+
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
101
|
+
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
102
|
+
require('qrcode');
|
|
103
|
+
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
104
|
+
var getProperErrorMessage = require('../../../modals/SignMessageConfirmationModal/getProperErrorMessage.cjs');
|
|
105
|
+
require('../../../../index.cjs');
|
|
106
|
+
var NeedHelpSection = require('../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
99
107
|
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
100
108
|
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
101
109
|
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
102
110
|
require('@hcaptcha/react-hcaptcha');
|
|
103
|
-
var
|
|
104
|
-
var DynamicWidgetContext = require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
111
|
+
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
|
|
105
112
|
var constants = require('../constants.cjs');
|
|
106
113
|
var waasExport = require('../utils/waasExport/waasExport.cjs');
|
|
107
|
-
require('../../../context/FooterAnimationContext/index.cjs');
|
|
108
114
|
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
109
|
-
require('../../../
|
|
110
|
-
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
111
|
-
require('../../../store/state/sendBalances.cjs');
|
|
115
|
+
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
112
116
|
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
113
|
-
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
114
|
-
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
115
|
-
require('../../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
116
|
-
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
117
|
-
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
118
|
-
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
119
|
-
require('../../../../index.cjs');
|
|
120
117
|
require('../../../store/state/tokenBalances.cjs');
|
|
121
118
|
var useSyncEmbeddedWalletFlow = require('../../../utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.cjs');
|
|
122
119
|
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
123
|
-
|
|
120
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
121
|
+
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
122
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
123
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
124
124
|
|
|
125
125
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
126
126
|
var _a, _b, _c;
|
|
@@ -133,6 +133,8 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
133
133
|
const { getEOAWallet, isSmartWallet } = useSmartWallets.useSmartWallets();
|
|
134
134
|
const [acknowledgement1, setAcknowledgement1] = React.useState(false);
|
|
135
135
|
const iframeContainerRef = React.useRef(null);
|
|
136
|
+
const [showSkeleton, setShowSkeleton] = React.useState(false);
|
|
137
|
+
const [waasExportComplete, setWaasExportComplete] = React.useState(false);
|
|
136
138
|
if (!primaryWallet) {
|
|
137
139
|
throw new utils.DynamicError('No primary wallet found', errors.INVALID_WALLET_DATA);
|
|
138
140
|
}
|
|
@@ -146,7 +148,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
146
148
|
const walletProperties = (_b = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId)) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
147
149
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
148
150
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
149
|
-
const [showSkeleton, setShowSkeleton] = React.useState(false);
|
|
150
151
|
// eslint-disable-next-line arrow-body-style
|
|
151
152
|
React.useEffect(() => {
|
|
152
153
|
return () => {
|
|
@@ -212,17 +213,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
if (isWaasWallet) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
216
|
+
// Start the export in the background
|
|
217
|
+
waasExport.exportWaasCredential({
|
|
218
|
+
address: exportPrivateKey ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
|
|
219
|
+
iframeContainer: iframeContainerRef.current,
|
|
220
|
+
user,
|
|
221
|
+
wallet: wallet,
|
|
222
|
+
})
|
|
223
|
+
.then(() => {
|
|
224
|
+
setWaasExportComplete(true);
|
|
225
|
+
})
|
|
226
|
+
.catch((error) => {
|
|
227
|
+
logger.logger.error(`Failed in exporting waas wallet ${wallet === null || wallet === void 0 ? void 0 : wallet.id}`, error);
|
|
228
|
+
dynamicEvents.dynamicEvents.emit('embeddedWalletRevealFailed', error);
|
|
229
|
+
});
|
|
230
|
+
// Return true immediately to show skeleton
|
|
231
|
+
return true;
|
|
226
232
|
}
|
|
227
233
|
return undefined;
|
|
228
234
|
}), {
|
|
@@ -231,6 +237,12 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
231
237
|
dynamicEvents.dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
232
238
|
},
|
|
233
239
|
});
|
|
240
|
+
// Reset waasExportComplete when data changes to false (new export starting)
|
|
241
|
+
React.useEffect(() => {
|
|
242
|
+
if (!data) {
|
|
243
|
+
setWaasExportComplete(false);
|
|
244
|
+
}
|
|
245
|
+
}, [data]);
|
|
234
246
|
const errorText = React.useMemo(() => {
|
|
235
247
|
if (!error) {
|
|
236
248
|
return undefined;
|
|
@@ -261,14 +273,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
261
273
|
if (data) {
|
|
262
274
|
// Show skeleton first
|
|
263
275
|
setShowSkeleton(true);
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
276
|
+
if (isWaasWallet) {
|
|
277
|
+
// For WAAS wallets, hide skeleton when export is actually complete
|
|
278
|
+
if (waasExportComplete) {
|
|
279
|
+
setShowSkeleton(false);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
// For other wallets, use the fixed 2-second delay
|
|
284
|
+
const timer = setTimeout(() => {
|
|
285
|
+
setShowSkeleton(false);
|
|
286
|
+
}, 2000);
|
|
287
|
+
return () => clearTimeout(timer);
|
|
288
|
+
}
|
|
269
289
|
}
|
|
270
290
|
return;
|
|
271
|
-
}, [data]);
|
|
291
|
+
}, [data, isWaasWallet, waasExportComplete]);
|
|
272
292
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => {
|
|
273
293
|
setShowAuthFlow(false);
|
|
274
294
|
}, type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
@@ -5,29 +5,26 @@ import { useState, useRef, useEffect, useMemo } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { DynamicError, AccessBlockedError } from '@dynamic-labs/utils';
|
|
7
7
|
import { isSessionKeyCompatibleWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
8
|
-
import
|
|
9
|
-
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
10
|
-
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
11
|
-
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
12
|
-
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
13
|
-
import { Typography } from '../../../components/Typography/Typography.js';
|
|
14
|
-
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
15
|
-
import '../../../context/DynamicContext/DynamicContext.js';
|
|
16
|
-
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
17
|
-
import '@dynamic-labs/sdk-api-core';
|
|
18
|
-
import { logger } from '../../../shared/logger.js';
|
|
19
|
-
import '@dynamic-labs/iconic';
|
|
8
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
20
9
|
import { ReactComponent as SvgClose } from '../../../shared/assets/close.js';
|
|
21
10
|
import { ReactComponent as SvgExportEmbeddedHero } from '../../../shared/assets/export-embedded-hero.js';
|
|
22
11
|
import { ReactComponent as SvgEyeOffIcon } from '../../../shared/assets/eye-off-icon.js';
|
|
23
12
|
import { ReactComponent as SvgInfo } from '../../../shared/assets/info.js';
|
|
24
13
|
import { ReactComponent as SvgWalletV2 } from '../../../shared/assets/wallet-v2.js';
|
|
14
|
+
import '@dynamic-labs/iconic';
|
|
25
15
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
16
|
+
import '@dynamic-labs/sdk-api-core';
|
|
17
|
+
import { logger } from '../../../shared/logger.js';
|
|
26
18
|
import '@dynamic-labs/wallet-book';
|
|
27
19
|
import '../../../utils/constants/colors.js';
|
|
28
20
|
import '../../../utils/constants/values.js';
|
|
29
21
|
import '../../../shared/consts/index.js';
|
|
22
|
+
import '../../../components/Alert/Alert.js';
|
|
30
23
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
24
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
25
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
26
|
+
import '../../../store/state/authMode/authMode.js';
|
|
27
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
31
28
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
32
29
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
33
30
|
import { INVALID_WALLET_DATA } from '../../../utils/constants/errors.js';
|
|
@@ -46,7 +43,6 @@ import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
|
46
43
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
47
44
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
48
45
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
49
|
-
import '../../../store/state/authMode/authMode.js';
|
|
50
46
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
51
47
|
import 'react-dom';
|
|
52
48
|
import '../../../utils/functions/compareChains/compareChains.js';
|
|
@@ -72,51 +68,55 @@ import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
|
72
68
|
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
73
69
|
import '@dynamic-labs/rpc-providers';
|
|
74
70
|
import '../../../store/state/walletOptions/walletOptions.js';
|
|
75
|
-
import '../../../components/
|
|
76
|
-
import '../../../
|
|
71
|
+
import { Typography } from '../../../components/Typography/Typography.js';
|
|
72
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
77
73
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
78
|
-
import '../../../components/InlineWidget/InlineWidget.js';
|
|
79
|
-
import '../../../components/Input/Input.js';
|
|
80
|
-
import '../../../components/IsBrowser/IsBrowser.js';
|
|
81
|
-
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
82
|
-
import '../../../components/OverlayCard/OverlayCard.js';
|
|
83
74
|
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
84
75
|
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
85
76
|
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
86
|
-
import
|
|
87
|
-
import '../../../
|
|
88
|
-
import '../../../components/
|
|
89
|
-
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
77
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
78
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
79
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
90
80
|
import 'react-focus-lock';
|
|
91
|
-
import '
|
|
81
|
+
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
82
|
+
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
83
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
84
|
+
import { Badge } from '../../../components/Badge/Badge.js';
|
|
85
|
+
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
86
|
+
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
92
87
|
import 'formik';
|
|
93
88
|
import '../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
94
|
-
import '../../../
|
|
89
|
+
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
90
|
+
import '../../../store/state/sendBalances.js';
|
|
91
|
+
import '../../../components/Input/Input.js';
|
|
92
|
+
import '../../../components/OverlayCard/OverlayCard.js';
|
|
93
|
+
import '../../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
94
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
95
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
96
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
97
|
+
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
98
|
+
import 'qrcode';
|
|
99
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
100
|
+
import { getProperErrorMessage } from '../../../modals/SignMessageConfirmationModal/getProperErrorMessage.js';
|
|
101
|
+
import '../../../../index.js';
|
|
102
|
+
import { NeedHelpSection } from '../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
95
103
|
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
96
104
|
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
97
105
|
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
98
106
|
import '@hcaptcha/react-hcaptcha';
|
|
99
|
-
import {
|
|
100
|
-
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
107
|
+
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
101
108
|
import { iframeContainerId, iframeElementId } from '../constants.js';
|
|
102
109
|
import { cleanupExport as cleanupExport$1, exportWaasCredential } from '../utils/waasExport/waasExport.js';
|
|
103
|
-
import '../../../context/FooterAnimationContext/index.js';
|
|
104
110
|
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
105
|
-
import '../../../
|
|
106
|
-
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
107
|
-
import '../../../store/state/sendBalances.js';
|
|
111
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
108
112
|
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
109
|
-
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
110
|
-
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
111
|
-
import '../../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
112
|
-
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
113
|
-
import '../../../context/OnrampContext/OnrampContext.js';
|
|
114
|
-
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
115
|
-
import '../../../../index.js';
|
|
116
113
|
import '../../../store/state/tokenBalances.js';
|
|
117
114
|
import { useSyncEmbeddedWalletFlow } from '../../../utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.js';
|
|
118
115
|
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
119
|
-
import
|
|
116
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
117
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
118
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
119
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
120
120
|
|
|
121
121
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
122
122
|
var _a, _b, _c;
|
|
@@ -129,6 +129,8 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
129
129
|
const { getEOAWallet, isSmartWallet } = useSmartWallets();
|
|
130
130
|
const [acknowledgement1, setAcknowledgement1] = useState(false);
|
|
131
131
|
const iframeContainerRef = useRef(null);
|
|
132
|
+
const [showSkeleton, setShowSkeleton] = useState(false);
|
|
133
|
+
const [waasExportComplete, setWaasExportComplete] = useState(false);
|
|
132
134
|
if (!primaryWallet) {
|
|
133
135
|
throw new DynamicError('No primary wallet found', INVALID_WALLET_DATA);
|
|
134
136
|
}
|
|
@@ -142,7 +144,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
142
144
|
const walletProperties = (_b = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId)) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
143
145
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
144
146
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
145
|
-
const [showSkeleton, setShowSkeleton] = useState(false);
|
|
146
147
|
// eslint-disable-next-line arrow-body-style
|
|
147
148
|
useEffect(() => {
|
|
148
149
|
return () => {
|
|
@@ -208,17 +209,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
if (isWaasWallet) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
// Start the export in the background
|
|
213
|
+
exportWaasCredential({
|
|
214
|
+
address: exportPrivateKey ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
|
|
215
|
+
iframeContainer: iframeContainerRef.current,
|
|
216
|
+
user,
|
|
217
|
+
wallet: wallet,
|
|
218
|
+
})
|
|
219
|
+
.then(() => {
|
|
220
|
+
setWaasExportComplete(true);
|
|
221
|
+
})
|
|
222
|
+
.catch((error) => {
|
|
223
|
+
logger.error(`Failed in exporting waas wallet ${wallet === null || wallet === void 0 ? void 0 : wallet.id}`, error);
|
|
224
|
+
dynamicEvents.emit('embeddedWalletRevealFailed', error);
|
|
225
|
+
});
|
|
226
|
+
// Return true immediately to show skeleton
|
|
227
|
+
return true;
|
|
222
228
|
}
|
|
223
229
|
return undefined;
|
|
224
230
|
}), {
|
|
@@ -227,6 +233,12 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
227
233
|
dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
228
234
|
},
|
|
229
235
|
});
|
|
236
|
+
// Reset waasExportComplete when data changes to false (new export starting)
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!data) {
|
|
239
|
+
setWaasExportComplete(false);
|
|
240
|
+
}
|
|
241
|
+
}, [data]);
|
|
230
242
|
const errorText = useMemo(() => {
|
|
231
243
|
if (!error) {
|
|
232
244
|
return undefined;
|
|
@@ -257,14 +269,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
257
269
|
if (data) {
|
|
258
270
|
// Show skeleton first
|
|
259
271
|
setShowSkeleton(true);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
if (isWaasWallet) {
|
|
273
|
+
// For WAAS wallets, hide skeleton when export is actually complete
|
|
274
|
+
if (waasExportComplete) {
|
|
275
|
+
setShowSkeleton(false);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
// For other wallets, use the fixed 2-second delay
|
|
280
|
+
const timer = setTimeout(() => {
|
|
281
|
+
setShowSkeleton(false);
|
|
282
|
+
}, 2000);
|
|
283
|
+
return () => clearTimeout(timer);
|
|
284
|
+
}
|
|
265
285
|
}
|
|
266
286
|
return;
|
|
267
|
-
}, [data]);
|
|
287
|
+
}, [data, isWaasWallet, waasExportComplete]);
|
|
268
288
|
const closeButton = (jsx(IconButton, { onClick: () => {
|
|
269
289
|
setShowAuthFlow(false);
|
|
270
290
|
}, type: 'button', children: jsx(SvgClose, {}) }));
|
|
@@ -7,8 +7,10 @@ var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
9
|
require('@dynamic-labs/sdk-api-core');
|
|
10
|
-
require('
|
|
11
|
-
require('
|
|
10
|
+
require('@dynamic-labs-sdk/client/core');
|
|
11
|
+
require('react');
|
|
12
|
+
require('@dynamic-labs-sdk/client');
|
|
13
|
+
require('../../../../client/client.cjs');
|
|
12
14
|
require('../../../../utils/constants/values.cjs');
|
|
13
15
|
var errors = require('../../../../utils/constants/errors.cjs');
|
|
14
16
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -16,19 +18,17 @@ require('../../../../shared/logger.cjs');
|
|
|
16
18
|
require('../../../../utils/constants/colors.cjs');
|
|
17
19
|
require('react-international-phone');
|
|
18
20
|
require('@dynamic-labs/iconic');
|
|
19
|
-
require('react');
|
|
20
21
|
require('react/jsx-runtime');
|
|
21
22
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
22
23
|
require('@dynamic-labs/wallet-book');
|
|
23
24
|
require('../../../../shared/consts/index.cjs');
|
|
24
25
|
require('../../../../store/state/nonce/nonce.cjs');
|
|
25
|
-
require('@dynamic-labs-sdk/client/core');
|
|
26
|
-
require('@dynamic-labs-sdk/client');
|
|
27
|
-
require('../../../../client/client.cjs');
|
|
28
|
-
require('../../../../events/dynamicEvents.cjs');
|
|
29
26
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
30
27
|
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
31
28
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
29
|
+
require('../../../../events/dynamicEvents.cjs');
|
|
30
|
+
require('../../../../store/state/projectSettings/projectSettings.cjs');
|
|
31
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
32
32
|
var embeddedWallets = require('../../../../data/api/embeddedWallets/embeddedWallets.cjs');
|
|
33
33
|
require('../../../../locale/locale.cjs');
|
|
34
34
|
|
|
@@ -3,8 +3,10 @@ import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { isPasskeyWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
5
|
import '@dynamic-labs/sdk-api-core';
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
6
|
+
import '@dynamic-labs-sdk/client/core';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@dynamic-labs-sdk/client';
|
|
9
|
+
import '../../../../client/client.js';
|
|
8
10
|
import '../../../../utils/constants/values.js';
|
|
9
11
|
import { INVALID_WALLET_DATA, ERROR_PROCESSING_REVEAL_REQUEST, USER_NOT_LOGGED_IN } from '../../../../utils/constants/errors.js';
|
|
10
12
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -12,19 +14,17 @@ import '../../../../shared/logger.js';
|
|
|
12
14
|
import '../../../../utils/constants/colors.js';
|
|
13
15
|
import 'react-international-phone';
|
|
14
16
|
import '@dynamic-labs/iconic';
|
|
15
|
-
import 'react';
|
|
16
17
|
import 'react/jsx-runtime';
|
|
17
18
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
18
19
|
import '@dynamic-labs/wallet-book';
|
|
19
20
|
import '../../../../shared/consts/index.js';
|
|
20
21
|
import '../../../../store/state/nonce/nonce.js';
|
|
21
|
-
import '@dynamic-labs-sdk/client/core';
|
|
22
|
-
import '@dynamic-labs-sdk/client';
|
|
23
|
-
import '../../../../client/client.js';
|
|
24
|
-
import '../../../../events/dynamicEvents.js';
|
|
25
22
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
26
23
|
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
27
24
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
25
|
+
import '../../../../events/dynamicEvents.js';
|
|
26
|
+
import '../../../../store/state/projectSettings/projectSettings.js';
|
|
27
|
+
import '../../../../config/ApiEndpoint.js';
|
|
28
28
|
import { exportEmbeddedWallet } from '../../../../data/api/embeddedWallets/embeddedWallets.js';
|
|
29
29
|
import '../../../../locale/locale.js';
|
|
30
30
|
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var errors = require('../../../../utils/constants/errors.cjs');
|
|
9
8
|
var logger = require('../../../../shared/logger.cjs');
|
|
9
|
+
var errors = require('../../../../utils/constants/errors.cjs');
|
|
10
10
|
|
|
11
11
|
const handleExportInitCheck = ({ user, wallet, }) => {
|
|
12
12
|
var _a, _b;
|
|
@@ -31,7 +31,7 @@ const exportWaasCredential = (_a) => _tslib.__awaiter(void 0, [_a], void 0, func
|
|
|
31
31
|
user,
|
|
32
32
|
wallet,
|
|
33
33
|
});
|
|
34
|
-
connector.exportPrivateKey({
|
|
34
|
+
yield connector.exportPrivateKey({
|
|
35
35
|
accountAddress: address || (walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.accountAddress),
|
|
36
36
|
displayContainer: iframeContainer,
|
|
37
37
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wallet } from '../../../../shared';
|
|
2
1
|
import { UserProfile } from '../../../../..';
|
|
2
|
+
import { Wallet } from '../../../../shared';
|
|
3
3
|
export declare const exportWaasCredential: ({ user, wallet, address, iframeContainer, }: {
|
|
4
4
|
user: UserProfile | undefined;
|
|
5
5
|
wallet: Wallet | null;
|