@dynamic-labs/sdk-react-core 4.19.5 → 4.19.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/package.cjs +3 -2
- package/package.js +3 -2
- package/package.json +13 -12
- package/src/functions.d.ts +1 -0
- package/src/lib/client/client.cjs +19 -0
- package/src/lib/client/client.d.ts +8 -0
- package/src/lib/client/client.js +11 -0
- package/src/lib/client/extension/constants.cjs +12 -0
- package/src/lib/client/extension/constants.d.ts +5 -0
- package/src/lib/client/extension/constants.js +8 -0
- package/src/lib/client/extension/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.cjs +14 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.d.ts +4 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.js +10 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +29 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.d.ts +7 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.js +25 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.cjs +30 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.d.ts +2 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.js +26 -0
- package/src/lib/client/extension/utils/useClientState/index.d.ts +1 -0
- package/src/lib/client/extension/utils/useClientState/useClientState.d.ts +2 -0
- package/src/lib/components/AppOriginTile/AppOriginTile.cjs +8 -5
- package/src/lib/components/AppOriginTile/AppOriginTile.d.ts +4 -1
- package/src/lib/components/AppOriginTile/AppOriginTile.js +8 -5
- package/src/lib/components/Chip/Chip.cjs +2 -3
- package/src/lib/components/Chip/Chip.d.ts +5 -4
- package/src/lib/components/Chip/Chip.js +2 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +3 -2
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -0
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.d.ts +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.d.ts +45 -0
- package/src/lib/data/api/exchangeAccounts/index.d.ts +1 -0
- package/src/lib/data/api/index.d.ts +1 -0
- package/src/lib/data/api/onramp/onramp.d.ts +2 -2
- package/src/lib/locale/en/translation.cjs +16 -0
- package/src/lib/locale/en/translation.d.ts +16 -0
- package/src/lib/locale/en/translation.js +16 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -1
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.cjs +22 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.d.ts +8 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.js +18 -0
- package/src/lib/modals/ZkSyncApprovalModal/index.d.ts +1 -0
- package/src/lib/modals/index.d.ts +1 -0
- package/src/lib/shared/assets/backup.cjs +52 -0
- package/src/lib/shared/assets/backup.js +28 -0
- package/src/lib/shared/assets/clock.cjs +54 -0
- package/src/lib/shared/assets/clock.js +30 -0
- package/src/lib/shared/assets/index.d.ts +2 -0
- 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/functions/getSessionInformation/getSessionInformation.cjs +4 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +4 -1
- package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.d.ts +2 -2
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +25 -18
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +25 -18
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.cjs +9 -6
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.d.ts +8 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.js +8 -7
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +3 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -3
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +4 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +4 -1
- package/src/lib/utils/hooks/useExchangeAccounts/index.d.ts +1 -0
- package/src/lib/utils/hooks/useExchangeAccounts/useExchangeAccounts.d.ts +13 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +4 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +4 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +12 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +12 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +138 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.d.ts +3 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +133 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +15 -88
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +15 -88
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.cjs +114 -0
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.js +110 -0
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.cjs +6 -6
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.js +2 -2
- package/src/lib/views/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.js +7 -5
|
@@ -116,16 +116,11 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
116
116
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
117
117
|
|
|
118
118
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
119
|
-
var _a, _b, _c
|
|
119
|
+
var _a, _b, _c;
|
|
120
120
|
const { primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext();
|
|
121
121
|
const { handleAcknowledgeExportPrompt } = useSyncEmbeddedWalletFlow();
|
|
122
122
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
123
|
-
//should use useIsWaasWallet hook
|
|
124
123
|
const isWaasWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => { var _a; return (_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('dynamicwaas'); });
|
|
125
|
-
// Check if it's a Sui wallet
|
|
126
|
-
const isSuiWallet = ((_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.connectedChain) === 'SUI';
|
|
127
|
-
// Check if it's a SOL wallet
|
|
128
|
-
const isSolWallet = ((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'SOL';
|
|
129
124
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
130
125
|
const { pushView } = useViewContext();
|
|
131
126
|
const { getEOAWallet, isSmartWallet } = useSmartWallets();
|
|
@@ -141,9 +136,9 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
141
136
|
catch (error) {
|
|
142
137
|
// waas wallet
|
|
143
138
|
}
|
|
144
|
-
const walletProperties = (
|
|
139
|
+
const walletProperties = (_b = (_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)) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
145
140
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
146
|
-
const wallet = (
|
|
141
|
+
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
147
142
|
const [showSkeleton, setShowSkeleton] = useState(false);
|
|
148
143
|
// eslint-disable-next-line arrow-body-style
|
|
149
144
|
useEffect(() => {
|
|
@@ -163,14 +158,14 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
163
158
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
164
159
|
}, []);
|
|
165
160
|
const { isLoading: exportLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
166
|
-
var
|
|
161
|
+
var _d, _e;
|
|
167
162
|
const iframeContainerElement = iframeContainerRef.current;
|
|
168
163
|
if (!iframeContainerElement ||
|
|
169
|
-
((
|
|
164
|
+
((_d = iframeContainerElement === null || iframeContainerElement === void 0 ? void 0 : iframeContainerElement.children) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
170
165
|
return;
|
|
171
166
|
}
|
|
172
167
|
if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
|
|
173
|
-
yield ((
|
|
168
|
+
yield ((_e = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _e === void 0 ? void 0 : _e.createOrRestoreSession());
|
|
174
169
|
}
|
|
175
170
|
if (isTurnkeyWallet) {
|
|
176
171
|
return initExport({
|
|
@@ -182,7 +177,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
182
177
|
return;
|
|
183
178
|
}));
|
|
184
179
|
const { mutate: handleExportWallet, isLoading, error, data, } = useMutation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
185
|
-
var
|
|
180
|
+
var _f, _g, _h;
|
|
186
181
|
handleAcknowledgeExportPrompt();
|
|
187
182
|
if (isTurnkeyWallet) {
|
|
188
183
|
try {
|
|
@@ -193,11 +188,11 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
193
188
|
wallet: wallet,
|
|
194
189
|
});
|
|
195
190
|
}
|
|
196
|
-
catch (
|
|
191
|
+
catch (_j) {
|
|
197
192
|
if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector) &&
|
|
198
|
-
((
|
|
199
|
-
yield ((
|
|
200
|
-
yield ((
|
|
193
|
+
((_f = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _f === void 0 ? void 0 : _f.removeSessionKeys)) {
|
|
194
|
+
yield ((_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.removeSessionKeys());
|
|
195
|
+
yield ((_h = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _h === void 0 ? void 0 : _h.createOrRestoreSession({
|
|
201
196
|
ignoreRestore: true,
|
|
202
197
|
}));
|
|
203
198
|
}
|
|
@@ -218,7 +213,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
218
213
|
wallet: wallet,
|
|
219
214
|
});
|
|
220
215
|
}
|
|
221
|
-
catch (
|
|
216
|
+
catch (_k) {
|
|
222
217
|
return undefined;
|
|
223
218
|
}
|
|
224
219
|
}
|
|
@@ -255,44 +250,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
255
250
|
setShowAuthFlow(false);
|
|
256
251
|
setDynamicWidgetView('send-balance');
|
|
257
252
|
}, className: 'embedded-reveal-view__zerodev-warning__link-button', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'primary', className: 'underline', copykey: 'dyn_embedded_reveal.aa_warning.button', children: t('dyn_embedded_reveal.aa_warning.button') }) })] })] })), jsx("div", { className: 'embedded-reveal-view__body__description', children: !(!isLoading && data && !error) && (jsx("div", { className: 'embedded-reveal-view__header', children: jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsx(SvgExportEmbeddedHero, {}) }) })) })] }));
|
|
258
|
-
useEffect(() => {
|
|
259
|
-
var _a;
|
|
260
|
-
if (((_a = iframeContainerRef === null || iframeContainerRef === void 0 ? void 0 : iframeContainerRef.current) === null || _a === void 0 ? void 0 : _a.children) && data) {
|
|
261
|
-
// eslint-disable-next-line prefer-destructuring
|
|
262
|
-
const iframeElement = iframeContainerRef.current.children[0];
|
|
263
|
-
let height = '88px';
|
|
264
|
-
let minHeight = '88px';
|
|
265
|
-
// Determine height based on wallet type and other conditions
|
|
266
|
-
if (!isTurnkeyHDWallet || exportPrivateKey) {
|
|
267
|
-
if (isSolWallet) {
|
|
268
|
-
height = '140px';
|
|
269
|
-
minHeight = '140px';
|
|
270
|
-
}
|
|
271
|
-
else if (isSuiWallet) {
|
|
272
|
-
height = '100px';
|
|
273
|
-
minHeight = '100px';
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
height = '88px';
|
|
277
|
-
minHeight = '88px';
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
// Turnkey HD wallet case
|
|
282
|
-
height = '120px';
|
|
283
|
-
minHeight = '120px';
|
|
284
|
-
}
|
|
285
|
-
iframeElement === null || iframeElement === void 0 ? void 0 : iframeElement.setAttribute('style', `height: ${height}; min-height: ${minHeight}; width: 100%; border: none; background: transparent; overflow: hidden;`);
|
|
286
|
-
}
|
|
287
|
-
}, [
|
|
288
|
-
iframeContainerRef,
|
|
289
|
-
data,
|
|
290
|
-
isTurnkeyHDWallet,
|
|
291
|
-
isWaasWallet,
|
|
292
|
-
exportPrivateKey,
|
|
293
|
-
isSuiWallet,
|
|
294
|
-
isSolWallet,
|
|
295
|
-
]);
|
|
296
253
|
useEffect(() => {
|
|
297
254
|
if (data) {
|
|
298
255
|
// Show skeleton first
|
|
@@ -339,14 +296,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
339
296
|
return `${baseClass} ${baseClass}--hidden`;
|
|
340
297
|
}
|
|
341
298
|
if (isWaasWallet) {
|
|
342
|
-
|
|
343
|
-
if (isSuiWallet) {
|
|
344
|
-
return `${waasClass} ${baseClass}--sui`;
|
|
345
|
-
}
|
|
346
|
-
if (isSolWallet) {
|
|
347
|
-
return `${waasClass} ${baseClass}--sol`;
|
|
348
|
-
}
|
|
349
|
-
return waasClass;
|
|
299
|
+
return `${baseClass} ${baseClass}--waas`;
|
|
350
300
|
}
|
|
351
301
|
return baseClass;
|
|
352
302
|
};
|
|
@@ -358,29 +308,10 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
358
308
|
if (showSkeleton) {
|
|
359
309
|
return `${baseClass} ${baseClass}--invisible`;
|
|
360
310
|
}
|
|
361
|
-
if (isWaasWallet) {
|
|
362
|
-
if (isSuiWallet) {
|
|
363
|
-
return `${baseClass} ${baseClass}--sui`;
|
|
364
|
-
}
|
|
365
|
-
if (isSolWallet) {
|
|
366
|
-
return `${baseClass} ${baseClass}--sol`;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
311
|
return baseClass;
|
|
370
312
|
};
|
|
371
313
|
const getSkeletonLines = () => {
|
|
372
|
-
|
|
373
|
-
if (isWaasWallet) {
|
|
374
|
-
if (isSolWallet) {
|
|
375
|
-
lineCount = 7; // For 140px height
|
|
376
|
-
}
|
|
377
|
-
else if (isSuiWallet) {
|
|
378
|
-
lineCount = 5; // For 100px height
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
else if (isTurnkeyHDWallet && !exportPrivateKey) {
|
|
382
|
-
lineCount = 6; // For 120px height
|
|
383
|
-
}
|
|
314
|
+
const lineCount = 5; // Updated for 110px height
|
|
384
315
|
const lines = [];
|
|
385
316
|
for (let i = 0; i < lineCount; i++) {
|
|
386
317
|
const isLastLine = i === lineCount - 1;
|
|
@@ -394,11 +325,7 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
394
325
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsx("div", { className: 'embedded-reveal-view', children: jsxs("div", { className: getBodyClassName(), children: [(!isWaasWallet ||
|
|
395
326
|
!hasInjectedCredential ||
|
|
396
327
|
title !== credentialTitle) &&
|
|
397
|
-
contentHeader, isTurnkeyWallet || isWaasWallet ? (jsxs("div", { className: getCredentialContainerClassName(), children: [jsx("div", { id: iframeContainerId, className: getIframeContainerClassName(), ref: iframeContainerRef }), showSkeleton && data && (jsx("div", { className:
|
|
398
|
-
? ' embedded-reveal-view__body__skeleton-container--sui'
|
|
399
|
-
: isWaasWallet && isSolWallet
|
|
400
|
-
? ' embedded-reveal-view__body__skeleton-container--sol'
|
|
401
|
-
: ''}`, children: getSkeletonLines() }))] })) : null, hasInjectedCredential ? (jsxs(Fragment, { children: [jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
|
|
328
|
+
contentHeader, isTurnkeyWallet || isWaasWallet ? (jsxs("div", { className: getCredentialContainerClassName(), children: [jsx("div", { id: iframeContainerId, className: getIframeContainerClassName(), ref: iframeContainerRef }), showSkeleton && data && (jsx("div", { className: 'embedded-reveal-view__body__skeleton-container', children: getSkeletonLines() }))] })) : null, hasInjectedCredential ? (jsxs(Fragment, { children: [jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
|
|
402
329
|
setShowAuthFlow(false);
|
|
403
330
|
}, loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
404
331
|
color: 'inherit',
|
|
@@ -86,12 +86,12 @@ require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
|
86
86
|
require('qrcode');
|
|
87
87
|
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
88
88
|
require('../../../../index.cjs');
|
|
89
|
+
var NeedHelpSection = require('../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
89
90
|
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
90
91
|
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
91
92
|
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
92
93
|
require('@hcaptcha/react-hcaptcha');
|
|
93
94
|
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
94
|
-
var NeedHelpSection = require('../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
95
95
|
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
96
96
|
var EmbeddedAuthChoiceCards = require('../EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs');
|
|
97
97
|
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
@@ -82,12 +82,12 @@ import '../../../context/OnrampContext/OnrampContext.js';
|
|
|
82
82
|
import 'qrcode';
|
|
83
83
|
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
84
84
|
import '../../../../index.js';
|
|
85
|
+
import { NeedHelpSection } from '../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
85
86
|
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
86
87
|
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
87
88
|
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
88
89
|
import '@hcaptcha/react-hcaptcha';
|
|
89
90
|
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
90
|
-
import { NeedHelpSection } from '../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
91
91
|
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
92
92
|
import { EmbeddedAuthChoiceCards } from '../EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js';
|
|
93
93
|
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
@@ -94,12 +94,12 @@ require('../../../../context/OnrampContext/OnrampContext.cjs');
|
|
|
94
94
|
require('qrcode');
|
|
95
95
|
require('../../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
96
96
|
require('../../../../../index.cjs');
|
|
97
|
+
var NeedHelpSection = require('../../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
97
98
|
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
98
99
|
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
99
100
|
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
100
101
|
require('@hcaptcha/react-hcaptcha');
|
|
101
102
|
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
102
|
-
var NeedHelpSection = require('../../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
103
103
|
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
104
104
|
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
105
105
|
require('../../../../store/state/tokenBalances.cjs');
|
|
@@ -90,12 +90,12 @@ import '../../../../context/OnrampContext/OnrampContext.js';
|
|
|
90
90
|
import 'qrcode';
|
|
91
91
|
import '../../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
92
92
|
import '../../../../../index.js';
|
|
93
|
+
import { NeedHelpSection } from '../../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
93
94
|
import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
94
95
|
import '../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
95
96
|
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
96
97
|
import '@hcaptcha/react-hcaptcha';
|
|
97
98
|
import '../../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
98
|
-
import { NeedHelpSection } from '../../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
99
99
|
import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
100
100
|
import '../../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
101
101
|
import '../../../../store/state/tokenBalances.js';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
9
|
+
require('@dynamic-labs/utils');
|
|
10
|
+
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
11
|
+
var close = require('../../shared/assets/close.cjs');
|
|
12
|
+
require('@dynamic-labs/iconic');
|
|
13
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
14
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
15
|
+
require('@dynamic-labs/sdk-api-core');
|
|
16
|
+
require('../../shared/logger.cjs');
|
|
17
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
18
|
+
require('@dynamic-labs/wallet-book');
|
|
19
|
+
require('../../utils/constants/colors.cjs');
|
|
20
|
+
require('../../utils/constants/values.cjs');
|
|
21
|
+
require('../../shared/consts/index.cjs');
|
|
22
|
+
require('../../components/Alert/Alert.cjs');
|
|
23
|
+
require('../../events/dynamicEvents.cjs');
|
|
24
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
25
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
26
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
27
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
28
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
29
|
+
require('@dynamic-labs/multi-wallet');
|
|
30
|
+
require('react-international-phone');
|
|
31
|
+
require('../../store/state/nonce/nonce.cjs');
|
|
32
|
+
require('../../store/state/projectSettings/projectSettings.cjs');
|
|
33
|
+
require('../../config/ApiEndpoint.cjs');
|
|
34
|
+
require('../../store/state/user/user.cjs');
|
|
35
|
+
require('../../locale/locale.cjs');
|
|
36
|
+
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
37
|
+
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
38
|
+
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
39
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
40
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
41
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
42
|
+
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
43
|
+
require('react-dom');
|
|
44
|
+
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
45
|
+
require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
46
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
47
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
48
|
+
require('bs58');
|
|
49
|
+
require('@dynamic-labs/types');
|
|
50
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
51
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
52
|
+
require('../../context/WalletContext/WalletContext.cjs');
|
|
53
|
+
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
54
|
+
require('yup');
|
|
55
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
56
|
+
require('../CollectUserDataView/useFields.cjs');
|
|
57
|
+
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
58
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
59
|
+
require('@dynamic-labs/rpc-providers');
|
|
60
|
+
require('../../store/state/walletOptions/walletOptions.cjs');
|
|
61
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
62
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
63
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
64
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
65
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
66
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
67
|
+
require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
68
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
69
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
70
|
+
require('react-focus-lock');
|
|
71
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
72
|
+
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
73
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
74
|
+
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
75
|
+
require('formik');
|
|
76
|
+
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
77
|
+
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
78
|
+
require('../../store/state/sendBalances.cjs');
|
|
79
|
+
require('../../components/Input/Input.cjs');
|
|
80
|
+
require('../../components/OverlayCard/OverlayCard.cjs');
|
|
81
|
+
require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
82
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
83
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
84
|
+
var getSessionInformation = require('../../utils/functions/getSessionInformation/getSessionInformation.cjs');
|
|
85
|
+
require('../../context/OnrampContext/OnrampContext.cjs');
|
|
86
|
+
require('qrcode');
|
|
87
|
+
require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
88
|
+
var SessionPermissionsView = require('../SessionPermissionsView/SessionPermissionsView.cjs');
|
|
89
|
+
var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
|
|
90
|
+
require('../../../index.cjs');
|
|
91
|
+
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
92
|
+
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
93
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
94
|
+
require('@hcaptcha/react-hcaptcha');
|
|
95
|
+
require('../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
96
|
+
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
97
|
+
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
98
|
+
require('../../store/state/tokenBalances.cjs');
|
|
99
|
+
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
100
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
101
|
+
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
102
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
103
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
104
|
+
|
|
105
|
+
const SessionKeyApprovalView = ({ onApprove, onReject, session, }) => {
|
|
106
|
+
const { t } = reactI18next.useTranslation();
|
|
107
|
+
const sessionName = React.useMemo(() => getSessionInformation.getSessionInformationName(session), [session]);
|
|
108
|
+
const renderCloseButton = React.useCallback(() => (jsxRuntime.jsx(IconButton.IconButton, { onClick: onReject, "aria-label": t('dyn_session_key_approval.aria.close_button_label'), children: jsxRuntime.jsx(close.ReactComponent, {}) })), [onReject, t]);
|
|
109
|
+
return (jsxRuntime.jsxs("div", { className: 'session-key-approval-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: renderCloseButton(), children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_key_approval.title', children: t('dyn_session_key_approval.title') }) }), jsxRuntime.jsxs("div", { className: 'session-key-approval-view__body', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { origin: sessionName }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_session_key_approval.description', align: 'center', children: t('dyn_session_key_approval.description') }), jsxRuntime.jsx(SessionPermissionsView.SessionPermissionsView, { showAdvanced: true, session: session })] }), jsxRuntime.jsxs("div", { className: 'session-key-approval-view__footer', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: onApprove, buttonVariant: 'brand-primary', expanded: true, copykey: 'dyn_session_key_approval.approve_button', typographyProps: {
|
|
110
|
+
color: 'white',
|
|
111
|
+
}, children: t('dyn_session_key_approval.approve_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: onReject, expanded: true, copykey: 'dyn_session_key_approval.reject_button', children: t('dyn_session_key_approval.reject_button') })] })] }));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports.SessionKeyApprovalView = SessionKeyApprovalView;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo, useCallback } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import '@dynamic-labs/utils';
|
|
6
|
+
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
7
|
+
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import '../../../../_virtual/_tslib.js';
|
|
11
|
+
import '@dynamic-labs/sdk-api-core';
|
|
12
|
+
import '../../shared/logger.js';
|
|
13
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
14
|
+
import '@dynamic-labs/wallet-book';
|
|
15
|
+
import '../../utils/constants/colors.js';
|
|
16
|
+
import '../../utils/constants/values.js';
|
|
17
|
+
import '../../shared/consts/index.js';
|
|
18
|
+
import '../../components/Alert/Alert.js';
|
|
19
|
+
import '../../events/dynamicEvents.js';
|
|
20
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
21
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
22
|
+
import '../../store/state/authMode/authMode.js';
|
|
23
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
24
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
25
|
+
import '@dynamic-labs/multi-wallet';
|
|
26
|
+
import 'react-international-phone';
|
|
27
|
+
import '../../store/state/nonce/nonce.js';
|
|
28
|
+
import '../../store/state/projectSettings/projectSettings.js';
|
|
29
|
+
import '../../config/ApiEndpoint.js';
|
|
30
|
+
import '../../store/state/user/user.js';
|
|
31
|
+
import '../../locale/locale.js';
|
|
32
|
+
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
33
|
+
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
34
|
+
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
35
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
36
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
37
|
+
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
38
|
+
import '../../context/VerificationContext/VerificationContext.js';
|
|
39
|
+
import 'react-dom';
|
|
40
|
+
import '../../utils/functions/compareChains/compareChains.js';
|
|
41
|
+
import '../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
42
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
43
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
44
|
+
import 'bs58';
|
|
45
|
+
import '@dynamic-labs/types';
|
|
46
|
+
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
47
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
48
|
+
import '../../context/WalletContext/WalletContext.js';
|
|
49
|
+
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
50
|
+
import 'yup';
|
|
51
|
+
import '../../context/MockContext/MockContext.js';
|
|
52
|
+
import '../CollectUserDataView/useFields.js';
|
|
53
|
+
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
54
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
55
|
+
import '@dynamic-labs/rpc-providers';
|
|
56
|
+
import '../../store/state/walletOptions/walletOptions.js';
|
|
57
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
58
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
59
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
60
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
61
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
62
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
63
|
+
import '../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
64
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
65
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
66
|
+
import 'react-focus-lock';
|
|
67
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
68
|
+
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
69
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
70
|
+
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
71
|
+
import 'formik';
|
|
72
|
+
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
73
|
+
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
74
|
+
import '../../store/state/sendBalances.js';
|
|
75
|
+
import '../../components/Input/Input.js';
|
|
76
|
+
import '../../components/OverlayCard/OverlayCard.js';
|
|
77
|
+
import '../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
78
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
79
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
80
|
+
import { getSessionInformationName } from '../../utils/functions/getSessionInformation/getSessionInformation.js';
|
|
81
|
+
import '../../context/OnrampContext/OnrampContext.js';
|
|
82
|
+
import 'qrcode';
|
|
83
|
+
import '../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
84
|
+
import { SessionPermissionsView } from '../SessionPermissionsView/SessionPermissionsView.js';
|
|
85
|
+
import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
|
|
86
|
+
import '../../../index.js';
|
|
87
|
+
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
88
|
+
import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
89
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
90
|
+
import '@hcaptcha/react-hcaptcha';
|
|
91
|
+
import '../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
92
|
+
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
93
|
+
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
94
|
+
import '../../store/state/tokenBalances.js';
|
|
95
|
+
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
96
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
97
|
+
import '../../components/IsBrowser/IsBrowser.js';
|
|
98
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
99
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
100
|
+
|
|
101
|
+
const SessionKeyApprovalView = ({ onApprove, onReject, session, }) => {
|
|
102
|
+
const { t } = useTranslation();
|
|
103
|
+
const sessionName = useMemo(() => getSessionInformationName(session), [session]);
|
|
104
|
+
const renderCloseButton = useCallback(() => (jsx(IconButton, { onClick: onReject, "aria-label": t('dyn_session_key_approval.aria.close_button_label'), children: jsx(SvgClose, {}) })), [onReject, t]);
|
|
105
|
+
return (jsxs("div", { className: 'session-key-approval-view', children: [jsx(ModalHeader, { trailing: renderCloseButton(), children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_key_approval.title', children: t('dyn_session_key_approval.title') }) }), jsxs("div", { className: 'session-key-approval-view__body', children: [jsx(AppOriginTile, { origin: sessionName }), jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_session_key_approval.description', align: 'center', children: t('dyn_session_key_approval.description') }), jsx(SessionPermissionsView, { showAdvanced: true, session: session })] }), jsxs("div", { className: 'session-key-approval-view__footer', children: [jsx(TypographyButton, { onClick: onApprove, buttonVariant: 'brand-primary', expanded: true, copykey: 'dyn_session_key_approval.approve_button', typographyProps: {
|
|
106
|
+
color: 'white',
|
|
107
|
+
}, children: t('dyn_session_key_approval.approve_button') }), jsx(TypographyButton, { onClick: onReject, expanded: true, copykey: 'dyn_session_key_approval.reject_button', children: t('dyn_session_key_approval.reject_button') })] })] }));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { SessionKeyApprovalView };
|
|
@@ -13,24 +13,24 @@ var Textarea = require('../../components/Textarea/Textarea.cjs');
|
|
|
13
13
|
require('@dynamic-labs/utils');
|
|
14
14
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
15
15
|
var AccordionToggle = require('../../components/Accordion/components/AccordionToggle/AccordionToggle.cjs');
|
|
16
|
+
var clock = require('../../shared/assets/clock.cjs');
|
|
16
17
|
var profileOutline = require('../../shared/assets/profile-outline.cjs');
|
|
17
|
-
var session = require('../../shared/assets/session.cjs');
|
|
18
18
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
19
19
|
var getSessionInformation = require('../../utils/functions/getSessionInformation/getSessionInformation.cjs');
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* A view component to render SessionInformation permissions
|
|
23
23
|
*/
|
|
24
|
-
const SessionPermissionsView = ({ session
|
|
24
|
+
const SessionPermissionsView = ({ session, showAdvanced = false, }) => {
|
|
25
25
|
const { t } = reactI18next.useTranslation();
|
|
26
26
|
const [isAdvancedExpanded, setIsAdvancedExpanded] = React.useState(false);
|
|
27
27
|
const toggleAdvancedExpanded = React.useCallback(() => {
|
|
28
28
|
setIsAdvancedExpanded(!isAdvancedExpanded);
|
|
29
29
|
}, [isAdvancedExpanded]);
|
|
30
|
-
const timeToExpire = React.useMemo(() => getSessionInformation.getSessionInformationExpiration(session
|
|
31
|
-
const spendingLimit = React.useMemo(() => getSessionInformation.getSessionInformationSpendingLimit(session
|
|
32
|
-
const sessionString = React.useMemo(() => getSessionInformation.getSessionInformationJson(session
|
|
33
|
-
return (jsxRuntime.jsxs("div", { className: 'session-permissions-view', children: [jsxRuntime.jsx("div", { className: 'session-permissions-view__header', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.permissions_label') }) }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__card', children: [jsxRuntime.jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(profileOutline.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.ownership') })] }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(
|
|
30
|
+
const timeToExpire = React.useMemo(() => getSessionInformation.getSessionInformationExpiration(session), [session]);
|
|
31
|
+
const spendingLimit = React.useMemo(() => getSessionInformation.getSessionInformationSpendingLimit(session), [session]);
|
|
32
|
+
const sessionString = React.useMemo(() => getSessionInformation.getSessionInformationJson(session), [session]);
|
|
33
|
+
return (jsxRuntime.jsxs("div", { className: 'session-permissions-view', children: [jsxRuntime.jsx("div", { className: 'session-permissions-view__header', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.permissions_label') }) }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__card', children: [jsxRuntime.jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(profileOutline.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.ownership') })] }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(clock.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.access', {
|
|
34
34
|
time: timeToExpire,
|
|
35
35
|
}) })] })] }), jsxRuntime.jsx("div", { className: 'session-permissions-view__header', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.spending_label') }) }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__card session-permissions-view__token-card', children: [jsxRuntime.jsxs("div", { className: 'session-permissions-view__token', children: [jsxRuntime.jsx(Icon.Icon, { size: 'medium', children: jsxRuntime.jsx(iconic.EthereumIcon, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', children: "ETH" })] }), jsxRuntime.jsxs("div", { className: 'session-permissions-view__spending', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_session_permissions.spending_limit') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: spendingLimit })] })] }), showAdvanced && (jsxRuntime.jsxs("div", { className: 'session-permissions-view__panel', children: [jsxRuntime.jsxs(AccordionToggle.AccordionToggle, { className: 'session-permissions-view__panel-toggle', isOpen: isAdvancedExpanded, onClick: toggleAdvancedExpanded, labelClassName: 'session-permissions-view__panel-toggle-label', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.advanced_label') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_session_permissions.advanced_description') })] }), isAdvancedExpanded && (jsxRuntime.jsx("div", { className: 'session-permissions-view__panel-content', children: jsxRuntime.jsx(Textarea.Textarea, { value: sessionString, readOnly: true, rows: 8, id: 'session-permissions-view__raw-json', "data-testid": 'session-permissions-view__raw-json', label: '' }) }))] }))] }));
|
|
36
36
|
};
|
|
@@ -9,8 +9,8 @@ import { Textarea } from '../../components/Textarea/Textarea.js';
|
|
|
9
9
|
import '@dynamic-labs/utils';
|
|
10
10
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
11
11
|
import { AccordionToggle } from '../../components/Accordion/components/AccordionToggle/AccordionToggle.js';
|
|
12
|
+
import { ReactComponent as SvgClock } from '../../shared/assets/clock.js';
|
|
12
13
|
import { ReactComponent as SvgProfileOutline } from '../../shared/assets/profile-outline.js';
|
|
13
|
-
import { ReactComponent as SvgSession } from '../../shared/assets/session.js';
|
|
14
14
|
import '../../context/ViewContext/ViewContext.js';
|
|
15
15
|
import { getSessionInformationExpiration, getSessionInformationSpendingLimit, getSessionInformationJson } from '../../utils/functions/getSessionInformation/getSessionInformation.js';
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ const SessionPermissionsView = ({ session, showAdvanced = false, }) => {
|
|
|
26
26
|
const timeToExpire = useMemo(() => getSessionInformationExpiration(session), [session]);
|
|
27
27
|
const spendingLimit = useMemo(() => getSessionInformationSpendingLimit(session), [session]);
|
|
28
28
|
const sessionString = useMemo(() => getSessionInformationJson(session), [session]);
|
|
29
|
-
return (jsxs("div", { className: 'session-permissions-view', children: [jsx("div", { className: 'session-permissions-view__header', children: jsx(Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.permissions_label') }) }), jsxs("div", { className: 'session-permissions-view__card', children: [jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgProfileOutline, {}) }), jsx(Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.ownership') })] }), jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(
|
|
29
|
+
return (jsxs("div", { className: 'session-permissions-view', children: [jsx("div", { className: 'session-permissions-view__header', children: jsx(Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.permissions_label') }) }), jsxs("div", { className: 'session-permissions-view__card', children: [jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgProfileOutline, {}) }), jsx(Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.ownership') })] }), jsxs("div", { className: 'session-permissions-view__card-permission', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgClock, {}) }), jsx(Typography, { variant: 'body_small', children: t('dyn_session_permissions.permissions.access', {
|
|
30
30
|
time: timeToExpire,
|
|
31
31
|
}) })] })] }), jsx("div", { className: 'session-permissions-view__header', children: jsx(Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.spending_label') }) }), jsxs("div", { className: 'session-permissions-view__card session-permissions-view__token-card', children: [jsxs("div", { className: 'session-permissions-view__token', children: [jsx(Icon, { size: 'medium', children: jsx(EthereumIcon, {}) }), jsx(Typography, { variant: 'body_normal', children: "ETH" })] }), jsxs("div", { className: 'session-permissions-view__spending', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_session_permissions.spending_limit') }), jsx(Typography, { variant: 'body_small', children: spendingLimit })] })] }), showAdvanced && (jsxs("div", { className: 'session-permissions-view__panel', children: [jsxs(AccordionToggle, { className: 'session-permissions-view__panel-toggle', isOpen: isAdvancedExpanded, onClick: toggleAdvancedExpanded, labelClassName: 'session-permissions-view__panel-toggle-label', children: [jsx(Typography, { variant: 'body_small', weight: 'bold', children: t('dyn_session_permissions.advanced_label') }), jsx(Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_session_permissions.advanced_description') })] }), isAdvancedExpanded && (jsx("div", { className: 'session-permissions-view__panel-content', children: jsx(Textarea, { value: sessionString, readOnly: true, rows: 8, id: 'session-permissions-view__raw-json', "data-testid": 'session-permissions-view__raw-json', label: '' }) }))] }))] }));
|
|
32
32
|
};
|
package/src/lib/views/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { NoQrNotInstalledView } from './/NoQrNotInstalledView';
|
|
2
|
+
export { BackupUnsuccessfulView } from './BackupUnsuccessfulView/BackupUnsuccessfulView';
|
|
2
3
|
export { CollectUserDataView } from './CollectUserDataView';
|
|
3
4
|
export { EmailConfirmationWaitingView } from './EmailConfirmationWaitingView';
|
|
4
5
|
export { NoAccess } from './NoAccess';
|
|
@@ -7,6 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var UserDeleteAccountView = require('./UserDeleteAccountView/UserDeleteAccountView.cjs');
|
|
8
8
|
var AccessBlockedView = require('./AccessBlockedView/AccessBlockedView.cjs');
|
|
9
9
|
var AccountExistsView = require('./AccountExistsView/AccountExistsView.cjs');
|
|
10
|
+
var BackupUnsuccessfulView = require('./BackupUnsuccessfulView/BackupUnsuccessfulView.cjs');
|
|
10
11
|
var BridgeNextWalletConnectionView = require('./BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs');
|
|
11
12
|
var BridgeSummaryView = require('./BridgeSummaryView/BridgeSummaryView.cjs');
|
|
12
13
|
var BridgeWelcomeView = require('./BridgeWelcomeView/BridgeWelcomeView.cjs');
|
|
@@ -152,6 +153,7 @@ var PasskeyNewDomainDetectedView = require('./Passkey/PasskeyNewDomainDetectedVi
|
|
|
152
153
|
const viewToComponentMap = {
|
|
153
154
|
'access-blocked': AccessBlockedView.AccessBlockedView,
|
|
154
155
|
'account-exists': AccountExistsView.AccountExistsView,
|
|
156
|
+
'backup-unsuccessful': BackupUnsuccessfulView.BackupUnsuccessfulView,
|
|
155
157
|
'bridge-next-wallet-connection': BridgeNextWalletConnectionView.BridgeNextWalletConnectionView,
|
|
156
158
|
'bridge-summary': BridgeSummaryView.BridgeSummaryView,
|
|
157
159
|
'bridge-welcome': BridgeWelcomeView.BridgeWelcomeView,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const viewToComponentMap: {
|
|
3
3
|
'access-blocked': import("react").FC;
|
|
4
4
|
'account-exists': () => JSX.Element;
|
|
5
|
+
'backup-unsuccessful': import("react").FC<{}>;
|
|
5
6
|
'bridge-next-wallet-connection': import("react").FC;
|
|
6
7
|
'bridge-summary': () => JSX.Element;
|
|
7
8
|
'bridge-welcome': () => JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { UserDeleteAccountView } from './UserDeleteAccountView/UserDeleteAccountView.js';
|
|
4
4
|
import { AccessBlockedView } from './AccessBlockedView/AccessBlockedView.js';
|
|
5
5
|
import { AccountExistsView } from './AccountExistsView/AccountExistsView.js';
|
|
6
|
+
import { BackupUnsuccessfulView } from './BackupUnsuccessfulView/BackupUnsuccessfulView.js';
|
|
6
7
|
import { BridgeNextWalletConnectionView } from './BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js';
|
|
7
8
|
import { BridgeSummaryView } from './BridgeSummaryView/BridgeSummaryView.js';
|
|
8
9
|
import { BridgeWelcomeView } from './BridgeWelcomeView/BridgeWelcomeView.js';
|
|
@@ -148,6 +149,7 @@ import { PasskeyNewDomainDetectedView } from './Passkey/PasskeyNewDomainDetected
|
|
|
148
149
|
const viewToComponentMap = {
|
|
149
150
|
'access-blocked': AccessBlockedView,
|
|
150
151
|
'account-exists': AccountExistsView,
|
|
152
|
+
'backup-unsuccessful': BackupUnsuccessfulView,
|
|
151
153
|
'bridge-next-wallet-connection': BridgeNextWalletConnectionView,
|
|
152
154
|
'bridge-summary': BridgeSummaryView,
|
|
153
155
|
'bridge-welcome': BridgeWelcomeView,
|
|
@@ -89,11 +89,11 @@ var CopyButton = require('../../../../components/CopyButton/CopyButton.cjs');
|
|
|
89
89
|
var QRCode = require('../../../../components/QRCode/QRCode.cjs');
|
|
90
90
|
require('../../views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
91
91
|
require('../../../../../index.cjs');
|
|
92
|
+
var TextButton = require('../../../../components/TextButton/TextButton.cjs');
|
|
92
93
|
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
93
94
|
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
94
95
|
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
95
96
|
require('@hcaptcha/react-hcaptcha');
|
|
96
|
-
var TextButton = require('../../../../components/TextButton/TextButton.cjs');
|
|
97
97
|
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
98
98
|
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
99
99
|
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|