@dynamic-labs/sdk-react-core 4.67.0 → 4.67.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -12
  5. package/src/index.d.ts +1 -1
  6. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +31 -11
  7. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +31 -11
  8. package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
  9. package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
  10. package/src/lib/styles/index.shadow.cjs +1 -1
  11. package/src/lib/styles/index.shadow.js +1 -1
  12. package/src/lib/utils/hooks/index.d.ts +1 -1
  13. package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.d.ts +2 -1
  14. package/src/lib/utils/hooks/useMfa/useMfa.cjs +6 -3
  15. package/src/lib/utils/hooks/useMfa/useMfa.d.ts +5 -3
  16. package/src/lib/utils/hooks/useMfa/useMfa.js +6 -3
  17. package/src/lib/utils/hooks/usePromptMfaAuth/usePromptMfaAuth.cjs +14 -185
  18. package/src/lib/utils/hooks/usePromptMfaAuth/usePromptMfaAuth.d.ts +15 -3
  19. package/src/lib/utils/hooks/usePromptMfaAuth/usePromptMfaAuth.js +14 -185
  20. package/src/lib/utils/hooks/useStepUpAuthentication/index.d.ts +1 -1
  21. package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.cjs +195 -24
  22. package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.d.ts +10 -0
  23. package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.js +189 -18
  24. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +10 -9
  25. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +10 -9
  26. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +4 -3
  27. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.d.ts +2 -0
  28. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +4 -3
  29. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +3 -1
  30. package/src/lib/views/MfaVerificationView/MfaVerificationView.d.ts +3 -2
  31. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +3 -1
  32. package/src/lib/views/Passkey/ConfirmPasskeyView/ConfirmPasskeyView.cjs +2 -1
  33. package/src/lib/views/Passkey/ConfirmPasskeyView/ConfirmPasskeyView.d.ts +3 -1
  34. package/src/lib/views/Passkey/ConfirmPasskeyView/ConfirmPasskeyView.js +2 -1
  35. package/src/lib/views/viewToComponentMap.d.ts +3 -2
@@ -245,15 +245,16 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
245
245
  }
246
246
  return baseClass;
247
247
  };
248
- const contentHeader = (jsxRuntime.jsxs("div", { children: [primaryWallet &&
249
- isSmartWallet(primaryWallet) &&
250
- !isLoading &&
251
- data &&
252
- !error && (jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__zerodev-warning', children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__zerodev-warning__title-row', children: [jsxRuntime.jsx(info.ReactComponent, { className: 'embedded-reveal-view__zerodev-warning__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', copykey: 'dyn_embedded_reveal.aa_warning.title', children: t('dyn_embedded_reveal.aa_warning.title') })] }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', weight: 'regular', copykey: 'dyn_embedded_reveal.aa_warning.subtitle', children: [t('dyn_embedded_reveal.aa_warning.subtitle'), jsxRuntime.jsx("button", { onClick: () => {
253
- setShowAuthFlow(false);
254
- setDynamicWidgetView('send-balance');
255
- }, className: 'embedded-reveal-view__zerodev-warning__link-button', children: jsxRuntime.jsx(Typography.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') }) })] })] })), jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__description', children: !hasInjectedCredential && (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header', children: jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsxRuntime.jsx(exportEmbeddedHero.ReactComponent, {}) }) })) })] }));
256
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view', children: jsxRuntime.jsxs("div", { className: getBodyClassName(), children: [(!isWaasWallet ||
248
+ const isEip7702SmartWallet = Boolean(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id.endsWith('-zerodev'));
249
+ const isErc4337SmartWallet = Boolean(primaryWallet && isSmartWallet(primaryWallet)) &&
250
+ !isEip7702SmartWallet;
251
+ const shouldShowAaWarning = isErc4337SmartWallet && !isLoading && Boolean(data) && !error;
252
+ const aaWarning = shouldShowAaWarning && (jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__zerodev-warning', children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__zerodev-warning__title-row', children: [jsxRuntime.jsx(info.ReactComponent, { className: 'embedded-reveal-view__zerodev-warning__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', copykey: 'dyn_embedded_reveal.aa_warning.title', children: t('dyn_embedded_reveal.aa_warning.title') })] }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', weight: 'regular', copykey: 'dyn_embedded_reveal.aa_warning.subtitle', children: [t('dyn_embedded_reveal.aa_warning.subtitle'), jsxRuntime.jsx("button", { onClick: () => {
253
+ setShowAuthFlow(false);
254
+ setDynamicWidgetView('send-balance');
255
+ }, className: 'embedded-reveal-view__zerodev-warning__link-button', children: jsxRuntime.jsx(Typography.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') }) })] })] }));
256
+ const contentHeader = (jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__description', children: !hasInjectedCredential && (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header', children: jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsxRuntime.jsx(exportEmbeddedHero.ReactComponent, {}) }) })) }) }));
257
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: isPromptForExport ? null : closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view', children: jsxRuntime.jsxs("div", { className: getBodyClassName(), children: [aaWarning, (!isWaasWallet ||
257
258
  !hasInjectedCredential ||
258
259
  title !== credentialTitle) &&
259
260
  contentHeader, (isTurnkeyWallet || isWaasWallet) && (jsxRuntime.jsx(EmbeddedWalletExport.EmbeddedWalletExport, { wallet: wallet, isTurnkeyWallet: isTurnkeyWallet, isWaasWallet: isWaasWallet, data: data, onIframeContainerRef: setIframeContainerRef, isVisible: !title.includes('Agree') })), hasInjectedCredential ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
@@ -241,15 +241,16 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
241
241
  }
242
242
  return baseClass;
243
243
  };
244
- const contentHeader = (jsxs("div", { children: [primaryWallet &&
245
- isSmartWallet(primaryWallet) &&
246
- !isLoading &&
247
- data &&
248
- !error && (jsxs("div", { className: 'embedded-reveal-view__zerodev-warning', children: [jsxs("div", { className: 'embedded-reveal-view__zerodev-warning__title-row', children: [jsx(SvgInfo, { className: 'embedded-reveal-view__zerodev-warning__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'bold', copykey: 'dyn_embedded_reveal.aa_warning.title', children: t('dyn_embedded_reveal.aa_warning.title') })] }), jsxs(Typography, { variant: 'body_normal', weight: 'regular', copykey: 'dyn_embedded_reveal.aa_warning.subtitle', children: [t('dyn_embedded_reveal.aa_warning.subtitle'), jsx("button", { onClick: () => {
249
- setShowAuthFlow(false);
250
- setDynamicWidgetView('send-balance');
251
- }, 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: !hasInjectedCredential && (jsx("div", { className: 'embedded-reveal-view__header', children: jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsx(SvgExportEmbeddedHero, {}) }) })) })] }));
252
- 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 ||
244
+ const isEip7702SmartWallet = Boolean(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id.endsWith('-zerodev'));
245
+ const isErc4337SmartWallet = Boolean(primaryWallet && isSmartWallet(primaryWallet)) &&
246
+ !isEip7702SmartWallet;
247
+ const shouldShowAaWarning = isErc4337SmartWallet && !isLoading && Boolean(data) && !error;
248
+ const aaWarning = shouldShowAaWarning && (jsxs("div", { className: 'embedded-reveal-view__zerodev-warning', children: [jsxs("div", { className: 'embedded-reveal-view__zerodev-warning__title-row', children: [jsx(SvgInfo, { className: 'embedded-reveal-view__zerodev-warning__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'bold', copykey: 'dyn_embedded_reveal.aa_warning.title', children: t('dyn_embedded_reveal.aa_warning.title') })] }), jsxs(Typography, { variant: 'body_normal', weight: 'regular', copykey: 'dyn_embedded_reveal.aa_warning.subtitle', children: [t('dyn_embedded_reveal.aa_warning.subtitle'), jsx("button", { onClick: () => {
249
+ setShowAuthFlow(false);
250
+ setDynamicWidgetView('send-balance');
251
+ }, 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') }) })] })] }));
252
+ const contentHeader = (jsx("div", { children: jsx("div", { className: 'embedded-reveal-view__body__description', children: !hasInjectedCredential && (jsx("div", { className: 'embedded-reveal-view__header', children: jsx("div", { className: 'embedded-reveal-view__header__hero', children: jsx(SvgExportEmbeddedHero, {}) }) })) }) }));
253
+ 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: [aaWarning, (!isWaasWallet ||
253
254
  !hasInjectedCredential ||
254
255
  title !== credentialTitle) &&
255
256
  contentHeader, (isTurnkeyWallet || isWaasWallet) && (jsx(EmbeddedWalletExport, { wallet: wallet, isTurnkeyWallet: isTurnkeyWallet, isWaasWallet: isWaasWallet, data: data, onIframeContainerRef: setIframeContainerRef, isVisible: !title.includes('Agree') })), hasInjectedCredential ? (jsxs(Fragment, { children: [jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', onClick: () => {
@@ -115,7 +115,7 @@ require('../../components/IsBrowser/IsBrowser.cjs');
115
115
  require('../../components/Popper/Popper/Popper.cjs');
116
116
  require('../../components/Popper/PopperContext/PopperContext.cjs');
117
117
 
118
- const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, }) => {
118
+ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
119
119
  const { handleLogOut } = useDynamicContext.useDynamicContext();
120
120
  const { t } = reactI18next.useTranslation();
121
121
  const { pushView } = ViewContext.useViewContext();
@@ -139,14 +139,14 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, })
139
139
  singleUse: true,
140
140
  }
141
141
  : undefined;
142
- // we're calling authenticatePasskeyMFA here because we don't want
143
- // it to be called twice by the usePromise in the confirmPasskey view
144
142
  const authenticatePasskeyPromise = authenticatePasskeyMFA({
145
143
  createMfaToken: createMfaTokenOptions,
144
+ requestedScopes,
146
145
  });
147
146
  pushView('passkey-confirm', {
148
147
  authenticatePasskeyPromise,
149
148
  createMfaToken,
149
+ requestedScopes,
150
150
  });
151
151
  };
152
152
  const handleTotpClick = () => {
@@ -160,6 +160,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, })
160
160
  pushView('mfa-verification', {
161
161
  createMfaToken,
162
162
  isInitialSetup,
163
+ requestedScopes,
163
164
  showBackButton: true,
164
165
  type: sdkApiCore.MFADeviceType.Totp,
165
166
  });
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
+ import type { TokenScope } from '@dynamic-labs/sdk-api-core';
2
3
  export type MfaChooseDeviceViewProps = {
3
4
  isInitialSetup?: boolean;
4
5
  createMfaToken?: boolean;
6
+ requestedScopes?: TokenScope[];
5
7
  };
6
8
  export declare const MfaChooseDeviceView: FC<MfaChooseDeviceViewProps>;
@@ -111,7 +111,7 @@ import '../../components/IsBrowser/IsBrowser.js';
111
111
  import '../../components/Popper/Popper/Popper.js';
112
112
  import '../../components/Popper/PopperContext/PopperContext.js';
113
113
 
114
- const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, }) => {
114
+ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
115
115
  const { handleLogOut } = useDynamicContext();
116
116
  const { t } = useTranslation();
117
117
  const { pushView } = useViewContext();
@@ -135,14 +135,14 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, })
135
135
  singleUse: true,
136
136
  }
137
137
  : undefined;
138
- // we're calling authenticatePasskeyMFA here because we don't want
139
- // it to be called twice by the usePromise in the confirmPasskey view
140
138
  const authenticatePasskeyPromise = authenticatePasskeyMFA({
141
139
  createMfaToken: createMfaTokenOptions,
140
+ requestedScopes,
142
141
  });
143
142
  pushView('passkey-confirm', {
144
143
  authenticatePasskeyPromise,
145
144
  createMfaToken,
145
+ requestedScopes,
146
146
  });
147
147
  };
148
148
  const handleTotpClick = () => {
@@ -156,6 +156,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, })
156
156
  pushView('mfa-verification', {
157
157
  createMfaToken,
158
158
  isInitialSetup,
159
+ requestedScopes,
159
160
  showBackButton: true,
160
161
  type: MFADeviceType.Totp,
161
162
  });
@@ -112,7 +112,7 @@ require('../../components/IsBrowser/IsBrowser.cjs');
112
112
  require('../../components/Popper/Popper/Popper.cjs');
113
113
  require('../../components/Popper/PopperContext/PopperContext.cjs');
114
114
 
115
- const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, }) => {
115
+ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
116
116
  const { t } = reactI18next.useTranslation();
117
117
  const { handleLogOut } = useDynamicContext.useDynamicContext();
118
118
  const { clearStackAndPush, pushView, goBack, canGoBack } = ViewContext.useViewContext();
@@ -130,6 +130,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
130
130
  code,
131
131
  createMfaToken: createMfaTokenOptions,
132
132
  deviceId,
133
+ requestedScopes,
133
134
  type,
134
135
  });
135
136
  }, {
@@ -164,6 +165,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
164
165
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: passwordHero.ReactComponent, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(mfaToken), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: onClickBack, disabled: isRateLimited }), !isInitialSetup && (jsxRuntime.jsxs("div", { className: 'mfa-verification-view__choose-another-method', children: [jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', {
165
166
  createMfaToken,
166
167
  isInitialSetup,
168
+ requestedScopes,
167
169
  }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick: handleLogOut, copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
168
170
  };
169
171
 
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { MFADeviceType } from '@dynamic-labs/sdk-api-core';
2
+ import { MFADeviceType, TokenScope } from '@dynamic-labs/sdk-api-core';
3
3
  export type MfaVerificationViewProps = {
4
4
  deviceId?: string;
5
5
  type?: MFADeviceType;
6
6
  isInitialSetup?: boolean;
7
7
  showBackButton?: boolean;
8
8
  createMfaToken?: boolean;
9
+ requestedScopes?: TokenScope[];
9
10
  };
10
- export declare const MfaVerificationView: ({ type, isInitialSetup, showBackButton, createMfaToken, deviceId, }: MfaVerificationViewProps) => JSX.Element;
11
+ export declare const MfaVerificationView: ({ type, isInitialSetup, showBackButton, createMfaToken, deviceId, requestedScopes, }: MfaVerificationViewProps) => JSX.Element;
@@ -108,7 +108,7 @@ import '../../components/IsBrowser/IsBrowser.js';
108
108
  import '../../components/Popper/Popper/Popper.js';
109
109
  import '../../components/Popper/PopperContext/PopperContext.js';
110
110
 
111
- const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, }) => {
111
+ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
112
112
  const { t } = useTranslation();
113
113
  const { handleLogOut } = useDynamicContext();
114
114
  const { clearStackAndPush, pushView, goBack, canGoBack } = useViewContext();
@@ -126,6 +126,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
126
126
  code,
127
127
  createMfaToken: createMfaTokenOptions,
128
128
  deviceId,
129
+ requestedScopes,
129
130
  type,
130
131
  });
131
132
  }, {
@@ -160,6 +161,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
160
161
  return (jsxs(Fragment, { children: [jsx(OTPVerificationView, { MainIcon: SvgPasswordHero, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: Boolean(mfaToken), onPinChange: onCodeChange, description: t('dyn_mfa.otp_verification_view.body'), onClickBack: onClickBack, disabled: isRateLimited }), !isInitialSetup && (jsxs("div", { className: 'mfa-verification-view__choose-another-method', children: [jsx(TextButton, { className: 'mfa-verification-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', {
161
162
  createMfaToken,
162
163
  isInitialSetup,
164
+ requestedScopes,
163
165
  }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick: handleLogOut, copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
164
166
  };
165
167
 
@@ -115,7 +115,7 @@ require('../../../components/IsBrowser/IsBrowser.cjs');
115
115
  require('../../../components/Popper/Popper/Popper.cjs');
116
116
  require('../../../components/Popper/PopperContext/PopperContext.cjs');
117
117
 
118
- const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise, }) => {
118
+ const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise, requestedScopes, }) => {
119
119
  const { t } = reactI18next.useTranslation();
120
120
  const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
121
121
  const { pushView } = ViewContext.useViewContext();
@@ -129,6 +129,7 @@ const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise
129
129
  return (jsxRuntime.jsxs("div", { className: classNames.classNames('confirm-passkey-view'), children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'confirm-passkey-view__header', children: jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'confirm-passkey-view__title', copykey: 'dyn_mfa.confirm_passkey_view.title', children: t('dyn_mfa.confirm_passkey_view.title') }) }) }), jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', messageKey: errorMessage, className: 'confirm-passkey-view__header-banner' }), jsxRuntime.jsxs("div", { className: classNames.classNames('confirm-passkey-view__content'), children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: fingerprint.ReactComponent, iconSize: 96, isSpinning: isLoading, treatAsFunctionComponent: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: classNames.classNames('confirm-passkey-view__description'), copykey: 'dyn_mfa.confirm_passkey_view.description', children: t('dyn_mfa.confirm_passkey_view.description') })] }), jsxRuntime.jsx("div", { className: 'confirm-passkey-view__choose-another-method', children: jsxRuntime.jsx(TextButton.TextButton, { className: 'confirm-passkey-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', {
130
130
  createMfaToken,
131
131
  isInitialSetup: false,
132
+ requestedScopes,
132
133
  }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) })] }));
133
134
  };
134
135
 
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
+ import type { TokenScope } from '@dynamic-labs/sdk-api-core';
2
3
  type ConfirmPasskeyViewProps = {
3
4
  createMfaToken?: boolean;
4
5
  authenticatePasskeyPromise: Promise<string | undefined>;
6
+ requestedScopes?: TokenScope[];
5
7
  };
6
- export declare const ConfirmPasskeyView: ({ createMfaToken, authenticatePasskeyPromise, }: ConfirmPasskeyViewProps) => JSX.Element;
8
+ export declare const ConfirmPasskeyView: ({ createMfaToken, authenticatePasskeyPromise, requestedScopes, }: ConfirmPasskeyViewProps) => JSX.Element;
7
9
  export {};
@@ -111,7 +111,7 @@ import '../../../components/IsBrowser/IsBrowser.js';
111
111
  import '../../../components/Popper/Popper/Popper.js';
112
112
  import '../../../components/Popper/PopperContext/PopperContext.js';
113
113
 
114
- const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise, }) => {
114
+ const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise, requestedScopes, }) => {
115
115
  const { t } = useTranslation();
116
116
  const { setShowAuthFlow } = useInternalDynamicContext();
117
117
  const { pushView } = useViewContext();
@@ -125,6 +125,7 @@ const ConfirmPasskeyView = ({ createMfaToken = false, authenticatePasskeyPromise
125
125
  return (jsxs("div", { className: classNames('confirm-passkey-view'), children: [jsx(ModalHeader, { alignContent: 'bottom', children: jsx("div", { className: 'confirm-passkey-view__header', children: jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'confirm-passkey-view__title', copykey: 'dyn_mfa.confirm_passkey_view.title', children: t('dyn_mfa.confirm_passkey_view.title') }) }) }), jsx(ModalHeaderBanner, { type: 'error', messageKey: errorMessage, className: 'confirm-passkey-view__header-banner' }), jsxs("div", { className: classNames('confirm-passkey-view__content'), children: [jsx(IconWithSpinner, { Icon: SvgFingerprint, iconSize: 96, isSpinning: isLoading, treatAsFunctionComponent: true }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: classNames('confirm-passkey-view__description'), copykey: 'dyn_mfa.confirm_passkey_view.description', children: t('dyn_mfa.confirm_passkey_view.description') })] }), jsx("div", { className: 'confirm-passkey-view__choose-another-method', children: jsx(TextButton, { className: 'confirm-passkey-view__choose-another-method-button', onClick: () => pushView('mfa-choose-device', {
126
126
  createMfaToken,
127
127
  isInitialSetup: false,
128
+ requestedScopes,
128
129
  }), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }) })] }));
129
130
  };
130
131
 
@@ -58,7 +58,7 @@ export declare const viewToComponentMap: {
58
58
  uri: string;
59
59
  secret: string;
60
60
  }) => JSX.Element;
61
- 'mfa-verification': ({ type, isInitialSetup, showBackButton, createMfaToken, deviceId, }: import("./MfaVerificationView").MfaVerificationViewProps) => JSX.Element;
61
+ 'mfa-verification': ({ type, isInitialSetup, showBackButton, createMfaToken, deviceId, requestedScopes, }: import("./MfaVerificationView").MfaVerificationViewProps) => JSX.Element;
62
62
  'mobile-wallet-redirect-view': import("react").FC<{
63
63
  onRetry: VoidFunction;
64
64
  connector?: import("dist/packages/wallet-connector-core/src").WalletConnector | undefined;
@@ -70,9 +70,10 @@ export declare const viewToComponentMap: {
70
70
  'network-not-supported-manual': import("react").FC;
71
71
  'no-access': () => JSX.Element;
72
72
  'no-qr-not-installed': () => JSX.Element | null;
73
- 'passkey-confirm': ({ createMfaToken, authenticatePasskeyPromise, }: {
73
+ 'passkey-confirm': ({ createMfaToken, authenticatePasskeyPromise, requestedScopes, }: {
74
74
  createMfaToken?: boolean | undefined;
75
75
  authenticatePasskeyPromise: Promise<string | undefined>;
76
+ requestedScopes?: import("@dynamic-labs/sdk-api-core").TokenScope[] | undefined;
76
77
  }) => JSX.Element;
77
78
  'passkey-intro': import("react").FC<{
78
79
  chains?: import("@dynamic-labs/sdk-api-core").EmbeddedWalletChainEnum[] | undefined;