@dynamic-labs/sdk-react-core 2.0.0-alpha.6 → 2.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/package.cjs +4 -4
- package/package.js +4 -4
- package/package.json +16 -16
- package/src/index.cjs +3 -7
- package/src/index.d.ts +1 -2
- package/src/index.js +2 -2
- package/src/lib/components/Alert/Alert.cjs +1 -0
- package/src/lib/components/Alert/Alert.js +1 -0
- package/src/lib/components/Alert/Alert.types.d.ts +1 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +1 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +4 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +4 -2
- package/src/lib/components/ShadowDOM/ShadowDOM.cjs +2 -0
- package/src/lib/components/ShadowDOM/ShadowDOM.js +2 -1
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.cjs +26 -10
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.js +27 -11
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -16
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +3 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +17 -17
- package/src/lib/context/DynamicContext/helpers/helpers.cjs +10 -0
- package/src/lib/context/DynamicContext/helpers/helpers.d.ts +5 -0
- package/src/lib/context/DynamicContext/helpers/helpers.js +10 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +0 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.d.ts +8 -7
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.js +1 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +14 -2
- package/src/lib/context/ErrorContext/ErrorContext.cjs +4 -0
- package/src/lib/context/ErrorContext/ErrorContext.d.ts +1 -0
- package/src/lib/context/ErrorContext/ErrorContext.js +4 -0
- package/src/lib/context/FundingContext/FundingContext.cjs +3 -1
- package/src/lib/context/FundingContext/FundingContext.js +3 -1
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +1 -0
- package/src/lib/context/PasskeyContext/PasskeyContext.js +1 -0
- package/src/lib/context/ViewContext/ViewContext.cjs +7 -0
- package/src/lib/context/ViewContext/ViewContext.js +7 -0
- package/src/lib/context/ViewContext/types/index.d.ts +5 -3
- package/src/lib/locale/en/translation.cjs +30 -16
- package/src/lib/locale/en/translation.d.ts +22 -8
- package/src/lib/locale/en/translation.js +30 -16
- package/src/lib/shared/types/localStorage.d.ts +1 -1
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +10 -28
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.d.ts +1 -5
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js +10 -28
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/mergeNetworks/index.d.ts +1 -0
- package/src/lib/utils/functions/mergeNetworks/mergeNetworks.cjs +26 -0
- package/src/lib/utils/functions/mergeNetworks/mergeNetworks.d.ts +13 -0
- package/src/lib/utils/functions/mergeNetworks/mergeNetworks.js +22 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +4 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -2
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +1 -0
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +33 -8
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +33 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +27 -5
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +27 -5
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +7 -6
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +7 -6
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +2 -6
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +2 -6
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.cjs +20 -54
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.d.ts +5 -3
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/useProcessNetworkConfigurations.js +20 -54
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +38 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.d.ts +2 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +34 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -11
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +8 -11
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +1 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +1 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +4 -7
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +4 -7
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +1 -1
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -8
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -8
- package/src/lib/views/{CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs → CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs} +5 -4
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.d.ts +13 -0
- package/src/lib/views/{CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js → CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js} +5 -4
- package/src/lib/views/CollectUserDataViewNoWallet/index.d.ts +1 -0
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +17 -2
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +17 -2
- package/src/lib/views/CreatePasswordView/CreatePasswordView.cjs +12 -13
- package/src/lib/views/CreatePasswordView/CreatePasswordView.d.ts +2 -0
- package/src/lib/views/CreatePasswordView/CreatePasswordView.js +12 -13
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +10 -17
- package/src/lib/views/EmailVerification/EmailVerification.js +10 -17
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +40 -13
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -3
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +40 -13
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +1 -1
- package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +8 -1
- package/src/lib/views/EnterPasswordView/EnterPasswordView.js +8 -1
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs +1 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js +1 -0
- package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +11 -5
- package/src/lib/views/LoginView/useLoginView/useLoginView.js +11 -5
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -0
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.d.ts +2 -3
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.d.ts +2 -3
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.d.ts +2 -3
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +1 -0
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +1 -0
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +31 -7
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +31 -7
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/views/viewToComponentMap.cjs +4 -4
- package/src/lib/views/viewToComponentMap.d.ts +60 -2
- package/src/lib/views/viewToComponentMap.js +4 -4
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +6 -4
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +2 -14
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +2 -14
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +3 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +4 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +2 -14
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +2 -14
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +18 -9
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +18 -9
- package/src/lib/utils/functions/isSameWalletName/index.d.ts +0 -1
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.cjs +0 -9
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.d.ts +0 -1
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +0 -5
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/index.d.ts +0 -1
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/index.d.ts +0 -1
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.cjs +0 -16
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.d.ts +0 -2
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.js +0 -12
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.d.ts +0 -2
- package/src/lib/views/CollectUserDataViewLoginWithEmail/index.d.ts +0 -1
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
require('react');
|
|
9
8
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
10
9
|
require('@dynamic-labs/sdk-api');
|
|
11
10
|
require('../../../../shared/logger.cjs');
|
|
@@ -19,6 +18,7 @@ require('viem');
|
|
|
19
18
|
require('@dynamic-labs/utils');
|
|
20
19
|
require('../../../../shared/consts/index.cjs');
|
|
21
20
|
require('../../../../events/dynamicEvents.cjs');
|
|
21
|
+
require('../../../../../../_virtual/_tslib.cjs');
|
|
22
22
|
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
23
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
24
24
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -85,18 +85,6 @@ const PendingAccountSwitchContent = () => {
|
|
|
85
85
|
const selectedConnector = (_a = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _a === void 0 ? void 0 : _a.connector;
|
|
86
86
|
const isSameWallet = (selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key) === (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key);
|
|
87
87
|
const { data: connectedWallet } = useConnectedAccountWallet.useConnectedAccountWallet((_b = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _b === void 0 ? void 0 : _b.connector, secondaryWallets);
|
|
88
|
-
React.useEffect(() => {
|
|
89
|
-
//flow client library only supports one connected wallet at any given time.
|
|
90
|
-
const disconnectAndConnect = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
91
|
-
var _a, _b;
|
|
92
|
-
if ((selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.connectedChain) !== 'FLOW') {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
yield ((_a = selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedConnector));
|
|
96
|
-
(_b = selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedConnector);
|
|
97
|
-
});
|
|
98
|
-
disconnectAndConnect();
|
|
99
|
-
}, [selectedConnector]);
|
|
100
88
|
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 ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}`, children: isSameWallet || !connectedWallet ? (jsxRuntime.jsx(SwitchAccountView.SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsxRuntime.jsx(SwitchOrUseActiveAccountView.SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) }));
|
|
101
89
|
};
|
|
102
90
|
const PendingAccountSwitchWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { children: jsxRuntime.jsx(PendingAccountSwitchContent, {}) }));
|
package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
2
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import 'react';
|
|
5
4
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
6
5
|
import '@dynamic-labs/sdk-api';
|
|
7
6
|
import '../../../../shared/logger.js';
|
|
@@ -15,6 +14,7 @@ import 'viem';
|
|
|
15
14
|
import '@dynamic-labs/utils';
|
|
16
15
|
import '../../../../shared/consts/index.js';
|
|
17
16
|
import '../../../../events/dynamicEvents.js';
|
|
17
|
+
import '../../../../../../_virtual/_tslib.js';
|
|
18
18
|
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
19
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
20
20
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -81,18 +81,6 @@ const PendingAccountSwitchContent = () => {
|
|
|
81
81
|
const selectedConnector = (_a = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _a === void 0 ? void 0 : _a.connector;
|
|
82
82
|
const isSameWallet = (selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key) === (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key);
|
|
83
83
|
const { data: connectedWallet } = useConnectedAccountWallet((_b = selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet) === null || _b === void 0 ? void 0 : _b.connector, secondaryWallets);
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
//flow client library only supports one connected wallet at any given time.
|
|
86
|
-
const disconnectAndConnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
if ((selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.connectedChain) !== 'FLOW') {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
yield ((_a = selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedConnector));
|
|
92
|
-
(_b = selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedConnector);
|
|
93
|
-
});
|
|
94
|
-
disconnectAndConnect();
|
|
95
|
-
}, [selectedConnector]);
|
|
96
84
|
return (jsx(DefaultPromptLayout, { dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key }), title: `Switch wallet in ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}`, children: isSameWallet || !connectedWallet ? (jsx(SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsx(SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) }));
|
|
97
85
|
};
|
|
98
86
|
const PendingAccountSwitchWidgetPortal = () => (jsx(WidgetPortal, { children: jsx(PendingAccountSwitchContent, {}) }));
|
|
@@ -51,6 +51,7 @@ require('../../../../../context/FooterAnimationContext/index.cjs');
|
|
|
51
51
|
require('../../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
52
52
|
require('../../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
53
53
|
require('react-focus-lock');
|
|
54
|
+
var Divider = require('../../../../../components/Divider/Divider.cjs');
|
|
54
55
|
require('../../../../../context/LoadingContext/LoadingContext.cjs');
|
|
55
56
|
require('qrcode');
|
|
56
57
|
require('../../../context/DynamicWidgetContext.cjs');
|
|
@@ -66,6 +67,7 @@ require('../../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
|
66
67
|
require('../../../../../components/InlineWidget/InlineWidget.cjs');
|
|
67
68
|
require('../../../../../components/Input/Input.cjs');
|
|
68
69
|
require('../../../../../components/IsBrowser/IsBrowser.cjs');
|
|
70
|
+
var LogoutButton = require('../../../../../components/LogoutButton/LogoutButton.cjs');
|
|
69
71
|
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
70
72
|
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
71
73
|
require('../../../../../views/WalletList/WalletList.cjs');
|
|
@@ -74,6 +76,6 @@ require('../../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryW
|
|
|
74
76
|
require('@hcaptcha/react-hcaptcha');
|
|
75
77
|
require('../../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs');
|
|
76
78
|
|
|
77
|
-
const SwitchAccountView = ({ selectedWalletToSwitchTo }) => (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress.shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) }), ' ', "in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " to make it active."] }));
|
|
79
|
+
const SwitchAccountView = ({ selectedWalletToSwitchTo }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress.shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) }), ' ', "in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " to make it active."] }), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
|
|
78
80
|
|
|
79
81
|
exports.SwitchAccountView = SwitchAccountView;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../../../../events/dynamicEvents.js';
|
|
4
4
|
import '../../../../../../../_virtual/_tslib.js';
|
|
@@ -47,6 +47,7 @@ import '../../../../../context/FooterAnimationContext/index.js';
|
|
|
47
47
|
import '../../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
48
48
|
import '../../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
49
49
|
import 'react-focus-lock';
|
|
50
|
+
import { Divider } from '../../../../../components/Divider/Divider.js';
|
|
50
51
|
import '../../../../../context/LoadingContext/LoadingContext.js';
|
|
51
52
|
import 'qrcode';
|
|
52
53
|
import '../../../context/DynamicWidgetContext.js';
|
|
@@ -62,6 +63,7 @@ import '../../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
|
62
63
|
import '../../../../../components/InlineWidget/InlineWidget.js';
|
|
63
64
|
import '../../../../../components/Input/Input.js';
|
|
64
65
|
import '../../../../../components/IsBrowser/IsBrowser.js';
|
|
66
|
+
import { LogoutButton } from '../../../../../components/LogoutButton/LogoutButton.js';
|
|
65
67
|
import '../../../../../components/Popper/Popper/Popper.js';
|
|
66
68
|
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
67
69
|
import '../../../../../views/WalletList/WalletList.js';
|
|
@@ -70,6 +72,6 @@ import '../../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWa
|
|
|
70
72
|
import '@hcaptcha/react-hcaptcha';
|
|
71
73
|
import '../../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js';
|
|
72
74
|
|
|
73
|
-
const SwitchAccountView = ({ selectedWalletToSwitchTo }) => (jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Switch to wallet", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) }), ' ', "in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " to make it active."] }));
|
|
75
|
+
const SwitchAccountView = ({ selectedWalletToSwitchTo }) => (jsxs(Fragment, { children: [jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Switch to wallet", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) }), ' ', "in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " to make it active."] }), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
|
|
74
76
|
|
|
75
77
|
export { SwitchAccountView };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
require('react');
|
|
9
8
|
require('../../../../events/dynamicEvents.cjs');
|
|
9
|
+
require('../../../../../../_virtual/_tslib.cjs');
|
|
10
10
|
require('@dynamic-labs/utils');
|
|
11
11
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
12
12
|
require('@dynamic-labs/sdk-api');
|
|
@@ -80,18 +80,6 @@ require('../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneI
|
|
|
80
80
|
|
|
81
81
|
const PendingAccountSwitchToLinkContent = () => {
|
|
82
82
|
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
83
|
-
React.useEffect(() => {
|
|
84
|
-
//flow client library only supports one connected wallet at any given time.
|
|
85
|
-
const disconnectAndConnect = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
-
var _a, _b;
|
|
87
|
-
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
91
|
-
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
92
|
-
});
|
|
93
|
-
disconnectAndConnect();
|
|
94
|
-
}, [selectedWalletConnector]);
|
|
95
83
|
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}`, children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["To link a new wallet, open", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), ' ', "and switch to the account you want to link."] }) }));
|
|
96
84
|
};
|
|
97
85
|
const PendingAccountSwitchToLinkWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt(), children: jsxRuntime.jsx(PendingAccountSwitchToLinkContent, {}) }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
2
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import 'react';
|
|
5
4
|
import '../../../../events/dynamicEvents.js';
|
|
5
|
+
import '../../../../../../_virtual/_tslib.js';
|
|
6
6
|
import '@dynamic-labs/utils';
|
|
7
7
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
8
8
|
import '@dynamic-labs/sdk-api';
|
|
@@ -76,18 +76,6 @@ import '../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneIn
|
|
|
76
76
|
|
|
77
77
|
const PendingAccountSwitchToLinkContent = () => {
|
|
78
78
|
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
//flow client library only supports one connected wallet at any given time.
|
|
81
|
-
const disconnectAndConnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
-
var _a, _b;
|
|
83
|
-
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
87
|
-
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
88
|
-
});
|
|
89
|
-
disconnectAndConnect();
|
|
90
|
-
}, [selectedWalletConnector]);
|
|
91
79
|
return (jsx(DefaultPromptLayout, { dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}`, children: jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["To link a new wallet, open", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), ' ', "and switch to the account you want to link."] }) }));
|
|
92
80
|
};
|
|
93
81
|
const PendingAccountSwitchToLinkWidgetPortal = () => (jsx(WidgetPortal, { onClose: useCloseMultiWalletPrompt(), children: jsx(PendingAccountSwitchToLinkContent, {}) }));
|
|
@@ -6,13 +6,14 @@ var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
10
|
require('../../../../events/dynamicEvents.cjs');
|
|
10
11
|
require('@dynamic-labs/utils');
|
|
11
12
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
12
13
|
var decodeJwt = require('../../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
13
14
|
require('@dynamic-labs/iconic');
|
|
14
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
var altKey = require('../../../../shared/assets/alt-key.cjs');
|
|
16
17
|
var androidTouchId = require('../../../../shared/assets/android-touch-id.cjs');
|
|
17
18
|
var checkCircle = require('../../../../shared/assets/check-circle.cjs');
|
|
18
19
|
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
@@ -37,7 +38,7 @@ require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
|
37
38
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
38
39
|
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
39
40
|
require('react-dom');
|
|
40
|
-
require('../../../../
|
|
41
|
+
var useEmbeddedWallet = require('../../../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
41
42
|
var ThemeContext = require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
42
43
|
var usePasskeyRecovery = require('../../../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
43
44
|
require('@dynamic-labs/types');
|
|
@@ -60,6 +61,7 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
60
61
|
require('../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
61
62
|
require('react-focus-lock');
|
|
62
63
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
64
|
+
require('../../../../context/WalletContext/WalletContext.cjs');
|
|
63
65
|
require('qrcode');
|
|
64
66
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
65
67
|
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
@@ -88,9 +90,10 @@ require('../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneI
|
|
|
88
90
|
var spinner = require('../../../../components/Spinner/spinner.cjs');
|
|
89
91
|
|
|
90
92
|
const WalletSettingsView = () => {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f;
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
94
|
+
const { authToken, projectSettings, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
92
95
|
const { goToInitialDynamicWidgetView, setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
93
|
-
const {
|
|
96
|
+
const { createPassword } = useEmbeddedWallet.useEmbeddedWallet();
|
|
94
97
|
const { initExportProcess } = useEmbeddedReveal.useEmbeddedReveal();
|
|
95
98
|
const { isTurnkeyWallet, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
96
99
|
const { theme } = ThemeContext.useThemeContext();
|
|
@@ -98,9 +101,12 @@ const WalletSettingsView = () => {
|
|
|
98
101
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
99
102
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
100
103
|
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
+
const cbWalletProperties = (_b = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === 'coinbasempc')) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
105
|
+
const isCoinbaseWallet = walletConnectorCore.isCoinbaseMpcWalletConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
106
|
+
const hasClaimedCoinbaseMPC = Boolean(cbWalletProperties === null || cbWalletProperties === void 0 ? void 0 : cbWalletProperties.claimed);
|
|
107
|
+
const turnkeyWalletProperties = (_d = (_c = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _d === void 0 ? void 0 : _d.walletProperties;
|
|
108
|
+
const isTurnkeyHDWallet = turnkeyWalletProperties === null || turnkeyWalletProperties === void 0 ? void 0 : turnkeyWalletProperties.turnkeyHDWalletId;
|
|
109
|
+
const isPasskeyEnabled = Boolean((_h = (_g = (_f = (_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _e === void 0 ? void 0 : _e.embeddedWallets) === null || _f === void 0 ? void 0 : _f.supportedSecurityMethods) === null || _g === void 0 ? void 0 : _g.passkey) === null || _h === void 0 ? void 0 : _h.isEnabled);
|
|
104
110
|
const isTurnkeyWalletWithAuthenticator = isTurnkeyWallet && !isTurnkeyWalletWithoutAuthenticator;
|
|
105
111
|
const handlePasskeyClick = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
106
112
|
if (isTurnkeyWalletWithAuthenticator) {
|
|
@@ -128,9 +134,12 @@ const WalletSettingsView = () => {
|
|
|
128
134
|
return undefined;
|
|
129
135
|
};
|
|
130
136
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: goToInitialDynamicWidgetView, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
131
|
-
|
|
137
|
+
const showSigninSection = (isPasskeyEnabled && isTurnkeyWallet) || isCoinbaseWallet;
|
|
138
|
+
return (jsxRuntime.jsxs("div", { className: 'wallet-settings-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx("div", { className: 'wallet-settings-view__header', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_wallet_settings.title', children: t('dyn_wallet_settings.title') }) }) }), jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body', children: [showSigninSection && (jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.signing_section.title') }), isPasskeyEnabled && isTurnkeyWallet && (jsxRuntime.jsx(Button.Button, { dataTestId: 'manage-passkeys-button', onClick: () => handlePasskeyClick(), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
139
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
140
|
+
jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { className: 'wallet-settings-view__body__section__button__icon', defaultIcon: jsxRuntime.jsx(androidTouchId.ReactComponent, { "data-testid": 'default-icon' }) }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.signing_section.passkey_button', children: t('dyn_wallet_settings.signing_section.passkey_button') })] }), endSlot: renderPasskeysButtonEndSlot(), disabled: isLoading, showInternalLoading: false })), isCoinbaseWallet && (jsxRuntime.jsx(Button.Button, { dataTestId: 'manage-password-button', onClick: () => createPassword(!hasClaimedCoinbaseMPC), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
132
141
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
133
|
-
jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(
|
|
142
|
+
jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(altKey.ReactComponent, { className: 'wallet-settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.signing_section.passkey_button', children: t('dyn_wallet_settings.signing_section.password_button') })] }), endSlot: hasClaimedCoinbaseMPC ? (jsxRuntime.jsx(checkCircle.ReactComponent, { className: 'wallet-settings-view__body__section__button__icon-secondary--success' })) : undefined, showInternalLoading: false }))] })), jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.export_section.title') }), jsxRuntime.jsx(Button.Button, { dataTestId: 'embedded-reveal-account-button', onClick: () => handleExportClick(), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
134
143
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
135
144
|
jsxRuntime.jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: `wallet-settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}` }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.export_section.private_key_button', children: t('dyn_wallet_settings.export_section.private_key_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'wallet-settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsxRuntime.jsx(Button.Button, { dataTestId: 'embedded-reveal-button', onClick: () => handleExportClick(true), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
136
145
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
@@ -2,13 +2,14 @@ import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { isCoinbaseMpcWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
6
|
import '../../../../events/dynamicEvents.js';
|
|
6
7
|
import '@dynamic-labs/utils';
|
|
7
8
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
8
9
|
import { decodeJwt } from '../../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
9
10
|
import '@dynamic-labs/iconic';
|
|
10
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import { ReactComponent as SvgAltKey } from '../../../../shared/assets/alt-key.js';
|
|
12
13
|
import { ReactComponent as SvgAndroidTouchId } from '../../../../shared/assets/android-touch-id.js';
|
|
13
14
|
import { ReactComponent as SvgCheckCircle } from '../../../../shared/assets/check-circle.js';
|
|
14
15
|
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
@@ -33,7 +34,7 @@ import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
|
33
34
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
34
35
|
import '../../../../context/VerificationContext/VerificationContext.js';
|
|
35
36
|
import 'react-dom';
|
|
36
|
-
import '../../../../
|
|
37
|
+
import { useEmbeddedWallet } from '../../../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
37
38
|
import { useThemeContext } from '../../../../context/ThemeContext/ThemeContext.js';
|
|
38
39
|
import { usePasskeyRecovery } from '../../../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
39
40
|
import '@dynamic-labs/types';
|
|
@@ -56,6 +57,7 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
56
57
|
import '../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
57
58
|
import 'react-focus-lock';
|
|
58
59
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
60
|
+
import '../../../../context/WalletContext/WalletContext.js';
|
|
59
61
|
import 'qrcode';
|
|
60
62
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
61
63
|
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
@@ -84,9 +86,10 @@ import '../../../../views/LoginView/sections/PhoneNumberSignInSection/usePhoneIn
|
|
|
84
86
|
import { Spinner } from '../../../../components/Spinner/spinner.js';
|
|
85
87
|
|
|
86
88
|
const WalletSettingsView = () => {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f;
|
|
89
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
90
|
+
const { authToken, projectSettings, primaryWallet } = useInternalDynamicContext();
|
|
88
91
|
const { goToInitialDynamicWidgetView, setDynamicWidgetView } = useWidgetContext();
|
|
89
|
-
const {
|
|
92
|
+
const { createPassword } = useEmbeddedWallet();
|
|
90
93
|
const { initExportProcess } = useEmbeddedReveal();
|
|
91
94
|
const { isTurnkeyWallet, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
92
95
|
const { theme } = useThemeContext();
|
|
@@ -94,9 +97,12 @@ const WalletSettingsView = () => {
|
|
|
94
97
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery();
|
|
95
98
|
const [isLoading, setIsLoading] = useState(false);
|
|
96
99
|
const decodedJwt = decodeJwt(authToken);
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
+
const cbWalletProperties = (_b = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === 'coinbasempc')) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
101
|
+
const isCoinbaseWallet = isCoinbaseMpcWalletConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
102
|
+
const hasClaimedCoinbaseMPC = Boolean(cbWalletProperties === null || cbWalletProperties === void 0 ? void 0 : cbWalletProperties.claimed);
|
|
103
|
+
const turnkeyWalletProperties = (_d = (_c = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _d === void 0 ? void 0 : _d.walletProperties;
|
|
104
|
+
const isTurnkeyHDWallet = turnkeyWalletProperties === null || turnkeyWalletProperties === void 0 ? void 0 : turnkeyWalletProperties.turnkeyHDWalletId;
|
|
105
|
+
const isPasskeyEnabled = Boolean((_h = (_g = (_f = (_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _e === void 0 ? void 0 : _e.embeddedWallets) === null || _f === void 0 ? void 0 : _f.supportedSecurityMethods) === null || _g === void 0 ? void 0 : _g.passkey) === null || _h === void 0 ? void 0 : _h.isEnabled);
|
|
100
106
|
const isTurnkeyWalletWithAuthenticator = isTurnkeyWallet && !isTurnkeyWalletWithoutAuthenticator;
|
|
101
107
|
const handlePasskeyClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
108
|
if (isTurnkeyWalletWithAuthenticator) {
|
|
@@ -124,9 +130,12 @@ const WalletSettingsView = () => {
|
|
|
124
130
|
return undefined;
|
|
125
131
|
};
|
|
126
132
|
const backButton = (jsx(IconButton, { type: 'button', onClick: goToInitialDynamicWidgetView, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
127
|
-
|
|
133
|
+
const showSigninSection = (isPasskeyEnabled && isTurnkeyWallet) || isCoinbaseWallet;
|
|
134
|
+
return (jsxs("div", { className: 'wallet-settings-view', children: [jsx(ModalHeader, { leading: backButton, children: jsx("div", { className: 'wallet-settings-view__header', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_wallet_settings.title', children: t('dyn_wallet_settings.title') }) }) }), jsxs("div", { className: 'wallet-settings-view__body', children: [showSigninSection && (jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.signing_section.title') }), isPasskeyEnabled && isTurnkeyWallet && (jsx(Button, { dataTestId: 'manage-passkeys-button', onClick: () => handlePasskeyClick(), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
135
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
136
|
+
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(PasskeyDeviceIcon, { className: 'wallet-settings-view__body__section__button__icon', defaultIcon: jsx(SvgAndroidTouchId, { "data-testid": 'default-icon' }) }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.signing_section.passkey_button', children: t('dyn_wallet_settings.signing_section.passkey_button') })] }), endSlot: renderPasskeysButtonEndSlot(), disabled: isLoading, showInternalLoading: false })), isCoinbaseWallet && (jsx(Button, { dataTestId: 'manage-password-button', onClick: () => createPassword(!hasClaimedCoinbaseMPC), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
128
137
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
129
|
-
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(
|
|
138
|
+
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(SvgAltKey, { className: 'wallet-settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.signing_section.passkey_button', children: t('dyn_wallet_settings.signing_section.password_button') })] }), endSlot: hasClaimedCoinbaseMPC ? (jsx(SvgCheckCircle, { className: 'wallet-settings-view__body__section__button__icon-secondary--success' })) : undefined, showInternalLoading: false }))] })), jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.export_section.title') }), jsx(Button, { dataTestId: 'embedded-reveal-account-button', onClick: () => handleExportClick(), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
130
139
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
131
140
|
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(SvgExportPrivateKey, { className: `wallet-settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}` }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_wallet_settings.export_section.private_key_button', children: t('dyn_wallet_settings.export_section.private_key_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'wallet-settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsx(Button, { dataTestId: 'embedded-reveal-button', onClick: () => handleExportClick(true), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
132
141
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './isSameWalletName';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
6
|
-
|
|
7
|
-
const isSameWalletName = (left, right) => walletConnectorCore.normalizeWalletName(left) === walletConnectorCore.normalizeWalletName(right);
|
|
8
|
-
|
|
9
|
-
exports.isSameWalletName = isSameWalletName;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isSameWalletName: (left: string, right: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './mergeCustomerEvmNetworksWithServerNetworks';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mergeCustomerEvmNetworksWithServerNetworks } from './mergeCustomerEvmNetworksWithServerNetworks';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const mergeCustomerEvmNetworksWithServerNetworks = (customerEvmNetworks, serverNetworks) => {
|
|
6
|
-
const evmNetworks = [...customerEvmNetworks];
|
|
7
|
-
serverNetworks.forEach((network) => {
|
|
8
|
-
const existingNetwork = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.find((item) => item.chainId === network.chainId);
|
|
9
|
-
if (!existingNetwork) {
|
|
10
|
-
evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.unshift(network);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
return evmNetworks;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.mergeCustomerEvmNetworksWithServerNetworks = mergeCustomerEvmNetworksWithServerNetworks;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const mergeCustomerEvmNetworksWithServerNetworks = (customerEvmNetworks, serverNetworks) => {
|
|
2
|
-
const evmNetworks = [...customerEvmNetworks];
|
|
3
|
-
serverNetworks.forEach((network) => {
|
|
4
|
-
const existingNetwork = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.find((item) => item.chainId === network.chainId);
|
|
5
|
-
if (!existingNetwork) {
|
|
6
|
-
evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.unshift(network);
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
return evmNetworks;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { mergeCustomerEvmNetworksWithServerNetworks };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CollectUserDataViewLoginWithEmail } from './CollectUserDataViewLoginWithEmail';
|