@dynamic-labs/sdk-react-core 4.19.5 → 4.19.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 +27 -0
- package/package.cjs +3 -2
- package/package.js +3 -2
- package/package.json +13 -12
- package/src/functions.d.ts +1 -0
- package/src/lib/client/client.cjs +19 -0
- package/src/lib/client/client.d.ts +8 -0
- package/src/lib/client/client.js +11 -0
- package/src/lib/client/extension/constants.cjs +12 -0
- package/src/lib/client/extension/constants.d.ts +5 -0
- package/src/lib/client/extension/constants.js +8 -0
- package/src/lib/client/extension/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.cjs +14 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.d.ts +4 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.js +10 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +29 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.d.ts +7 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.js +25 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.cjs +30 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.d.ts +2 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.js +26 -0
- package/src/lib/client/extension/utils/useClientState/index.d.ts +1 -0
- package/src/lib/client/extension/utils/useClientState/useClientState.d.ts +2 -0
- package/src/lib/components/AppOriginTile/AppOriginTile.cjs +8 -5
- package/src/lib/components/AppOriginTile/AppOriginTile.d.ts +4 -1
- package/src/lib/components/AppOriginTile/AppOriginTile.js +8 -5
- package/src/lib/components/Chip/Chip.cjs +2 -3
- package/src/lib/components/Chip/Chip.d.ts +5 -4
- package/src/lib/components/Chip/Chip.js +2 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +3 -2
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -0
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.d.ts +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.d.ts +45 -0
- package/src/lib/data/api/exchangeAccounts/index.d.ts +1 -0
- package/src/lib/data/api/index.d.ts +1 -0
- package/src/lib/data/api/onramp/onramp.d.ts +2 -2
- package/src/lib/locale/en/translation.cjs +16 -0
- package/src/lib/locale/en/translation.d.ts +16 -0
- package/src/lib/locale/en/translation.js +16 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -1
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.cjs +22 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.d.ts +8 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.js +18 -0
- package/src/lib/modals/ZkSyncApprovalModal/index.d.ts +1 -0
- package/src/lib/modals/index.d.ts +1 -0
- package/src/lib/shared/assets/backup.cjs +52 -0
- package/src/lib/shared/assets/backup.js +28 -0
- package/src/lib/shared/assets/clock.cjs +54 -0
- package/src/lib/shared/assets/clock.js +30 -0
- package/src/lib/shared/assets/index.d.ts +2 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +1 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +1 -0
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +4 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +4 -1
- package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.d.ts +2 -2
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +25 -18
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +25 -18
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.cjs +9 -6
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.d.ts +8 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.js +8 -7
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +3 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -3
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +4 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +4 -1
- package/src/lib/utils/hooks/useExchangeAccounts/index.d.ts +1 -0
- package/src/lib/utils/hooks/useExchangeAccounts/useExchangeAccounts.d.ts +13 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +4 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +4 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +12 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +12 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +138 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.d.ts +3 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +133 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +15 -88
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +15 -88
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.cjs +114 -0
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.js +110 -0
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.cjs +6 -6
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.js +2 -2
- package/src/lib/views/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.js +7 -5
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
9
|
+
require('@dynamic-labs/utils');
|
|
10
|
+
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
11
|
+
var exclamation = require('../../shared/assets/exclamation.cjs');
|
|
12
|
+
require('@dynamic-labs/iconic');
|
|
13
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
14
|
+
var warningRed = require('../../shared/assets/warning-red.cjs');
|
|
15
|
+
var backup = require('../../shared/assets/backup.cjs');
|
|
16
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
17
|
+
require('@dynamic-labs/sdk-api-core');
|
|
18
|
+
require('../../shared/logger.cjs');
|
|
19
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
20
|
+
require('@dynamic-labs/wallet-book');
|
|
21
|
+
require('../../utils/constants/colors.cjs');
|
|
22
|
+
require('../../utils/constants/values.cjs');
|
|
23
|
+
require('../../shared/consts/index.cjs');
|
|
24
|
+
require('../../components/Alert/Alert.cjs');
|
|
25
|
+
require('../../events/dynamicEvents.cjs');
|
|
26
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
27
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
28
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
29
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
30
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('@dynamic-labs/multi-wallet');
|
|
32
|
+
require('react-international-phone');
|
|
33
|
+
require('../../store/state/nonce/nonce.cjs');
|
|
34
|
+
require('../../store/state/projectSettings/projectSettings.cjs');
|
|
35
|
+
require('../../config/ApiEndpoint.cjs');
|
|
36
|
+
require('../../store/state/user/user.cjs');
|
|
37
|
+
require('../../locale/locale.cjs');
|
|
38
|
+
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
39
|
+
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
40
|
+
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
41
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
+
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
45
|
+
require('react-dom');
|
|
46
|
+
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
47
|
+
require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
48
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
49
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
50
|
+
require('bs58');
|
|
51
|
+
require('@dynamic-labs/types');
|
|
52
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
53
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
54
|
+
require('../../context/WalletContext/WalletContext.cjs');
|
|
55
|
+
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
56
|
+
require('yup');
|
|
57
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
58
|
+
require('../CollectUserDataView/useFields.cjs');
|
|
59
|
+
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
60
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
61
|
+
require('@dynamic-labs/rpc-providers');
|
|
62
|
+
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
63
|
+
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
64
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
65
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
66
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
67
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
68
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
69
|
+
require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
70
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
71
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
72
|
+
require('react-focus-lock');
|
|
73
|
+
var Icon = require('../../components/Icon/Icon.cjs');
|
|
74
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
75
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
76
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
77
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
78
|
+
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
79
|
+
require('formik');
|
|
80
|
+
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
81
|
+
require('../../store/state/sendBalances.cjs');
|
|
82
|
+
require('../../components/Input/Input.cjs');
|
|
83
|
+
require('../../components/OverlayCard/OverlayCard.cjs');
|
|
84
|
+
require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
85
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
86
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
87
|
+
require('../../context/OnrampContext/OnrampContext.cjs');
|
|
88
|
+
require('qrcode');
|
|
89
|
+
require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
90
|
+
require('../../../index.cjs');
|
|
91
|
+
var NeedHelpSection = require('../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
92
|
+
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
93
|
+
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
94
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
95
|
+
require('@hcaptcha/react-hcaptcha');
|
|
96
|
+
require('../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
97
|
+
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
98
|
+
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
99
|
+
require('../../store/state/tokenBalances.cjs');
|
|
100
|
+
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
101
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
102
|
+
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
103
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
104
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
105
|
+
|
|
106
|
+
const BackupUnsuccessfulView = () => {
|
|
107
|
+
const { t } = reactI18next.useTranslation();
|
|
108
|
+
const isProperlyMounted = React.useRef(false);
|
|
109
|
+
const refreshPage = () => {
|
|
110
|
+
window.location.reload();
|
|
111
|
+
};
|
|
112
|
+
// force refresh on component unmount
|
|
113
|
+
React.useEffect(() => {
|
|
114
|
+
const timer = setTimeout(() => {
|
|
115
|
+
isProperlyMounted.current = true;
|
|
116
|
+
}, 100);
|
|
117
|
+
return () => {
|
|
118
|
+
clearTimeout(timer);
|
|
119
|
+
// Only refresh if component was properly mounted and is now being unmounted
|
|
120
|
+
if (isProperlyMounted.current) {
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
refreshPage();
|
|
123
|
+
}, 0);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}, []);
|
|
127
|
+
return (jsxRuntime.jsxs("div", { className: 'backup-unsuccessful-view', children: [jsxRuntime.jsxs("div", { className: 'backup-unsuccessful-view__content', children: [jsxRuntime.jsxs("div", { className: 'backup-icon-container', children: [jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(backup.ReactComponent, { className: 'backup-icon', width: 64, height: 64 }) }), jsxRuntime.jsxs("div", { className: 'warning-icon-container', children: [jsxRuntime.jsx(warningRed.ReactComponent, { className: 'combined-icon', width: 40, height: 40 }), jsxRuntime.jsx(exclamation.ReactComponent, { className: 'exclamation-icon', width: 20, height: 20, style: {
|
|
128
|
+
left: '50%',
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
top: '50%',
|
|
131
|
+
transform: 'translate(-50%, -50%)',
|
|
132
|
+
} })] })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', children: t('dyn_waas.backup_unsuccessful.description') }), jsxRuntime.jsx("div", { className: 'need-help-section', children: jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}) }), jsxRuntime.jsx("div", { className: 'button-group', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: () => refreshPage(), copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
133
|
+
color: 'inherit',
|
|
134
|
+
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) })] }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { asFooter: true })] }));
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
exports.BackupUnsuccessfulView = BackupUnsuccessfulView;
|
|
138
|
+
exports["default"] = BackupUnsuccessfulView;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import '@dynamic-labs/utils';
|
|
6
|
+
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
7
|
+
import { ReactComponent as SvgExclamation } from '../../shared/assets/exclamation.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import { ReactComponent as SvgWarningRed } from '../../shared/assets/warning-red.js';
|
|
11
|
+
import { ReactComponent as SvgBackup } from '../../shared/assets/backup.js';
|
|
12
|
+
import '../../../../_virtual/_tslib.js';
|
|
13
|
+
import '@dynamic-labs/sdk-api-core';
|
|
14
|
+
import '../../shared/logger.js';
|
|
15
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
16
|
+
import '@dynamic-labs/wallet-book';
|
|
17
|
+
import '../../utils/constants/colors.js';
|
|
18
|
+
import '../../utils/constants/values.js';
|
|
19
|
+
import '../../shared/consts/index.js';
|
|
20
|
+
import '../../components/Alert/Alert.js';
|
|
21
|
+
import '../../events/dynamicEvents.js';
|
|
22
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
23
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
24
|
+
import '../../store/state/authMode/authMode.js';
|
|
25
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
26
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '@dynamic-labs/multi-wallet';
|
|
28
|
+
import 'react-international-phone';
|
|
29
|
+
import '../../store/state/nonce/nonce.js';
|
|
30
|
+
import '../../store/state/projectSettings/projectSettings.js';
|
|
31
|
+
import '../../config/ApiEndpoint.js';
|
|
32
|
+
import '../../store/state/user/user.js';
|
|
33
|
+
import '../../locale/locale.js';
|
|
34
|
+
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
35
|
+
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
36
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
37
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
|
+
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
+
import '../../context/VerificationContext/VerificationContext.js';
|
|
41
|
+
import 'react-dom';
|
|
42
|
+
import '../../utils/functions/compareChains/compareChains.js';
|
|
43
|
+
import '../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
44
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
45
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
46
|
+
import 'bs58';
|
|
47
|
+
import '@dynamic-labs/types';
|
|
48
|
+
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
49
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
50
|
+
import '../../context/WalletContext/WalletContext.js';
|
|
51
|
+
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
52
|
+
import 'yup';
|
|
53
|
+
import '../../context/MockContext/MockContext.js';
|
|
54
|
+
import '../CollectUserDataView/useFields.js';
|
|
55
|
+
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
56
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
57
|
+
import '@dynamic-labs/rpc-providers';
|
|
58
|
+
import '../../store/state/walletOptions/walletOptions.js';
|
|
59
|
+
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
60
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
61
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
62
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
63
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
64
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
65
|
+
import '../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
66
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
67
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
68
|
+
import 'react-focus-lock';
|
|
69
|
+
import { Icon } from '../../components/Icon/Icon.js';
|
|
70
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
71
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
72
|
+
import '../../components/IconButton/IconButton.js';
|
|
73
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
74
|
+
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
75
|
+
import 'formik';
|
|
76
|
+
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
77
|
+
import '../../store/state/sendBalances.js';
|
|
78
|
+
import '../../components/Input/Input.js';
|
|
79
|
+
import '../../components/OverlayCard/OverlayCard.js';
|
|
80
|
+
import '../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
81
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
82
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
83
|
+
import '../../context/OnrampContext/OnrampContext.js';
|
|
84
|
+
import 'qrcode';
|
|
85
|
+
import '../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
86
|
+
import '../../../index.js';
|
|
87
|
+
import { NeedHelpSection } from '../../components/NeedHelpSection/NeedHelpSection.js';
|
|
88
|
+
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
89
|
+
import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
90
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
91
|
+
import '@hcaptcha/react-hcaptcha';
|
|
92
|
+
import '../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
93
|
+
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
94
|
+
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
95
|
+
import '../../store/state/tokenBalances.js';
|
|
96
|
+
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
97
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
98
|
+
import '../../components/IsBrowser/IsBrowser.js';
|
|
99
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
100
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
101
|
+
|
|
102
|
+
const BackupUnsuccessfulView = () => {
|
|
103
|
+
const { t } = useTranslation();
|
|
104
|
+
const isProperlyMounted = useRef(false);
|
|
105
|
+
const refreshPage = () => {
|
|
106
|
+
window.location.reload();
|
|
107
|
+
};
|
|
108
|
+
// force refresh on component unmount
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
const timer = setTimeout(() => {
|
|
111
|
+
isProperlyMounted.current = true;
|
|
112
|
+
}, 100);
|
|
113
|
+
return () => {
|
|
114
|
+
clearTimeout(timer);
|
|
115
|
+
// Only refresh if component was properly mounted and is now being unmounted
|
|
116
|
+
if (isProperlyMounted.current) {
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
refreshPage();
|
|
119
|
+
}, 0);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
123
|
+
return (jsxs("div", { className: 'backup-unsuccessful-view', children: [jsxs("div", { className: 'backup-unsuccessful-view__content', children: [jsxs("div", { className: 'backup-icon-container', children: [jsx(Icon, { color: 'brand-primary', children: jsx(SvgBackup, { className: 'backup-icon', width: 64, height: 64 }) }), jsxs("div", { className: 'warning-icon-container', children: [jsx(SvgWarningRed, { className: 'combined-icon', width: 40, height: 40 }), jsx(SvgExclamation, { className: 'exclamation-icon', width: 20, height: 20, style: {
|
|
124
|
+
left: '50%',
|
|
125
|
+
position: 'absolute',
|
|
126
|
+
top: '50%',
|
|
127
|
+
transform: 'translate(-50%, -50%)',
|
|
128
|
+
} })] })] }), jsx(Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', children: t('dyn_waas.backup_unsuccessful.description') }), jsx("div", { className: 'need-help-section', children: jsx(NeedHelpSection, {}) }), jsx("div", { className: 'button-group', children: jsx(TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: () => refreshPage(), copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
129
|
+
color: 'inherit',
|
|
130
|
+
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) })] }), jsx(PoweredByDynamic, { asFooter: true })] }));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { BackupUnsuccessfulView, BackupUnsuccessfulView as default };
|
|
@@ -120,16 +120,11 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
120
120
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
121
121
|
|
|
122
122
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
123
|
-
var _a, _b, _c
|
|
123
|
+
var _a, _b, _c;
|
|
124
124
|
const { primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
125
125
|
const { handleAcknowledgeExportPrompt } = useSyncEmbeddedWalletFlow.useSyncEmbeddedWalletFlow();
|
|
126
126
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
127
|
-
//should use useIsWaasWallet hook
|
|
128
127
|
const isWaasWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => { var _a; return (_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('dynamicwaas'); });
|
|
129
|
-
// Check if it's a Sui wallet
|
|
130
|
-
const isSuiWallet = ((_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.connectedChain) === 'SUI';
|
|
131
|
-
// Check if it's a SOL wallet
|
|
132
|
-
const isSolWallet = ((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'SOL';
|
|
133
128
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
134
129
|
const { pushView } = ViewContext.useViewContext();
|
|
135
130
|
const { getEOAWallet, isSmartWallet } = useSmartWallets.useSmartWallets();
|
|
@@ -145,9 +140,9 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
145
140
|
catch (error) {
|
|
146
141
|
// waas wallet
|
|
147
142
|
}
|
|
148
|
-
const walletProperties = (
|
|
143
|
+
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;
|
|
149
144
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
150
|
-
const wallet = (
|
|
145
|
+
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
151
146
|
const [showSkeleton, setShowSkeleton] = React.useState(false);
|
|
152
147
|
// eslint-disable-next-line arrow-body-style
|
|
153
148
|
React.useEffect(() => {
|
|
@@ -167,14 +162,14 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
167
162
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
168
163
|
}, []);
|
|
169
164
|
const { isLoading: exportLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
170
|
-
var
|
|
165
|
+
var _d, _e;
|
|
171
166
|
const iframeContainerElement = iframeContainerRef.current;
|
|
172
167
|
if (!iframeContainerElement ||
|
|
173
|
-
((
|
|
168
|
+
((_d = iframeContainerElement === null || iframeContainerElement === void 0 ? void 0 : iframeContainerElement.children) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
174
169
|
return;
|
|
175
170
|
}
|
|
176
171
|
if (walletConnectorCore.isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
|
|
177
|
-
yield ((
|
|
172
|
+
yield ((_e = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _e === void 0 ? void 0 : _e.createOrRestoreSession());
|
|
178
173
|
}
|
|
179
174
|
if (isTurnkeyWallet) {
|
|
180
175
|
return turnkeyExport.initExport({
|
|
@@ -186,7 +181,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
186
181
|
return;
|
|
187
182
|
}));
|
|
188
183
|
const { mutate: handleExportWallet, isLoading, error, data, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
189
|
-
var
|
|
184
|
+
var _f, _g, _h;
|
|
190
185
|
handleAcknowledgeExportPrompt();
|
|
191
186
|
if (isTurnkeyWallet) {
|
|
192
187
|
try {
|
|
@@ -197,11 +192,11 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
197
192
|
wallet: wallet,
|
|
198
193
|
});
|
|
199
194
|
}
|
|
200
|
-
catch (
|
|
195
|
+
catch (_j) {
|
|
201
196
|
if (walletConnectorCore.isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector) &&
|
|
202
|
-
((
|
|
203
|
-
yield ((
|
|
204
|
-
yield ((
|
|
197
|
+
((_f = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _f === void 0 ? void 0 : _f.removeSessionKeys)) {
|
|
198
|
+
yield ((_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.removeSessionKeys());
|
|
199
|
+
yield ((_h = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _h === void 0 ? void 0 : _h.createOrRestoreSession({
|
|
205
200
|
ignoreRestore: true,
|
|
206
201
|
}));
|
|
207
202
|
}
|
|
@@ -222,7 +217,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
222
217
|
wallet: wallet,
|
|
223
218
|
});
|
|
224
219
|
}
|
|
225
|
-
catch (
|
|
220
|
+
catch (_k) {
|
|
226
221
|
return undefined;
|
|
227
222
|
}
|
|
228
223
|
}
|
|
@@ -259,44 +254,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
259
254
|
setShowAuthFlow(false);
|
|
260
255
|
setDynamicWidgetView('send-balance');
|
|
261
256
|
}, className: 'embedded-reveal-view__zerodev-warning__link-button', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'primary', className: 'underline', copykey: 'dyn_embedded_reveal.aa_warning.button', children: t('dyn_embedded_reveal.aa_warning.button') }) })] })] })), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__description', children: !(!isLoading && data && !error) && (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header', children: jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsxRuntime.jsx(exportEmbeddedHero.ReactComponent, {}) }) })) })] }));
|
|
262
|
-
React.useEffect(() => {
|
|
263
|
-
var _a;
|
|
264
|
-
if (((_a = iframeContainerRef === null || iframeContainerRef === void 0 ? void 0 : iframeContainerRef.current) === null || _a === void 0 ? void 0 : _a.children) && data) {
|
|
265
|
-
// eslint-disable-next-line prefer-destructuring
|
|
266
|
-
const iframeElement = iframeContainerRef.current.children[0];
|
|
267
|
-
let height = '88px';
|
|
268
|
-
let minHeight = '88px';
|
|
269
|
-
// Determine height based on wallet type and other conditions
|
|
270
|
-
if (!isTurnkeyHDWallet || exportPrivateKey) {
|
|
271
|
-
if (isSolWallet) {
|
|
272
|
-
height = '140px';
|
|
273
|
-
minHeight = '140px';
|
|
274
|
-
}
|
|
275
|
-
else if (isSuiWallet) {
|
|
276
|
-
height = '100px';
|
|
277
|
-
minHeight = '100px';
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
height = '88px';
|
|
281
|
-
minHeight = '88px';
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
// Turnkey HD wallet case
|
|
286
|
-
height = '120px';
|
|
287
|
-
minHeight = '120px';
|
|
288
|
-
}
|
|
289
|
-
iframeElement === null || iframeElement === void 0 ? void 0 : iframeElement.setAttribute('style', `height: ${height}; min-height: ${minHeight}; width: 100%; border: none; background: transparent; overflow: hidden;`);
|
|
290
|
-
}
|
|
291
|
-
}, [
|
|
292
|
-
iframeContainerRef,
|
|
293
|
-
data,
|
|
294
|
-
isTurnkeyHDWallet,
|
|
295
|
-
isWaasWallet,
|
|
296
|
-
exportPrivateKey,
|
|
297
|
-
isSuiWallet,
|
|
298
|
-
isSolWallet,
|
|
299
|
-
]);
|
|
300
257
|
React.useEffect(() => {
|
|
301
258
|
if (data) {
|
|
302
259
|
// Show skeleton first
|
|
@@ -343,14 +300,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
343
300
|
return `${baseClass} ${baseClass}--hidden`;
|
|
344
301
|
}
|
|
345
302
|
if (isWaasWallet) {
|
|
346
|
-
|
|
347
|
-
if (isSuiWallet) {
|
|
348
|
-
return `${waasClass} ${baseClass}--sui`;
|
|
349
|
-
}
|
|
350
|
-
if (isSolWallet) {
|
|
351
|
-
return `${waasClass} ${baseClass}--sol`;
|
|
352
|
-
}
|
|
353
|
-
return waasClass;
|
|
303
|
+
return `${baseClass} ${baseClass}--waas`;
|
|
354
304
|
}
|
|
355
305
|
return baseClass;
|
|
356
306
|
};
|
|
@@ -362,29 +312,10 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
362
312
|
if (showSkeleton) {
|
|
363
313
|
return `${baseClass} ${baseClass}--invisible`;
|
|
364
314
|
}
|
|
365
|
-
if (isWaasWallet) {
|
|
366
|
-
if (isSuiWallet) {
|
|
367
|
-
return `${baseClass} ${baseClass}--sui`;
|
|
368
|
-
}
|
|
369
|
-
if (isSolWallet) {
|
|
370
|
-
return `${baseClass} ${baseClass}--sol`;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
315
|
return baseClass;
|
|
374
316
|
};
|
|
375
317
|
const getSkeletonLines = () => {
|
|
376
|
-
|
|
377
|
-
if (isWaasWallet) {
|
|
378
|
-
if (isSolWallet) {
|
|
379
|
-
lineCount = 7; // For 140px height
|
|
380
|
-
}
|
|
381
|
-
else if (isSuiWallet) {
|
|
382
|
-
lineCount = 5; // For 100px height
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
else if (isTurnkeyHDWallet && !exportPrivateKey) {
|
|
386
|
-
lineCount = 6; // For 120px height
|
|
387
|
-
}
|
|
318
|
+
const lineCount = 5; // Updated for 110px height
|
|
388
319
|
const lines = [];
|
|
389
320
|
for (let i = 0; i < lineCount; i++) {
|
|
390
321
|
const isLastLine = i === lineCount - 1;
|
|
@@ -398,11 +329,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
398
329
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view', children: jsxRuntime.jsxs("div", { className: getBodyClassName(), children: [(!isWaasWallet ||
|
|
399
330
|
!hasInjectedCredential ||
|
|
400
331
|
title !== credentialTitle) &&
|
|
401
|
-
contentHeader, isTurnkeyWallet || isWaasWallet ? (jsxRuntime.jsxs("div", { className: getCredentialContainerClassName(), children: [jsxRuntime.jsx("div", { id: constants.iframeContainerId, className: getIframeContainerClassName(), ref: iframeContainerRef }), showSkeleton && data && (jsxRuntime.jsx("div", { className:
|
|
402
|
-
? ' embedded-reveal-view__body__skeleton-container--sui'
|
|
403
|
-
: isWaasWallet && isSolWallet
|
|
404
|
-
? ' embedded-reveal-view__body__skeleton-container--sol'
|
|
405
|
-
: ''}`, children: getSkeletonLines() }))] })) : null, hasInjectedCredential ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
|
|
332
|
+
contentHeader, isTurnkeyWallet || isWaasWallet ? (jsxRuntime.jsxs("div", { className: getCredentialContainerClassName(), children: [jsxRuntime.jsx("div", { id: constants.iframeContainerId, className: getIframeContainerClassName(), ref: iframeContainerRef }), showSkeleton && data && (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__skeleton-container', children: getSkeletonLines() }))] })) : null, hasInjectedCredential ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
|
|
406
333
|
setShowAuthFlow(false);
|
|
407
334
|
}, loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
408
335
|
color: 'inherit',
|