@dynamic-labs/sdk-react-core 1.0.0-alpha.6 → 1.0.0-alpha.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 +32 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +10 -10
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/Main.cjs +18 -21
- package/src/lib/Main.js +18 -21
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +84 -5
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +85 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +8 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +8 -6
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +68 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.d.ts +6 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +64 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/index.d.ts +1 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs +24 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.d.ts +6 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js +20 -0
- package/src/lib/components/SecureTurnkeyWalletCard/index.d.ts +1 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +5 -2
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +5 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +6 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +6 -2
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +8 -5
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -5
- package/src/lib/context/DynamicContext/hooks/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.cjs +23 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.d.ts +4 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.js +19 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -1
- package/src/lib/data/api.cjs +14 -10
- package/src/lib/data/api.d.ts +2 -2
- package/src/lib/data/api.js +14 -10
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +9 -11
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -12
- package/src/lib/locale/en/translation.cjs +77 -3
- package/src/lib/locale/en/translation.d.ts +76 -2
- package/src/lib/locale/en/translation.js +77 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +6 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +6 -2
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +1 -1
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +1 -6
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +3 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +3 -0
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -8
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -8
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/index.d.ts +1 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +83 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +15 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +79 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +11 -3
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +11 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +57 -33
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +57 -33
- package/src/lib/utils/hooks/useEventListener/useEventListener.cjs +2 -1
- package/src/lib/utils/hooks/useEventListener/useEventListener.js +2 -1
- package/src/lib/utils/hooks/useIsTurnkeyWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +37 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.d.ts +6 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +33 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +9 -5
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +10 -6
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +20 -21
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +1 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +20 -21
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -9
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -10
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
- package/src/lib/views/LoginView/useLoginView.cjs +101 -84
- package/src/lib/views/LoginView/useLoginView.js +102 -85
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +20 -50
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +1 -6
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +20 -50
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +7 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +7 -2
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +8 -10
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +8 -10
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +56 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.d.ts +13 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +52 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +12 -2
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +12 -2
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +3 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +6 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +8 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +8 -5
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -3
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +11 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +11 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -3
- 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/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +16 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +16 -6
- package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
- package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
|
@@ -36,6 +36,7 @@ require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
|
36
36
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
37
37
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
38
38
|
require('../../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
39
|
+
var useIsTurnkeyWallet = require('../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
39
40
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
40
41
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
41
42
|
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -51,6 +52,7 @@ require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
51
52
|
require('yup');
|
|
52
53
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
53
54
|
require('@dynamic-labs/types');
|
|
55
|
+
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
54
56
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
55
57
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
56
58
|
require('formik');
|
|
@@ -58,7 +60,6 @@ require('../../../../components/IconButton/IconButton.cjs');
|
|
|
58
60
|
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
59
61
|
require('../../../../components/Alert/Alert.cjs');
|
|
60
62
|
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
61
|
-
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
62
63
|
var TextButton = require('../../../../components/TextButton/TextButton.cjs');
|
|
63
64
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
64
65
|
var Input = require('../../../../components/Input/Input.cjs');
|
|
@@ -72,6 +73,7 @@ var passkeyRecovery = require('../../utils/passkeyRecovery/passkeyRecovery.cjs')
|
|
|
72
73
|
const bundleRegex = new RegExp(/^([A-Za-z0-9\s_+@\.-]+)$/);
|
|
73
74
|
const PasskeyBundleRecovery = () => {
|
|
74
75
|
const { authToken, primaryWallet, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
76
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
75
77
|
const [bundleInput, setBundleInput] = React.useState('');
|
|
76
78
|
const [resendingCode, setResendingCode] = React.useState(false);
|
|
77
79
|
const [isValid, setIsValid] = React.useState(false);
|
|
@@ -130,7 +132,10 @@ const PasskeyBundleRecovery = () => {
|
|
|
130
132
|
}
|
|
131
133
|
});
|
|
132
134
|
const emailIcon = (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(iconic.SignInWithEmailIcon, {}) }));
|
|
133
|
-
|
|
135
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
136
|
+
? 'dyn_passkey_secure_modal'
|
|
137
|
+
: 'dyn_passkey_recovery';
|
|
138
|
+
return (jsxRuntime.jsxs("div", { className: 'passkey-recovery-view', children: [!error$1 && !isValid ? (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: emailIcon, isSpinning: !error$1 && !isValid, iconSize: 96 })) : (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 64, variant: error$1 ? 'red' : 'green', InnerIcon: error$1 ? error.ReactComponent : check.ReactComponent })), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: [t(`${translationKey}.code.description`), " ", jsxRuntime.jsx("strong", { children: "turnkey.com" })] }), jsxRuntime.jsx("div", { className: 'passkey-recovery-view__actions', children: jsxRuntime.jsx(Input.Input, { id: 'passkey-recovery-bundle', "data-testid": 'passkey-recovery-bundle-input', value: bundleInput, onChange: handleBundleChanged, label: t(`${translationKey}.code.input_label`), disabled: isLoading || resendingCode, error: Boolean(error$1), className: isValid ? 'passkey-recovery-view__input-valid' : '', autoFocus: true }) }), jsxRuntime.jsxs("div", { className: 'passkey-recovery-view__resend-code', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t(`${translationKey}.code.resend.text`) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'link', children: jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'resend-email-button', onClick: handleResentEmail, disabled: resendingCode || isLoading || bundleInput.length > 0, children: t(`${translationKey}.code.resend.button`) }) })] })] }));
|
|
134
139
|
};
|
|
135
140
|
|
|
136
141
|
exports.PasskeyBundleRecovery = PasskeyBundleRecovery;
|
|
@@ -32,6 +32,7 @@ import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
|
32
32
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
33
33
|
import '../../../../context/MockContext/MockContext.js';
|
|
34
34
|
import '../../../../context/QrCodeContext/QrCodeContext.js';
|
|
35
|
+
import { useIsTurnkeyWallet } from '../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
35
36
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
36
37
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
37
38
|
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -47,6 +48,7 @@ import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
47
48
|
import 'yup';
|
|
48
49
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
49
50
|
import '@dynamic-labs/types';
|
|
51
|
+
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
50
52
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
51
53
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
52
54
|
import 'formik';
|
|
@@ -54,7 +56,6 @@ import '../../../../components/IconButton/IconButton.js';
|
|
|
54
56
|
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
55
57
|
import '../../../../components/Alert/Alert.js';
|
|
56
58
|
import '../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
57
|
-
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
58
59
|
import { TextButton } from '../../../../components/TextButton/TextButton.js';
|
|
59
60
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
60
61
|
import { Input } from '../../../../components/Input/Input.js';
|
|
@@ -68,6 +69,7 @@ import { passkeyRecoveryBundleValidation, resentRecoveryEmail } from '../../util
|
|
|
68
69
|
const bundleRegex = new RegExp(/^([A-Za-z0-9\s_+@\.-]+)$/);
|
|
69
70
|
const PasskeyBundleRecovery = () => {
|
|
70
71
|
const { authToken, primaryWallet, environmentId } = useInternalDynamicContext();
|
|
72
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
71
73
|
const [bundleInput, setBundleInput] = useState('');
|
|
72
74
|
const [resendingCode, setResendingCode] = useState(false);
|
|
73
75
|
const [isValid, setIsValid] = useState(false);
|
|
@@ -126,7 +128,10 @@ const PasskeyBundleRecovery = () => {
|
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
130
|
const emailIcon = (jsx(Icon, { color: 'brand-primary', children: jsx(SignInWithEmailIcon, {}) }));
|
|
129
|
-
|
|
131
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
132
|
+
? 'dyn_passkey_secure_modal'
|
|
133
|
+
: 'dyn_passkey_recovery';
|
|
134
|
+
return (jsxs("div", { className: 'passkey-recovery-view', children: [!error && !isValid ? (jsx(IconWithSpinner, { Icon: emailIcon, isSpinning: !error && !isValid, iconSize: 96 })) : (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 64, variant: error ? 'red' : 'green', InnerIcon: error ? SvgError : SvgCheck })), jsxs(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: [t(`${translationKey}.code.description`), " ", jsx("strong", { children: "turnkey.com" })] }), jsx("div", { className: 'passkey-recovery-view__actions', children: jsx(Input, { id: 'passkey-recovery-bundle', "data-testid": 'passkey-recovery-bundle-input', value: bundleInput, onChange: handleBundleChanged, label: t(`${translationKey}.code.input_label`), disabled: isLoading || resendingCode, error: Boolean(error), className: isValid ? 'passkey-recovery-view__input-valid' : '', autoFocus: true }) }), jsxs("div", { className: 'passkey-recovery-view__resend-code', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: t(`${translationKey}.code.resend.text`) }), jsx(Typography, { variant: 'body_small', color: 'link', children: jsx(TextButton, { "data-testid": 'resend-email-button', onClick: handleResentEmail, disabled: resendingCode || isLoading || bundleInput.length > 0, children: t(`${translationKey}.code.resend.button`) }) })] })] }));
|
|
130
135
|
};
|
|
131
136
|
|
|
132
137
|
export { PasskeyBundleRecovery };
|
|
@@ -37,6 +37,7 @@ require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
|
37
37
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
38
38
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
39
39
|
require('../../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
40
|
+
var useIsTurnkeyWallet = require('../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
40
41
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
41
42
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
42
43
|
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -46,11 +47,12 @@ require('../../../../context/EmailVerificationContext/EmailVerificationContext.c
|
|
|
46
47
|
require('qrcode');
|
|
47
48
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
48
49
|
require('i18next');
|
|
49
|
-
|
|
50
|
+
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
50
51
|
require('yup');
|
|
51
52
|
var ErrorContainer = require('../../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
52
53
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
53
54
|
require('@dynamic-labs/types');
|
|
55
|
+
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
54
56
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
55
57
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
56
58
|
require('formik');
|
|
@@ -59,7 +61,6 @@ require('../../../../components/IconButton/IconButton.cjs');
|
|
|
59
61
|
require('../../../../components/Alert/Alert.cjs');
|
|
60
62
|
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
61
63
|
var getProperErrorMessage = require('../../../../modals/SignMessageConfirmationModal/getProperErrorMessage.cjs');
|
|
62
|
-
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
63
64
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
64
65
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
65
66
|
var NeedHelpSection = require('../../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
@@ -70,8 +71,8 @@ var passkeyRecovery = require('../../utils/passkeyRecovery/passkeyRecovery.cjs')
|
|
|
70
71
|
var PasskeyDeviceIcon = require('../../PasskeyDeviceIcon/PasskeyDeviceIcon.cjs');
|
|
71
72
|
|
|
72
73
|
const PasskeyCompleteRecovery = () => {
|
|
73
|
-
const { authToken, primaryWallet, environmentId, internalEvents, user, setShowAuthFlow, setUser, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
74
|
-
const {
|
|
74
|
+
const { authToken, primaryWallet, environmentId, internalEvents, user, setShowAuthFlow, setUser, setShowPasskeyCreatedSuccess, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
75
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
75
76
|
const { t } = reactI18next.useTranslation();
|
|
76
77
|
const { mutate: completeRecovery, isLoading, error, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
77
78
|
const { jwt, decodedJwt } = yield passkeyRecovery.completePasskeyRecovery({
|
|
@@ -83,8 +84,8 @@ const PasskeyCompleteRecovery = () => {
|
|
|
83
84
|
internalEvents.current.emit('passkeyRecoveryCompleted', primaryWallet);
|
|
84
85
|
index.storeAuthToken(jwt);
|
|
85
86
|
setUser(createUserProfile.createUserProfile(decodedJwt));
|
|
86
|
-
setDynamicWidgetView('manage-passkeys');
|
|
87
87
|
setShowAuthFlow(false);
|
|
88
|
+
setShowPasskeyCreatedSuccess();
|
|
88
89
|
}), {
|
|
89
90
|
onFailure: (err) => {
|
|
90
91
|
logger.logger.error('Failed to init passkey recovery', err);
|
|
@@ -100,9 +101,12 @@ const PasskeyCompleteRecovery = () => {
|
|
|
100
101
|
}
|
|
101
102
|
return getProperErrorMessage.getProperErrorMessage(error);
|
|
102
103
|
}, [error]);
|
|
103
|
-
|
|
104
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
105
|
+
? 'dyn_passkey_secure_modal'
|
|
106
|
+
: 'dyn_passkey_recovery';
|
|
107
|
+
return (jsxRuntime.jsxs("div", { className: 'passkey-recovery-view', children: [jsxRuntime.jsx("div", { className: 'passkey-recovery-view__header', children: jsxRuntime.jsx(passkeyIntroIcon.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t(`${translationKey}.complete.description`) }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx("div", { className: 'passkey-recovery-view__actions', children: jsxRuntime.jsx(Button.Button, { buttonVariant: 'brand-primary', buttonPadding: 'large', dataTestId: 'passkey-recovery-complete-button', onClick: () => completeRecovery(), disabled: isLoading, showInternalLoading: false, typographyProps: {
|
|
104
108
|
color: 'inherit',
|
|
105
|
-
}, children: jsxRuntime.jsxs("div", { className: 'passkey-recovery-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, {}), jsxRuntime.jsx(Typography.Typography, { children: t(
|
|
109
|
+
}, children: jsxRuntime.jsxs("div", { className: 'passkey-recovery-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, {}), jsxRuntime.jsx(Typography.Typography, { children: t(`${translationKey}.complete.complete_button`) })] }) }) }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {})] }));
|
|
106
110
|
};
|
|
107
111
|
|
|
108
112
|
exports.PasskeyCompleteRecovery = PasskeyCompleteRecovery;
|
|
@@ -33,6 +33,7 @@ import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
|
33
33
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
34
34
|
import '../../../../context/MockContext/MockContext.js';
|
|
35
35
|
import '../../../../context/QrCodeContext/QrCodeContext.js';
|
|
36
|
+
import { useIsTurnkeyWallet } from '../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
36
37
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
37
38
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
38
39
|
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -42,11 +43,12 @@ import '../../../../context/EmailVerificationContext/EmailVerificationContext.js
|
|
|
42
43
|
import 'qrcode';
|
|
43
44
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
44
45
|
import 'i18next';
|
|
45
|
-
import
|
|
46
|
+
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
46
47
|
import 'yup';
|
|
47
48
|
import { ErrorContainer } from '../../../../components/ErrorContainer/ErrorContainer.js';
|
|
48
49
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
49
50
|
import '@dynamic-labs/types';
|
|
51
|
+
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
50
52
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
51
53
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
52
54
|
import 'formik';
|
|
@@ -55,7 +57,6 @@ import '../../../../components/IconButton/IconButton.js';
|
|
|
55
57
|
import '../../../../components/Alert/Alert.js';
|
|
56
58
|
import '../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
57
59
|
import { getProperErrorMessage } from '../../../../modals/SignMessageConfirmationModal/getProperErrorMessage.js';
|
|
58
|
-
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
59
60
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
60
61
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
61
62
|
import { NeedHelpSection } from '../../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
@@ -66,8 +67,8 @@ import { completePasskeyRecovery } from '../../utils/passkeyRecovery/passkeyReco
|
|
|
66
67
|
import { PasskeyDeviceIcon } from '../../PasskeyDeviceIcon/PasskeyDeviceIcon.js';
|
|
67
68
|
|
|
68
69
|
const PasskeyCompleteRecovery = () => {
|
|
69
|
-
const { authToken, primaryWallet, environmentId, internalEvents, user, setShowAuthFlow, setUser, } = useInternalDynamicContext();
|
|
70
|
-
const {
|
|
70
|
+
const { authToken, primaryWallet, environmentId, internalEvents, user, setShowAuthFlow, setUser, setShowPasskeyCreatedSuccess, } = useInternalDynamicContext();
|
|
71
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
71
72
|
const { t } = useTranslation();
|
|
72
73
|
const { mutate: completeRecovery, isLoading, error, } = useMutation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
74
|
const { jwt, decodedJwt } = yield completePasskeyRecovery({
|
|
@@ -79,8 +80,8 @@ const PasskeyCompleteRecovery = () => {
|
|
|
79
80
|
internalEvents.current.emit('passkeyRecoveryCompleted', primaryWallet);
|
|
80
81
|
storeAuthToken(jwt);
|
|
81
82
|
setUser(createUserProfile(decodedJwt));
|
|
82
|
-
setDynamicWidgetView('manage-passkeys');
|
|
83
83
|
setShowAuthFlow(false);
|
|
84
|
+
setShowPasskeyCreatedSuccess();
|
|
84
85
|
}), {
|
|
85
86
|
onFailure: (err) => {
|
|
86
87
|
logger.error('Failed to init passkey recovery', err);
|
|
@@ -96,9 +97,12 @@ const PasskeyCompleteRecovery = () => {
|
|
|
96
97
|
}
|
|
97
98
|
return getProperErrorMessage(error);
|
|
98
99
|
}, [error]);
|
|
99
|
-
|
|
100
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
101
|
+
? 'dyn_passkey_secure_modal'
|
|
102
|
+
: 'dyn_passkey_recovery';
|
|
103
|
+
return (jsxs("div", { className: 'passkey-recovery-view', children: [jsx("div", { className: 'passkey-recovery-view__header', children: jsx(SvgPasskeyIntroIcon, {}) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t(`${translationKey}.complete.description`) }), errorText && jsx(ErrorContainer, { children: errorText }), jsx("div", { className: 'passkey-recovery-view__actions', children: jsx(Button, { buttonVariant: 'brand-primary', buttonPadding: 'large', dataTestId: 'passkey-recovery-complete-button', onClick: () => completeRecovery(), disabled: isLoading, showInternalLoading: false, typographyProps: {
|
|
100
104
|
color: 'inherit',
|
|
101
|
-
}, children: jsxs("div", { className: 'passkey-recovery-view__inline-button', children: [jsx(PasskeyDeviceIcon, {}), jsx(Typography, { children: t(
|
|
105
|
+
}, children: jsxs("div", { className: 'passkey-recovery-view__inline-button', children: [jsx(PasskeyDeviceIcon, {}), jsx(Typography, { children: t(`${translationKey}.complete.complete_button`) })] }) }) }), jsx(NeedHelpSection, {})] }));
|
|
102
106
|
};
|
|
103
107
|
|
|
104
108
|
export { PasskeyCompleteRecovery };
|
|
@@ -13,7 +13,6 @@ var logger = require('../../../../shared/logger.cjs');
|
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
-
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
17
16
|
var close = require('../../../../shared/assets/close.cjs');
|
|
18
17
|
var signInWithEmail = require('../../../../shared/assets/sign-in-with-email.cjs');
|
|
19
18
|
require('@dynamic-labs/wallet-book');
|
|
@@ -38,6 +37,7 @@ require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
|
38
37
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
39
38
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
40
39
|
require('../../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
40
|
+
var useIsTurnkeyWallet = require('../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
41
41
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
42
42
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
43
43
|
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -49,11 +49,12 @@ require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
|
49
49
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
50
50
|
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
51
51
|
require('i18next');
|
|
52
|
-
|
|
52
|
+
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
53
53
|
require('yup');
|
|
54
54
|
var ErrorContainer = require('../../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
55
55
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
56
56
|
require('@dynamic-labs/types');
|
|
57
|
+
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
57
58
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
58
59
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
59
60
|
require('formik');
|
|
@@ -63,7 +64,6 @@ var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
|
63
64
|
require('../../../../components/Alert/Alert.cjs');
|
|
64
65
|
var constants = require('../constants.cjs');
|
|
65
66
|
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
66
|
-
var useMutation = require('../../../../utils/hooks/useMutation/useMutation.cjs');
|
|
67
67
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
68
68
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
69
69
|
var NeedHelpSection = require('../../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
@@ -74,8 +74,8 @@ var passkeyRecovery = require('../../utils/passkeyRecovery/passkeyRecovery.cjs')
|
|
|
74
74
|
|
|
75
75
|
const PasskeyInitRecovery = () => {
|
|
76
76
|
const { authToken, primaryWallet, environmentId, internalEvents, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
77
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
77
78
|
const { setView } = ViewContext.useViewContext();
|
|
78
|
-
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
79
79
|
useElementById.useElementById(constants.iframeContainerId);
|
|
80
80
|
const { t } = reactI18next.useTranslation();
|
|
81
81
|
const { mutate: initRecovery, isLoading, error, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -103,13 +103,11 @@ const PasskeyInitRecovery = () => {
|
|
|
103
103
|
return 'Something went wrong.';
|
|
104
104
|
}, [error]);
|
|
105
105
|
const EmailIcon = (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signInWithEmail.ReactComponent, {}) }));
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
106
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
107
|
+
? 'dyn_passkey_secure_modal'
|
|
108
|
+
: 'dyn_passkey_recovery';
|
|
110
109
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setShowAuthFlow(false), "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
111
|
-
|
|
112
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: t('dyn_passkey_recovery.start.title') }) }), jsxRuntime.jsxs("div", { className: 'passkey-recovery-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, isSpinning: isLoading, iconSize: 96 }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t('dyn_passkey_recovery.start.description') }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx("div", { className: 'passkey-recovery-view__actions', children: jsxRuntime.jsx(Button.Button, { buttonPadding: 'large', dataTestId: 'passkey-recovery-button', onClick: () => initRecovery(), disabled: isLoading, showInternalLoading: false, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { children: t('dyn_passkey_recovery.start.start_button') }) }) }) }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {})] })] }));
|
|
110
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: t(`${translationKey}.start.title`) }) }), jsxRuntime.jsxs("div", { className: 'passkey-recovery-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, isSpinning: isLoading, iconSize: 96 }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t(`${translationKey}.start.description`) }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx("div", { className: 'passkey-recovery-view__actions', children: jsxRuntime.jsx(Button.Button, { buttonPadding: 'large', dataTestId: 'passkey-recovery-button', onClick: () => initRecovery(), disabled: isLoading, showInternalLoading: false, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { children: t(`${translationKey}.start.start_button`) }) }) }) }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {})] })] }));
|
|
113
111
|
};
|
|
114
112
|
|
|
115
113
|
exports.PasskeyInitRecovery = PasskeyInitRecovery;
|
|
@@ -9,7 +9,6 @@ import { logger } from '../../../../shared/logger.js';
|
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
-
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
13
12
|
import { ReactComponent as SvgClose } from '../../../../shared/assets/close.js';
|
|
14
13
|
import { ReactComponent as SvgSignInWithEmail } from '../../../../shared/assets/sign-in-with-email.js';
|
|
15
14
|
import '@dynamic-labs/wallet-book';
|
|
@@ -34,6 +33,7 @@ import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
|
34
33
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
35
34
|
import '../../../../context/MockContext/MockContext.js';
|
|
36
35
|
import '../../../../context/QrCodeContext/QrCodeContext.js';
|
|
36
|
+
import { useIsTurnkeyWallet } from '../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
37
37
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
38
38
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
39
39
|
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -45,11 +45,12 @@ import '../../../../context/ThemeContext/ThemeContext.js';
|
|
|
45
45
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
46
46
|
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
47
47
|
import 'i18next';
|
|
48
|
-
import
|
|
48
|
+
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
49
49
|
import 'yup';
|
|
50
50
|
import { ErrorContainer } from '../../../../components/ErrorContainer/ErrorContainer.js';
|
|
51
51
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
52
|
import '@dynamic-labs/types';
|
|
53
|
+
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
53
54
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
54
55
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
55
56
|
import 'formik';
|
|
@@ -59,7 +60,6 @@ import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
|
59
60
|
import '../../../../components/Alert/Alert.js';
|
|
60
61
|
import { iframeContainerId, iframeElementId } from '../constants.js';
|
|
61
62
|
import '../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
62
|
-
import { useMutation } from '../../../../utils/hooks/useMutation/useMutation.js';
|
|
63
63
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
64
64
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
65
65
|
import { NeedHelpSection } from '../../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
@@ -70,8 +70,8 @@ import { initPasskeyRecovery } from '../../utils/passkeyRecovery/passkeyRecovery
|
|
|
70
70
|
|
|
71
71
|
const PasskeyInitRecovery = () => {
|
|
72
72
|
const { authToken, primaryWallet, environmentId, internalEvents, setShowAuthFlow, } = useInternalDynamicContext();
|
|
73
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
73
74
|
const { setView } = useViewContext();
|
|
74
|
-
const { setDynamicWidgetView } = useWidgetContext();
|
|
75
75
|
useElementById(iframeContainerId);
|
|
76
76
|
const { t } = useTranslation();
|
|
77
77
|
const { mutate: initRecovery, isLoading, error, } = useMutation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -99,13 +99,11 @@ const PasskeyInitRecovery = () => {
|
|
|
99
99
|
return 'Something went wrong.';
|
|
100
100
|
}, [error]);
|
|
101
101
|
const EmailIcon = (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignInWithEmail, {}) }));
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
102
|
+
const translationKey = isTurnkeyWalletWithoutAuthenticator
|
|
103
|
+
? 'dyn_passkey_secure_modal'
|
|
104
|
+
: 'dyn_passkey_recovery';
|
|
106
105
|
const closeButton = (jsx(IconButton, { type: 'button', onClick: () => setShowAuthFlow(false), "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
|
|
107
|
-
|
|
108
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: t('dyn_passkey_recovery.start.title') }) }), jsxs("div", { className: 'passkey-recovery-view', children: [jsx(IconWithSpinner, { Icon: EmailIcon, isSpinning: isLoading, iconSize: 96 }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t('dyn_passkey_recovery.start.description') }), errorText && jsx(ErrorContainer, { children: errorText }), jsx("div", { className: 'passkey-recovery-view__actions', children: jsx(Button, { buttonPadding: 'large', dataTestId: 'passkey-recovery-button', onClick: () => initRecovery(), disabled: isLoading, showInternalLoading: false, children: jsx("div", { children: jsx(Typography, { children: t('dyn_passkey_recovery.start.start_button') }) }) }) }), jsx(NeedHelpSection, {})] })] }));
|
|
106
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: t(`${translationKey}.start.title`) }) }), jsxs("div", { className: 'passkey-recovery-view', children: [jsx(IconWithSpinner, { Icon: EmailIcon, isSpinning: isLoading, iconSize: 96 }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-recovery-view__subtitle', children: t(`${translationKey}.start.description`) }), errorText && jsx(ErrorContainer, { children: errorText }), jsx("div", { className: 'passkey-recovery-view__actions', children: jsx(Button, { buttonPadding: 'large', dataTestId: 'passkey-recovery-button', onClick: () => initRecovery(), disabled: isLoading, showInternalLoading: false, children: jsx("div", { children: jsx(Typography, { children: t(`${translationKey}.start.start_button`) }) }) }) }), jsx(NeedHelpSection, {})] })] }));
|
|
109
107
|
};
|
|
110
108
|
|
|
111
109
|
export { PasskeyInitRecovery };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
|
+
var decodeJwt = require('../../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
8
|
+
require('@dynamic-labs/iconic');
|
|
9
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
10
|
+
require('react/jsx-runtime');
|
|
11
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
+
require('react');
|
|
13
|
+
require('../../../../shared/logger.cjs');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('viem');
|
|
18
|
+
require('../../../../shared/consts/index.cjs');
|
|
19
|
+
var api = require('../../../../data/api.cjs');
|
|
20
|
+
var findEmbeddedWalletFromVerifiedCredentials = require('../../../../utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
require('@dynamic-labs/sdk-api');
|
|
23
|
+
|
|
24
|
+
const createPregeneratedWallet = ({ user, walletConnector, environmentId, authToken, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
if (!authToken) {
|
|
26
|
+
throw new utils.DynamicError('Auth token is not defined');
|
|
27
|
+
}
|
|
28
|
+
if (!walletConnector) {
|
|
29
|
+
throw new utils.DynamicError('PasskeyWalletConnector not found');
|
|
30
|
+
}
|
|
31
|
+
if (!user) {
|
|
32
|
+
throw new utils.DynamicError('User is not defined');
|
|
33
|
+
}
|
|
34
|
+
walletConnector.setEmail(user.email);
|
|
35
|
+
const signersResponse = yield api.createTurnkeyEvmEmbeddedWallet({
|
|
36
|
+
environmentId,
|
|
37
|
+
userJwt: authToken,
|
|
38
|
+
});
|
|
39
|
+
const { jwt } = signersResponse;
|
|
40
|
+
const decodedJwt = decodeJwt.decodeJwt(jwt);
|
|
41
|
+
if (decodedJwt === undefined)
|
|
42
|
+
throw new utils.DynamicError('Invalid token!');
|
|
43
|
+
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(jwt);
|
|
44
|
+
if (!embeddedWalletVerifiedCredential) {
|
|
45
|
+
throw new utils.DynamicError('EmbeddedWalletVerifiedCredential not found');
|
|
46
|
+
}
|
|
47
|
+
walletConnector.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
48
|
+
return {
|
|
49
|
+
decodedJwt,
|
|
50
|
+
embeddedWalletVerifiedCredential,
|
|
51
|
+
jwt,
|
|
52
|
+
walletConnector,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
exports.createPregeneratedWallet = createPregeneratedWallet;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEmailWalletConnector, IPasskeyWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { UserProfile } from '../../../../shared';
|
|
3
|
+
export declare const createPregeneratedWallet: ({ user, walletConnector, environmentId, authToken, }: {
|
|
4
|
+
authToken: string | undefined;
|
|
5
|
+
environmentId: string;
|
|
6
|
+
user: UserProfile | undefined;
|
|
7
|
+
walletConnector: (IPasskeyWalletConnector & IEmailWalletConnector) | undefined;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
decodedJwt: Omit<import("@dynamic-labs/sdk-api").DynamicJwt, "jwt">;
|
|
10
|
+
embeddedWalletVerifiedCredential: import("@dynamic-labs/sdk-api").JwtVerifiedCredential;
|
|
11
|
+
jwt: string;
|
|
12
|
+
walletConnector: IPasskeyWalletConnector & IEmailWalletConnector;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
|
+
import { decodeJwt } from '../../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
4
|
+
import '@dynamic-labs/iconic';
|
|
5
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import '../../../../shared/logger.js';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../../../utils/constants/colors.js';
|
|
12
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import 'viem';
|
|
14
|
+
import '../../../../shared/consts/index.js';
|
|
15
|
+
import { createTurnkeyEvmEmbeddedWallet } from '../../../../data/api.js';
|
|
16
|
+
import { findEmbeddedWalletFromVerifiedCredentials } from '../../../../utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import '@dynamic-labs/sdk-api';
|
|
19
|
+
|
|
20
|
+
const createPregeneratedWallet = ({ user, walletConnector, environmentId, authToken, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
if (!authToken) {
|
|
22
|
+
throw new DynamicError('Auth token is not defined');
|
|
23
|
+
}
|
|
24
|
+
if (!walletConnector) {
|
|
25
|
+
throw new DynamicError('PasskeyWalletConnector not found');
|
|
26
|
+
}
|
|
27
|
+
if (!user) {
|
|
28
|
+
throw new DynamicError('User is not defined');
|
|
29
|
+
}
|
|
30
|
+
walletConnector.setEmail(user.email);
|
|
31
|
+
const signersResponse = yield createTurnkeyEvmEmbeddedWallet({
|
|
32
|
+
environmentId,
|
|
33
|
+
userJwt: authToken,
|
|
34
|
+
});
|
|
35
|
+
const { jwt } = signersResponse;
|
|
36
|
+
const decodedJwt = decodeJwt(jwt);
|
|
37
|
+
if (decodedJwt === undefined)
|
|
38
|
+
throw new DynamicError('Invalid token!');
|
|
39
|
+
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(jwt);
|
|
40
|
+
if (!embeddedWalletVerifiedCredential) {
|
|
41
|
+
throw new DynamicError('EmbeddedWalletVerifiedCredential not found');
|
|
42
|
+
}
|
|
43
|
+
walletConnector.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
44
|
+
return {
|
|
45
|
+
decodedJwt,
|
|
46
|
+
embeddedWalletVerifiedCredential,
|
|
47
|
+
jwt,
|
|
48
|
+
walletConnector,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { createPregeneratedWallet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createPregeneratedWallet } from './createPregeneratedWallet';
|
|
@@ -95,7 +95,7 @@ const completePasskeyRecovery = ({ authToken, userEmail, environmentId, wallet,
|
|
|
95
95
|
}
|
|
96
96
|
const connector = wallet.connector;
|
|
97
97
|
connector.setEmail(userEmail);
|
|
98
|
-
const organizationId = (_f = (_e = (_d = decodedJwt.verifiedCredentials) === null || _d === void 0 ? void 0 : _d.find(({ walletName }) => walletName === 'turnkey')) === null || _e === void 0 ? void 0 : _e.walletProperties) === null || _f === void 0 ? void 0 : _f.turnkeySubOrganizationId;
|
|
98
|
+
const organizationId = (_f = (_e = (_d = decodedJwt.verifiedCredentials) === null || _d === void 0 ? void 0 : _d.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _e === void 0 ? void 0 : _e.walletProperties) === null || _f === void 0 ? void 0 : _f.turnkeySubOrganizationId;
|
|
99
99
|
if (!organizationId) {
|
|
100
100
|
throw new utils.DynamicError('Invalid token!');
|
|
101
101
|
}
|
|
@@ -91,7 +91,7 @@ const completePasskeyRecovery = ({ authToken, userEmail, environmentId, wallet,
|
|
|
91
91
|
}
|
|
92
92
|
const connector = wallet.connector;
|
|
93
93
|
connector.setEmail(userEmail);
|
|
94
|
-
const organizationId = (_f = (_e = (_d = decodedJwt.verifiedCredentials) === null || _d === void 0 ? void 0 : _d.find(({ walletName }) => walletName === 'turnkey')) === null || _e === void 0 ? void 0 : _e.walletProperties) === null || _f === void 0 ? void 0 : _f.turnkeySubOrganizationId;
|
|
94
|
+
const organizationId = (_f = (_e = (_d = decodedJwt.verifiedCredentials) === null || _d === void 0 ? void 0 : _d.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _e === void 0 ? void 0 : _e.walletProperties) === null || _f === void 0 ? void 0 : _f.turnkeySubOrganizationId;
|
|
95
95
|
if (!organizationId) {
|
|
96
96
|
throw new DynamicError('Invalid token!');
|
|
97
97
|
}
|
|
@@ -60,10 +60,10 @@ require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCa
|
|
|
60
60
|
var CopyButton = require('../../../components/CopyButton/CopyButton.cjs');
|
|
61
61
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
62
62
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
63
|
+
var TextButton = require('../../../components/TextButton/TextButton.cjs');
|
|
63
64
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
64
65
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
65
66
|
require('react-focus-lock');
|
|
66
|
-
var TextButton = require('../../../components/TextButton/TextButton.cjs');
|
|
67
67
|
|
|
68
68
|
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => (jsxRuntime.jsxs("div", { className: classNames.classNames('qrcode-container__container', {
|
|
69
69
|
'qrcode-container__container--message': showQrCodeMessage,
|
|
@@ -56,10 +56,10 @@ import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCar
|
|
|
56
56
|
import { CopyButton } from '../../../components/CopyButton/CopyButton.js';
|
|
57
57
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
58
58
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
59
|
+
import { TextButton } from '../../../components/TextButton/TextButton.js';
|
|
59
60
|
import '../../../components/Popper/Popper/Popper.js';
|
|
60
61
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
61
62
|
import 'react-focus-lock';
|
|
62
|
-
import { TextButton } from '../../../components/TextButton/TextButton.js';
|
|
63
63
|
|
|
64
64
|
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => (jsxs("div", { className: classNames('qrcode-container__container', {
|
|
65
65
|
'qrcode-container__container--message': showQrCodeMessage,
|
|
@@ -45,6 +45,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
45
45
|
require('react-focus-lock');
|
|
46
46
|
require('formik');
|
|
47
47
|
require('yup');
|
|
48
|
+
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
48
49
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
49
50
|
var TransactionConfirmationPageLayout = require('../../components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs');
|
|
50
51
|
var TransactionRow = require('../../components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs');
|
|
@@ -70,7 +71,6 @@ var useTransactionGas = require('./hooks/useTransactionGas/useTransactionGas.cjs
|
|
|
70
71
|
var useTransactionTotal = require('./hooks/useTransactionTotal/useTransactionTotal.cjs');
|
|
71
72
|
var transactionErrorMessage = require('./helpers/transactionErrorMessage.cjs');
|
|
72
73
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
73
|
-
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
74
74
|
|
|
75
75
|
const TransactionConfirmationView = ({ transaction, mutation, onError, onSuccess, onClickBack, onClickClose, title, displayPoweredByDynamicFooter = false, provider, }) => {
|
|
76
76
|
const { appName, appLogoUrl, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -155,6 +155,8 @@ const TransactionConfirmationView = ({ transaction, mutation, onError, onSuccess
|
|
|
155
155
|
return total > balance;
|
|
156
156
|
}, [balance, total]);
|
|
157
157
|
const alert = React.useMemo(() => {
|
|
158
|
+
if (isTransactionLoading || Boolean(errorMessage))
|
|
159
|
+
return null;
|
|
158
160
|
if (utils.TransactionGasCannotBeSponsoredError.isInstance(transactionError)) {
|
|
159
161
|
return (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', children: t('dyn_send_transaction.error_message.gas_not_sponsored') }));
|
|
160
162
|
}
|
|
@@ -166,7 +168,15 @@ const TransactionConfirmationView = ({ transaction, mutation, onError, onSuccess
|
|
|
166
168
|
amountLeft,
|
|
167
169
|
currencySymbol,
|
|
168
170
|
}) }));
|
|
169
|
-
}, [
|
|
171
|
+
}, [
|
|
172
|
+
currencySymbol,
|
|
173
|
+
hasInsufficientFunds,
|
|
174
|
+
missingFunds,
|
|
175
|
+
t,
|
|
176
|
+
transactionError,
|
|
177
|
+
isTransactionLoading,
|
|
178
|
+
errorMessage,
|
|
179
|
+
]);
|
|
170
180
|
return (jsxRuntime.jsxs(TransactionConfirmationPageLayout.TransactionConfirmationPageLayout, { onClickBack: onClickBack, onClickClose: onClickClose, title: title, appOrigin: appOrigin, appName: appName, appLogoUrl: appLogoUrl, isLoading: isLoading, onClickSend: () => send(), displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, disableSendButton: isTransactionLoading || hasInsufficientFunds, error: errorMessage, alert: alert, children: [jsxRuntime.jsx(TransactionRow.TransactionRow, { label: t('dyn_send_transaction.confirmation.data.from'), isLoading: isTransactionFromAddressLoading, title: transactionFromAddress, children: shortenWalletAddress.shortenWalletAddress(transactionFromAddress, 4, 4) }), jsxRuntime.jsx(TransactionRow.TransactionRow, { label: t('dyn_send_transaction.confirmation.data.to'), isLoading: isTransactionToAddressLoading, title: transactionToAddress, children: transactionToAddress &&
|
|
171
181
|
shortenWalletAddress.shortenWalletAddress(transactionToAddress, 4, 4) }), jsxRuntime.jsx(TransactionRow.TransactionRow, { label: t('dyn_send_transaction.confirmation.data.amount'), isLoading: isTransactionValueLoading, isEmpty: !transactionValue, title: transactionValue ? formatBigNumber.formatBigNumber(transactionValue) : undefined, suffix: currencySymbol, icon: chainIcon, dataTestId: 'transaction-amount', children: transactionValue ? formatBigNumber.formatBigNumber(transactionValue, 10) : 0 }), !isGasSponsored && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TransactionRow.TransactionRow, { label: isGasEstimated
|
|
172
182
|
? t('dyn_send_transaction.confirmation.data.gas_estimate')
|