@dynamic-labs/sdk-react-core 3.9.9 → 3.9.11

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 (74) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/index.d.ts +1 -0
  6. package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +32 -31
  7. package/src/lib/components/NeedHelpSection/NeedHelpSection.d.ts +2 -1
  8. package/src/lib/components/NeedHelpSection/NeedHelpSection.js +34 -33
  9. package/src/lib/components/SupportLinks/SupportLinks.cjs +24 -0
  10. package/src/lib/components/SupportLinks/SupportLinks.d.ts +6 -0
  11. package/src/lib/components/SupportLinks/SupportLinks.js +20 -0
  12. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +3 -2
  13. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +3 -2
  14. package/src/lib/components/TransactionConfirmationPageLayout/utils.cjs +6 -2
  15. package/src/lib/components/TransactionConfirmationPageLayout/utils.js +6 -2
  16. package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -0
  17. package/src/lib/context/DynamicContext/DynamicContext.js +2 -0
  18. package/src/lib/context/UserWalletsContext/UserWalletsContext.cjs +19 -14
  19. package/src/lib/context/UserWalletsContext/UserWalletsContext.js +20 -15
  20. package/src/lib/context/ViewContext/types/index.d.ts +1 -1
  21. package/src/lib/data/api/wallets/wallets.cjs +3 -0
  22. package/src/lib/data/api/wallets/wallets.js +4 -1
  23. package/src/lib/events/dynamicEvents.cjs +4 -0
  24. package/src/lib/events/dynamicEvents.d.ts +2 -2
  25. package/src/lib/events/dynamicEvents.js +4 -0
  26. package/src/lib/events/index.d.ts +1 -0
  27. package/src/lib/events/wallets.d.ts +25 -0
  28. package/src/lib/locale/en/translation.cjs +7 -2
  29. package/src/lib/locale/en/translation.d.ts +5 -0
  30. package/src/lib/locale/en/translation.js +7 -2
  31. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +3 -1
  32. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +3 -1
  33. package/src/lib/shared/types/embeddedWallets.d.ts +7 -1
  34. package/src/lib/styles/index.shadow.cjs +1 -1
  35. package/src/lib/styles/index.shadow.js +1 -1
  36. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
  37. package/src/lib/utils/hooks/index.d.ts +1 -0
  38. package/src/lib/utils/hooks/useAggregateWalletEvents/index.d.ts +1 -0
  39. package/src/lib/utils/hooks/useAggregateWalletEvents/useAggregateWalletEvents.cjs +56 -0
  40. package/src/lib/utils/hooks/useAggregateWalletEvents/useAggregateWalletEvents.d.ts +2 -0
  41. package/src/lib/utils/hooks/useAggregateWalletEvents/useAggregateWalletEvents.js +52 -0
  42. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
  43. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
  44. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +3 -1
  45. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +3 -1
  46. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +5 -0
  47. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +6 -1
  48. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +3 -0
  49. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +3 -0
  50. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +4 -3
  51. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +4 -3
  52. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.cjs +14 -4
  53. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.js +14 -4
  54. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs +1 -1
  55. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js +1 -1
  56. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +11 -3
  57. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +11 -3
  58. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +3 -3
  59. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.d.ts +4 -1
  60. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +3 -3
  61. package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.cjs +101 -0
  62. package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.d.ts +2 -0
  63. package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.js +97 -0
  64. package/src/lib/views/WalletAlreadyExistsView/index.d.ts +1 -0
  65. package/src/lib/views/viewToComponentMap.cjs +2 -0
  66. package/src/lib/views/viewToComponentMap.d.ts +2 -1
  67. package/src/lib/views/viewToComponentMap.js +2 -0
  68. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
  69. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
  70. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +10 -4
  71. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.d.ts +3 -1
  72. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +10 -4
  73. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +3 -1
  74. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +3 -1
@@ -1,34 +1,39 @@
1
1
  'use client'
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { createContext, useContext, useState, useRef, useCallback } from 'react';
3
+ import { createContext, useContext, useState, useRef, useCallback, useEffect } from 'react';
4
4
  import { dynamicEvents } from '../../events/dynamicEvents.js';
5
5
 
6
6
  /** Context for accessing the current user/session's wallets */
7
7
  const UserWalletsContext = createContext(undefined);
8
8
  const UserWalletsProvider = ({ children }) => {
9
9
  const [userWallets, _setUserWallets] = useState([]);
10
+ const prevUserWallets = useRef([]);
10
11
  const addedWalletsIds = useRef([]);
11
12
  const removedWalletsIds = useRef([]);
12
13
  const setUserWallets = useCallback((returnUpdatedWallets) => {
13
14
  _setUserWallets((prevWallets) => {
15
+ prevUserWallets.current = prevWallets;
14
16
  const updatedWallets = returnUpdatedWallets(prevWallets);
15
- addedWalletsIds.current.forEach((walletId) => {
16
- const wallet = updatedWallets.find(({ id }) => id === walletId);
17
- if (!wallet)
18
- return;
19
- dynamicEvents.emit('walletAdded', wallet, updatedWallets);
20
- });
21
- removedWalletsIds.current.forEach((walletId) => {
22
- const wallet = prevWallets.find(({ id }) => id === walletId);
23
- if (!wallet)
24
- return;
25
- dynamicEvents.emit('walletRemoved', wallet, updatedWallets);
26
- });
27
- addedWalletsIds.current = [];
28
- removedWalletsIds.current = [];
29
17
  return updatedWallets;
30
18
  });
31
19
  }, []);
20
+ // it's an useEffect because it needs to be called after the userWallets state is updated
21
+ useEffect(() => {
22
+ addedWalletsIds.current.forEach((walletId) => {
23
+ const wallet = userWallets.find(({ id }) => id === walletId);
24
+ if (!wallet)
25
+ return;
26
+ dynamicEvents.emit('walletAdded', wallet, userWallets);
27
+ });
28
+ removedWalletsIds.current.forEach((walletId) => {
29
+ const wallet = prevUserWallets.current.find(({ id }) => id === walletId);
30
+ if (!wallet)
31
+ return;
32
+ dynamicEvents.emit('walletRemoved', wallet, userWallets);
33
+ });
34
+ addedWalletsIds.current = [];
35
+ removedWalletsIds.current = [];
36
+ }, [userWallets]);
32
37
  return (jsx(UserWalletsContext.Provider, { value: {
33
38
  addedWalletsIds,
34
39
  registerUserWallet: (newWallet) => setUserWallets((userWallets) => [...userWallets, newWallet]),
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { viewToComponentMap } from '../../../views/viewToComponentMap';
3
- export type ViewType = 'access-blocked' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'create-password-view' | 'wallet-claim-intro' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view';
3
+ export type ViewType = 'access-blocked' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'create-password-view' | 'wallet-claim-intro' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists';
4
4
  export type ViewMapConstraint = Record<ViewType, FC<any>>;
5
5
  type ComponentProps<T extends FC<any>> = T extends FC<infer P> ? P : never;
6
6
  export type ViewMap = typeof viewToComponentMap;
@@ -51,6 +51,9 @@ const linkWallet = (environmentId_1, _b) => _tslib.__awaiter(void 0, [environmen
51
51
  }
52
52
  catch (e) {
53
53
  const data = yield utils.logResponseError(e, 'Error linkWallet');
54
+ if (data.code === 'embedded_wallet_address_already_linked') {
55
+ throw new utils$1.EmbeddedWalletExistsError(data.code);
56
+ }
54
57
  if (data.code === 'reassign_wallet_confirm' ||
55
58
  data.code === 'reassign_wallet_error') {
56
59
  throw new utils$1.WalletUsedError(data.code);
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../_virtual/_tslib.js';
3
3
  import { VerifyRequestFromJSON } from '@dynamic-labs/sdk-api-core';
4
- import { WalletUsedError, MergeAccountsConfirmationError, SandboxMaximumThresholdReachedError, DynamicError, WalletNotDeployedError, ChainalysisError, GateBlockedError, NoAccessError, AccountExistsError } from '@dynamic-labs/utils';
4
+ import { EmbeddedWalletExistsError, WalletUsedError, MergeAccountsConfirmationError, SandboxMaximumThresholdReachedError, DynamicError, WalletNotDeployedError, ChainalysisError, GateBlockedError, NoAccessError, AccountExistsError } from '@dynamic-labs/utils';
5
5
  import { sdkApi } from '../api.js';
6
6
  import { storeAuthTokenAndUser } from '../../../store/state/user/storeAuthTokenAndUser/storeAuthTokenAndUser.js';
7
7
  import '../../../store/state/user/user.js';
@@ -47,6 +47,9 @@ const linkWallet = (environmentId_1, _b) => __awaiter(void 0, [environmentId_1,
47
47
  }
48
48
  catch (e) {
49
49
  const data = yield logResponseError(e, 'Error linkWallet');
50
+ if (data.code === 'embedded_wallet_address_already_linked') {
51
+ throw new EmbeddedWalletExistsError(data.code);
52
+ }
50
53
  if (data.code === 'reassign_wallet_confirm' ||
51
54
  data.code === 'reassign_wallet_error') {
52
55
  throw new WalletUsedError(data.code);
@@ -25,6 +25,10 @@ const externalEvents = [
25
25
  'primaryWalletNetworkChanged',
26
26
  'mfaCompletionSuccess',
27
27
  'mfaCompletionFailure',
28
+ 'smsVerificationResult',
29
+ 'walletAdded',
30
+ 'walletRemoved',
31
+ 'userWalletsChanged',
28
32
  ];
29
33
  // Full internal event emitter
30
34
  const dynamicEvents = new EventEmitter__default["default"]();
@@ -11,7 +11,7 @@ import { tokenBalancesEvents } from './tokenBalances';
11
11
  /** Maps internal event names to their listeners */
12
12
  export type DynamicEvents = AuthEvents & UIEvents & OTPEvents & WalletEvents & PasskeyEvents & SocialEvents & EmbeddedWalletEvents & MultiWalletInternalEvents & tokenBalancesEvents;
13
13
  /** Which events are accessible by our clients */
14
- export declare const externalEvents: ("logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "walletAdded" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "embeddedWalletCreated")[];
14
+ export declare const externalEvents: ("logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "embeddedWalletCreated")[];
15
15
  export declare const dynamicEvents: EventEmitter<DynamicEvents, any>;
16
- export declare const publicDynamicEvents: EventEmitter<"logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "walletAdded" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "embeddedWalletCreated", any>;
16
+ export declare const publicDynamicEvents: EventEmitter<"logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "embeddedWalletCreated", any>;
17
17
  export type DynamicEventEmitter = typeof dynamicEvents;
@@ -17,6 +17,10 @@ const externalEvents = [
17
17
  'primaryWalletNetworkChanged',
18
18
  'mfaCompletionSuccess',
19
19
  'mfaCompletionFailure',
20
+ 'smsVerificationResult',
21
+ 'walletAdded',
22
+ 'walletRemoved',
23
+ 'userWalletsChanged',
20
24
  ];
21
25
  // Full internal event emitter
22
26
  const dynamicEvents = new EventEmitter();
@@ -1 +1,2 @@
1
1
  export * from './dynamicEvents';
2
+ export { type UserWalletsChangedParams } from './wallets';
@@ -1,4 +1,25 @@
1
+ import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
1
2
  import { Wallet } from '../shared/types/wallets';
3
+ export type UserWalletsUpdateType = {
4
+ updateType: 'walletAdded';
5
+ addedWallet: Wallet;
6
+ } | {
7
+ updateType: 'walletRemoved';
8
+ removedWallet: Wallet;
9
+ } | {
10
+ updateType: 'primaryWalletChanged';
11
+ } | {
12
+ updateType: 'primaryWalletNetworkChanged';
13
+ newNetwork: string | number;
14
+ } | {
15
+ updateType: 'nonPrimaryWalletNetworkChanged';
16
+ newNetwork: string | number;
17
+ affectedWallets: Wallet[];
18
+ };
19
+ export type UserWalletsChangedParams = {
20
+ userWallets: Wallet[];
21
+ primaryWallet: Wallet | undefined;
22
+ } & UserWalletsUpdateType;
2
23
  export type WalletEvents = {
3
24
  /** Triggered when a new wallet is added to user wallets list */
4
25
  walletAdded: (wallet: Wallet, userWallets: Wallet[]) => void;
@@ -8,4 +29,8 @@ export type WalletEvents = {
8
29
  primaryWalletChanged: (newPrimaryWallet: Wallet) => void;
9
30
  /** Triggered when the network changes in primary wallet */
10
31
  primaryWalletNetworkChanged: (newNetwork: string | number) => void;
32
+ /** Triggered when the network changes in non-primary wallet */
33
+ nonPrimaryWalletNetworkChanged: (newNetwork: string | number, connector: WalletConnector) => void;
34
+ /** Triggered when there is a change in user wallets */
35
+ userWalletsChanged: (params: UserWalletsChangedParams) => void;
11
36
  };
@@ -1233,10 +1233,11 @@ const translation = {
1233
1233
  }
1234
1234
  */
1235
1235
  dyn_need_help_section: {
1236
- info: 'Problem Signing?',
1236
+ info: 'Need Help?',
1237
1237
  contact_support: 'Contact support',
1238
1238
  divider: 'or',
1239
- help_button: 'go here.',
1239
+ help_button: 'Go here for support',
1240
+ visit_platform: 'Visit {{platform}}',
1240
1241
  },
1241
1242
  /**
1242
1243
  * @description copy keys for network not supported view
@@ -2007,6 +2008,10 @@ const translation = {
2007
2008
  },
2008
2009
  log_out_button: 'Log out',
2009
2010
  title: 'Transfer this wallet?',
2011
+ already_exists: {
2012
+ title: 'Wallet Already Linked',
2013
+ description: 'This wallet is already used as an embedded wallet. You cannot link it unless you delete the existing embedded wallet.',
2014
+ },
2010
2015
  },
2011
2016
  /**
2012
2017
  * @description copy keys for connecting wallets list view
@@ -1233,6 +1233,7 @@ export declare const translation: {
1233
1233
  contact_support: string;
1234
1234
  divider: string;
1235
1235
  help_button: string;
1236
+ visit_platform: string;
1236
1237
  };
1237
1238
  /**
1238
1239
  * @description copy keys for network not supported view
@@ -2003,6 +2004,10 @@ export declare const translation: {
2003
2004
  };
2004
2005
  log_out_button: string;
2005
2006
  title: string;
2007
+ already_exists: {
2008
+ title: string;
2009
+ description: string;
2010
+ };
2006
2011
  };
2007
2012
  /**
2008
2013
  * @description copy keys for connecting wallets list view
@@ -1229,10 +1229,11 @@ const translation = {
1229
1229
  }
1230
1230
  */
1231
1231
  dyn_need_help_section: {
1232
- info: 'Problem Signing?',
1232
+ info: 'Need Help?',
1233
1233
  contact_support: 'Contact support',
1234
1234
  divider: 'or',
1235
- help_button: 'go here.',
1235
+ help_button: 'Go here for support',
1236
+ visit_platform: 'Visit {{platform}}',
1236
1237
  },
1237
1238
  /**
1238
1239
  * @description copy keys for network not supported view
@@ -2003,6 +2004,10 @@ const translation = {
2003
2004
  },
2004
2005
  log_out_button: 'Log out',
2005
2006
  title: 'Transfer this wallet?',
2007
+ already_exists: {
2008
+ title: 'Wallet Already Linked',
2009
+ description: 'This wallet is already used as an embedded wallet. You cannot link it unless you delete the existing embedded wallet.',
2010
+ },
2006
2011
  },
2007
2012
  /**
2008
2013
  * @description copy keys for connecting wallets list view
@@ -154,7 +154,9 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
154
154
  const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
155
155
  (eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
156
156
  if ((yield shouldInitRecovery()) && !isSessionKeyCompatible) {
157
- yield initPasskeyRecoveryProcess('email', 'signMessage');
157
+ yield initPasskeyRecoveryProcess('email', {
158
+ type: 'signMessage',
159
+ });
158
160
  }
159
161
  if (signWithoutModal === true) {
160
162
  onSignMessage('callHandlerOutsideModal');
@@ -150,7 +150,9 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, message, handler, o
150
150
  const isSessionKeyCompatible = (primaryWallet && isSessionKeyCompatibleWallet(primaryWallet)) ||
151
151
  (eoaWallet && isSessionKeyCompatibleWallet(eoaWallet));
152
152
  if ((yield shouldInitRecovery()) && !isSessionKeyCompatible) {
153
- yield initPasskeyRecoveryProcess('email', 'signMessage');
153
+ yield initPasskeyRecoveryProcess('email', {
154
+ type: 'signMessage',
155
+ });
154
156
  }
155
157
  if (signWithoutModal === true) {
156
158
  onSignMessage('callHandlerOutsideModal');
@@ -3,4 +3,10 @@ export type EmbeddedWalletSessionSettings = {
3
3
  userId: string;
4
4
  createdAt: number;
5
5
  };
6
- export type EmbeddedWalletCurrentAction = 'signMessage' | 'sendTransaction' | 'helpSession' | 'signTransaction' | 'reveal';
6
+ export type EmbeddedWalletCurrentActionSettings = {
7
+ goBack?: () => void;
8
+ };
9
+ export type EmbeddedWalletCurrentAction = {
10
+ type: 'signMessage' | 'sendTransaction' | 'helpSession' | 'signTransaction' | 'reveal';
11
+ settings?: EmbeddedWalletCurrentActionSettings;
12
+ };