@dynamic-labs/sdk-react-core 4.53.0 → 4.53.1
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 +2 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +12 -16
- package/src/lib/components/NeedHelpSection/NeedHelpSection.d.ts +3 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +12 -16
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +9 -3
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +9 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +7 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +8 -2
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +4 -2
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +4 -2
package/CHANGELOG.md
CHANGED
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.53.
|
|
3
|
+
"version": "4.53.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.843",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.2",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.53.
|
|
19
|
-
"@dynamic-labs/iconic": "4.53.
|
|
20
|
-
"@dynamic-labs/locale": "4.53.
|
|
21
|
-
"@dynamic-labs/logger": "4.53.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.53.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.53.
|
|
24
|
-
"@dynamic-labs/store": "4.53.
|
|
25
|
-
"@dynamic-labs/types": "4.53.
|
|
26
|
-
"@dynamic-labs/utils": "4.53.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.53.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.53.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.53.1",
|
|
19
|
+
"@dynamic-labs/iconic": "4.53.1",
|
|
20
|
+
"@dynamic-labs/locale": "4.53.1",
|
|
21
|
+
"@dynamic-labs/logger": "4.53.1",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.53.1",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.53.1",
|
|
24
|
+
"@dynamic-labs/store": "4.53.1",
|
|
25
|
+
"@dynamic-labs/types": "4.53.1",
|
|
26
|
+
"@dynamic-labs/utils": "4.53.1",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.53.1",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.53.1",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -6,12 +6,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
10
|
+
var TextButton = require('../TextButton/TextButton.cjs');
|
|
11
|
+
var Typography = require('../Typography/Typography.cjs');
|
|
12
|
+
var usePasskeyRecovery = require('../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
13
|
+
var SupportLinks = require('../SupportLinks/SupportLinks.cjs');
|
|
14
|
+
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
9
15
|
require('react');
|
|
10
16
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
11
17
|
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
12
18
|
require('@dynamic-labs/iconic');
|
|
13
19
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
|
-
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
15
20
|
require('../../shared/logger.cjs');
|
|
16
21
|
require('@dynamic-labs/wallet-book');
|
|
17
22
|
require('@dynamic-labs/utils');
|
|
@@ -44,7 +49,6 @@ require('../../utils/functions/compareChains/compareChains.cjs');
|
|
|
44
49
|
require('../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
45
50
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
46
51
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
47
|
-
var usePasskeyRecovery = require('../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
48
52
|
require('bs58');
|
|
49
53
|
require('@dynamic-labs/types');
|
|
50
54
|
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
@@ -58,11 +62,8 @@ require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
|
58
62
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
59
63
|
require('@dynamic-labs/rpc-providers');
|
|
60
64
|
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
61
|
-
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
62
65
|
require('../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
63
66
|
require('../Alert/Alert.cjs');
|
|
64
|
-
var Typography = require('../Typography/Typography.cjs');
|
|
65
|
-
var TextButton = require('../TextButton/TextButton.cjs');
|
|
66
67
|
require('../ShadowDOM/ShadowDOM.cjs');
|
|
67
68
|
require('../IconButton/IconButton.cjs');
|
|
68
69
|
require('../InlineWidget/InlineWidget.cjs');
|
|
@@ -73,7 +74,6 @@ require('../OverlayCard/OverlayCard.cjs');
|
|
|
73
74
|
require('../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
74
75
|
require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
75
76
|
require('../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
76
|
-
var SupportLinks = require('../SupportLinks/SupportLinks.cjs');
|
|
77
77
|
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
78
78
|
require('../Popper/Popper/Popper.cjs');
|
|
79
79
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
@@ -108,9 +108,9 @@ require('../../store/state/multichainBalances.cjs');
|
|
|
108
108
|
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
109
109
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
110
110
|
|
|
111
|
-
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
111
|
+
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, walletCredential, }) => {
|
|
112
112
|
var _a, _b, _c, _d, _e, _f;
|
|
113
|
-
const { projectSettings
|
|
113
|
+
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
114
114
|
const { t } = reactI18next.useTranslation();
|
|
115
115
|
const { pushView } = ViewContext.useViewContext();
|
|
116
116
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
@@ -120,15 +120,12 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
120
120
|
const isRecoveryEnabled = !isRecoveryFlow &&
|
|
121
121
|
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _c === void 0 ? void 0 : _c.find((p) => p.provider === sdkApiCore.ProviderEnum.Turnkey && p.enabledAt)) &&
|
|
122
122
|
Boolean((_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.embeddedWallets) === null || _e === void 0 ? void 0 : _e.emailRecoveryEnabled);
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
sdkApiCore.EmbeddedWalletVersionEnum.V3;
|
|
126
|
-
// revert to v2 wallet view (no passkey recovery) if passkey recovery is not enabled
|
|
127
|
-
const v1Wallet = !v3Wallet && !v2Wallet && isRecoveryEnabled;
|
|
123
|
+
const v1WalletWithRecovery = ((_f = walletCredential === null || walletCredential === void 0 ? void 0 : walletCredential.walletProperties) === null || _f === void 0 ? void 0 : _f.version) ===
|
|
124
|
+
sdkApiCore.EmbeddedWalletVersionEnum.V1 && isRecoveryEnabled;
|
|
128
125
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
129
126
|
const getSupportHelpSession = () => {
|
|
130
127
|
// For v1 wallets, only show the "Go here for support" link that triggers recovery
|
|
131
|
-
if (
|
|
128
|
+
if (v1WalletWithRecovery) {
|
|
132
129
|
return (jsxRuntime.jsx(TextButton.TextButton, { copykey: 'dyn_need_help_section.help_button', className: classNames.classNames('need-help-section__helper-link'), onClick: () => initPasskeyRecoveryProcess(undefined, {
|
|
133
130
|
settings: isExport
|
|
134
131
|
? {
|
|
@@ -140,14 +137,13 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
140
137
|
type: 'helpSession',
|
|
141
138
|
}), children: t('dyn_need_help_section.help_button') }));
|
|
142
139
|
}
|
|
143
|
-
// V2 Wallet or V1 Wallet without recovery
|
|
144
140
|
if (hasContactInfo) {
|
|
145
141
|
return (jsxRuntime.jsx(SupportLinks.SupportLinks, { supportEmail: supportEmail, supportUrls: supportUrls }));
|
|
146
142
|
}
|
|
147
143
|
return null;
|
|
148
144
|
};
|
|
149
145
|
// if there is no support info, don't render the component
|
|
150
|
-
return getSupportHelpSession() ? (jsxRuntime.jsxs("div", { className: 'need-help-section', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_need_help_section.info', children:
|
|
146
|
+
return getSupportHelpSession() ? (jsxRuntime.jsxs("div", { className: 'need-help-section', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_need_help_section.info', children: v1WalletWithRecovery
|
|
151
147
|
? t('dyn_need_help_section.info.v1')
|
|
152
148
|
: t('dyn_need_help_section.info.not_v1') }), getSupportHelpSession()] })) : null;
|
|
153
149
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
|
|
2
3
|
type Props = {
|
|
3
4
|
isRecoveryFlow?: boolean;
|
|
4
5
|
isExport?: boolean;
|
|
6
|
+
walletCredential?: JwtVerifiedCredential;
|
|
5
7
|
};
|
|
6
|
-
export declare const NeedHelpSection: ({ isRecoveryFlow, isExport, }: Props) => JSX.Element | null;
|
|
8
|
+
export declare const NeedHelpSection: ({ isRecoveryFlow, isExport, walletCredential, }: Props) => JSX.Element | null;
|
|
7
9
|
export {};
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { ProviderEnum, EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
6
|
+
import { TextButton } from '../TextButton/TextButton.js';
|
|
7
|
+
import { Typography } from '../Typography/Typography.js';
|
|
8
|
+
import { usePasskeyRecovery } from '../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
9
|
+
import { SupportLinks } from '../SupportLinks/SupportLinks.js';
|
|
10
|
+
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
5
11
|
import 'react';
|
|
6
12
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
7
13
|
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
8
14
|
import '@dynamic-labs/iconic';
|
|
9
15
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
|
-
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
11
16
|
import '../../shared/logger.js';
|
|
12
17
|
import '@dynamic-labs/wallet-book';
|
|
13
18
|
import '@dynamic-labs/utils';
|
|
@@ -40,7 +45,6 @@ import '../../utils/functions/compareChains/compareChains.js';
|
|
|
40
45
|
import '../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
41
46
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
42
47
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
43
|
-
import { usePasskeyRecovery } from '../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
44
48
|
import 'bs58';
|
|
45
49
|
import '@dynamic-labs/types';
|
|
46
50
|
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
@@ -54,11 +58,8 @@ import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
|
54
58
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
55
59
|
import '@dynamic-labs/rpc-providers';
|
|
56
60
|
import '../../store/state/walletOptions/walletOptions.js';
|
|
57
|
-
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
58
61
|
import '../Accordion/components/AccordionItem/AccordionItem.js';
|
|
59
62
|
import '../Alert/Alert.js';
|
|
60
|
-
import { Typography } from '../Typography/Typography.js';
|
|
61
|
-
import { TextButton } from '../TextButton/TextButton.js';
|
|
62
63
|
import '../ShadowDOM/ShadowDOM.js';
|
|
63
64
|
import '../IconButton/IconButton.js';
|
|
64
65
|
import '../InlineWidget/InlineWidget.js';
|
|
@@ -69,7 +70,6 @@ import '../OverlayCard/OverlayCard.js';
|
|
|
69
70
|
import '../Transition/ZoomTransition/ZoomTransition.js';
|
|
70
71
|
import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
71
72
|
import '../Transition/OpacityTransition/OpacityTransition.js';
|
|
72
|
-
import { SupportLinks } from '../SupportLinks/SupportLinks.js';
|
|
73
73
|
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
74
74
|
import '../Popper/Popper/Popper.js';
|
|
75
75
|
import '../Popper/PopperContext/PopperContext.js';
|
|
@@ -104,9 +104,9 @@ import '../../store/state/multichainBalances.js';
|
|
|
104
104
|
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
105
105
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
106
106
|
|
|
107
|
-
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
107
|
+
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, walletCredential, }) => {
|
|
108
108
|
var _a, _b, _c, _d, _e, _f;
|
|
109
|
-
const { projectSettings
|
|
109
|
+
const { projectSettings } = useInternalDynamicContext();
|
|
110
110
|
const { t } = useTranslation();
|
|
111
111
|
const { pushView } = useViewContext();
|
|
112
112
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
@@ -116,15 +116,12 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
116
116
|
const isRecoveryEnabled = !isRecoveryFlow &&
|
|
117
117
|
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _c === void 0 ? void 0 : _c.find((p) => p.provider === ProviderEnum.Turnkey && p.enabledAt)) &&
|
|
118
118
|
Boolean((_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.embeddedWallets) === null || _e === void 0 ? void 0 : _e.emailRecoveryEnabled);
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
EmbeddedWalletVersionEnum.V3;
|
|
122
|
-
// revert to v2 wallet view (no passkey recovery) if passkey recovery is not enabled
|
|
123
|
-
const v1Wallet = !v3Wallet && !v2Wallet && isRecoveryEnabled;
|
|
119
|
+
const v1WalletWithRecovery = ((_f = walletCredential === null || walletCredential === void 0 ? void 0 : walletCredential.walletProperties) === null || _f === void 0 ? void 0 : _f.version) ===
|
|
120
|
+
EmbeddedWalletVersionEnum.V1 && isRecoveryEnabled;
|
|
124
121
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
125
122
|
const getSupportHelpSession = () => {
|
|
126
123
|
// For v1 wallets, only show the "Go here for support" link that triggers recovery
|
|
127
|
-
if (
|
|
124
|
+
if (v1WalletWithRecovery) {
|
|
128
125
|
return (jsx(TextButton, { copykey: 'dyn_need_help_section.help_button', className: classNames('need-help-section__helper-link'), onClick: () => initPasskeyRecoveryProcess(undefined, {
|
|
129
126
|
settings: isExport
|
|
130
127
|
? {
|
|
@@ -136,14 +133,13 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
136
133
|
type: 'helpSession',
|
|
137
134
|
}), children: t('dyn_need_help_section.help_button') }));
|
|
138
135
|
}
|
|
139
|
-
// V2 Wallet or V1 Wallet without recovery
|
|
140
136
|
if (hasContactInfo) {
|
|
141
137
|
return (jsx(SupportLinks, { supportEmail: supportEmail, supportUrls: supportUrls }));
|
|
142
138
|
}
|
|
143
139
|
return null;
|
|
144
140
|
};
|
|
145
141
|
// if there is no support info, don't render the component
|
|
146
|
-
return getSupportHelpSession() ? (jsxs("div", { className: 'need-help-section', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_need_help_section.info', children:
|
|
142
|
+
return getSupportHelpSession() ? (jsxs("div", { className: 'need-help-section', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_need_help_section.info', children: v1WalletWithRecovery
|
|
147
143
|
? t('dyn_need_help_section.info.v1')
|
|
148
144
|
: t('dyn_need_help_section.info.not_v1') }), getSupportHelpSession()] })) : null;
|
|
149
145
|
};
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
7
8
|
var reactI18next = require('react-i18next');
|
|
8
|
-
require('react');
|
|
9
9
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
10
10
|
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
11
11
|
require('@dynamic-labs/iconic');
|
|
@@ -125,10 +125,16 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
125
125
|
var _a;
|
|
126
126
|
const { t } = reactI18next.useTranslation();
|
|
127
127
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
128
|
-
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
128
|
+
const { setShowAuthFlow, user, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
129
129
|
const { pushView } = ViewContext.useViewContext();
|
|
130
130
|
const { userNeedsCrossDomainPasskey } = PasskeyContext.usePasskeyContext();
|
|
131
131
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
132
|
+
const walletCredential = React.useMemo(() => {
|
|
133
|
+
var _a;
|
|
134
|
+
if (!user || !primaryWallet)
|
|
135
|
+
return undefined;
|
|
136
|
+
return (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((cred) => cred.address === primaryWallet.address);
|
|
137
|
+
}, [user, primaryWallet]);
|
|
132
138
|
const { currency } = useFetchCurrency.useFetchCurrency(walletConnector);
|
|
133
139
|
const currencySymbol = utils.useCurrencySymbol(currentToken, currency === null || currency === void 0 ? void 0 : currency.symbol);
|
|
134
140
|
const { nativePrice } = sendBalances.useSendBalanceState();
|
|
@@ -144,7 +150,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
144
150
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
145
151
|
const gasFiatValue = fiatUtils.getGasFiatValue(currentToken, transaction, nativePrice);
|
|
146
152
|
const totalGasFiatValue = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
147
|
-
return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__banner', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsxRuntime.jsx(TransactionCard.TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsxRuntime.jsx(SendBalanceTransactionCard.SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = utils.getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: alert && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), displayPoweredByDynamicFooter && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-confirmation__divider' }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
|
|
153
|
+
return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__banner', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsxRuntime.jsx(TransactionCard.TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsxRuntime.jsx(SendBalanceTransactionCard.SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = utils.getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: alert && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-confirmation__divider' }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
|
|
148
154
|
};
|
|
149
155
|
|
|
150
156
|
exports.TransactionConfirmationPageLayout = TransactionConfirmationPageLayout;
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import 'react';
|
|
5
5
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
6
6
|
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
7
7
|
import '@dynamic-labs/iconic';
|
|
@@ -121,10 +121,16 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
121
121
|
var _a;
|
|
122
122
|
const { t } = useTranslation();
|
|
123
123
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
124
|
-
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
124
|
+
const { setShowAuthFlow, user, primaryWallet } = useInternalDynamicContext();
|
|
125
125
|
const { pushView } = useViewContext();
|
|
126
126
|
const { userNeedsCrossDomainPasskey } = usePasskeyContext();
|
|
127
127
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery();
|
|
128
|
+
const walletCredential = useMemo(() => {
|
|
129
|
+
var _a;
|
|
130
|
+
if (!user || !primaryWallet)
|
|
131
|
+
return undefined;
|
|
132
|
+
return (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((cred) => cred.address === primaryWallet.address);
|
|
133
|
+
}, [user, primaryWallet]);
|
|
128
134
|
const { currency } = useFetchCurrency(walletConnector);
|
|
129
135
|
const currencySymbol = useCurrencySymbol(currentToken, currency === null || currency === void 0 ? void 0 : currency.symbol);
|
|
130
136
|
const { nativePrice } = useSendBalanceState();
|
|
@@ -140,7 +146,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
140
146
|
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
141
147
|
const gasFiatValue = getGasFiatValue(currentToken, transaction, nativePrice);
|
|
142
148
|
const totalGasFiatValue = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
143
|
-
return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsx("div", { className: 'transaction-confirmation__banner', children: jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'transaction-confirmation__body', children: [jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsx("div", { className: 'transaction-confirmation__error', children: jsx(ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsx(TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsx(SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: alert && (jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsx(NeedHelpSection, {}), displayPoweredByDynamicFooter && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-confirmation__divider' }), jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
|
|
149
|
+
return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsx("div", { className: 'transaction-confirmation__banner', children: jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'transaction-confirmation__body', children: [jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsx("div", { className: 'transaction-confirmation__error', children: jsx(ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsx(TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsx(SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: alert && (jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsx(NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-confirmation__divider' }), jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
|
|
144
150
|
};
|
|
145
151
|
|
|
146
152
|
export { TransactionConfirmationPageLayout };
|
|
@@ -138,6 +138,12 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
|
|
|
138
138
|
const { t } = reactI18next.useTranslation();
|
|
139
139
|
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
140
140
|
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
141
|
+
const walletCredential = React.useMemo(() => {
|
|
142
|
+
var _a;
|
|
143
|
+
if (!user || !primaryWallet)
|
|
144
|
+
return undefined;
|
|
145
|
+
return (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((cred) => cred.address === primaryWallet.address);
|
|
146
|
+
}, [user, primaryWallet]);
|
|
141
147
|
const handleOnReject = React.useCallback(() => {
|
|
142
148
|
didConfirmRef.current = false;
|
|
143
149
|
setShow(false);
|
|
@@ -215,7 +221,7 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
|
|
|
215
221
|
message: message
|
|
216
222
|
.toString()
|
|
217
223
|
.replace(/^"(.*)"$/, '$1')
|
|
218
|
-
.replace(/\\n/g, '\n') }) }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
|
|
224
|
+
.replace(/\\n/g, '\n') }) }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { walletCredential: walletCredential }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
|
|
219
225
|
};
|
|
220
226
|
|
|
221
227
|
exports.SignMessageConfirmationModal = SignMessageConfirmationModal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { useRef, useState,
|
|
4
|
+
import { useRef, useState, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { DynamicError, AccessBlockedError, UserRejectedRequestError } from '@dynamic-labs/utils';
|
|
7
7
|
import { isSessionKeyCompatibleWallet } from '@dynamic-labs/wallet-connector-core';
|
|
@@ -134,6 +134,12 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
|
|
|
134
134
|
const { t } = useTranslation();
|
|
135
135
|
const { getEOAWallet } = useSmartWallets();
|
|
136
136
|
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
137
|
+
const walletCredential = useMemo(() => {
|
|
138
|
+
var _a;
|
|
139
|
+
if (!user || !primaryWallet)
|
|
140
|
+
return undefined;
|
|
141
|
+
return (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((cred) => cred.address === primaryWallet.address);
|
|
142
|
+
}, [user, primaryWallet]);
|
|
137
143
|
const handleOnReject = useCallback(() => {
|
|
138
144
|
didConfirmRef.current = false;
|
|
139
145
|
setShow(false);
|
|
@@ -211,7 +217,7 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
|
|
|
211
217
|
message: message
|
|
212
218
|
.toString()
|
|
213
219
|
.replace(/^"(.*)"$/, '$1')
|
|
214
|
-
.replace(/\\n/g, '\n') }) }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
|
|
220
|
+
.replace(/\\n/g, '\n') }) }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, { walletCredential: walletCredential }), jsx(PoweredByDynamic, {})] })] }) }) }));
|
|
215
221
|
};
|
|
216
222
|
|
|
217
223
|
export { SignMessageConfirmationModal };
|
|
@@ -147,7 +147,9 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
147
147
|
catch (error) {
|
|
148
148
|
// waas wallet
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const turnkeyCredential = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId);
|
|
151
|
+
const walletProperties = turnkeyCredential === null || turnkeyCredential === void 0 ? void 0 : turnkeyCredential.walletProperties;
|
|
152
|
+
const walletCredential = (_b = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _b === void 0 ? void 0 : _b.find((cred) => cred.address === primaryWallet.address);
|
|
151
153
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
152
154
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
153
155
|
// eslint-disable-next-line arrow-body-style
|
|
@@ -258,7 +260,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
258
260
|
}, children: t('dyn_embedded_reveal.done_button_label') }), !exportPrivateKey && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'embedded-reveal-view__body__unlink_button', buttonVariant: 'tertiary', buttonPadding: 'none', copykey: 'dyn_embedded_reveal.unlink', onClick: handleClickUnlink, typographyProps: {
|
|
259
261
|
color: 'secondary',
|
|
260
262
|
variant: 'button_tertiary',
|
|
261
|
-
}, children: t('dyn_embedded_reveal.unlink') }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__description', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__badge-container', children: jsxRuntime.jsx(Badge.Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', copykey: 'dyn_embedded_reveal.prompt_for_export_description', children: t('dyn_embedded_reveal.prompt_for_export_description') })] }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(walletV2.ReactComponent, { height: 16, width: 16 }) }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement__text', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.title', children: [t('dyn_embedded_reveal.statement_1.title'), ":"] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(eyeOffIcon.ReactComponent, { height: 16, width: 16 }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__statement__text', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }) })] })] }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__confirm_card', children: jsxRuntime.jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setIsAcknowledged(!isAcknowledged), children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: isAcknowledged, onChange: () => setIsAcknowledged(!isAcknowledged), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'export-agreement-checkbox' }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }) }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { isExport: true }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__button_section', children: [isPromptForExport && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'primary', onClick: () => {
|
|
263
|
+
}, children: t('dyn_embedded_reveal.unlink') }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__description', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__badge-container', children: jsxRuntime.jsx(Badge.Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', copykey: 'dyn_embedded_reveal.prompt_for_export_description', children: t('dyn_embedded_reveal.prompt_for_export_description') })] }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(walletV2.ReactComponent, { height: 16, width: 16 }) }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement__text', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.title', children: [t('dyn_embedded_reveal.statement_1.title'), ":"] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(eyeOffIcon.ReactComponent, { height: 16, width: 16 }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__statement__text', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }) })] })] }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__confirm_card', children: jsxRuntime.jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setIsAcknowledged(!isAcknowledged), children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: isAcknowledged, onChange: () => setIsAcknowledged(!isAcknowledged), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'export-agreement-checkbox' }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }) }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { isExport: true, walletCredential: walletCredential }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__button_section', children: [isPromptForExport && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'primary', onClick: () => {
|
|
262
264
|
handleAcknowledgeExportPrompt();
|
|
263
265
|
setShowAuthFlow(false);
|
|
264
266
|
}, dataTestId: 'export-agreement-skip-button', copykey: 'dyn_embedded_reveal.skip_button_label', expanded: true, buttonClassName: 'embedded-reveal-view__body__button', children: t('dyn_embedded_reveal.skip_button_label') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
|
|
@@ -143,7 +143,9 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
143
143
|
catch (error) {
|
|
144
144
|
// waas wallet
|
|
145
145
|
}
|
|
146
|
-
const
|
|
146
|
+
const turnkeyCredential = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId);
|
|
147
|
+
const walletProperties = turnkeyCredential === null || turnkeyCredential === void 0 ? void 0 : turnkeyCredential.walletProperties;
|
|
148
|
+
const walletCredential = (_b = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _b === void 0 ? void 0 : _b.find((cred) => cred.address === primaryWallet.address);
|
|
147
149
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
148
150
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
149
151
|
// eslint-disable-next-line arrow-body-style
|
|
@@ -254,7 +256,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
254
256
|
}, children: t('dyn_embedded_reveal.done_button_label') }), !exportPrivateKey && (jsx(TypographyButton, { buttonClassName: 'embedded-reveal-view__body__unlink_button', buttonVariant: 'tertiary', buttonPadding: 'none', copykey: 'dyn_embedded_reveal.unlink', onClick: handleClickUnlink, typographyProps: {
|
|
255
257
|
color: 'secondary',
|
|
256
258
|
variant: 'button_tertiary',
|
|
257
|
-
}, children: t('dyn_embedded_reveal.unlink') }))] })) : (jsxs(Fragment, { children: [jsxs("div", { className: 'embedded-reveal-view__body__description', children: [jsx("div", { className: 'embedded-reveal-view__body__badge-container', children: jsx(Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', copykey: 'dyn_embedded_reveal.prompt_for_export_description', children: t('dyn_embedded_reveal.prompt_for_export_description') })] }), errorText && jsx(ErrorContainer, { children: errorText }), jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgWalletV2, { height: 16, width: 16 }) }), jsxs("div", { className: 'embedded-reveal-view__body__card__statement__text', children: [jsxs(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.title', children: [t('dyn_embedded_reveal.statement_1.title'), ":"] }), jsx(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgEyeOffIcon, { height: 16, width: 16 }) }), jsx("div", { className: 'embedded-reveal-view__body__card__statement__text', children: jsx(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }) })] })] }), jsx("div", { className: 'embedded-reveal-view__body__confirm_card', children: jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setIsAcknowledged(!isAcknowledged), children: [jsx("div", { children: jsx(Checkbox, { checked: isAcknowledged, onChange: () => setIsAcknowledged(!isAcknowledged), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'export-agreement-checkbox' }) }), jsx("div", { children: jsx(Typography, { variant: 'body_small', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }) }), jsx(NeedHelpSection, { isExport: true }), jsxs("div", { className: 'embedded-reveal-view__body__button_section', children: [isPromptForExport && (jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'primary', onClick: () => {
|
|
259
|
+
}, children: t('dyn_embedded_reveal.unlink') }))] })) : (jsxs(Fragment, { children: [jsxs("div", { className: 'embedded-reveal-view__body__description', children: [jsx("div", { className: 'embedded-reveal-view__body__badge-container', children: jsx(Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', copykey: 'dyn_embedded_reveal.prompt_for_export_description', children: t('dyn_embedded_reveal.prompt_for_export_description') })] }), errorText && jsx(ErrorContainer, { children: errorText }), jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgWalletV2, { height: 16, width: 16 }) }), jsxs("div", { className: 'embedded-reveal-view__body__card__statement__text', children: [jsxs(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.title', children: [t('dyn_embedded_reveal.statement_1.title'), ":"] }), jsx(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgEyeOffIcon, { height: 16, width: 16 }) }), jsx("div", { className: 'embedded-reveal-view__body__card__statement__text', children: jsx(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }) })] })] }), jsx("div", { className: 'embedded-reveal-view__body__confirm_card', children: jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setIsAcknowledged(!isAcknowledged), children: [jsx("div", { children: jsx(Checkbox, { checked: isAcknowledged, onChange: () => setIsAcknowledged(!isAcknowledged), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'export-agreement-checkbox' }) }), jsx("div", { children: jsx(Typography, { variant: 'body_small', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }) }), jsx(NeedHelpSection, { isExport: true, walletCredential: walletCredential }), jsxs("div", { className: 'embedded-reveal-view__body__button_section', children: [isPromptForExport && (jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'primary', onClick: () => {
|
|
258
260
|
handleAcknowledgeExportPrompt();
|
|
259
261
|
setShowAuthFlow(false);
|
|
260
262
|
}, dataTestId: 'export-agreement-skip-button', copykey: 'dyn_embedded_reveal.skip_button_label', expanded: true, buttonClassName: 'embedded-reveal-view__body__button', children: t('dyn_embedded_reveal.skip_button_label') })), jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
|