@dynamic-labs/sdk-react-core 4.6.2 → 4.7.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/lib/Main.cjs +1 -1
  6. package/src/lib/Main.js +1 -1
  7. package/src/lib/components/BaseButton/BaseButton.cjs +20 -0
  8. package/src/lib/components/BaseButton/BaseButton.d.ts +21 -0
  9. package/src/lib/components/BaseButton/BaseButton.js +16 -0
  10. package/src/lib/components/BaseButton/index.d.ts +1 -0
  11. package/src/lib/components/Button/Button.cjs +5 -1
  12. package/src/lib/components/Button/Button.d.ts +6 -7
  13. package/src/lib/components/Button/Button.js +5 -1
  14. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.cjs +2 -2
  15. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.js +2 -2
  16. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
  17. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +2 -1
  18. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +2 -2
  19. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +2 -2
  20. package/src/lib/context/ViewContext/types/index.d.ts +1 -1
  21. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -2
  22. package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -2
  23. package/src/lib/locale/en/translation.cjs +10 -0
  24. package/src/lib/locale/en/translation.d.ts +10 -0
  25. package/src/lib/locale/en/translation.js +10 -0
  26. package/src/lib/styles/index.shadow.cjs +1 -1
  27. package/src/lib/styles/index.shadow.js +1 -1
  28. package/src/lib/utils/constants/localStorage.cjs +2 -0
  29. package/src/lib/utils/constants/localStorage.d.ts +1 -0
  30. package/src/lib/utils/constants/localStorage.js +2 -1
  31. package/src/lib/utils/functions/generateMessages/index.cjs +1 -1
  32. package/src/lib/utils/functions/generateMessages/index.js +1 -1
  33. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +2 -2
  34. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +2 -2
  35. package/src/lib/utils/functions/index.d.ts +0 -1
  36. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.cjs +1 -3
  37. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.d.ts +2 -1
  38. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.js +1 -3
  39. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
  40. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
  41. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -1
  42. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -1
  43. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
  44. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
  45. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
  46. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +1 -1
  47. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +1 -1
  48. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
  49. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
  50. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.cjs +4 -96
  51. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.js +4 -96
  52. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +32 -19
  53. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +2 -2
  54. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +31 -18
  55. package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.cjs +1 -1
  56. package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.js +1 -1
  57. package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +2 -2
  58. package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +2 -2
  59. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +12 -16
  60. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +13 -17
  61. package/src/lib/utils/types/ButtonAriaProps.d.ts +5 -0
  62. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +3 -1
  63. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +3 -1
  64. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -2
  65. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -2
  66. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
  67. package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
  68. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
  69. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
  70. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +130 -0
  71. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.d.ts +3 -0
  72. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +125 -0
  73. package/src/lib/views/UserDeleteAccountView/index.d.ts +1 -0
  74. package/src/lib/views/viewToComponentMap.cjs +2 -0
  75. package/src/lib/views/viewToComponentMap.d.ts +1 -0
  76. package/src/lib/views/viewToComponentMap.js +2 -0
  77. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +20 -8
  78. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +21 -9
  79. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
  80. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
  81. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
  82. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +6 -16
  83. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +6 -16
  84. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +13 -4
  85. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +13 -4
  86. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +18 -6
  87. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +19 -7
  88. package/src/lib/shared/assets/gear.cjs +0 -54
  89. package/src/lib/shared/assets/gear.js +0 -30
  90. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.cjs +0 -13
  91. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.d.ts +0 -3
  92. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.js +0 -9
@@ -1,4 +1,4 @@
1
- import { ChainEnum } from '@dynamic-labs/sdk-api-core';
1
+ import { ChainEnum, TokenBalance } from '@dynamic-labs/sdk-api-core';
2
2
  export declare const useTokenBalances: ({ accountAddress, networkId, chainName, tokenAddresses, includeFiat, includeNativeBalance, }?: {
3
3
  accountAddress?: string;
4
4
  networkId?: number;
@@ -11,5 +11,5 @@ export declare const useTokenBalances: ({ accountAddress, networkId, chainName,
11
11
  fetchAccountBalances: (forceRefresh?: boolean) => Promise<void>;
12
12
  isError: boolean;
13
13
  isLoading: boolean;
14
- tokenBalances: import("@dynamic-labs/sdk-api-core").TokenBalance[];
14
+ tokenBalances: TokenBalance[];
15
15
  };
@@ -5,7 +5,7 @@ import { ChainEnum } from '@dynamic-labs/sdk-api-core';
5
5
  import { useTokenBalancesState, setTokenBalanceVariable } from '../../../store/state/tokenBalances.js';
6
6
  import { getAccountTokenBalances } from '../../../data/api/chains/balances.js';
7
7
  import '../../../context/DynamicContext/DynamicContext.js';
8
- import '../../../shared/logger.js';
8
+ import { logger } from '../../../shared/logger.js';
9
9
  import '@dynamic-labs/iconic';
10
10
  import '@dynamic-labs/wallet-connector-core';
11
11
  import 'react/jsx-runtime';
@@ -22,12 +22,12 @@ import { USER_NOT_LOGGED_IN } from '../../constants/errors.js';
22
22
  import '@dynamic-labs/multi-wallet';
23
23
  import 'react-international-phone';
24
24
  import '../../../store/state/nonce/nonce.js';
25
- import '../../../store/state/projectSettings/projectSettings.js';
25
+ import { getProjectSettings } from '../../../store/state/projectSettings/projectSettings.js';
26
26
  import '../../../config/ApiEndpoint.js';
27
27
  import { logResponseError } from '../../../data/api/utils.js';
28
- import '../../../store/state/user/user.js';
28
+ import { getUser } from '../../../store/state/user/user.js';
29
29
  import '../../../locale/locale.js';
30
- import { useDynamicSettings } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
30
+ import { useDynamicSettings, getEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
31
31
  import '../../../store/state/primaryWalletId/primaryWalletId.js';
32
32
  import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
33
33
  import '../../../context/AccountExistsContext/AccountExistsContext.js';
@@ -97,17 +97,18 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
97
97
  const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm, tokenAddresses, includeFiat = false, includeNativeBalance = false, } = {}) => {
98
98
  const tokenBalancesState = useTokenBalancesState();
99
99
  const { tokenBalances, isLoading, error } = tokenBalancesState;
100
- const { primaryWallet, environmentId, network, user, projectSettings, authMode, } = useInternalDynamicContext();
100
+ const { primaryWallet, authMode, network } = useInternalDynamicContext();
101
101
  const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
102
- const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
103
102
  const requestAccount = accountAddress !== null && accountAddress !== void 0 ? accountAddress : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
104
- const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : network;
103
+ const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
105
104
  const fetchAccountBalances = useCallback((...args_1) => __awaiter(void 0, [...args_1], void 0, function* (forceRefresh = false) {
106
105
  var _a;
106
+ const user = getUser();
107
107
  if (authMode !== 'connect-only' && !user) {
108
108
  setTokenBalanceVariable('error', USER_NOT_LOGGED_IN);
109
109
  return;
110
110
  }
111
+ const projectSettings = getProjectSettings();
111
112
  if (authMode === 'connect-only' &&
112
113
  !((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _a === void 0 ? void 0 : _a.connectOnlyMultiAsset)) {
113
114
  return;
@@ -116,29 +117,41 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm
116
117
  setTokenBalanceVariable('error', `Chain ${requestChainName} is not supported for token balances`);
117
118
  return;
118
119
  }
119
- const isValidEvmRequest = chainName === ChainEnum.Evm &&
120
+ // the reason why we need to get the network here again insteaf of using the value
121
+ // from DynamicContext is because this function might run before the network state is
122
+ // properly set when switching wallets, so we want to make sure we have the latest network
123
+ const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : (yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(true)));
124
+ const isValidEvmRequest = requestChainName === ChainEnum.Evm &&
120
125
  requestNetwork &&
121
126
  !isNaN(Number(requestNetwork));
122
- const isValidRequest = isValidEvmRequest || chainName === ChainEnum.Sol;
127
+ const isValidRequest = isValidEvmRequest || requestChainName === ChainEnum.Sol;
128
+ logger.logVerboseTroubleshootingMessage('[useTokenBalances] will try to fetch token balances', {
129
+ isLoading,
130
+ isValidRequest,
131
+ networkId,
132
+ requestAccount,
133
+ requestChainName,
134
+ requestNetwork,
135
+ });
123
136
  if (isLoading || !requestAccount || !isValidRequest) {
124
137
  setTokenBalanceVariable('tokenBalances', undefined);
125
138
  return;
126
139
  }
127
140
  setTokenBalanceVariable('isLoading', true);
141
+ let response = [];
128
142
  try {
129
- const response = yield getAccountTokenBalances({
143
+ response = yield getAccountTokenBalances({
130
144
  accountAddress: requestAccount,
131
145
  chainName: requestChainName,
132
- environmentId,
146
+ environmentId: getEnvironmentId(),
133
147
  forceRefresh,
134
148
  includeNative: includeNativeBalance,
135
149
  includePrices: includeFiat,
136
- networkId: chainName === ChainEnum.Evm ? Number(requestNetwork) : 0,
150
+ networkId: requestChainName === ChainEnum.Evm ? Number(requestNetwork) : 0,
137
151
  });
138
152
  if (!response)
139
153
  return;
140
154
  setTokenBalanceVariable('error', undefined);
141
- setTokenBalanceVariable('tokenBalances', response);
142
155
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
143
156
  }
144
157
  catch (e) {
@@ -147,23 +160,23 @@ const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm
147
160
  setTokenBalanceVariable('error', errorMessage);
148
161
  }
149
162
  finally {
163
+ setTokenBalanceVariable('tokenBalances', response);
150
164
  setTokenBalanceVariable('isLoading', false);
151
165
  }
152
166
  }), [
153
- user,
154
167
  requestChainName,
155
- chainName,
156
- requestNetwork,
157
168
  isLoading,
158
169
  requestAccount,
159
- environmentId,
160
170
  includeNativeBalance,
161
171
  includeFiat,
172
+ authMode,
173
+ networkId,
174
+ walletConnector,
162
175
  ]);
163
176
  useInternalDynamicEvents('tokenBalancesChanged', () => fetchAccountBalances(true));
164
177
  useEffect(() => {
165
178
  fetchAccountBalances();
166
- }, [requestAccount, requestNetwork]);
179
+ }, [requestAccount, network, networkId]);
167
180
  const { tokensFilter } = useDynamicSettings();
168
181
  const lowerTokenAddresses = tokenAddresses === null || tokenAddresses === void 0 ? void 0 : tokenAddresses.map((address) => address.toLowerCase());
169
182
  const initialTokenBalances = lowerTokenAddresses
@@ -43,7 +43,7 @@ const useSVMTransactionSimulation = () => {
43
43
  const fee = fees.reduce((acc, curr) => acc + curr, BigInt(0));
44
44
  const result = yield blockaid.simulateBlockaidSVMTransaction({
45
45
  accountAddress: primaryWallet.address,
46
- chain: (yield primaryWallet.connector.getNetwork()),
46
+ chain: (yield primaryWallet.connector.getNetwork(true)),
47
47
  environmentId,
48
48
  transactions: encodedTransactions,
49
49
  });
@@ -35,7 +35,7 @@ const useSVMTransactionSimulation = () => {
35
35
  const fee = fees.reduce((acc, curr) => acc + curr, BigInt(0));
36
36
  const result = yield simulateBlockaidSVMTransaction({
37
37
  accountAddress: primaryWallet.address,
38
- chain: (yield primaryWallet.connector.getNetwork()),
38
+ chain: (yield primaryWallet.connector.getNetwork(true)),
39
39
  environmentId,
40
40
  transactions: encodedTransactions,
41
41
  });
@@ -25,7 +25,7 @@ var useWalletConnectorEvent = require('../events/useWalletConnectorEvent/useWall
25
25
  */
26
26
  const useWalletConnectorNetwork = (walletConnector, { onChange } = { onChange: () => { } }) => {
27
27
  const [network, setNetwork] = React.useState();
28
- const { isLoading } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
28
+ const { isLoading } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(true), {
29
29
  deps: [walletConnector],
30
30
  onResolve: (network) => {
31
31
  setNetwork(network);
@@ -43,7 +43,7 @@ const useWalletConnectorNetwork = (walletConnector, { onChange } = { onChange: (
43
43
  useWalletConnectorEvent.useWalletConnectorEvent(walletConnector || undefined, 'disconnect', () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
44
44
  if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) !== 'argentx')
45
45
  return;
46
- const chain = yield walletConnector.getNetwork();
46
+ const chain = yield walletConnector.getNetwork(true);
47
47
  setNetwork(chain);
48
48
  onChange === null || onChange === void 0 ? void 0 : onChange(chain);
49
49
  }));
@@ -21,7 +21,7 @@ import { useWalletConnectorEvent } from '../events/useWalletConnectorEvent/useWa
21
21
  */
22
22
  const useWalletConnectorNetwork = (walletConnector, { onChange } = { onChange: () => { } }) => {
23
23
  const [network, setNetwork] = useState();
24
- const { isLoading } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
24
+ const { isLoading } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(true), {
25
25
  deps: [walletConnector],
26
26
  onResolve: (network) => {
27
27
  setNetwork(network);
@@ -39,7 +39,7 @@ const useWalletConnectorNetwork = (walletConnector, { onChange } = { onChange: (
39
39
  useWalletConnectorEvent(walletConnector || undefined, 'disconnect', () => __awaiter(void 0, void 0, void 0, function* () {
40
40
  if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) !== 'argentx')
41
41
  return;
42
- const chain = yield walletConnector.getNetwork();
42
+ const chain = yield walletConnector.getNetwork(true);
43
43
  setNetwork(chain);
44
44
  onChange === null || onChange === void 0 ? void 0 : onChange(chain);
45
45
  }));
@@ -15,13 +15,21 @@ const findSmartWallet = (account, verifiedCredentials) => verifiedCredentials.fi
15
15
  const isOwnerOfASmartWallet = (account, verifiedCredentials) => Boolean(findSmartWallet(account, verifiedCredentials));
16
16
  const initializeSmartWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ account, verifiedCredentials, walletConnectorOptions, primaryWalletId, }) {
17
17
  var _b, _c, _d, _e, _f;
18
+ const smartWallet = findWalletOptionFor.findWalletOptionFor(account, walletConnectorOptions);
19
+ if (!smartWallet) {
20
+ throw new Error('could not find smart wallet from wallet options');
21
+ }
22
+ const connector = smartWallet.walletConnector;
23
+ if (!walletConnectorCore.isAccountAbstractionConnector(connector)) {
24
+ throw new Error('could not initialize smart wallet');
25
+ }
18
26
  const owner = findOwner(account, verifiedCredentials);
19
27
  if (!owner) {
20
28
  throw new Error('could not find associated eoa account for smart wallet');
21
29
  }
22
30
  const ownerWallet = findWalletOptionFor.findWalletOptionFor(owner, walletConnectorOptions);
23
- if (!ownerWallet) {
24
- throw new Error('could not find owner wallet from wallet options');
31
+ if (!owner.address || !account.address || !ownerWallet) {
32
+ throw new Error('could not find owner or smart wallet address');
25
33
  }
26
34
  if (ownerWallet && walletConnectorCore.isTurnkeyWalletConnector(ownerWallet.walletConnector)) {
27
35
  const sortedVcs = (_c = (_b = ownerWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.reduce((acc, vc) => {
@@ -37,25 +45,13 @@ const initializeSmartWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, fun
37
45
  ownerWallet.walletConnector.setVerifiedCredentials(sortedVcs);
38
46
  }
39
47
  }
40
- const smartWallet = findWalletOptionFor.findWalletOptionFor(account, walletConnectorOptions);
41
- if (!smartWallet) {
42
- throw new Error('could not find smart wallet from wallet options');
43
- }
44
- const connector = smartWallet.walletConnector;
45
- if (!walletConnectorCore.isAccountAbstractionConnector(connector)) {
46
- throw new Error('could not initialize smart wallet');
47
- }
48
- if (!owner.address || !account.address) {
49
- throw new Error('could not find owner or smart wallet address');
50
- }
51
- const shouldSetEoaConnector = primaryWalletId === owner.id || primaryWalletId === account.id;
52
48
  yield connector.registerEoa({
53
49
  ecdsaProviderType: (_d = account.walletProperties) === null || _d === void 0 ? void 0 : _d.ecdsaProviderType,
54
50
  entryPointVersion: (_e = account.walletProperties) === null || _e === void 0 ? void 0 : _e.entryPointVersion,
55
51
  eoaAddress: owner.address,
56
- eoaConnector: ownerWallet.walletConnector,
52
+ eoaConnector: ownerWallet === null || ownerWallet === void 0 ? void 0 : ownerWallet.walletConnector,
57
53
  kernelVersion: (_f = account.walletProperties) === null || _f === void 0 ? void 0 : _f.kernelVersion,
58
- shouldSetEoaConnector,
54
+ shouldSetEoaConnector: primaryWalletId === owner.id || primaryWalletId === account.id,
59
55
  smartWalletAddress: account.address,
60
56
  });
61
57
  });
@@ -1,6 +1,6 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../../../_virtual/_tslib.js';
3
- import { isTurnkeyWalletConnector, isSameAddress, isAccountAbstractionConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { isAccountAbstractionConnector, isTurnkeyWalletConnector, isSameAddress } from '@dynamic-labs/wallet-connector-core';
4
4
  import { VerifiedCredentialNameToChainEnum } from '../../../../constants/values.js';
5
5
  import { findWalletOptionFor } from '../../../../functions/findWalletOptionFor/findWalletOptionFor.js';
6
6
 
@@ -11,13 +11,21 @@ const findSmartWallet = (account, verifiedCredentials) => verifiedCredentials.fi
11
11
  const isOwnerOfASmartWallet = (account, verifiedCredentials) => Boolean(findSmartWallet(account, verifiedCredentials));
12
12
  const initializeSmartWallet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ account, verifiedCredentials, walletConnectorOptions, primaryWalletId, }) {
13
13
  var _b, _c, _d, _e, _f;
14
+ const smartWallet = findWalletOptionFor(account, walletConnectorOptions);
15
+ if (!smartWallet) {
16
+ throw new Error('could not find smart wallet from wallet options');
17
+ }
18
+ const connector = smartWallet.walletConnector;
19
+ if (!isAccountAbstractionConnector(connector)) {
20
+ throw new Error('could not initialize smart wallet');
21
+ }
14
22
  const owner = findOwner(account, verifiedCredentials);
15
23
  if (!owner) {
16
24
  throw new Error('could not find associated eoa account for smart wallet');
17
25
  }
18
26
  const ownerWallet = findWalletOptionFor(owner, walletConnectorOptions);
19
- if (!ownerWallet) {
20
- throw new Error('could not find owner wallet from wallet options');
27
+ if (!owner.address || !account.address || !ownerWallet) {
28
+ throw new Error('could not find owner or smart wallet address');
21
29
  }
22
30
  if (ownerWallet && isTurnkeyWalletConnector(ownerWallet.walletConnector)) {
23
31
  const sortedVcs = (_c = (_b = ownerWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.reduce((acc, vc) => {
@@ -33,25 +41,13 @@ const initializeSmartWallet = (_a) => __awaiter(void 0, [_a], void 0, function*
33
41
  ownerWallet.walletConnector.setVerifiedCredentials(sortedVcs);
34
42
  }
35
43
  }
36
- const smartWallet = findWalletOptionFor(account, walletConnectorOptions);
37
- if (!smartWallet) {
38
- throw new Error('could not find smart wallet from wallet options');
39
- }
40
- const connector = smartWallet.walletConnector;
41
- if (!isAccountAbstractionConnector(connector)) {
42
- throw new Error('could not initialize smart wallet');
43
- }
44
- if (!owner.address || !account.address) {
45
- throw new Error('could not find owner or smart wallet address');
46
- }
47
- const shouldSetEoaConnector = primaryWalletId === owner.id || primaryWalletId === account.id;
48
44
  yield connector.registerEoa({
49
45
  ecdsaProviderType: (_d = account.walletProperties) === null || _d === void 0 ? void 0 : _d.ecdsaProviderType,
50
46
  entryPointVersion: (_e = account.walletProperties) === null || _e === void 0 ? void 0 : _e.entryPointVersion,
51
47
  eoaAddress: owner.address,
52
- eoaConnector: ownerWallet.walletConnector,
48
+ eoaConnector: ownerWallet === null || ownerWallet === void 0 ? void 0 : ownerWallet.walletConnector,
53
49
  kernelVersion: (_f = account.walletProperties) === null || _f === void 0 ? void 0 : _f.kernelVersion,
54
- shouldSetEoaConnector,
50
+ shouldSetEoaConnector: primaryWalletId === owner.id || primaryWalletId === account.id,
55
51
  smartWalletAddress: account.address,
56
52
  });
57
53
  });
@@ -0,0 +1,5 @@
1
+ export type ButtonAriaProps = {
2
+ ariaLabel?: string;
3
+ ariaExpanded?: boolean;
4
+ ariaControls?: string;
5
+ };
@@ -113,7 +113,9 @@ const CollectUserDataView = () => {
113
113
  if (!userWithMissingInfo) {
114
114
  return null;
115
115
  }
116
- const _isSupportedNetwork = !network || isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
116
+ const _isSupportedNetwork = !network ||
117
+ !walletConnector ||
118
+ isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
117
119
  const shouldDisplayWrongNetworkState = !_isSupportedNetwork && Boolean(walletConnector);
118
120
  const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
119
121
  return (jsxRuntime.jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__network-container', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: 28 })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) })] }), walletConnector && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: walletConnector, showNetworkName: true, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' }))] }), onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), shouldDisplayWrongNetworkState && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('collect-user-data__form', {
@@ -109,7 +109,9 @@ const CollectUserDataView = () => {
109
109
  if (!userWithMissingInfo) {
110
110
  return null;
111
111
  }
112
- const _isSupportedNetwork = !network || isSupportedNetwork({ network, walletConnector });
112
+ const _isSupportedNetwork = !network ||
113
+ !walletConnector ||
114
+ isSupportedNetwork({ network, walletConnector });
113
115
  const shouldDisplayWrongNetworkState = !_isSupportedNetwork && Boolean(walletConnector);
114
116
  const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
115
117
  return (jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxs("div", { className: 'collect-user-data__network-container', children: [jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsx(AuthProviderIcon, { iconSize: 28 })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress(walletAddress, 3, 3) })] }), walletConnector && (jsx(NetworkPicker, { currentNetwork: network, connector: walletConnector, showNetworkName: true, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' }))] }), onboardingImageUrl && (jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), shouldDisplayWrongNetworkState && (jsx(ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxs("div", { className: classNames('collect-user-data__form', {
@@ -28,7 +28,6 @@ require('../../context/ErrorContext/ErrorContext.cjs');
28
28
  require('@dynamic-labs/multi-wallet');
29
29
  require('react-international-phone');
30
30
  require('../../store/state/nonce/nonce.cjs');
31
- var getWalletConnectorNetworks = require('../../utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.cjs');
32
31
  var pixelToRem = require('../../utils/functions/pixelToRem/pixelToRem.cjs');
33
32
  require('../../store/state/projectSettings/projectSettings.cjs');
34
33
  require('../../config/ApiEndpoint.cjs');
@@ -102,6 +101,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
102
101
  // The component notifies the user about the required manual network change,
103
102
  // as the wallet does not support programmatic network change.
104
103
  const NetworkNotSupportedSwitchManual = () => {
104
+ var _a;
105
105
  const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
106
106
  useNetworkNotSupported.useNetworkNotSupported();
107
107
  const { t } = reactI18next.useTranslation();
@@ -110,7 +110,7 @@ const NetworkNotSupportedSwitchManual = () => {
110
110
  height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
111
111
  width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
112
112
  } }));
113
- const walletConnectorNetworks = getWalletConnectorNetworks.getWalletConnectorNetworks(walletConnector);
113
+ const walletConnectorNetworks = (_a = walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getEnabledNetworks()) !== null && _a !== void 0 ? _a : [];
114
114
  const getSubtitleCopyKey = () => {
115
115
  if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
116
116
  return 'dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet';
@@ -24,7 +24,6 @@ import '../../context/ErrorContext/ErrorContext.js';
24
24
  import '@dynamic-labs/multi-wallet';
25
25
  import 'react-international-phone';
26
26
  import '../../store/state/nonce/nonce.js';
27
- import { getWalletConnectorNetworks } from '../../utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.js';
28
27
  import { pixelToRem } from '../../utils/functions/pixelToRem/pixelToRem.js';
29
28
  import '../../store/state/projectSettings/projectSettings.js';
30
29
  import '../../config/ApiEndpoint.js';
@@ -98,6 +97,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
98
97
  // The component notifies the user about the required manual network change,
99
98
  // as the wallet does not support programmatic network change.
100
99
  const NetworkNotSupportedSwitchManual = () => {
100
+ var _a;
101
101
  const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
102
102
  useNetworkNotSupported();
103
103
  const { t } = useTranslation();
@@ -106,7 +106,7 @@ const NetworkNotSupportedSwitchManual = () => {
106
106
  height: pixelToRem(iconSize * iconRatio),
107
107
  width: pixelToRem(iconSize * iconRatio),
108
108
  } }));
109
- const walletConnectorNetworks = getWalletConnectorNetworks(walletConnector);
109
+ const walletConnectorNetworks = (_a = walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getEnabledNetworks()) !== null && _a !== void 0 ? _a : [];
110
110
  const getSubtitleCopyKey = () => {
111
111
  if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
112
112
  return 'dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet';
@@ -150,7 +150,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
150
150
  return () => {
151
151
  sendBalances.resetSendBalanceState();
152
152
  };
153
- }, [chain === null || chain === void 0 ? void 0 : chain.name, walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain]);
153
+ }, [chain === null || chain === void 0 ? void 0 : chain.chainId, chain === null || chain === void 0 ? void 0 : chain.name, walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain]);
154
154
  React.useEffect(() => {
155
155
  if (unorderedTokenBalances)
156
156
  setTokenBalances(moveNativeTokenToFirstPosition(unorderedTokenBalances));
@@ -146,7 +146,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
146
146
  return () => {
147
147
  resetSendBalanceState();
148
148
  };
149
- }, [chain === null || chain === void 0 ? void 0 : chain.name, walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain]);
149
+ }, [chain === null || chain === void 0 ? void 0 : chain.chainId, chain === null || chain === void 0 ? void 0 : chain.name, walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain]);
150
150
  useEffect(() => {
151
151
  if (unorderedTokenBalances)
152
152
  setTokenBalances(moveNativeTokenToFirstPosition(unorderedTokenBalances));
@@ -191,7 +191,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
191
191
  }
192
192
  result = yield blockaid.simulateBlockaidSVMTransaction({
193
193
  accountAddress: transaction.from,
194
- chain: (yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork())),
194
+ chain: (yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(true))),
195
195
  environmentId,
196
196
  transactions: encodedTransactions,
197
197
  });
@@ -183,7 +183,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
183
183
  }
184
184
  result = yield simulateBlockaidSVMTransaction({
185
185
  accountAddress: transaction.from,
186
- chain: (yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork())),
186
+ chain: (yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(true))),
187
187
  environmentId,
188
188
  transactions: encodedTransactions,
189
189
  });
@@ -0,0 +1,130 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../../_virtual/_tslib.cjs');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var React = require('react');
9
+ var reactI18next = require('react-i18next');
10
+ require('../../events/dynamicEvents.cjs');
11
+ require('@dynamic-labs/utils');
12
+ require('../../context/DynamicContext/DynamicContext.cjs');
13
+ require('@dynamic-labs/sdk-api-core');
14
+ require('../../shared/logger.cjs');
15
+ require('@dynamic-labs/iconic');
16
+ require('@dynamic-labs/wallet-connector-core');
17
+ var exclamation = require('../../shared/assets/exclamation.cjs');
18
+ require('../../context/ViewContext/ViewContext.cjs');
19
+ var warningRed = require('../../shared/assets/warning-red.cjs');
20
+ require('@dynamic-labs/wallet-book');
21
+ require('../../utils/constants/colors.cjs');
22
+ require('../../utils/constants/values.cjs');
23
+ require('../../shared/consts/index.cjs');
24
+ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
25
+ require('../../context/CaptchaContext/CaptchaContext.cjs');
26
+ require('../../context/ErrorContext/ErrorContext.cjs');
27
+ require('@dynamic-labs/multi-wallet');
28
+ require('react-international-phone');
29
+ require('../../store/state/nonce/nonce.cjs');
30
+ require('../../store/state/projectSettings/projectSettings.cjs');
31
+ require('../../config/ApiEndpoint.cjs');
32
+ require('../../store/state/user/user.cjs');
33
+ require('../../locale/locale.cjs');
34
+ require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
35
+ require('../../store/state/primaryWalletId/primaryWalletId.cjs');
36
+ require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
37
+ require('../../context/AccountExistsContext/AccountExistsContext.cjs');
38
+ require('../../context/UserWalletsContext/UserWalletsContext.cjs');
39
+ require('../../context/VerificationContext/VerificationContext.cjs');
40
+ require('react-dom');
41
+ require('../../utils/functions/compareChains/compareChains.cjs');
42
+ require('../../context/ThemeContext/ThemeContext.cjs');
43
+ require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
44
+ require('bs58');
45
+ require('@dynamic-labs/types');
46
+ require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
47
+ require('../../context/LoadingContext/LoadingContext.cjs');
48
+ require('../../context/WalletContext/WalletContext.cjs');
49
+ require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
50
+ require('yup');
51
+ require('../../context/MockContext/MockContext.cjs');
52
+ require('../CollectUserDataView/useFields.cjs');
53
+ require('../../context/FieldsStateContext/FieldsStateContext.cjs');
54
+ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
55
+ require('@dynamic-labs/rpc-providers');
56
+ require('../../store/state/loadingAndLifecycle.cjs');
57
+ require('@dynamic-labs/store');
58
+ require('../../store/state/walletOptions/walletOptions.cjs');
59
+ require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
60
+ require('../../components/Alert/Alert.cjs');
61
+ var Typography = require('../../components/Typography/Typography.cjs');
62
+ require('../../components/ShadowDOM/ShadowDOM.cjs');
63
+ var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
64
+ require('../../components/IconButton/IconButton.cjs');
65
+ require('../../components/InlineWidget/InlineWidget.cjs');
66
+ var Input = require('../../components/Input/Input.cjs');
67
+ require('../../components/IsBrowser/IsBrowser.cjs');
68
+ require('../../components/MenuList/Dropdown/Dropdown.cjs');
69
+ require('../../components/OverlayCard/OverlayCard.cjs');
70
+ require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
71
+ require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
72
+ require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
73
+ require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
74
+ require('../../components/Popper/Popper/Popper.cjs');
75
+ require('../../components/Popper/PopperContext/PopperContext.cjs');
76
+ require('react-focus-lock');
77
+ require('qrcode');
78
+ require('formik');
79
+ require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
80
+ require('../../context/WalletGroupContext/WalletGroupContext.cjs');
81
+ require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
82
+ require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
83
+ require('../../context/ConnectWithOtpContext/constants.cjs');
84
+ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
85
+ require('@hcaptcha/react-hcaptcha');
86
+ require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
87
+ require('../../context/FooterAnimationContext/index.cjs');
88
+ require('../../context/PasskeyContext/PasskeyContext.cjs');
89
+ require('../../store/state/sendBalances.cjs');
90
+ require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
91
+ require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
92
+ require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
93
+ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
94
+ require('../../context/OnrampContext/OnrampContext.cjs');
95
+ require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
96
+ require('../../../index.cjs');
97
+ require('../../store/state/tokenBalances.cjs');
98
+ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
99
+ var useDeleteUserAccount = require('../../utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs');
100
+
101
+ const UserDeleteAccountView = () => {
102
+ const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
103
+ const { t } = reactI18next.useTranslation();
104
+ const { deleteUser, isLoading, error } = useDeleteUserAccount.useDeleteUserAccount();
105
+ const [isBackupConfirmed, setIsBackupConfirmed] = React.useState(false);
106
+ const [confirmText, setConfirmText] = React.useState('');
107
+ const handleConfirmTextChange = React.useCallback((e) => {
108
+ setConfirmText(e.target.value);
109
+ }, []);
110
+ const handleBackupConfirmChange = React.useCallback((e) => {
111
+ setIsBackupConfirmed(e.target.checked);
112
+ }, []);
113
+ const handleCancel = React.useCallback(() => {
114
+ setShowAuthFlow(false);
115
+ }, [setShowAuthFlow]);
116
+ const handleDelete = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
117
+ if (!isBackupConfirmed)
118
+ return;
119
+ yield deleteUser();
120
+ }), [deleteUser, isBackupConfirmed]);
121
+ const isDeleteEnabled = React.useMemo(() => isBackupConfirmed && confirmText === 'DELETE' && !isLoading, [isBackupConfirmed, confirmText, isLoading]);
122
+ return (jsxRuntime.jsx("div", { className: 'delete-account-view', children: jsxRuntime.jsxs("div", { className: 'delete-account-view__content', children: [jsxRuntime.jsx("div", { className: 'warning-section', children: jsxRuntime.jsxs("div", { className: 'warning-icon-container', children: [jsxRuntime.jsx(warningRed.ReactComponent, { className: 'warning-icon' }), jsxRuntime.jsx(exclamation.ReactComponent, { className: 'exclamation-icon' })] }) }), jsxRuntime.jsx("div", { className: 'message-box', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', children: t('dyn_settings.delete_account.description') }) }), jsxRuntime.jsxs("div", { className: 'confirmation-section', children: [jsxRuntime.jsxs("div", { className: 'checkbox-container', children: [jsxRuntime.jsx("input", { type: 'checkbox', checked: isBackupConfirmed, onChange: handleBackupConfirmChange }), jsxRuntime.jsx(Typography.Typography, { className: 'checkbox-text', variant: 'body_small', children: t('dyn_settings.delete_account.backup_confirmation') })] }), jsxRuntime.jsxs("div", { className: 'input-section', children: [jsxRuntime.jsx(Typography.Typography, { className: 'input-label', variant: 'body_small', children: t('dyn_settings.delete_account.type_delete') }), jsxRuntime.jsx(Input.Input, { id: 'delete-confirmation', label: t('dyn_settings.delete_account.type_delete_label'), value: confirmText, onChange: handleConfirmTextChange, placeholder: 'DELETE', variant: 'dense' })] }), error && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'error-1', children: error.message }))] }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'button', onClick: handleCancel, copykey: 'dyn_settings.delete_account.cancel', children: t('dyn_settings.delete_account.cancel') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'delete-button', buttonVariant: 'primary', type: 'submit', onClick: handleDelete, disabled: !isDeleteEnabled, typographyProps: {
123
+ color: isDeleteEnabled ? 'white' : 'tertiary',
124
+ }, copykey: 'dyn_settings.delete_account.confirm', children: isLoading
125
+ ? t('dyn_settings.delete_account.deleting')
126
+ : t('dyn_settings.delete_account.confirm') })] })] }) }));
127
+ };
128
+
129
+ exports.UserDeleteAccountView = UserDeleteAccountView;
130
+ exports["default"] = UserDeleteAccountView;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const UserDeleteAccountView: React.FC;
3
+ export default UserDeleteAccountView;