@dynamic-labs/sdk-react-core 4.79.2 → 4.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/components/LogoutButton/LogoutButton.cjs +2 -2
- package/src/lib/components/LogoutButton/LogoutButton.js +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +63 -3
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +63 -3
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.cjs +40 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.d.ts +16 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.js +36 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.cjs +17 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.d.ts +8 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.js +12 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +9 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +25 -12
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.d.ts +5 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +24 -11
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +3 -3
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/types/IInternalDynamicContext.d.ts +8 -1
- package/src/lib/events/auth.d.ts +2 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useAleoShieldedBalances/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +372 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.d.ts +24 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +368 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +2 -2
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +3 -3
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -3
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +2 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +3 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +2 -2
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +5 -5
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +5 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.cjs +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +2 -2
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +7 -7
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +7 -7
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +53 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +53 -0
- package/src/lib/views/SmsVerification/SmsVerification.cjs +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.js +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +191 -11
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +191 -11
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.d.ts +10 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
|
@@ -34,15 +34,15 @@ require('../../events/dynamicEvents.cjs');
|
|
|
34
34
|
var getUserProfile = require('../../client/extension/user/getUserProfile/getUserProfile.cjs');
|
|
35
35
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
36
36
|
require('../../components/Alert/Alert.cjs');
|
|
37
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
38
37
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
38
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
39
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
40
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
39
41
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
40
42
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
46
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -118,7 +118,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
118
118
|
|
|
119
119
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
|
-
const {
|
|
121
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
122
122
|
const { clearStackAndPush, pushView, goBack, canGoBack } = ViewContext.useViewContext();
|
|
123
123
|
const { authenticateDevice } = useMfa.useMfa();
|
|
124
124
|
const [code, setCode] = React.useState('');
|
|
@@ -170,7 +170,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
170
170
|
createMfaToken,
|
|
171
171
|
isInitialSetup,
|
|
172
172
|
requestedScopes,
|
|
173
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick:
|
|
173
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
exports.MfaVerificationView = MfaVerificationView;
|
|
@@ -30,15 +30,15 @@ import '../../events/dynamicEvents.js';
|
|
|
30
30
|
import { getUserProfile } from '../../client/extension/user/getUserProfile/getUserProfile.js';
|
|
31
31
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
32
32
|
import '../../components/Alert/Alert.js';
|
|
33
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
34
33
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
34
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
35
|
+
import '../../store/state/authMode/authMode.js';
|
|
36
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
35
37
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
36
38
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
-
import '../../store/state/authMode/authMode.js';
|
|
41
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
42
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
43
|
import 'react-dom';
|
|
44
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -114,7 +114,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
114
114
|
|
|
115
115
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
116
116
|
const { t } = useTranslation();
|
|
117
|
-
const {
|
|
117
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
118
118
|
const { clearStackAndPush, pushView, goBack, canGoBack } = useViewContext();
|
|
119
119
|
const { authenticateDevice } = useMfa();
|
|
120
120
|
const [code, setCode] = useState('');
|
|
@@ -166,7 +166,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
166
166
|
createMfaToken,
|
|
167
167
|
isInitialSetup,
|
|
168
168
|
requestedScopes,
|
|
169
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick:
|
|
169
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export { MfaVerificationView };
|
|
@@ -124,7 +124,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
124
124
|
|
|
125
125
|
const PasskeyIntroView = ({ chains }) => {
|
|
126
126
|
var _a;
|
|
127
|
-
const { walletConnectorOptions, environmentId,
|
|
127
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
128
128
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
129
129
|
!getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
|
|
130
130
|
const { t } = reactI18next.useTranslation();
|
|
@@ -159,7 +159,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
159
159
|
}, [error]);
|
|
160
160
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view', children: [jsxRuntime.jsx("div", { className: 'passkey-intro-view__header', children: jsxRuntime.jsx(passkeyIntro2.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx(AuthChoiceInfo.AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
161
161
|
color: 'inherit',
|
|
162
|
-
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
162
|
+
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
exports.PasskeyIntroView = PasskeyIntroView;
|
|
@@ -120,7 +120,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
120
120
|
|
|
121
121
|
const PasskeyIntroView = ({ chains }) => {
|
|
122
122
|
var _a;
|
|
123
|
-
const { walletConnectorOptions, environmentId,
|
|
123
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext();
|
|
124
124
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
125
125
|
!getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
|
|
126
126
|
const { t } = useTranslation();
|
|
@@ -155,7 +155,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
155
155
|
}, [error]);
|
|
156
156
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxs("div", { className: 'passkey-intro-view', children: [jsx("div", { className: 'passkey-intro-view__header', children: jsx(SvgPasskeyIntro2, {}) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsx(ErrorContainer, { children: errorText }), jsx(AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxs("div", { className: 'passkey-intro-view__actions', children: [jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
157
157
|
color: 'inherit',
|
|
158
|
-
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
158
|
+
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
export { PasskeyIntroView };
|
|
@@ -183,6 +183,52 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
183
183
|
if (orderedTokenBalances)
|
|
184
184
|
setTokenBalances(orderedTokenBalances);
|
|
185
185
|
}, [orderedTokenBalances]);
|
|
186
|
+
// Chain override: when the active IUITransaction provides
|
|
187
|
+
// `getSendableTokenBalances`, prefer that list for the picker. Used by
|
|
188
|
+
// chains where the spendable balance source diverges from
|
|
189
|
+
// `useTokenBalances` (e.g. Aleo Send always spends from private
|
|
190
|
+
// records, not the public-balance mapping redcoast returns). Chains
|
|
191
|
+
// that don't implement the method get the default fetcher unchanged.
|
|
192
|
+
//
|
|
193
|
+
// Also re-anchors `currentToken` to the matching entry in the override
|
|
194
|
+
// list. Without this, the picker's row renders the override balance
|
|
195
|
+
// (it reads from `tokenBalances`) but the form's "Available" line
|
|
196
|
+
// renders the original public balance (it reads from `currentToken`),
|
|
197
|
+
// which is stale.
|
|
198
|
+
React.useEffect(() => {
|
|
199
|
+
if (!(transaction === null || transaction === void 0 ? void 0 : transaction.getSendableTokenBalances))
|
|
200
|
+
return;
|
|
201
|
+
let cancelled = false;
|
|
202
|
+
transaction
|
|
203
|
+
.getSendableTokenBalances()
|
|
204
|
+
.then((overrideBalances) => {
|
|
205
|
+
if (cancelled)
|
|
206
|
+
return;
|
|
207
|
+
if (!overrideBalances || overrideBalances.length === 0)
|
|
208
|
+
return;
|
|
209
|
+
setTokenBalances(overrideBalances);
|
|
210
|
+
setCurrentToken((prev) => {
|
|
211
|
+
if (!prev)
|
|
212
|
+
return overrideBalances[0];
|
|
213
|
+
const match = overrideBalances.find((t) => t.address === prev.address);
|
|
214
|
+
if (!match)
|
|
215
|
+
return overrideBalances[0];
|
|
216
|
+
// Skip the swap if values are unchanged — avoids a re-render
|
|
217
|
+
// loop when transaction recreation re-fires this effect.
|
|
218
|
+
if (match.rawBalance === prev.rawBalance &&
|
|
219
|
+
match.balance === prev.balance) {
|
|
220
|
+
return prev;
|
|
221
|
+
}
|
|
222
|
+
return match;
|
|
223
|
+
});
|
|
224
|
+
})
|
|
225
|
+
.catch((err) => {
|
|
226
|
+
logger.logger.debug('[SendBalanceView] getSendableTokenBalances threw — falling back to default token list', err);
|
|
227
|
+
});
|
|
228
|
+
return () => {
|
|
229
|
+
cancelled = true;
|
|
230
|
+
};
|
|
231
|
+
}, [transaction]);
|
|
186
232
|
React.useEffect(() => {
|
|
187
233
|
if (!walletConnector)
|
|
188
234
|
return;
|
|
@@ -201,6 +247,13 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
201
247
|
transaction.nonNativeValue = BigInt(0);
|
|
202
248
|
transaction.nonNativeDecimal = currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals;
|
|
203
249
|
}
|
|
250
|
+
// Chain hook: tells the transaction which picker entry the user
|
|
251
|
+
// landed on (or just switched to). Aleo uses this to flip submit
|
|
252
|
+
// between credits / stablecoin / ARC-21 program signatures + to
|
|
253
|
+
// re-anchor decimals for parse/format.
|
|
254
|
+
if (currentToken && transaction.setSelectedToken) {
|
|
255
|
+
transaction.setSelectedToken(currentToken.address);
|
|
256
|
+
}
|
|
204
257
|
setTransaction(transaction);
|
|
205
258
|
})
|
|
206
259
|
.catch((error) => {
|
|
@@ -179,6 +179,52 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
179
179
|
if (orderedTokenBalances)
|
|
180
180
|
setTokenBalances(orderedTokenBalances);
|
|
181
181
|
}, [orderedTokenBalances]);
|
|
182
|
+
// Chain override: when the active IUITransaction provides
|
|
183
|
+
// `getSendableTokenBalances`, prefer that list for the picker. Used by
|
|
184
|
+
// chains where the spendable balance source diverges from
|
|
185
|
+
// `useTokenBalances` (e.g. Aleo Send always spends from private
|
|
186
|
+
// records, not the public-balance mapping redcoast returns). Chains
|
|
187
|
+
// that don't implement the method get the default fetcher unchanged.
|
|
188
|
+
//
|
|
189
|
+
// Also re-anchors `currentToken` to the matching entry in the override
|
|
190
|
+
// list. Without this, the picker's row renders the override balance
|
|
191
|
+
// (it reads from `tokenBalances`) but the form's "Available" line
|
|
192
|
+
// renders the original public balance (it reads from `currentToken`),
|
|
193
|
+
// which is stale.
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
if (!(transaction === null || transaction === void 0 ? void 0 : transaction.getSendableTokenBalances))
|
|
196
|
+
return;
|
|
197
|
+
let cancelled = false;
|
|
198
|
+
transaction
|
|
199
|
+
.getSendableTokenBalances()
|
|
200
|
+
.then((overrideBalances) => {
|
|
201
|
+
if (cancelled)
|
|
202
|
+
return;
|
|
203
|
+
if (!overrideBalances || overrideBalances.length === 0)
|
|
204
|
+
return;
|
|
205
|
+
setTokenBalances(overrideBalances);
|
|
206
|
+
setCurrentToken((prev) => {
|
|
207
|
+
if (!prev)
|
|
208
|
+
return overrideBalances[0];
|
|
209
|
+
const match = overrideBalances.find((t) => t.address === prev.address);
|
|
210
|
+
if (!match)
|
|
211
|
+
return overrideBalances[0];
|
|
212
|
+
// Skip the swap if values are unchanged — avoids a re-render
|
|
213
|
+
// loop when transaction recreation re-fires this effect.
|
|
214
|
+
if (match.rawBalance === prev.rawBalance &&
|
|
215
|
+
match.balance === prev.balance) {
|
|
216
|
+
return prev;
|
|
217
|
+
}
|
|
218
|
+
return match;
|
|
219
|
+
});
|
|
220
|
+
})
|
|
221
|
+
.catch((err) => {
|
|
222
|
+
logger.debug('[SendBalanceView] getSendableTokenBalances threw — falling back to default token list', err);
|
|
223
|
+
});
|
|
224
|
+
return () => {
|
|
225
|
+
cancelled = true;
|
|
226
|
+
};
|
|
227
|
+
}, [transaction]);
|
|
182
228
|
useEffect(() => {
|
|
183
229
|
if (!walletConnector)
|
|
184
230
|
return;
|
|
@@ -197,6 +243,13 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
197
243
|
transaction.nonNativeValue = BigInt(0);
|
|
198
244
|
transaction.nonNativeDecimal = currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals;
|
|
199
245
|
}
|
|
246
|
+
// Chain hook: tells the transaction which picker entry the user
|
|
247
|
+
// landed on (or just switched to). Aleo uses this to flip submit
|
|
248
|
+
// between credits / stablecoin / ARC-21 program signatures + to
|
|
249
|
+
// re-anchor decimals for parse/format.
|
|
250
|
+
if (currentToken && transaction.setSelectedToken) {
|
|
251
|
+
transaction.setSelectedToken(currentToken.address);
|
|
252
|
+
}
|
|
200
253
|
setTransaction(transaction);
|
|
201
254
|
})
|
|
202
255
|
.catch((error) => {
|
|
@@ -116,11 +116,11 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
116
116
|
|
|
117
117
|
const SmsVerification = () => {
|
|
118
118
|
const { view } = ViewContext.useViewContext();
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
121
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
122
122
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification.useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
123
|
-
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick:
|
|
123
|
+
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
124
124
|
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: PhoneIcon.PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
125
125
|
};
|
|
126
126
|
|
|
@@ -112,11 +112,11 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
112
112
|
|
|
113
113
|
const SmsVerification = () => {
|
|
114
114
|
const { view } = useViewContext();
|
|
115
|
-
const {
|
|
115
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
116
116
|
const { t } = useTranslation();
|
|
117
117
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
118
118
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
119
|
-
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick:
|
|
119
|
+
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
120
120
|
return (jsx(OTPVerificationView, { MainIcon: PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -37,7 +37,7 @@ require('../../../utils/constants/values.cjs');
|
|
|
37
37
|
var AgreementSection = require('./AgreementSection.cjs');
|
|
38
38
|
|
|
39
39
|
const WalletDelegationView = ({ wallets, }) => {
|
|
40
|
-
const { setShowAuthFlow,
|
|
40
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
41
|
const { user } = useDynamicContext.useDynamicContext();
|
|
42
42
|
const appName = settingsUtils.useAppName();
|
|
43
43
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation.useWalletDelegation();
|
|
@@ -289,7 +289,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
289
289
|
color: 'primary',
|
|
290
290
|
weight: 'bold',
|
|
291
291
|
}, onClick: () => {
|
|
292
|
-
|
|
292
|
+
handleLogOutWithReason('user-intent');
|
|
293
293
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
294
294
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
295
295
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|
|
@@ -33,7 +33,7 @@ import '../../../utils/constants/values.js';
|
|
|
33
33
|
import { AgreementSection } from './AgreementSection.js';
|
|
34
34
|
|
|
35
35
|
const WalletDelegationView = ({ wallets, }) => {
|
|
36
|
-
const { setShowAuthFlow,
|
|
36
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext();
|
|
37
37
|
const { user } = useDynamicContext();
|
|
38
38
|
const appName = useAppName();
|
|
39
39
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation();
|
|
@@ -285,7 +285,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
285
285
|
color: 'primary',
|
|
286
286
|
weight: 'bold',
|
|
287
287
|
}, onClick: () => {
|
|
288
|
-
|
|
288
|
+
handleLogOutWithReason('user-intent');
|
|
289
289
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
290
290
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
291
291
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|
|
@@ -119,7 +119,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
119
119
|
|
|
120
120
|
const iconSize = 64;
|
|
121
121
|
const WalletLockedView = () => {
|
|
122
|
-
const {
|
|
122
|
+
const { handleLogOutWithReason, primaryWallet, setShowAuthFlow, appName } = useInternalDynamicContext.useInternalDynamicContext();
|
|
123
123
|
const { t } = reactI18next.useTranslation();
|
|
124
124
|
if (!primaryWallet) {
|
|
125
125
|
return null;
|
|
@@ -137,7 +137,7 @@ const WalletLockedView = () => {
|
|
|
137
137
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
138
138
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
139
139
|
} }));
|
|
140
|
-
return (jsxRuntime.jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxRuntime.jsxs("div", { className: 'wallet-locked-view__content', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsxRuntime.jsx(Divider.Divider, { text: 'Or' }), jsxRuntime.jsx(TextButton.TextButton, { className: 'wallet-locked-view__log-out', onClick:
|
|
140
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxRuntime.jsxs("div", { className: 'wallet-locked-view__content', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsxRuntime.jsx(Divider.Divider, { text: 'Or' }), jsxRuntime.jsx(TextButton.TextButton, { className: 'wallet-locked-view__log-out', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_locked.logout', children: t('dyn_wallet_locked.logout') })] })] }));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
exports.WalletLockedView = WalletLockedView;
|
|
@@ -115,7 +115,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
115
115
|
|
|
116
116
|
const iconSize = 64;
|
|
117
117
|
const WalletLockedView = () => {
|
|
118
|
-
const {
|
|
118
|
+
const { handleLogOutWithReason, primaryWallet, setShowAuthFlow, appName } = useInternalDynamicContext();
|
|
119
119
|
const { t } = useTranslation();
|
|
120
120
|
if (!primaryWallet) {
|
|
121
121
|
return null;
|
|
@@ -133,7 +133,7 @@ const WalletLockedView = () => {
|
|
|
133
133
|
height: pixelToRem(iconSize * iconRatio),
|
|
134
134
|
width: pixelToRem(iconSize * iconRatio),
|
|
135
135
|
} }));
|
|
136
|
-
return (jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsx(ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxs("div", { className: 'wallet-locked-view__content', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsx(Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsx(TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsx(Divider, { text: 'Or' }), jsx(TextButton, { className: 'wallet-locked-view__log-out', onClick:
|
|
136
|
+
return (jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsx(ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxs("div", { className: 'wallet-locked-view__content', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsx(Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsx(TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsx(Divider, { text: 'Or' }), jsx(TextButton, { className: 'wallet-locked-view__log-out', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_locked.logout', children: t('dyn_wallet_locked.logout') })] })] }));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
export { WalletLockedView };
|
|
@@ -123,7 +123,7 @@ const WalletUsedView = () => {
|
|
|
123
123
|
const { t } = reactI18next.useTranslation();
|
|
124
124
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
125
125
|
const { pushView } = ViewContext.useViewContext();
|
|
126
|
-
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount,
|
|
126
|
+
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOutWithReason, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
127
127
|
const { data: walletAddress } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
128
128
|
const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
|
|
129
129
|
return accounts === null || accounts === void 0 ? void 0 : accounts[0];
|
|
@@ -177,7 +177,7 @@ const WalletUsedView = () => {
|
|
|
177
177
|
setMultiWalletWidgetState('idle');
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
return (jsxRuntime.jsxs("div", { className: 'wallet-used-view__container', children: [jsxRuntime.jsx("div", { className: 'wallet-used-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxRuntime.jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsxRuntime.jsx(Checkbox.Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick:
|
|
180
|
+
return (jsxRuntime.jsxs("div", { className: 'wallet-used-view__container', children: [jsxRuntime.jsx("div", { className: 'wallet-used-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxRuntime.jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsxRuntime.jsx(Checkbox.Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_link.log_out_button', children: t('dyn_wallet_link.log_out_button') })] }));
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
exports.WalletUsedView = WalletUsedView;
|
|
@@ -119,7 +119,7 @@ const WalletUsedView = () => {
|
|
|
119
119
|
const { t } = useTranslation();
|
|
120
120
|
const { loading, setLoading } = useLoadingContext();
|
|
121
121
|
const { pushView } = useViewContext();
|
|
122
|
-
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount,
|
|
122
|
+
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOutWithReason, } = useInternalDynamicContext();
|
|
123
123
|
const { data: walletAddress } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
124
|
const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
|
|
125
125
|
return accounts === null || accounts === void 0 ? void 0 : accounts[0];
|
|
@@ -173,7 +173,7 @@ const WalletUsedView = () => {
|
|
|
173
173
|
setMultiWalletWidgetState('idle');
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
return (jsxs("div", { className: 'wallet-used-view__container', children: [jsx("div", { className: 'wallet-used-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsx(Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsx(TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsx(TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick:
|
|
176
|
+
return (jsxs("div", { className: 'wallet-used-view__container', children: [jsx("div", { className: 'wallet-used-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsx(Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsx(TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsx(TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_link.log_out_button', children: t('dyn_wallet_link.log_out_button') })] }));
|
|
177
177
|
};
|
|
178
178
|
|
|
179
179
|
export { WalletUsedView };
|