@dynamic-labs/sdk-react-core 2.2.7 → 2.2.9
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 +24 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +4 -5
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +4 -5
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +1 -1
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/context/DynamicContext/types/index.d.ts +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/isMultiAssetSupportedNetwork/isMultiAssetSupportedNetwork.cjs +4 -3
- package/src/lib/utils/functions/isMultiAssetSupportedNetwork/isMultiAssetSupportedNetwork.js +4 -3
- package/src/lib/utils/functions/validatePhoneLength/validatePhoneLength.cjs +2 -7
- package/src/lib/utils/functions/validatePhoneLength/validatePhoneLength.d.ts +1 -1
- package/src/lib/utils/functions/validatePhoneLength/validatePhoneLength.js +3 -8
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +45 -45
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +45 -45
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +43 -42
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +43 -42
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +6 -4
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +6 -4
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +14 -7
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.d.ts +6 -1
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +14 -7
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.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/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +1 -1
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.cjs +1 -1
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.js +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
- package/src/lib/views/WalletRedirectView/WalletRedirectView.cjs +1 -1
- package/src/lib/views/WalletRedirectView/WalletRedirectView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +5 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +5 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +10 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +10 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +3 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +3 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +0 -16
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +0 -12
|
@@ -65,6 +65,7 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
65
65
|
require('../../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
66
66
|
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
67
67
|
require('react-focus-lock');
|
|
68
|
+
var ListTile = require('../../../../components/ListTile/ListTile.cjs');
|
|
68
69
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
69
70
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
70
71
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -75,7 +76,6 @@ require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSucces
|
|
|
75
76
|
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
76
77
|
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
77
78
|
var Badge = require('../../../../components/Badge/Badge.cjs');
|
|
78
|
-
var ListTile = require('../../../../components/ListTile/ListTile.cjs');
|
|
79
79
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
80
80
|
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
81
81
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
@@ -61,6 +61,7 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
61
61
|
import '../../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
62
62
|
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
63
63
|
import 'react-focus-lock';
|
|
64
|
+
import { ListTile } from '../../../../components/ListTile/ListTile.js';
|
|
64
65
|
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
65
66
|
import '../../../../components/IconButton/IconButton.js';
|
|
66
67
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -71,7 +72,6 @@ import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccess
|
|
|
71
72
|
import '../../../../context/PasskeyContext/PasskeyContext.js';
|
|
72
73
|
import '../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
73
74
|
import { Badge } from '../../../../components/Badge/Badge.js';
|
|
74
|
-
import { ListTile } from '../../../../components/ListTile/ListTile.js';
|
|
75
75
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
76
76
|
import '../../../../components/IsBrowser/IsBrowser.js';
|
|
77
77
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
@@ -66,6 +66,7 @@ require('../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
|
66
66
|
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
67
67
|
require('react-focus-lock');
|
|
68
68
|
var Icon = require('../../../components/Icon/Icon.cjs');
|
|
69
|
+
var ListTile = require('../../../components/ListTile/ListTile.cjs');
|
|
69
70
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
70
71
|
require('../../../components/IconButton/IconButton.cjs');
|
|
71
72
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -76,7 +77,6 @@ require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBa
|
|
|
76
77
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
77
78
|
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
78
79
|
var Badge = require('../../../components/Badge/Badge.cjs');
|
|
79
|
-
var ListTile = require('../../../components/ListTile/ListTile.cjs');
|
|
80
80
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
81
81
|
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
82
82
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
@@ -62,6 +62,7 @@ import '../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
|
62
62
|
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
63
63
|
import 'react-focus-lock';
|
|
64
64
|
import { Icon } from '../../../components/Icon/Icon.js';
|
|
65
|
+
import { ListTile } from '../../../components/ListTile/ListTile.js';
|
|
65
66
|
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
66
67
|
import '../../../components/IconButton/IconButton.js';
|
|
67
68
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -72,7 +73,6 @@ import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBan
|
|
|
72
73
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
73
74
|
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
74
75
|
import { Badge } from '../../../components/Badge/Badge.js';
|
|
75
|
-
import { ListTile } from '../../../components/ListTile/ListTile.js';
|
|
76
76
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
77
77
|
import '../../../components/IsBrowser/IsBrowser.js';
|
|
78
78
|
import '../../../components/Popper/Popper/Popper.js';
|
|
@@ -62,10 +62,10 @@ require('../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
|
62
62
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
63
63
|
require('react-focus-lock');
|
|
64
64
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
65
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
65
66
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
66
67
|
require('../../components/IconButton/IconButton.cjs');
|
|
67
68
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
68
|
-
var Typography = require('../../components/Typography/Typography.cjs');
|
|
69
69
|
require('formik');
|
|
70
70
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
71
71
|
require('../../components/Input/Input.cjs');
|
|
@@ -58,10 +58,10 @@ import '../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
|
58
58
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
59
59
|
import 'react-focus-lock';
|
|
60
60
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
61
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
61
62
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
62
63
|
import '../../components/IconButton/IconButton.js';
|
|
63
64
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
64
|
-
import { Typography } from '../../components/Typography/Typography.js';
|
|
65
65
|
import 'formik';
|
|
66
66
|
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
67
67
|
import '../../components/Input/Input.js';
|
|
@@ -64,9 +64,9 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
64
64
|
require('../../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
65
65
|
require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
66
66
|
require('react-focus-lock');
|
|
67
|
+
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
67
68
|
var AuthProviderIcon = require('../../../../components/AuthProviderIcon/AuthProviderIcon.cjs');
|
|
68
69
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
69
|
-
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
70
70
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
71
71
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
72
72
|
require('formik');
|
|
@@ -60,9 +60,9 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
60
60
|
import '../../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
61
61
|
import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
62
62
|
import 'react-focus-lock';
|
|
63
|
+
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
63
64
|
import { AuthProviderIcon } from '../../../../components/AuthProviderIcon/AuthProviderIcon.js';
|
|
64
65
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
65
|
-
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
66
66
|
import '../../../../components/IconButton/IconButton.js';
|
|
67
67
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
68
68
|
import 'formik';
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs
CHANGED
|
@@ -108,7 +108,11 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
108
108
|
const { primaryWallet, network, projectSettings, handleLogOut, user, walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
109
109
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
110
110
|
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
111
|
-
const { isLoading: isLoadingTokenBalances, tokenBalances } = useTokenBalances.useTokenBalances({
|
|
111
|
+
const { isLoading: isLoadingTokenBalances, tokenBalances } = useTokenBalances.useTokenBalances({
|
|
112
|
+
chainName: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain,
|
|
113
|
+
includeFiat: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.showFiat,
|
|
114
|
+
includeNativeBalance: true,
|
|
115
|
+
});
|
|
112
116
|
const filteredTokenBalances = (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.filter((token) => token.name)) || [];
|
|
113
117
|
const address = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
114
118
|
const nameService = useFetchNameService.useFetchNameService(address);
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js
CHANGED
|
@@ -104,7 +104,11 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
104
104
|
const { primaryWallet, network, projectSettings, handleLogOut, user, walletConnector, } = useInternalDynamicContext();
|
|
105
105
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
106
106
|
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
107
|
-
const { isLoading: isLoadingTokenBalances, tokenBalances } = useTokenBalances({
|
|
107
|
+
const { isLoading: isLoadingTokenBalances, tokenBalances } = useTokenBalances({
|
|
108
|
+
chainName: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain,
|
|
109
|
+
includeFiat: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.showFiat,
|
|
110
|
+
includeNativeBalance: true,
|
|
111
|
+
});
|
|
108
112
|
const filteredTokenBalances = (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.filter((token) => token.name)) || [];
|
|
109
113
|
const address = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
110
114
|
const nameService = useFetchNameService(address);
|
package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
10
|
require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
10
11
|
require('../../../../components/Alert/Alert.cjs');
|
|
11
12
|
require('react');
|
|
@@ -16,7 +17,6 @@ require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
|
16
17
|
require('@dynamic-labs/sdk-api-core');
|
|
17
18
|
require('../../../../shared/logger.cjs');
|
|
18
19
|
require('@dynamic-labs/iconic');
|
|
19
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
20
20
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
21
21
|
require('../../../../utils/constants/colors.cjs');
|
|
22
22
|
require('../../../../utils/constants/values.cjs');
|
|
@@ -63,6 +63,7 @@ var PromptModal = require('../../components/PromptModal/PromptModal.cjs');
|
|
|
63
63
|
var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
64
64
|
var useCloseMultiWalletPrompt = require('../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.cjs');
|
|
65
65
|
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
66
|
+
var HardwareWalletToggle = require('../../../../components/HardwareWalletToggle/HardwareWalletToggle.cjs');
|
|
66
67
|
var Divider = require('../../../../components/Divider/Divider.cjs');
|
|
67
68
|
require('../../context/DynamicWidgetContext.cjs');
|
|
68
69
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
@@ -87,17 +88,19 @@ require('@hcaptcha/react-hcaptcha');
|
|
|
87
88
|
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
88
89
|
|
|
89
90
|
const DetectedNewWalletContent = () => {
|
|
90
|
-
var _a;
|
|
91
91
|
const { t } = reactI18next.useTranslation();
|
|
92
92
|
const { setMultiWalletWidgetState, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
93
93
|
const handleClick = () => {
|
|
94
94
|
setMultiWalletWidgetState('awaiting_signature', undefined, 'linking_new_wallet');
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
97
|
+
return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'detected-new-wallet-modal', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key }), title: t('dyn_detected_new_wallet.title'), children: [jsxRuntime.jsxs("div", { className: 'detected-new-wallet-modal__top-section', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: t('dyn_detected_new_wallet.description', {
|
|
98
|
+
walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name,
|
|
99
|
+
}) }), walletConnector &&
|
|
100
|
+
walletConnectorCore.isHardwareWalletConnector(walletConnector) &&
|
|
101
|
+
walletConnector.canConnectWithHardwareWallet() && (jsxRuntime.jsx(HardwareWalletToggle.HardwareWalletToggle, { connectors: [walletConnector], copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { expanded: true, onClick: handleClick, typographyProps: {
|
|
102
|
+
variant: 'button_secondary',
|
|
103
|
+
}, children: t('dyn_detected_new_wallet.confirm_button') })] }), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'detected-new-wallet-modal__log-out-button' })] }));
|
|
101
104
|
};
|
|
102
105
|
const DetectedNewWalletWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt(), children: jsxRuntime.jsx(DetectedNewWalletContent, {}) }));
|
|
103
106
|
const DetectedNewWalletModal = () => (jsxRuntime.jsx(PromptModal.PromptModal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt(), children: jsxRuntime.jsx(DetectedNewWalletContent, {}) }));
|
package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { isHardwareWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
6
|
import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
6
7
|
import '../../../../components/Alert/Alert.js';
|
|
7
8
|
import 'react';
|
|
@@ -12,7 +13,6 @@ import '../../../../context/DynamicContext/DynamicContext.js';
|
|
|
12
13
|
import '@dynamic-labs/sdk-api-core';
|
|
13
14
|
import '../../../../shared/logger.js';
|
|
14
15
|
import '@dynamic-labs/iconic';
|
|
15
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
16
16
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
17
17
|
import '../../../../utils/constants/colors.js';
|
|
18
18
|
import '../../../../utils/constants/values.js';
|
|
@@ -59,6 +59,7 @@ import { PromptModal } from '../../components/PromptModal/PromptModal.js';
|
|
|
59
59
|
import { WidgetPortal } from '../../components/WidgetPortal/WidgetPortal.js';
|
|
60
60
|
import { useCloseMultiWalletPrompt } from '../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.js';
|
|
61
61
|
import { DefaultPromptLayout } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
62
|
+
import { HardwareWalletToggle } from '../../../../components/HardwareWalletToggle/HardwareWalletToggle.js';
|
|
62
63
|
import { Divider } from '../../../../components/Divider/Divider.js';
|
|
63
64
|
import '../../context/DynamicWidgetContext.js';
|
|
64
65
|
import '../../../../components/IconButton/IconButton.js';
|
|
@@ -83,17 +84,19 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
83
84
|
import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
84
85
|
|
|
85
86
|
const DetectedNewWalletContent = () => {
|
|
86
|
-
var _a;
|
|
87
87
|
const { t } = useTranslation();
|
|
88
88
|
const { setMultiWalletWidgetState, primaryWallet } = useInternalDynamicContext();
|
|
89
89
|
const handleClick = () => {
|
|
90
90
|
setMultiWalletWidgetState('awaiting_signature', undefined, 'linking_new_wallet');
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
93
|
+
return (jsxs(DefaultPromptLayout, { dataTestId: 'detected-new-wallet-modal', icon: jsx(WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key }), title: t('dyn_detected_new_wallet.title'), children: [jsxs("div", { className: 'detected-new-wallet-modal__top-section', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: t('dyn_detected_new_wallet.description', {
|
|
94
|
+
walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name,
|
|
95
|
+
}) }), walletConnector &&
|
|
96
|
+
isHardwareWalletConnector(walletConnector) &&
|
|
97
|
+
walletConnector.canConnectWithHardwareWallet() && (jsx(HardwareWalletToggle, { connectors: [walletConnector], copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') })), jsx(TypographyButton, { expanded: true, onClick: handleClick, typographyProps: {
|
|
98
|
+
variant: 'button_secondary',
|
|
99
|
+
}, children: t('dyn_detected_new_wallet.confirm_button') })] }), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'detected-new-wallet-modal__log-out-button' })] }));
|
|
97
100
|
};
|
|
98
101
|
const DetectedNewWalletWidgetPortal = () => (jsx(WidgetPortal, { onClose: useCloseMultiWalletPrompt(), children: jsx(DetectedNewWalletContent, {}) }));
|
|
99
102
|
const DetectedNewWalletModal = () => (jsx(PromptModal, { onClose: useCloseMultiWalletPrompt(), children: jsx(DetectedNewWalletContent, {}) }));
|
|
@@ -85,12 +85,13 @@ require('../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
|
85
85
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
86
86
|
|
|
87
87
|
const PendingAccountSwitchContent = () => {
|
|
88
|
-
var _a, _b;
|
|
88
|
+
var _a, _b, _c, _d;
|
|
89
89
|
const { selectedWalletWithAction, primaryWallet, secondaryWallets } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
90
|
const selectedConnector = (_a = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _a === void 0 ? void 0 : _a.connector;
|
|
91
91
|
const isSameWallet = (selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key) === (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key);
|
|
92
92
|
const { data: connectedWallet } = useConnectedAccountWallet.useConnectedAccountWallet((_b = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _b === void 0 ? void 0 : _b.connector, secondaryWallets);
|
|
93
|
-
|
|
93
|
+
const selectedWalletToSwitchTo = (_d = (_c = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) !== null && _c !== void 0 ? _c : primaryWallet) !== null && _d !== void 0 ? _d : undefined;
|
|
94
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key }), title: `Switch wallet in ${selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name}`, children: isSameWallet || !connectedWallet ? (jsxRuntime.jsx(SwitchAccountView.SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletToSwitchTo })) : (jsxRuntime.jsx(SwitchOrUseActiveAccountView.SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletToSwitchTo })) }));
|
|
94
95
|
};
|
|
95
96
|
const PendingAccountSwitchWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { children: jsxRuntime.jsx(PendingAccountSwitchContent, {}) }));
|
|
96
97
|
const PendingAccountSwitchModal = () => (jsxRuntime.jsx(PromptModal.PromptModal, { children: jsxRuntime.jsx(PendingAccountSwitchContent, {}) }));
|
package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js
CHANGED
|
@@ -81,12 +81,13 @@ import '../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
|
81
81
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
82
82
|
|
|
83
83
|
const PendingAccountSwitchContent = () => {
|
|
84
|
-
var _a, _b;
|
|
84
|
+
var _a, _b, _c, _d;
|
|
85
85
|
const { selectedWalletWithAction, primaryWallet, secondaryWallets } = useInternalDynamicContext();
|
|
86
86
|
const selectedConnector = (_a = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _a === void 0 ? void 0 : _a.connector;
|
|
87
87
|
const isSameWallet = (selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key) === (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key);
|
|
88
88
|
const { data: connectedWallet } = useConnectedAccountWallet((_b = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _b === void 0 ? void 0 : _b.connector, secondaryWallets);
|
|
89
|
-
|
|
89
|
+
const selectedWalletToSwitchTo = (_d = (_c = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) !== null && _c !== void 0 ? _c : primaryWallet) !== null && _d !== void 0 ? _d : undefined;
|
|
90
|
+
return (jsx(DefaultPromptLayout, { dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key }), title: `Switch wallet in ${selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name}`, children: isSameWallet || !connectedWallet ? (jsx(SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletToSwitchTo })) : (jsx(SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletToSwitchTo })) }));
|
|
90
91
|
};
|
|
91
92
|
const PendingAccountSwitchWidgetPortal = () => (jsx(WidgetPortal, { children: jsx(PendingAccountSwitchContent, {}) }));
|
|
92
93
|
const PendingAccountSwitchModal = () => (jsx(PromptModal, { children: jsx(PendingAccountSwitchContent, {}) }));
|
|
@@ -61,8 +61,8 @@ require('../../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
61
61
|
require('../../../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
62
62
|
require('../../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
63
63
|
require('react-focus-lock');
|
|
64
|
-
var Divider = require('../../../../../components/Divider/Divider.cjs');
|
|
65
64
|
var Icon = require('../../../../../components/Icon/Icon.cjs');
|
|
65
|
+
var Divider = require('../../../../../components/Divider/Divider.cjs');
|
|
66
66
|
require('../../../context/DynamicWidgetContext.cjs');
|
|
67
67
|
require('../../../../../components/IconButton/IconButton.cjs');
|
|
68
68
|
require('../../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -57,8 +57,8 @@ import '../../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
57
57
|
import '../../../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
58
58
|
import '../../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
59
59
|
import 'react-focus-lock';
|
|
60
|
-
import { Divider } from '../../../../../components/Divider/Divider.js';
|
|
61
60
|
import { Icon } from '../../../../../components/Icon/Icon.js';
|
|
61
|
+
import { Divider } from '../../../../../components/Divider/Divider.js';
|
|
62
62
|
import '../../../context/DynamicWidgetContext.js';
|
|
63
63
|
import '../../../../../components/IconButton/IconButton.js';
|
|
64
64
|
import '../../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
-
|
|
8
|
-
const isWalletLinked = (address, linkedWallets) => {
|
|
9
|
-
if (!address || !(linkedWallets === null || linkedWallets === void 0 ? void 0 : linkedWallets.length)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
const linkedWallet = linkedWallets.find((wallet) => walletConnectorCore.isSameAddress(wallet.address, address, wallet.chain));
|
|
13
|
-
return Boolean(linkedWallet);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.isWalletLinked = isWalletLinked;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
|
|
4
|
-
const isWalletLinked = (address, linkedWallets) => {
|
|
5
|
-
if (!address || !(linkedWallets === null || linkedWallets === void 0 ? void 0 : linkedWallets.length)) {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
const linkedWallet = linkedWallets.find((wallet) => isSameAddress(wallet.address, address, wallet.chain));
|
|
9
|
-
return Boolean(linkedWallet);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { isWalletLinked };
|