@dynamic-labs/sdk-react-core 4.20.6 → 4.20.8
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -3
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.cjs +75 -0
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.js +70 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +4 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +4 -0
- package/src/lib/locale/en/translation.cjs +24 -1
- package/src/lib/locale/en/translation.d.ts +23 -0
- package/src/lib/locale/en/translation.js +24 -1
- package/src/lib/shared/assets/index.d.ts +2 -0
- package/src/lib/shared/assets/locked.cjs +52 -0
- package/src/lib/shared/assets/locked.js +28 -0
- package/src/lib/shared/assets/white-check-black-circle.cjs +61 -0
- package/src/lib/shared/assets/white-check-black-circle.js +37 -0
- package/src/lib/store/state/dynamicContextProps/dynamicContextProps.cjs +2 -3
- package/src/lib/store/state/dynamicContextProps/dynamicContextProps.js +2 -3
- 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/getTransactionLink/getTransactionLink.cjs +3 -0
- package/src/lib/utils/functions/getTransactionLink/getTransactionLink.d.ts +1 -1
- package/src/lib/utils/functions/getTransactionLink/getTransactionLink.js +3 -0
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +8 -5
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +8 -5
- package/src/lib/utils/hooks/useExchangeAccounts/useExchangeAccounts.cjs +57 -0
- package/src/lib/utils/hooks/useExchangeAccounts/useExchangeAccounts.js +53 -0
- package/src/lib/utils/hooks/usePromptAndFundWithExchange/index.d.ts +1 -0
- package/src/lib/utils/hooks/usePromptAndFundWithExchange/usePromptAndFundWithExchange.d.ts +4 -0
- package/src/lib/utils/hooks/useSubmitExchangeFunding/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.cjs +199 -0
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.d.ts +11 -0
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.js +195 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +14 -4
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +14 -4
- package/src/lib/views/MfaExchangeView/MfaExchangeView.cjs +127 -0
- package/src/lib/views/MfaExchangeView/MfaExchangeView.d.ts +7 -0
- package/src/lib/views/MfaExchangeView/MfaExchangeView.js +123 -0
- package/src/lib/views/MfaExchangeView/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +4 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +9 -13
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +3 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.d.ts +1 -2
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.cjs +121 -0
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.d.ts +11 -0
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.js +117 -0
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs +85 -15
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js +85 -15
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/types.d.ts +14 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/utils/useExchangeTokensForFunding/useExchangeTokensForFunding.cjs +131 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/utils/useExchangeTokensForFunding/useExchangeTokensForFunding.js +127 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { UnprocessableEntityErrorCode } from '@dynamic-labs/sdk-api-core';
|
|
7
|
+
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
8
|
+
import { useExchangeAccounts } from '../useExchangeAccounts/useExchangeAccounts.js';
|
|
9
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
10
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
11
|
+
import '../../../shared/logger.js';
|
|
12
|
+
import '@dynamic-labs/iconic';
|
|
13
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
14
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
15
|
+
import '@dynamic-labs/wallet-book';
|
|
16
|
+
import '@dynamic-labs/utils';
|
|
17
|
+
import '../../constants/colors.js';
|
|
18
|
+
import '../../constants/values.js';
|
|
19
|
+
import '../../../shared/consts/index.js';
|
|
20
|
+
import '../../../events/dynamicEvents.js';
|
|
21
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
22
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
23
|
+
import '@dynamic-labs/multi-wallet';
|
|
24
|
+
import 'react-international-phone';
|
|
25
|
+
import '../../../store/state/nonce/nonce.js';
|
|
26
|
+
import '../../../store/state/projectSettings/projectSettings.js';
|
|
27
|
+
import '../../../config/ApiEndpoint.js';
|
|
28
|
+
import '../../../store/state/user/user.js';
|
|
29
|
+
import '../../../locale/locale.js';
|
|
30
|
+
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
31
|
+
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
32
|
+
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.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 '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
57
|
+
import '../../../components/Alert/Alert.js';
|
|
58
|
+
import { Typography } from '../../../components/Typography/Typography.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 '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
78
|
+
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
79
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
80
|
+
import '@hcaptcha/react-hcaptcha';
|
|
81
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
82
|
+
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
83
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
84
|
+
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
85
|
+
import '../../../store/state/sendBalances.js';
|
|
86
|
+
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
87
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
88
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
89
|
+
import { getTransactionLink } from '../../functions/getTransactionLink/getTransactionLink.js';
|
|
90
|
+
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
91
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
92
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
93
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
94
|
+
import '../../../../index.js';
|
|
95
|
+
import '../../../store/state/tokenBalances.js';
|
|
96
|
+
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
97
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
98
|
+
|
|
99
|
+
const useSubmitExchangeFunding = () => {
|
|
100
|
+
const { exchangeTransfer } = useExchangeAccounts();
|
|
101
|
+
const { setDynamicWidgetView, goToInitialDynamicWidgetView, setHeaderAlert } = useWidgetContext();
|
|
102
|
+
const { clearStackAndPush } = useViewContext();
|
|
103
|
+
const { primaryWallet, setShowAuthFlow } = useInternalDynamicContext();
|
|
104
|
+
const { t } = useTranslation();
|
|
105
|
+
const submit = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ tokenAmount, exchange, tokenSymbol, mfaCode, toAddress, props, }) {
|
|
106
|
+
if (!tokenAmount)
|
|
107
|
+
return;
|
|
108
|
+
try {
|
|
109
|
+
const result = yield exchangeTransfer({
|
|
110
|
+
exchange,
|
|
111
|
+
transferRequest: Object.assign({ amount: parseInt(tokenAmount, 10), currency: tokenSymbol, to: toAddress }, (mfaCode ? { mfaCode } : {})),
|
|
112
|
+
});
|
|
113
|
+
const txlink = yield getTransactionLink({
|
|
114
|
+
transactionHash: result.id,
|
|
115
|
+
walletConnector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector,
|
|
116
|
+
});
|
|
117
|
+
setShowAuthFlow(false);
|
|
118
|
+
setDynamicWidgetView('deposited-exchange', {
|
|
119
|
+
onClose: goToInitialDynamicWidgetView,
|
|
120
|
+
onSubmit: goToInitialDynamicWidgetView,
|
|
121
|
+
onView: () => {
|
|
122
|
+
if (txlink) {
|
|
123
|
+
window.open(txlink, '_blank', 'noopener,noreferrer');
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
toAddress,
|
|
127
|
+
transaction: result,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
let errorMessage = '';
|
|
132
|
+
let showError = false;
|
|
133
|
+
if (error.code ===
|
|
134
|
+
UnprocessableEntityErrorCode.TransferMfaRequired) {
|
|
135
|
+
setShowAuthFlow(true);
|
|
136
|
+
clearStackAndPush('mfa-exchange-view', {
|
|
137
|
+
onBack: () => {
|
|
138
|
+
setShowAuthFlow(false);
|
|
139
|
+
setDynamicWidgetView('confirm-exchange-transfer', Object.assign({}, props));
|
|
140
|
+
},
|
|
141
|
+
onSubmit: (code) => {
|
|
142
|
+
submit({
|
|
143
|
+
exchange,
|
|
144
|
+
mfaCode: code,
|
|
145
|
+
props,
|
|
146
|
+
toAddress,
|
|
147
|
+
tokenAmount,
|
|
148
|
+
tokenSymbol,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
else if (error.code ===
|
|
154
|
+
UnprocessableEntityErrorCode.TransferMfaFailed) {
|
|
155
|
+
showError = true;
|
|
156
|
+
errorMessage = t('dyn_exchange_transfer_errors.mfa_failed');
|
|
157
|
+
}
|
|
158
|
+
else if (error.code ===
|
|
159
|
+
UnprocessableEntityErrorCode.InvalidTransferCurrency) {
|
|
160
|
+
showError = true;
|
|
161
|
+
errorMessage = t('dyn_exchange_transfer_errors.invalid_currency_description');
|
|
162
|
+
}
|
|
163
|
+
else if (error.code ===
|
|
164
|
+
UnprocessableEntityErrorCode.InvalidTransferFunds) {
|
|
165
|
+
showError = true;
|
|
166
|
+
errorMessage = t('dyn_exchange_transfer_errors.invalid_balance');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
showError = true;
|
|
170
|
+
errorMessage = t('dyn_exchange_transfer_errors.unknown');
|
|
171
|
+
}
|
|
172
|
+
if (showError) {
|
|
173
|
+
const errorAlert = (jsxs(Typography, { variant: 'body_normal', color: 'current-color', children: [t('dyn_exchange_transfer_errors.title'), jsx(Typography, { color: 'current-color', children: errorMessage })] }));
|
|
174
|
+
setShowAuthFlow(false);
|
|
175
|
+
goToInitialDynamicWidgetView();
|
|
176
|
+
setHeaderAlert({
|
|
177
|
+
content: errorAlert,
|
|
178
|
+
variant: 'error',
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}), [
|
|
183
|
+
clearStackAndPush,
|
|
184
|
+
exchangeTransfer,
|
|
185
|
+
goToInitialDynamicWidgetView,
|
|
186
|
+
primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector,
|
|
187
|
+
setDynamicWidgetView,
|
|
188
|
+
setHeaderAlert,
|
|
189
|
+
setShowAuthFlow,
|
|
190
|
+
t,
|
|
191
|
+
]);
|
|
192
|
+
return submit;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export { useSubmitExchangeFunding };
|
|
@@ -15,7 +15,7 @@ var warningRed = require('../../shared/assets/warning-red.cjs');
|
|
|
15
15
|
var backup = require('../../shared/assets/backup.cjs');
|
|
16
16
|
require('../../../../_virtual/_tslib.cjs');
|
|
17
17
|
require('@dynamic-labs/sdk-api-core');
|
|
18
|
-
require('../../shared/logger.cjs');
|
|
18
|
+
var logger = require('../../shared/logger.cjs');
|
|
19
19
|
require('@dynamic-labs/wallet-connector-core');
|
|
20
20
|
require('@dynamic-labs/wallet-book');
|
|
21
21
|
require('@dynamic-labs/utils');
|
|
@@ -24,9 +24,8 @@ require('../../utils/constants/values.cjs');
|
|
|
24
24
|
require('../../shared/consts/index.cjs');
|
|
25
25
|
require('../../components/Alert/Alert.cjs');
|
|
26
26
|
require('../../events/dynamicEvents.cjs');
|
|
27
|
+
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
27
28
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
28
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
29
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
30
29
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
31
30
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
32
31
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -42,6 +41,8 @@ require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
|
42
41
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
43
42
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
44
43
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
45
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
46
47
|
require('react-dom');
|
|
47
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -113,6 +114,7 @@ const BackupUnsuccessfulView = () => {
|
|
|
113
114
|
const supportEmail = (_a = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
114
115
|
const supportUrls = (_b = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
|
|
115
116
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
117
|
+
const { handleLogOut } = useDynamicContext.useDynamicContext();
|
|
116
118
|
const refreshPage = () => {
|
|
117
119
|
window.location.reload();
|
|
118
120
|
};
|
|
@@ -140,7 +142,15 @@ const BackupUnsuccessfulView = () => {
|
|
|
140
142
|
'button-group--with-help-section': hasContactInfo,
|
|
141
143
|
}), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: () => refreshPage(), copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
142
144
|
color: 'inherit',
|
|
143
|
-
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) }), jsxRuntime.jsx("div", { className: '
|
|
145
|
+
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) }), jsxRuntime.jsx("div", { className: classNames.classNames('button-group', 'logout-group', {
|
|
146
|
+
'button-group--with-help-section': hasContactInfo,
|
|
147
|
+
}), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'logout-button', buttonVariant: 'tertiary', type: 'submit', onClick: () => {
|
|
148
|
+
logger.logger.error('BackupUnsuccessfulView: Could not backup wallet, logging out');
|
|
149
|
+
handleLogOut();
|
|
150
|
+
}, copykey: 'dyn_waas.backup_unsuccessful.log_out', typographyProps: {
|
|
151
|
+
color: 'inherit',
|
|
152
|
+
weight: 'medium',
|
|
153
|
+
}, children: t('dyn_waas.backup_unsuccessful.log_out') }) }), jsxRuntime.jsx("div", { className: 'need-help-section', children: jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}) })] }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { asFooter: true })] }));
|
|
144
154
|
};
|
|
145
155
|
|
|
146
156
|
exports.BackupUnsuccessfulView = BackupUnsuccessfulView;
|
|
@@ -11,7 +11,7 @@ import { ReactComponent as SvgWarningRed } from '../../shared/assets/warning-red
|
|
|
11
11
|
import { ReactComponent as SvgBackup } from '../../shared/assets/backup.js';
|
|
12
12
|
import '../../../../_virtual/_tslib.js';
|
|
13
13
|
import '@dynamic-labs/sdk-api-core';
|
|
14
|
-
import '../../shared/logger.js';
|
|
14
|
+
import { logger } from '../../shared/logger.js';
|
|
15
15
|
import '@dynamic-labs/wallet-connector-core';
|
|
16
16
|
import '@dynamic-labs/wallet-book';
|
|
17
17
|
import '@dynamic-labs/utils';
|
|
@@ -20,9 +20,8 @@ import '../../utils/constants/values.js';
|
|
|
20
20
|
import '../../shared/consts/index.js';
|
|
21
21
|
import '../../components/Alert/Alert.js';
|
|
22
22
|
import '../../events/dynamicEvents.js';
|
|
23
|
+
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
23
24
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
24
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
25
|
-
import '../../store/state/authMode/authMode.js';
|
|
26
25
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
27
26
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
28
27
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -38,6 +37,8 @@ import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
|
38
37
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
39
38
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
40
39
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
+
import '../../store/state/authMode/authMode.js';
|
|
41
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
41
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
42
43
|
import 'react-dom';
|
|
43
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -109,6 +110,7 @@ const BackupUnsuccessfulView = () => {
|
|
|
109
110
|
const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
110
111
|
const supportUrls = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
|
|
111
112
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
113
|
+
const { handleLogOut } = useDynamicContext();
|
|
112
114
|
const refreshPage = () => {
|
|
113
115
|
window.location.reload();
|
|
114
116
|
};
|
|
@@ -136,7 +138,15 @@ const BackupUnsuccessfulView = () => {
|
|
|
136
138
|
'button-group--with-help-section': hasContactInfo,
|
|
137
139
|
}), children: jsx(TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: () => refreshPage(), copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
138
140
|
color: 'inherit',
|
|
139
|
-
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) }), jsx("div", { className: '
|
|
141
|
+
}, children: t('dyn_waas.backup_unsuccessful.try_again') }) }), jsx("div", { className: classNames('button-group', 'logout-group', {
|
|
142
|
+
'button-group--with-help-section': hasContactInfo,
|
|
143
|
+
}), children: jsx(TypographyButton, { buttonClassName: 'logout-button', buttonVariant: 'tertiary', type: 'submit', onClick: () => {
|
|
144
|
+
logger.error('BackupUnsuccessfulView: Could not backup wallet, logging out');
|
|
145
|
+
handleLogOut();
|
|
146
|
+
}, copykey: 'dyn_waas.backup_unsuccessful.log_out', typographyProps: {
|
|
147
|
+
color: 'inherit',
|
|
148
|
+
weight: 'medium',
|
|
149
|
+
}, children: t('dyn_waas.backup_unsuccessful.log_out') }) }), jsx("div", { className: 'need-help-section', children: jsx(NeedHelpSection, {}) })] }), jsx(PoweredByDynamic, { asFooter: true })] }));
|
|
140
150
|
};
|
|
141
151
|
|
|
142
152
|
export { BackupUnsuccessfulView, BackupUnsuccessfulView as default };
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
10
|
+
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
13
|
+
var arrowLeft = require('../../shared/assets/arrow-left.cjs');
|
|
14
|
+
var locked = require('../../shared/assets/locked.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
18
|
+
require('@dynamic-labs/sdk-api-core');
|
|
19
|
+
require('../../shared/logger.cjs');
|
|
20
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
21
|
+
require('@dynamic-labs/wallet-book');
|
|
22
|
+
require('../../utils/constants/colors.cjs');
|
|
23
|
+
require('../../utils/constants/values.cjs');
|
|
24
|
+
require('../../shared/consts/index.cjs');
|
|
25
|
+
require('../../components/Alert/Alert.cjs');
|
|
26
|
+
require('../../events/dynamicEvents.cjs');
|
|
27
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
28
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
29
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
30
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
31
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
32
|
+
require('@dynamic-labs/multi-wallet');
|
|
33
|
+
require('react-international-phone');
|
|
34
|
+
require('../../store/state/nonce/nonce.cjs');
|
|
35
|
+
var pixelToRem = require('../../utils/functions/pixelToRem/pixelToRem.cjs');
|
|
36
|
+
require('../../store/state/projectSettings/projectSettings.cjs');
|
|
37
|
+
require('../../config/ApiEndpoint.cjs');
|
|
38
|
+
require('../../store/state/user/user.cjs');
|
|
39
|
+
require('../../locale/locale.cjs');
|
|
40
|
+
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
41
|
+
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
42
|
+
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
43
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
44
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
45
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
46
|
+
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
|
+
require('react-dom');
|
|
48
|
+
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
49
|
+
require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
50
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
51
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
52
|
+
require('bs58');
|
|
53
|
+
require('@dynamic-labs/types');
|
|
54
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
55
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
56
|
+
require('../../context/WalletContext/WalletContext.cjs');
|
|
57
|
+
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
58
|
+
require('yup');
|
|
59
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
60
|
+
require('../CollectUserDataView/useFields.cjs');
|
|
61
|
+
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
62
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
63
|
+
require('@dynamic-labs/rpc-providers');
|
|
64
|
+
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
65
|
+
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
66
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
67
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
68
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
69
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
70
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
71
|
+
require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
72
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
73
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
74
|
+
require('react-focus-lock');
|
|
75
|
+
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
76
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
77
|
+
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
78
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
79
|
+
require('formik');
|
|
80
|
+
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
81
|
+
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
82
|
+
require('../../store/state/sendBalances.cjs');
|
|
83
|
+
require('../../components/Input/Input.cjs');
|
|
84
|
+
require('../../components/OverlayCard/OverlayCard.cjs');
|
|
85
|
+
require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
86
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
87
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
88
|
+
require('../../context/OnrampContext/OnrampContext.cjs');
|
|
89
|
+
require('qrcode');
|
|
90
|
+
require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
91
|
+
require('../../../index.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('../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
99
|
+
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
100
|
+
require('../../store/state/tokenBalances.cjs');
|
|
101
|
+
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
102
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
103
|
+
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
104
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
105
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
106
|
+
|
|
107
|
+
const iconSize = 96;
|
|
108
|
+
const MfaExchangeView = ({ onSubmit, onBack }) => {
|
|
109
|
+
const { t } = reactI18next.useTranslation();
|
|
110
|
+
const [mfaCode, setMfaCode] = React.useState('');
|
|
111
|
+
const handleCodeChanged = (event) => {
|
|
112
|
+
const inputCode = event.target.value;
|
|
113
|
+
setMfaCode(inputCode);
|
|
114
|
+
};
|
|
115
|
+
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: () => {
|
|
116
|
+
onBack();
|
|
117
|
+
}, children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
118
|
+
const icon = (jsxRuntime.jsx(locked.ReactComponent, { style: {
|
|
119
|
+
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
120
|
+
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
121
|
+
} }));
|
|
122
|
+
return (jsxRuntime.jsxs("div", { className: 'mfa-exchange-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', children: t('dyn_exchange_mfa.title') }) }), jsxRuntime.jsxs("div", { className: 'mfa-exchange-view__content', children: [jsxRuntime.jsxs("div", { className: 'mfa-exchange-view__content__icon-description', children: [jsxRuntime.jsx("div", { className: 'mfa-exchange-view__content__icon-description__icon-holder', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, customSpinnerColor: 'black', iconSize: iconSize, className: 'mfa-exchange-view__content__icon-description__icon-holder__icon', isSpinning: true }) }), jsxRuntime.jsx("div", { className: 'mfa-exchange-view__content__icon-description__description-holder', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'mfa-exchange-view__content__icon-description__description-holder__description', color: 'secondary', children: t('dyn_exchange_mfa.description') }) })] }), jsxRuntime.jsx("div", { className: 'mfa-exchange-view__content__input', children: jsxRuntime.jsx("input", { id: 'mfa-input', "data-testid": 'mfa-input', value: mfaCode, onChange: handleCodeChanged, className: 'mfa-exchange-view__content__input__input' }) }), jsxRuntime.jsx("div", { className: 'mfa-exchange-view__content__confirm', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'confirm-button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: { color: 'white' }, className: 'mfa-exchange-view__content__confirm__button', disabled: mfaCode === '', onClick: () => {
|
|
123
|
+
onSubmit(mfaCode);
|
|
124
|
+
}, children: t('dyn_exchange_mfa.button') }) })] }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { asFooter: true })] }));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
exports.MfaExchangeView = MfaExchangeView;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
6
|
+
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
9
|
+
import { ReactComponent as SvgArrowLeft } from '../../shared/assets/arrow-left.js';
|
|
10
|
+
import { ReactComponent as SvgLocked } from '../../shared/assets/locked.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
13
|
+
import '../../../../_virtual/_tslib.js';
|
|
14
|
+
import '@dynamic-labs/sdk-api-core';
|
|
15
|
+
import '../../shared/logger.js';
|
|
16
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
17
|
+
import '@dynamic-labs/wallet-book';
|
|
18
|
+
import '../../utils/constants/colors.js';
|
|
19
|
+
import '../../utils/constants/values.js';
|
|
20
|
+
import '../../shared/consts/index.js';
|
|
21
|
+
import '../../components/Alert/Alert.js';
|
|
22
|
+
import '../../events/dynamicEvents.js';
|
|
23
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
24
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
25
|
+
import '../../store/state/authMode/authMode.js';
|
|
26
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
27
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
28
|
+
import '@dynamic-labs/multi-wallet';
|
|
29
|
+
import 'react-international-phone';
|
|
30
|
+
import '../../store/state/nonce/nonce.js';
|
|
31
|
+
import { pixelToRem } from '../../utils/functions/pixelToRem/pixelToRem.js';
|
|
32
|
+
import '../../store/state/projectSettings/projectSettings.js';
|
|
33
|
+
import '../../config/ApiEndpoint.js';
|
|
34
|
+
import '../../store/state/user/user.js';
|
|
35
|
+
import '../../locale/locale.js';
|
|
36
|
+
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
37
|
+
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
38
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
39
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
40
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
41
|
+
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
42
|
+
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
|
+
import 'react-dom';
|
|
44
|
+
import '../../utils/functions/compareChains/compareChains.js';
|
|
45
|
+
import '../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
46
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
47
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
48
|
+
import 'bs58';
|
|
49
|
+
import '@dynamic-labs/types';
|
|
50
|
+
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
51
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
52
|
+
import '../../context/WalletContext/WalletContext.js';
|
|
53
|
+
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
54
|
+
import 'yup';
|
|
55
|
+
import '../../context/MockContext/MockContext.js';
|
|
56
|
+
import '../CollectUserDataView/useFields.js';
|
|
57
|
+
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
58
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
59
|
+
import '@dynamic-labs/rpc-providers';
|
|
60
|
+
import '../../store/state/walletOptions/walletOptions.js';
|
|
61
|
+
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
62
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
63
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
64
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
65
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
66
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
67
|
+
import '../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
68
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
69
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
70
|
+
import 'react-focus-lock';
|
|
71
|
+
import { iconRatio, IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
72
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
73
|
+
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
74
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
75
|
+
import 'formik';
|
|
76
|
+
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
77
|
+
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
78
|
+
import '../../store/state/sendBalances.js';
|
|
79
|
+
import '../../components/Input/Input.js';
|
|
80
|
+
import '../../components/OverlayCard/OverlayCard.js';
|
|
81
|
+
import '../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
82
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
83
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
84
|
+
import '../../context/OnrampContext/OnrampContext.js';
|
|
85
|
+
import 'qrcode';
|
|
86
|
+
import '../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
87
|
+
import '../../../index.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 '../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
95
|
+
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
96
|
+
import '../../store/state/tokenBalances.js';
|
|
97
|
+
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
98
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
99
|
+
import '../../components/IsBrowser/IsBrowser.js';
|
|
100
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
101
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
102
|
+
|
|
103
|
+
const iconSize = 96;
|
|
104
|
+
const MfaExchangeView = ({ onSubmit, onBack }) => {
|
|
105
|
+
const { t } = useTranslation();
|
|
106
|
+
const [mfaCode, setMfaCode] = useState('');
|
|
107
|
+
const handleCodeChanged = (event) => {
|
|
108
|
+
const inputCode = event.target.value;
|
|
109
|
+
setMfaCode(inputCode);
|
|
110
|
+
};
|
|
111
|
+
const backButton = (jsx(IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: () => {
|
|
112
|
+
onBack();
|
|
113
|
+
}, children: jsx(SvgArrowLeft, {}) }));
|
|
114
|
+
const icon = (jsx(SvgLocked, { style: {
|
|
115
|
+
height: pixelToRem(iconSize * iconRatio),
|
|
116
|
+
width: pixelToRem(iconSize * iconRatio),
|
|
117
|
+
} }));
|
|
118
|
+
return (jsxs("div", { className: 'mfa-exchange-view', children: [jsx(ModalHeader, { leading: backButton, children: jsx(Typography, { variant: 'title', children: t('dyn_exchange_mfa.title') }) }), jsxs("div", { className: 'mfa-exchange-view__content', children: [jsxs("div", { className: 'mfa-exchange-view__content__icon-description', children: [jsx("div", { className: 'mfa-exchange-view__content__icon-description__icon-holder', children: jsx(IconWithSpinner, { Icon: icon, customSpinnerColor: 'black', iconSize: iconSize, className: 'mfa-exchange-view__content__icon-description__icon-holder__icon', isSpinning: true }) }), jsx("div", { className: 'mfa-exchange-view__content__icon-description__description-holder', children: jsx(Typography, { variant: 'body_normal', className: 'mfa-exchange-view__content__icon-description__description-holder__description', color: 'secondary', children: t('dyn_exchange_mfa.description') }) })] }), jsx("div", { className: 'mfa-exchange-view__content__input', children: jsx("input", { id: 'mfa-input', "data-testid": 'mfa-input', value: mfaCode, onChange: handleCodeChanged, className: 'mfa-exchange-view__content__input__input' }) }), jsx("div", { className: 'mfa-exchange-view__content__confirm', children: jsx(TypographyButton, { dataTestId: 'confirm-button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: { color: 'white' }, className: 'mfa-exchange-view__content__confirm__button', disabled: mfaCode === '', onClick: () => {
|
|
119
|
+
onSubmit(mfaCode);
|
|
120
|
+
}, children: t('dyn_exchange_mfa.button') }) })] }), jsx(PoweredByDynamic, { asFooter: true })] }));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { MfaExchangeView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MfaExchangeView } from './MfaExchangeView';
|
|
@@ -142,6 +142,7 @@ var WalletSignSpinnerView = require('./WalletSignSpinnerView/WalletSignSpinnerVi
|
|
|
142
142
|
var WalletUsedView = require('./WalletUsedView/WalletUsedView.cjs');
|
|
143
143
|
var ExchangeList = require('./ExchangeList/ExchangeList.cjs');
|
|
144
144
|
var DuplicateWalletView = require('./DuplicateWalletView/DuplicateWalletView.cjs');
|
|
145
|
+
var MfaExchangeView = require('./MfaExchangeView/MfaExchangeView.cjs');
|
|
145
146
|
require('../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
146
147
|
require('../store/state/tokenBalances.cjs');
|
|
147
148
|
require('../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
@@ -187,6 +188,7 @@ const viewToComponentMap = {
|
|
|
187
188
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView.MergeUserAccountsWithSameEmailView,
|
|
188
189
|
'mfa-choose-device': MfaChooseDeviceView.MfaChooseDeviceView,
|
|
189
190
|
'mfa-display-backup-codes': MfaDisplayBackupCodesView.MfaDisplayBackupCodesView,
|
|
191
|
+
'mfa-exchange-view': MfaExchangeView.MfaExchangeView,
|
|
190
192
|
'mfa-recovery': MfaRecoveryView.MfaRecoveryView,
|
|
191
193
|
'mfa-secure-device': MfaSecureDeviceView.MfaSecureDeviceView,
|
|
192
194
|
'mfa-secure-device-help': MfaSecureDeviceHelpView.MfaSecureDeviceHelper,
|
|
@@ -41,6 +41,10 @@ export declare const viewToComponentMap: {
|
|
|
41
41
|
'mfa-display-backup-codes': ({ regenerateCodes, }: {
|
|
42
42
|
regenerateCodes: boolean;
|
|
43
43
|
}) => JSX.Element;
|
|
44
|
+
'mfa-exchange-view': import("react").FC<{
|
|
45
|
+
onSubmit: (code: string) => void;
|
|
46
|
+
onBack: () => void;
|
|
47
|
+
}>;
|
|
44
48
|
'mfa-recovery': import("react").FC;
|
|
45
49
|
'mfa-secure-device': ({ type, isInitialSetup, }: import("./MfaSecureDeviceView").MfaSecureDeviceViewProps) => JSX.Element;
|
|
46
50
|
'mfa-secure-device-help': ({ uri, secret, }: {
|
|
@@ -138,6 +138,7 @@ import { WalletSignSpinnerView } from './WalletSignSpinnerView/WalletSignSpinner
|
|
|
138
138
|
import { WalletUsedView } from './WalletUsedView/WalletUsedView.js';
|
|
139
139
|
import { ExchangeList } from './ExchangeList/ExchangeList.js';
|
|
140
140
|
import { DuplicateWalletView } from './DuplicateWalletView/DuplicateWalletView.js';
|
|
141
|
+
import { MfaExchangeView } from './MfaExchangeView/MfaExchangeView.js';
|
|
141
142
|
import '../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
142
143
|
import '../store/state/tokenBalances.js';
|
|
143
144
|
import '../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
@@ -183,6 +184,7 @@ const viewToComponentMap = {
|
|
|
183
184
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView,
|
|
184
185
|
'mfa-choose-device': MfaChooseDeviceView,
|
|
185
186
|
'mfa-display-backup-codes': MfaDisplayBackupCodesView,
|
|
187
|
+
'mfa-exchange-view': MfaExchangeView,
|
|
186
188
|
'mfa-recovery': MfaRecoveryView,
|
|
187
189
|
'mfa-secure-device': MfaSecureDeviceView,
|
|
188
190
|
'mfa-secure-device-help': MfaSecureDeviceHelper,
|