@dynamic-labs/sdk-react-core 4.47.2 → 4.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +6 -5
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +6 -5
- package/src/lib/components/EmbeddedWalletExport/EmbeddedWalletExport.js +1 -1
- package/src/lib/components/index.d.ts +1 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +1 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +13 -9
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +2 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +13 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +9 -1
- package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +9 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +1 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +59 -58
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +60 -59
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +1 -1
- package/src/lib/views/ExportSharesView/ExportSharesView.cjs +206 -0
- package/src/lib/views/ExportSharesView/ExportSharesView.d.ts +5 -0
- package/src/lib/views/ExportSharesView/ExportSharesView.js +202 -0
- package/src/lib/views/ExportSharesView/index.d.ts +2 -0
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +8 -6
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +8 -6
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.cjs +1 -1
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.js +1 -1
- package/src/lib/views/viewToComponentMap.cjs +5 -3
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +5 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +4 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.cjs +16 -7
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.js +16 -7
- package/src/lib/widgets/DynamicWidget/views/ExportAndRecoveryView/ExportAndRecoveryView.cjs +183 -0
- package/src/lib/widgets/DynamicWidget/views/ExportAndRecoveryView/ExportAndRecoveryView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ExportAndRecoveryView/ExportAndRecoveryView.js +179 -0
- package/src/lib/widgets/DynamicWidget/views/ExportAndRecoveryView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ExportSharesPasscodeView/ExportSharesPasscodeView.cjs +146 -0
- package/src/lib/widgets/DynamicWidget/views/ExportSharesPasscodeView/ExportSharesPasscodeView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ExportSharesPasscodeView/ExportSharesPasscodeView.js +142 -0
- package/src/lib/widgets/DynamicWidget/views/ExportSharesPasscodeView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.cjs +10 -5
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.js +10 -5
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var AccessBlockedView = require('./AccessBlockedView/AccessBlockedView.cjs');
|
|
8
8
|
var AccountExistsView = require('./AccountExistsView/AccountExistsView.cjs');
|
|
9
|
+
var AccountUpgradedView = require('./AccountUpgradedView/AccountUpgradedView.cjs');
|
|
9
10
|
var BackupUnsuccessfulView = require('./BackupUnsuccessfulView/BackupUnsuccessfulView.cjs');
|
|
10
11
|
var BridgeNextWalletConnectionView = require('./BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs');
|
|
11
12
|
var BridgeSummaryView = require('./BridgeSummaryView/BridgeSummaryView.cjs');
|
|
@@ -21,6 +22,7 @@ var EmbeddedDeleteView = require('./EmbeddedDeleteView/EmbeddedDeleteView.cjs');
|
|
|
21
22
|
var EmbeddedRevealView = require('./EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs');
|
|
22
23
|
var ExchangeList = require('./ExchangeList/ExchangeList.cjs');
|
|
23
24
|
var ExchangeWhitelistWarning = require('./ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
25
|
+
var ExportSharesView = require('./ExportSharesView/ExportSharesView.cjs');
|
|
24
26
|
var FarcasterConnectView = require('./FarcasterConnectView/FarcasterConnectView.cjs');
|
|
25
27
|
var GlobalWalletConfirmView = require('./GlobalWalletConfirmView/GlobalWalletConfirmView.cjs');
|
|
26
28
|
var GlobalWalletInfoView = require('./GlobalWalletInfoView/GlobalWalletInfoView.cjs');
|
|
@@ -133,8 +135,8 @@ require('../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cj
|
|
|
133
135
|
var PendingSignatureView = require('./PendingSignatureView/PendingSignatureView.cjs');
|
|
134
136
|
var QrCodeView = require('./QrCodeView/QrCodeView.cjs');
|
|
135
137
|
var WalletList = require('./WalletList/WalletList.cjs');
|
|
136
|
-
var SetupPasskeyView = require('./Passkey/SetupPasskeyView/SetupPasskeyView.cjs');
|
|
137
138
|
var ConfirmPasskeyView = require('./Passkey/ConfirmPasskeyView/ConfirmPasskeyView.cjs');
|
|
139
|
+
var SetupPasskeyView = require('./Passkey/SetupPasskeyView/SetupPasskeyView.cjs');
|
|
138
140
|
var PendingConnectView = require('./PendingConnectView/PendingConnectView.cjs');
|
|
139
141
|
var SandboxMaximumThresholdReached = require('./SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs');
|
|
140
142
|
var SelectHardwareWalletView = require('./SelectHardwareWalletView/SelectHardwareWalletView.cjs');
|
|
@@ -144,6 +146,7 @@ var SocialRedirectView = require('./SocialRedirectView/SocialRedirectView.cjs');
|
|
|
144
146
|
var SocialWrongAccountView = require('./SocialWrongAccountView/SocialWrongAccountView.cjs');
|
|
145
147
|
var UnifiedList = require('./UnifiedList/UnifiedList.cjs');
|
|
146
148
|
var UserDeleteAccountView = require('./UserDeleteAccountView/UserDeleteAccountView.cjs');
|
|
149
|
+
var WaasUpgradeView = require('./WaasUpgradeView/WaasUpgradeView.cjs');
|
|
147
150
|
var WalletAlreadyExistsView = require('./WalletAlreadyExistsView/WalletAlreadyExistsView.cjs');
|
|
148
151
|
var WalletCannotBeTransferredView = require('./WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs');
|
|
149
152
|
var WalletGroupView = require('./WalletGroupView/WalletGroupView.cjs');
|
|
@@ -153,8 +156,6 @@ var WalletRedirectView = require('./WalletRedirectView/WalletRedirectView.cjs');
|
|
|
153
156
|
var WalletSignSpinnerView = require('./WalletSignSpinnerView/WalletSignSpinnerView.cjs');
|
|
154
157
|
var WalletUpgradeFlowView = require('./WalletUpgradeFlowView/WalletUpgradeFlowView.cjs');
|
|
155
158
|
var WalletUsedView = require('./WalletUsedView/WalletUsedView.cjs');
|
|
156
|
-
var WaasUpgradeView = require('./WaasUpgradeView/WaasUpgradeView.cjs');
|
|
157
|
-
var AccountUpgradedView = require('./AccountUpgradedView/AccountUpgradedView.cjs');
|
|
158
159
|
require('../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
159
160
|
require('../store/state/tokenBalances.cjs');
|
|
160
161
|
require('../store/state/multichainBalances.cjs');
|
|
@@ -185,6 +186,7 @@ const viewToComponentMap = {
|
|
|
185
186
|
'embedded-wallet-auth-choice': EmbeddedAuthChoice.EmbeddedAuthChoice,
|
|
186
187
|
'embedded-wallet-exists': WalletAlreadyExistsView.WalletAlreadyExistsView,
|
|
187
188
|
'exchange-whitelist-warning': ExchangeWhitelistWarning.ExchangeWhitelistWarning,
|
|
189
|
+
'export-shares-view': ExportSharesView.ExportSharesView,
|
|
188
190
|
'external-funding-exchange-list': ExchangeList.ExchangeList,
|
|
189
191
|
'external-funding-wallet-list': WalletList.WalletList,
|
|
190
192
|
'farcaster-connect-view': FarcasterConnectView.FarcasterConnectView,
|
|
@@ -26,6 +26,7 @@ export declare const viewToComponentMap: {
|
|
|
26
26
|
onContinue: () => void;
|
|
27
27
|
onClose: () => void;
|
|
28
28
|
}>;
|
|
29
|
+
'export-shares-view': import("react").FC<import("./ExportSharesView").ExportSharesViewProps>;
|
|
29
30
|
'external-funding-exchange-list': ({ onSelectExchange, showDefaultFooter, scrollContainerClassName, }: import("./ExchangeList").ExchangeListProps) => JSX.Element;
|
|
30
31
|
'external-funding-wallet-list': ({ isWalletConnectList, onSelectWallet, viewWalletsFilter, showDefaultFooter, scrollContainerClassName, }: import("./WalletList").WalletListProps) => JSX.Element;
|
|
31
32
|
'farcaster-connect-view': ({ url }: import("./FarcasterConnectView/FarcasterConnectView").FarcasterConnectViewProps) => JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { AccessBlockedView } from './AccessBlockedView/AccessBlockedView.js';
|
|
4
4
|
import { AccountExistsView } from './AccountExistsView/AccountExistsView.js';
|
|
5
|
+
import { AccountUpgradedView } from './AccountUpgradedView/AccountUpgradedView.js';
|
|
5
6
|
import { BackupUnsuccessfulView } from './BackupUnsuccessfulView/BackupUnsuccessfulView.js';
|
|
6
7
|
import { BridgeNextWalletConnectionView } from './BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js';
|
|
7
8
|
import { BridgeSummaryView } from './BridgeSummaryView/BridgeSummaryView.js';
|
|
@@ -17,6 +18,7 @@ import { EmbeddedDeleteView } from './EmbeddedDeleteView/EmbeddedDeleteView.js';
|
|
|
17
18
|
import { EmbeddedRevealView } from './EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js';
|
|
18
19
|
import { ExchangeList } from './ExchangeList/ExchangeList.js';
|
|
19
20
|
import { ExchangeWhitelistWarning } from './ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
21
|
+
import { ExportSharesView } from './ExportSharesView/ExportSharesView.js';
|
|
20
22
|
import { FarcasterConnectView } from './FarcasterConnectView/FarcasterConnectView.js';
|
|
21
23
|
import { GlobalWalletConfirmView } from './GlobalWalletConfirmView/GlobalWalletConfirmView.js';
|
|
22
24
|
import { GlobalWalletInfoView } from './GlobalWalletInfoView/GlobalWalletInfoView.js';
|
|
@@ -129,8 +131,8 @@ import '../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js'
|
|
|
129
131
|
import { PendingSignatureView } from './PendingSignatureView/PendingSignatureView.js';
|
|
130
132
|
import { QrCodeView } from './QrCodeView/QrCodeView.js';
|
|
131
133
|
import { WalletList } from './WalletList/WalletList.js';
|
|
132
|
-
import { SetupPasskeyView } from './Passkey/SetupPasskeyView/SetupPasskeyView.js';
|
|
133
134
|
import { ConfirmPasskeyView } from './Passkey/ConfirmPasskeyView/ConfirmPasskeyView.js';
|
|
135
|
+
import { SetupPasskeyView } from './Passkey/SetupPasskeyView/SetupPasskeyView.js';
|
|
134
136
|
import { PendingConnectView } from './PendingConnectView/PendingConnectView.js';
|
|
135
137
|
import { SandboxMaximumThresholdReached } from './SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js';
|
|
136
138
|
import { SelectHardwareWalletView } from './SelectHardwareWalletView/SelectHardwareWalletView.js';
|
|
@@ -140,6 +142,7 @@ import { SocialRedirectView } from './SocialRedirectView/SocialRedirectView.js';
|
|
|
140
142
|
import { SocialWrongAccountView } from './SocialWrongAccountView/SocialWrongAccountView.js';
|
|
141
143
|
import { UnifiedList } from './UnifiedList/UnifiedList.js';
|
|
142
144
|
import { UserDeleteAccountView } from './UserDeleteAccountView/UserDeleteAccountView.js';
|
|
145
|
+
import { WaasUpgradeView } from './WaasUpgradeView/WaasUpgradeView.js';
|
|
143
146
|
import { WalletAlreadyExistsView } from './WalletAlreadyExistsView/WalletAlreadyExistsView.js';
|
|
144
147
|
import { WalletCannotBeTransferredView } from './WalletCannotBeTransferredView/WalletCannotBeTransferredView.js';
|
|
145
148
|
import { WalletGroupView } from './WalletGroupView/WalletGroupView.js';
|
|
@@ -149,8 +152,6 @@ import { WalletRedirectView } from './WalletRedirectView/WalletRedirectView.js';
|
|
|
149
152
|
import { WalletSignSpinnerView } from './WalletSignSpinnerView/WalletSignSpinnerView.js';
|
|
150
153
|
import { WalletUpgradeFlowView } from './WalletUpgradeFlowView/WalletUpgradeFlowView.js';
|
|
151
154
|
import { WalletUsedView } from './WalletUsedView/WalletUsedView.js';
|
|
152
|
-
import { WaasUpgradeView } from './WaasUpgradeView/WaasUpgradeView.js';
|
|
153
|
-
import { AccountUpgradedView } from './AccountUpgradedView/AccountUpgradedView.js';
|
|
154
155
|
import '../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
155
156
|
import '../store/state/tokenBalances.js';
|
|
156
157
|
import '../store/state/multichainBalances.js';
|
|
@@ -181,6 +182,7 @@ const viewToComponentMap = {
|
|
|
181
182
|
'embedded-wallet-auth-choice': EmbeddedAuthChoice,
|
|
182
183
|
'embedded-wallet-exists': WalletAlreadyExistsView,
|
|
183
184
|
'exchange-whitelist-warning': ExchangeWhitelistWarning,
|
|
185
|
+
'export-shares-view': ExportSharesView,
|
|
184
186
|
'external-funding-exchange-list': ExchangeList,
|
|
185
187
|
'external-funding-wallet-list': WalletList,
|
|
186
188
|
'farcaster-connect-view': FarcasterConnectView,
|
|
@@ -23,6 +23,8 @@ var ConfirmExchangeTransferView = require('../../views/ConfirmExchangeTransferVi
|
|
|
23
23
|
var ConnectedAppsView = require('../../views/ConnectedAppsView/ConnectedAppsView.cjs');
|
|
24
24
|
var DepositedExchangeView = require('../../views/DepositedExchangeView/DepositedExchangeView.cjs');
|
|
25
25
|
var DepositView = require('../../views/DepositView/DepositView.cjs');
|
|
26
|
+
var ExportAndRecoveryView = require('../../views/ExportAndRecoveryView/ExportAndRecoveryView.cjs');
|
|
27
|
+
var ExportSharesPasscodeView = require('../../views/ExportSharesPasscodeView/ExportSharesPasscodeView.cjs');
|
|
26
28
|
var GlobalWalletView = require('../../views/GlobalWalletView/GlobalWalletView.cjs');
|
|
27
29
|
var ManagePasskeysMfaWidgetView = require('../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.cjs');
|
|
28
30
|
var ManageTotpMfaWidgetView = require('../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs');
|
|
@@ -41,6 +43,8 @@ const mapViewToComponent = {
|
|
|
41
43
|
'deposit-view': DepositView.DepositView,
|
|
42
44
|
'deposited-exchange': DepositedExchangeView.DepositedExchangeView,
|
|
43
45
|
'edit-profile': EditProfileView.EditProfileView,
|
|
46
|
+
'export-and-recovery': ExportAndRecoveryView.ExportAndRecoveryView,
|
|
47
|
+
'export-shares-passcode': ExportSharesPasscodeView.ExportSharesPasscodeView,
|
|
44
48
|
'global-wallet': GlobalWalletView.GlobalWalletView,
|
|
45
49
|
'manage-passkeys': ManagePasskeysWidgetView.ManagePasskeysWidgetView,
|
|
46
50
|
'manage-passkeys-mfa': ManagePasskeysMfaWidgetView.ManagePasskeysMfaWidgetView,
|
|
@@ -20,6 +20,8 @@ export declare const mapViewToComponent: {
|
|
|
20
20
|
toAddress: string;
|
|
21
21
|
}>;
|
|
22
22
|
'edit-profile': import("react").FC<import("../../views/EditProfileView/EditProfileView").EditProfileViewProps>;
|
|
23
|
+
'export-and-recovery': import("react").FC;
|
|
24
|
+
'export-shares-passcode': import("react").FC;
|
|
23
25
|
'global-wallet': import("react").FC<{}>;
|
|
24
26
|
'manage-passkeys': import("react").FC;
|
|
25
27
|
'manage-passkeys-mfa': import("react").FC;
|
|
@@ -19,6 +19,8 @@ import { ConfirmExchangeTransferView } from '../../views/ConfirmExchangeTransfer
|
|
|
19
19
|
import { ConnectedAppsView } from '../../views/ConnectedAppsView/ConnectedAppsView.js';
|
|
20
20
|
import { DepositedExchangeView } from '../../views/DepositedExchangeView/DepositedExchangeView.js';
|
|
21
21
|
import { DepositView } from '../../views/DepositView/DepositView.js';
|
|
22
|
+
import { ExportAndRecoveryView } from '../../views/ExportAndRecoveryView/ExportAndRecoveryView.js';
|
|
23
|
+
import { ExportSharesPasscodeView } from '../../views/ExportSharesPasscodeView/ExportSharesPasscodeView.js';
|
|
22
24
|
import { GlobalWalletView } from '../../views/GlobalWalletView/GlobalWalletView.js';
|
|
23
25
|
import { ManagePasskeysMfaWidgetView } from '../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.js';
|
|
24
26
|
import { ManageTotpMfaWidgetView } from '../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js';
|
|
@@ -37,6 +39,8 @@ const mapViewToComponent = {
|
|
|
37
39
|
'deposit-view': DepositView,
|
|
38
40
|
'deposited-exchange': DepositedExchangeView,
|
|
39
41
|
'edit-profile': EditProfileView,
|
|
42
|
+
'export-and-recovery': ExportAndRecoveryView,
|
|
43
|
+
'export-shares-passcode': ExportSharesPasscodeView,
|
|
40
44
|
'global-wallet': GlobalWalletView,
|
|
41
45
|
'manage-passkeys': ManagePasskeysWidgetView,
|
|
42
46
|
'manage-passkeys-mfa': ManagePasskeysMfaWidgetView,
|
|
@@ -13,7 +13,7 @@ export declare const DynamicSessionManagementViews: readonly ["session-managemen
|
|
|
13
13
|
export type DynamicSessionManagementViewsType = typeof DynamicSessionManagementViews[number];
|
|
14
14
|
export declare const DynamicTransactionsWidgetViews: readonly ["send-balance"];
|
|
15
15
|
export type DynamicTransactionsWidgetViewsType = typeof DynamicTransactionsWidgetViews[number];
|
|
16
|
-
export type DynamicWidgetViews = 'wallets' | 'profile' | 'edit-profile' | 'choose-wallet-funding-method' | 'receive-wallet-funds' | 'deposited-exchange' | 'receive-exchange-funds' | 'crypto-com-onramp' | DynamicTransactionsWidgetViewsType | DynamicPasskeyWidgetViewsType | DynamicMfaWidgetViewsType | DynamicSettingsType | DynamicGlobalWalletType | DynamicSessionManagementViewsType | 'connected-apps' | 'deposit-view' | 'confirm-exchange-transfer' | 'choose-onramp-provider' | 'choose-linked-wallet' | 'waas-backup' | 'waas-backup-info' | 'wallet-delegation' | 'wallets-delegated-settings';
|
|
16
|
+
export type DynamicWidgetViews = 'wallets' | 'profile' | 'edit-profile' | 'choose-wallet-funding-method' | 'receive-wallet-funds' | 'deposited-exchange' | 'receive-exchange-funds' | 'crypto-com-onramp' | DynamicTransactionsWidgetViewsType | DynamicPasskeyWidgetViewsType | DynamicMfaWidgetViewsType | DynamicSettingsType | DynamicGlobalWalletType | DynamicSessionManagementViewsType | 'connected-apps' | 'deposit-view' | 'confirm-exchange-transfer' | 'choose-onramp-provider' | 'choose-linked-wallet' | 'waas-backup' | 'waas-backup-info' | 'wallet-delegation' | 'wallets-delegated-settings' | 'export-and-recovery' | 'export-shares-passcode';
|
|
17
17
|
export type DynamicWidgetViewMapConstraint = Record<DynamicWidgetViews, FC<any>>;
|
|
18
18
|
export type DynamicWidgetViewMap = typeof mapViewToComponent;
|
|
19
19
|
export type SetDynamicWidgetView = <T extends DynamicWidgetViews>(view: T, props?: ComponentProps<DynamicWidgetViewMap[T]>) => void;
|
|
@@ -130,6 +130,7 @@ const EmbeddedWalletExportSection = () => {
|
|
|
130
130
|
const isTurnkeyHDWallet = Boolean(turnkeyWalletProperties === null || turnkeyWalletProperties === void 0 ? void 0 : turnkeyWalletProperties.turnkeyHDWalletId);
|
|
131
131
|
const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
132
132
|
(eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
|
|
133
|
+
const isV3WaasWallet = Boolean(wallet && ((_h = (_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.key) === null || _h === void 0 ? void 0 : _h.startsWith('dynamicwaas')));
|
|
133
134
|
const handleExportClick = React.useCallback((recoveryPhrase) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
134
135
|
if (!isSessionKeyCompatible) {
|
|
135
136
|
if (yield shouldInitRecovery()) {
|
|
@@ -145,23 +146,31 @@ const EmbeddedWalletExportSection = () => {
|
|
|
145
146
|
initExportProcess,
|
|
146
147
|
isSessionKeyCompatible,
|
|
147
148
|
]);
|
|
148
|
-
const handleExportButtonClick = React.useCallback(() =>
|
|
149
|
+
const handleExportButtonClick = React.useCallback(() => {
|
|
150
|
+
if (isV3WaasWallet) {
|
|
151
|
+
setDynamicWidgetView('export-and-recovery');
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
handleExportClick();
|
|
155
|
+
}
|
|
156
|
+
}, [handleExportClick, isV3WaasWallet, setDynamicWidgetView]);
|
|
149
157
|
const handleExportWithPhraseClick = React.useCallback(() => handleExportClick(true), [handleExportClick]);
|
|
150
158
|
const exportIconClasses = React.useMemo(() => `settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}`, [theme.theme.name]);
|
|
151
|
-
const isV3WaasWallet = Boolean(wallet && ((_h = (_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.key) === null || _h === void 0 ? void 0 : _h.startsWith('dynamicwaas')));
|
|
152
159
|
const isGoogleDriveBackupEnabled = Boolean((_l = (_k = (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.waas) === null || _k === void 0 ? void 0 : _k.backupOptions) === null || _l === void 0 ? void 0 : _l.includes(sdkApiCore.WaasBackupOptionsEnum.GoogleDrive));
|
|
153
160
|
const shouldShowBackupOption = isV3WaasWallet && isGoogleDriveBackupEnabled;
|
|
154
161
|
const handleBackupClick = React.useCallback(() => {
|
|
155
162
|
setDynamicWidgetView('waas-backup');
|
|
156
163
|
}, [setDynamicWidgetView]);
|
|
164
|
+
const exportButtonStartSlot = React.useMemo(() => (jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: isV3WaasWallet
|
|
165
|
+
? 'dyn_settings.export_section.export_button'
|
|
166
|
+
: 'dyn_settings.export_section.private_key_button', children: isV3WaasWallet
|
|
167
|
+
? t('dyn_settings.export_section.export_button', 'Export')
|
|
168
|
+
: t('dyn_settings.export_section.private_key_button') })] })), [exportIconClasses, isV3WaasWallet, t]);
|
|
169
|
+
const recoveryPhraseButtonStartSlot = React.useMemo(() => (jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] })), [exportIconClasses, t]);
|
|
157
170
|
if (!isEmbeddedWallet) {
|
|
158
171
|
return null;
|
|
159
172
|
}
|
|
160
|
-
return (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.export_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.export_section.title') }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-account-button', onClick: handleExportButtonClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
161
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
162
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
163
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
164
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })), shouldShowBackupOption && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'backup-button', onClick: handleBackupClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
173
|
+
return (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.export_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.export_section.title') }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-account-button', onClick: handleExportButtonClick, buttonClassName: 'settings-view__body__section__button', startSlot: exportButtonStartSlot, endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && !isV3WaasWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot: recoveryPhraseButtonStartSlot, endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })), shouldShowBackupOption && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'backup-button', onClick: handleBackupClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
165
174
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
166
175
|
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(backupArrow.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.backup_button', children: t('dyn_settings.export_section.backup_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }));
|
|
167
176
|
};
|
|
@@ -126,6 +126,7 @@ const EmbeddedWalletExportSection = () => {
|
|
|
126
126
|
const isTurnkeyHDWallet = Boolean(turnkeyWalletProperties === null || turnkeyWalletProperties === void 0 ? void 0 : turnkeyWalletProperties.turnkeyHDWalletId);
|
|
127
127
|
const isSessionKeyCompatible = (primaryWallet && isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
128
128
|
(eoaWallet && isSessionKeyCompatibleWallet(eoaWallet));
|
|
129
|
+
const isV3WaasWallet = Boolean(wallet && ((_h = (_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.key) === null || _h === void 0 ? void 0 : _h.startsWith('dynamicwaas')));
|
|
129
130
|
const handleExportClick = useCallback((recoveryPhrase) => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
131
|
if (!isSessionKeyCompatible) {
|
|
131
132
|
if (yield shouldInitRecovery()) {
|
|
@@ -141,23 +142,31 @@ const EmbeddedWalletExportSection = () => {
|
|
|
141
142
|
initExportProcess,
|
|
142
143
|
isSessionKeyCompatible,
|
|
143
144
|
]);
|
|
144
|
-
const handleExportButtonClick = useCallback(() =>
|
|
145
|
+
const handleExportButtonClick = useCallback(() => {
|
|
146
|
+
if (isV3WaasWallet) {
|
|
147
|
+
setDynamicWidgetView('export-and-recovery');
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
handleExportClick();
|
|
151
|
+
}
|
|
152
|
+
}, [handleExportClick, isV3WaasWallet, setDynamicWidgetView]);
|
|
145
153
|
const handleExportWithPhraseClick = useCallback(() => handleExportClick(true), [handleExportClick]);
|
|
146
154
|
const exportIconClasses = useMemo(() => `settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}`, [theme.theme.name]);
|
|
147
|
-
const isV3WaasWallet = Boolean(wallet && ((_h = (_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.key) === null || _h === void 0 ? void 0 : _h.startsWith('dynamicwaas')));
|
|
148
155
|
const isGoogleDriveBackupEnabled = Boolean((_l = (_k = (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.waas) === null || _k === void 0 ? void 0 : _k.backupOptions) === null || _l === void 0 ? void 0 : _l.includes(WaasBackupOptionsEnum.GoogleDrive));
|
|
149
156
|
const shouldShowBackupOption = isV3WaasWallet && isGoogleDriveBackupEnabled;
|
|
150
157
|
const handleBackupClick = useCallback(() => {
|
|
151
158
|
setDynamicWidgetView('waas-backup');
|
|
152
159
|
}, [setDynamicWidgetView]);
|
|
160
|
+
const exportButtonStartSlot = useMemo(() => (jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportPrivateKey, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: isV3WaasWallet
|
|
161
|
+
? 'dyn_settings.export_section.export_button'
|
|
162
|
+
: 'dyn_settings.export_section.private_key_button', children: isV3WaasWallet
|
|
163
|
+
? t('dyn_settings.export_section.export_button', 'Export')
|
|
164
|
+
: t('dyn_settings.export_section.private_key_button') })] })), [exportIconClasses, isV3WaasWallet, t]);
|
|
165
|
+
const recoveryPhraseButtonStartSlot = useMemo(() => (jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] })), [exportIconClasses, t]);
|
|
153
166
|
if (!isEmbeddedWallet) {
|
|
154
167
|
return null;
|
|
155
168
|
}
|
|
156
|
-
return (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: jsx(Typography, { copykey: 'dyn_settings.export_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.export_section.title') }) }), jsx(TypographyButton, { dataTestId: 'embedded-reveal-account-button', onClick: handleExportButtonClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
157
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
158
|
-
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportPrivateKey, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsx(TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
159
|
-
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
160
|
-
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })), shouldShowBackupOption && (jsx(TypographyButton, { dataTestId: 'backup-button', onClick: handleBackupClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
169
|
+
return (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: jsx(Typography, { copykey: 'dyn_settings.export_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.export_section.title') }) }), jsx(TypographyButton, { dataTestId: 'embedded-reveal-account-button', onClick: handleExportButtonClick, buttonClassName: 'settings-view__body__section__button', startSlot: exportButtonStartSlot, endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && !isV3WaasWallet && (jsx(TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot: recoveryPhraseButtonStartSlot, endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })), shouldShowBackupOption && (jsx(TypographyButton, { dataTestId: 'backup-button', onClick: handleBackupClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
161
170
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
162
171
|
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgBackupArrow, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.backup_button', children: t('dyn_settings.export_section.backup_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }));
|
|
163
172
|
};
|
|
@@ -0,0 +1,183 @@
|
|
|
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
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('@dynamic-labs-sdk/client/core');
|
|
12
|
+
require('@dynamic-labs/sdk-api-core');
|
|
13
|
+
require('../../../../client/client.cjs');
|
|
14
|
+
require('@dynamic-labs-sdk/client');
|
|
15
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
16
|
+
require('@dynamic-labs/iconic');
|
|
17
|
+
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
18
|
+
var exportPrivateKey = require('../../../../shared/assets/export-private-key.cjs');
|
|
19
|
+
var exportRecoveryPhrase = require('../../../../shared/assets/export-recovery-phrase.cjs');
|
|
20
|
+
var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
|
|
21
|
+
require('../../../../shared/logger.cjs');
|
|
22
|
+
require('@dynamic-labs/wallet-book');
|
|
23
|
+
require('@dynamic-labs/utils');
|
|
24
|
+
require('../../../../utils/constants/colors.cjs');
|
|
25
|
+
require('../../../../utils/constants/values.cjs');
|
|
26
|
+
require('../../../../shared/consts/index.cjs');
|
|
27
|
+
require('@dynamic-labs/multi-wallet');
|
|
28
|
+
require('react-international-phone');
|
|
29
|
+
require('../../../../store/state/nonce/nonce.cjs');
|
|
30
|
+
require('@dynamic-labs/locale');
|
|
31
|
+
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
32
|
+
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
33
|
+
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
34
|
+
require('../../../../events/dynamicEvents.cjs');
|
|
35
|
+
var useUser = require('../../../../client/extension/user/useUser/useUser.cjs');
|
|
36
|
+
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
37
|
+
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
38
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
39
|
+
var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
|
|
40
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
41
|
+
require('../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
42
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
43
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
44
|
+
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
45
|
+
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
46
|
+
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
47
|
+
require('../../../../store/state/authMode/authMode.cjs');
|
|
48
|
+
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
49
|
+
require('react-dom');
|
|
50
|
+
require('../../../../utils/functions/compareChains/compareChains.cjs');
|
|
51
|
+
require('../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
52
|
+
var ThemeContext = require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
53
|
+
var useSmartWallets = require('../../../../utils/hooks/useSmartWallets/useSmartWallets.cjs');
|
|
54
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
55
|
+
var usePasskeyRecovery = require('../../../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
56
|
+
require('bs58');
|
|
57
|
+
require('@dynamic-labs/types');
|
|
58
|
+
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
59
|
+
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
60
|
+
require('../../../../context/WalletContext/WalletContext.cjs');
|
|
61
|
+
require('../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
62
|
+
require('yup');
|
|
63
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
64
|
+
require('../../../../views/CollectUserDataView/useFields.cjs');
|
|
65
|
+
require('../../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
66
|
+
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
67
|
+
require('@dynamic-labs/rpc-providers');
|
|
68
|
+
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
69
|
+
require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
70
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
71
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
72
|
+
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
73
|
+
require('../../../../components/Input/Input.cjs');
|
|
74
|
+
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
75
|
+
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
76
|
+
require('../../../../components/OverlayCard/OverlayCard.cjs');
|
|
77
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
78
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
79
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
80
|
+
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
81
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
82
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
83
|
+
require('react-focus-lock');
|
|
84
|
+
require('qrcode');
|
|
85
|
+
require('formik');
|
|
86
|
+
require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
87
|
+
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
88
|
+
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
89
|
+
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
90
|
+
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
91
|
+
require('@hcaptcha/react-hcaptcha');
|
|
92
|
+
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
93
|
+
require('../../helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
94
|
+
require('../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
95
|
+
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
96
|
+
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
97
|
+
require('../../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
98
|
+
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
99
|
+
require('../../../../context/OnrampContext/OnrampContext.cjs');
|
|
100
|
+
require('../../../../store/state/sendBalances.cjs');
|
|
101
|
+
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
102
|
+
require('../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
103
|
+
require('../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
104
|
+
require('../../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
105
|
+
require('../../components/PasskeyCard/PasskeyCard.cjs');
|
|
106
|
+
var useEmbeddedReveal = require('../../../../utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs');
|
|
107
|
+
require('../CryptoComOnramp/CryptoComOnramp.cjs');
|
|
108
|
+
require('../../../../../index.cjs');
|
|
109
|
+
require('../ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
110
|
+
require('../../../../store/state/tokenBalances.cjs');
|
|
111
|
+
require('../../../../store/state/multichainBalances.cjs');
|
|
112
|
+
require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
113
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
114
|
+
|
|
115
|
+
const ExportAndRecoveryView = () => {
|
|
116
|
+
var _a, _b;
|
|
117
|
+
const { t } = reactI18next.useTranslation();
|
|
118
|
+
const { theme } = ThemeContext.useThemeContext();
|
|
119
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
120
|
+
const { primaryWallet, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
121
|
+
const { pushView } = ViewContext.useViewContext();
|
|
122
|
+
const user = useUser.useUser();
|
|
123
|
+
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
124
|
+
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
125
|
+
const { initExportProcess } = useEmbeddedReveal.useEmbeddedReveal();
|
|
126
|
+
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
127
|
+
const wallet = eoaWallet !== null && eoaWallet !== void 0 ? eoaWallet : primaryWallet;
|
|
128
|
+
const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
129
|
+
(eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
|
|
130
|
+
const isV3WaasWallet = Boolean(wallet && ((_b = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === null || _b === void 0 ? void 0 : _b.startsWith('dynamicwaas')));
|
|
131
|
+
const walletCredential = React.useMemo(() => {
|
|
132
|
+
var _a;
|
|
133
|
+
if (!user || !primaryWallet)
|
|
134
|
+
return undefined;
|
|
135
|
+
return (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((cred) => cred.walletName === 'dynamicwaas' &&
|
|
136
|
+
cred.address === primaryWallet.address);
|
|
137
|
+
}, [user, primaryWallet]);
|
|
138
|
+
const isPasswordEncrypted = React.useMemo(() => {
|
|
139
|
+
var _a;
|
|
140
|
+
const keyShares = (_a = walletCredential === null || walletCredential === void 0 ? void 0 : walletCredential.walletProperties) === null || _a === void 0 ? void 0 : _a.keyShares;
|
|
141
|
+
if (!keyShares || !Array.isArray(keyShares))
|
|
142
|
+
return false;
|
|
143
|
+
return keyShares.some((keyShare) => keyShare &&
|
|
144
|
+
typeof keyShare === 'object' &&
|
|
145
|
+
'passwordEncrypted' in keyShare &&
|
|
146
|
+
keyShare.passwordEncrypted === true);
|
|
147
|
+
}, [walletCredential]);
|
|
148
|
+
const handleBackClick = React.useCallback(() => setDynamicWidgetView('account-and-security-settings'), [setDynamicWidgetView]);
|
|
149
|
+
const handlePrivateKeyClick = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
150
|
+
if (!isSessionKeyCompatible) {
|
|
151
|
+
if (yield shouldInitRecovery()) {
|
|
152
|
+
yield initPasskeyRecoveryProcess(undefined, {
|
|
153
|
+
type: 'reveal',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return initExportProcess();
|
|
158
|
+
}), [
|
|
159
|
+
isSessionKeyCompatible,
|
|
160
|
+
shouldInitRecovery,
|
|
161
|
+
initPasskeyRecoveryProcess,
|
|
162
|
+
initExportProcess,
|
|
163
|
+
]);
|
|
164
|
+
const handleExportSharesClick = React.useCallback(() => {
|
|
165
|
+
setShowAuthFlow(true, {
|
|
166
|
+
ignoreIfIsEmbeddedWidget: false,
|
|
167
|
+
performMultiWalletChecks: false,
|
|
168
|
+
});
|
|
169
|
+
if (isPasswordEncrypted) {
|
|
170
|
+
setDynamicWidgetView('export-shares-passcode');
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
pushView('export-shares-view');
|
|
174
|
+
}
|
|
175
|
+
}, [isPasswordEncrypted, setDynamicWidgetView, setShowAuthFlow, pushView]);
|
|
176
|
+
const exportIconClasses = React.useMemo(() => `settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}`, [theme.theme.name]);
|
|
177
|
+
const privateKeyButtonStartSlot = React.useMemo(() => (jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_export_and_recovery.private_key', children: t('dyn_export_and_recovery.private_key') })] })), [exportIconClasses, t]);
|
|
178
|
+
const exportSharesButtonStartSlot = React.useMemo(() => (jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsxs("div", { className: 'export-and-recovery-view__export-shares-label', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_export_and_recovery.export_shares', children: t('dyn_export_and_recovery.export_shares') }), jsxRuntime.jsx("span", { className: 'export-and-recovery-view__advanced-badge', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'inherit', weight: 'medium', copykey: 'dyn_export_and_recovery.advanced', children: t('dyn_export_and_recovery.advanced') }) })] })] })), [exportIconClasses, t]);
|
|
179
|
+
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
180
|
+
return (jsxRuntime.jsxs("div", { className: 'export-and-recovery-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_export_and_recovery.title', children: t('dyn_export_and_recovery.title') }) }) }), jsxRuntime.jsx("div", { className: 'account-wrap', children: jsxRuntime.jsxs("div", { className: 'settings-view__body', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'private-key-button', onClick: handlePrivateKeyClick, buttonClassName: 'settings-view__body__section__button', startSlot: privateKeyButtonStartSlot, endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isV3WaasWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'export-shares-button', onClick: handleExportSharesClick, buttonClassName: 'settings-view__body__section__button', startSlot: exportSharesButtonStartSlot, endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }) })] }));
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
exports.ExportAndRecoveryView = ExportAndRecoveryView;
|