@dynamic-labs/sdk-react-core 0.18.0-RC.12 → 0.18.0-RC.14

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 (52) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +9 -9
  5. package/src/lib/Main.cjs +2 -2
  6. package/src/lib/Main.js +2 -2
  7. package/src/lib/context/DynamicContext/DynamicContext.cjs +11 -11
  8. package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -4
  9. package/src/lib/context/DynamicContext/DynamicContext.js +11 -11
  10. package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -2
  11. package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
  12. package/src/lib/context/DynamicContext/useDynamicContext.js +2 -2
  13. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/NewToWeb3WalletItem/NewToWeb3WalletItem.cjs +1 -1
  14. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/NewToWeb3WalletItem/NewToWeb3WalletItem.js +1 -1
  15. package/src/lib/utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.cjs +1 -0
  16. package/src/lib/utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.js +1 -0
  17. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +2 -2
  18. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.d.ts +1 -1
  19. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +2 -2
  20. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +1 -1
  21. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +1 -1
  22. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +4 -3
  23. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +5 -4
  24. package/src/lib/utils/hooks/index.d.ts +1 -0
  25. package/src/lib/utils/hooks/useConnectWithEmail/index.d.ts +1 -0
  26. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +1 -4
  27. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.d.ts +1 -4
  28. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +1 -4
  29. package/src/lib/utils/hooks/useEmailProvider/index.d.ts +1 -0
  30. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +54 -0
  31. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.d.ts +10 -0
  32. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +50 -0
  33. package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -0
  34. package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -0
  35. package/src/lib/utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.cjs +17 -0
  36. package/src/lib/utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.d.ts +2 -0
  37. package/src/lib/utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.js +13 -0
  38. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +3 -3
  39. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +3 -3
  40. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +24 -51
  41. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +24 -51
  42. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs +2 -2
  43. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.js +2 -2
  44. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +7 -5
  45. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +7 -5
  46. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +14 -14
  47. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +14 -14
  48. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +20 -24
  49. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +21 -25
  50. package/src/lib/views/WalletList/WalletList.cjs +2 -2
  51. package/src/lib/views/WalletList/WalletList.js +2 -2
  52. package/src/lib/views/WalletList/WalletListItem/WalletListItem.types.d.ts +1 -2
@@ -19,7 +19,7 @@ require('../../../../utils/constants/colors.cjs');
19
19
  require('../../../../shared/utils/classes/storage/localStorage.cjs');
20
20
  require('ethers');
21
21
  require('../../../../shared/consts/index.cjs');
22
- require('../../../../context/DynamicContext/DynamicContext.cjs');
22
+ var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
23
23
  require('@dynamic-labs/multi-wallet');
24
24
  require('../../../../components/ShadowDOM/ShadowDOM.cjs');
25
25
  require('../../../../context/ThemeContext/ThemeContext.cjs');
@@ -55,16 +55,18 @@ require('../../../../components/OverlayCard/OverlayCard.context.cjs');
55
55
  var capitalize = require('../../../../shared/utils/functions/capitalize/capitalize.cjs');
56
56
 
57
57
  const SocialSignIn = () => {
58
+ const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext.useInternalDynamicContext();
58
59
  const { socialProvider, setSocialProvider, socialWalletConnector, enabledSocialProviders, } = SocialRedirectContext.useSocialRedirectContext();
59
60
  const getSocialIcon = useGetSocialIcon.useGetSocialIcon();
60
61
  const [showCard, setShowCard] = React.useState(false);
61
62
  const closeCard = () => !isLoading && setShowCard(false);
62
- const numberOfEnabledSocialProviders = enabledSocialProviders.length;
63
+ const socialProviders = socialProvidersFilter(enabledSocialProviders);
64
+ const numberOfEnabledSocialProviders = socialProviders.length;
63
65
  const showConnectText = numberOfEnabledSocialProviders === 1;
64
66
  const showCardButton = numberOfEnabledSocialProviders > 5;
65
67
  const socialProvidersToDisplayInline = showCardButton
66
- ? enabledSocialProviders.slice(0, 4)
67
- : enabledSocialProviders.slice(0, 5);
68
+ ? socialProviders.slice(0, 4)
69
+ : socialProviders.slice(0, 5);
68
70
  const numberOfSocialGridItems = numberOfEnabledSocialProviders + (showCardButton ? 1 : 0);
69
71
  const { mutate: onClickProvider, isLoading } = useMutation.useMutation((provider) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
70
72
  setSocialProvider(provider);
@@ -74,7 +76,7 @@ const SocialSignIn = () => {
74
76
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: closeCard, type: 'button', id: 'close-button', disabled: isLoading, "data-testid": 'close-button' }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
75
77
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'social-sign-in', style: {
76
78
  '--number-of-social-grid-items': numberOfSocialGridItems,
77
- } }, { children: [socialProvidersToDisplayInline.map((provider) => (jsxRuntime.jsxs(IconListTile.IconListTile, Object.assign({ dataTestId: `inline-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--tile' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }), showConnectText && (jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary' }, { children: ["Connect with ", capitalize.capitalize(provider)] })))] }), provider))), showCardButton && (jsxRuntime.jsx(IconListTile.IconListTile, Object.assign({ dataTestId: 'show-more-options', onClick: () => setShowCard(true) }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-primary' }, { children: jsxRuntime.jsx(dotsHorizontal.ReactComponent, {}) })) }), 'show-more-options'))] })), jsxRuntime.jsx(OverlayCard.OverlayCard, Object.assign({ isOpen: showCard, onClickOverlay: closeCard }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'social-sign-in--card' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: "Choose a social account" })) })), jsxRuntime.jsx("div", Object.assign({ className: 'social-sign-in--card--body' }, { children: enabledSocialProviders.map((provider) => (jsxRuntime.jsx(IconListTile.IconListTile, Object.assign({ dataTestId: `card-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--card--tile' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }) }), provider))) }))] })) }))] }));
79
+ } }, { children: [socialProvidersToDisplayInline.map((provider) => (jsxRuntime.jsxs(IconListTile.IconListTile, Object.assign({ dataTestId: `inline-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--tile' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }), showConnectText && (jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary' }, { children: ["Connect with ", capitalize.capitalize(provider)] })))] }), provider))), showCardButton && (jsxRuntime.jsx(IconListTile.IconListTile, Object.assign({ dataTestId: 'show-more-options', onClick: () => setShowCard(true) }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-primary' }, { children: jsxRuntime.jsx(dotsHorizontal.ReactComponent, {}) })) }), 'show-more-options'))] })), jsxRuntime.jsx(OverlayCard.OverlayCard, Object.assign({ isOpen: showCard, onClickOverlay: closeCard }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'social-sign-in--card' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: "Choose a social account" })) })), jsxRuntime.jsx("div", Object.assign({ className: 'social-sign-in--card--body' }, { children: socialProviders.map((provider) => (jsxRuntime.jsx(IconListTile.IconListTile, Object.assign({ dataTestId: `card-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--card--tile' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }) }), provider))) }))] })) }))] }));
78
80
  };
79
81
 
80
82
  exports.SocialSignIn = SocialSignIn;
@@ -15,7 +15,7 @@ import '../../../../utils/constants/colors.js';
15
15
  import '../../../../shared/utils/classes/storage/localStorage.js';
16
16
  import 'ethers';
17
17
  import '../../../../shared/consts/index.js';
18
- import '../../../../context/DynamicContext/DynamicContext.js';
18
+ import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
19
19
  import '@dynamic-labs/multi-wallet';
20
20
  import '../../../../components/ShadowDOM/ShadowDOM.js';
21
21
  import '../../../../context/ThemeContext/ThemeContext.js';
@@ -51,16 +51,18 @@ import '../../../../components/OverlayCard/OverlayCard.context.js';
51
51
  import { capitalize } from '../../../../shared/utils/functions/capitalize/capitalize.js';
52
52
 
53
53
  const SocialSignIn = () => {
54
+ const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext();
54
55
  const { socialProvider, setSocialProvider, socialWalletConnector, enabledSocialProviders, } = useSocialRedirectContext();
55
56
  const getSocialIcon = useGetSocialIcon();
56
57
  const [showCard, setShowCard] = useState(false);
57
58
  const closeCard = () => !isLoading && setShowCard(false);
58
- const numberOfEnabledSocialProviders = enabledSocialProviders.length;
59
+ const socialProviders = socialProvidersFilter(enabledSocialProviders);
60
+ const numberOfEnabledSocialProviders = socialProviders.length;
59
61
  const showConnectText = numberOfEnabledSocialProviders === 1;
60
62
  const showCardButton = numberOfEnabledSocialProviders > 5;
61
63
  const socialProvidersToDisplayInline = showCardButton
62
- ? enabledSocialProviders.slice(0, 4)
63
- : enabledSocialProviders.slice(0, 5);
64
+ ? socialProviders.slice(0, 4)
65
+ : socialProviders.slice(0, 5);
64
66
  const numberOfSocialGridItems = numberOfEnabledSocialProviders + (showCardButton ? 1 : 0);
65
67
  const { mutate: onClickProvider, isLoading } = useMutation((provider) => __awaiter(void 0, void 0, void 0, function* () {
66
68
  setSocialProvider(provider);
@@ -70,7 +72,7 @@ const SocialSignIn = () => {
70
72
  const closeButton = (jsx(IconButton, Object.assign({ onClick: closeCard, type: 'button', id: 'close-button', disabled: isLoading, "data-testid": 'close-button' }, { children: jsx(SvgClose, {}) })));
71
73
  return (jsxs(Fragment, { children: [jsxs("div", Object.assign({ className: 'social-sign-in', style: {
72
74
  '--number-of-social-grid-items': numberOfSocialGridItems,
73
- } }, { children: [socialProvidersToDisplayInline.map((provider) => (jsxs(IconListTile, Object.assign({ dataTestId: `inline-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--tile' }, { children: [jsx(IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }), showConnectText && (jsxs(Typography, Object.assign({ variant: 'button_primary' }, { children: ["Connect with ", capitalize(provider)] })))] }), provider))), showCardButton && (jsx(IconListTile, Object.assign({ dataTestId: 'show-more-options', onClick: () => setShowCard(true) }, { children: jsx(Icon, Object.assign({ color: 'text-primary' }, { children: jsx(SvgDotsHorizontal, {}) })) }), 'show-more-options'))] })), jsx(OverlayCard, Object.assign({ isOpen: showCard, onClickOverlay: closeCard }, { children: jsxs("div", Object.assign({ className: 'social-sign-in--card' }, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: "Choose a social account" })) })), jsx("div", Object.assign({ className: 'social-sign-in--card--body' }, { children: enabledSocialProviders.map((provider) => (jsx(IconListTile, Object.assign({ dataTestId: `card-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--card--tile' }, { children: jsx(IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }) }), provider))) }))] })) }))] }));
75
+ } }, { children: [socialProvidersToDisplayInline.map((provider) => (jsxs(IconListTile, Object.assign({ dataTestId: `inline-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--tile' }, { children: [jsx(IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }), showConnectText && (jsxs(Typography, Object.assign({ variant: 'button_primary' }, { children: ["Connect with ", capitalize(provider)] })))] }), provider))), showCardButton && (jsx(IconListTile, Object.assign({ dataTestId: 'show-more-options', onClick: () => setShowCard(true) }, { children: jsx(Icon, Object.assign({ color: 'text-primary' }, { children: jsx(SvgDotsHorizontal, {}) })) }), 'show-more-options'))] })), jsx(OverlayCard, Object.assign({ isOpen: showCard, onClickOverlay: closeCard }, { children: jsxs("div", Object.assign({ className: 'social-sign-in--card' }, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: "Choose a social account" })) })), jsx("div", Object.assign({ className: 'social-sign-in--card--body' }, { children: socialProviders.map((provider) => (jsx(IconListTile, Object.assign({ dataTestId: `card-${provider}`, onClick: () => onClickProvider(provider), className: 'social-sign-in--card--tile' }, { children: jsx(IconWithSpinner, { Icon: getSocialIcon(provider), isSpinning: socialProvider === provider, iconSize: 32 }) }), provider))) }))] })) }))] }));
74
76
  };
75
77
 
76
78
  export { SocialSignIn };
@@ -39,6 +39,7 @@ require('../../context/MockContext/MockContext.cjs');
39
39
  var useConnectAndSign = require('../../utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
40
40
  require('../../context/CaptchaContext/CaptchaContext.cjs');
41
41
  require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
42
+ var useWalletConnectorEvents = require('../../utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.cjs');
42
43
  var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
43
44
  require('../../components/Popper/Popper/Popper.cjs');
44
45
  require('../../components/Popper/PopperContext/PopperContext.cjs');
@@ -48,27 +49,26 @@ require('../../components/InlineWidget/InlineWidget.cjs');
48
49
  var NetworkPicker = require('../../components/NetworkPicker/NetworkPicker.cjs');
49
50
  var UserAddress = require('../../components/UserAddress/UserAddress.cjs');
50
51
  var AuthProviderIcon = require('../../components/AuthProviderIcon/AuthProviderIcon.cjs');
51
- var useUpdateUserProfileByJWTCallback = require('../../utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs');
52
52
  var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNetworkButton.cjs');
53
53
 
54
54
  const NetworkNotSupported = () => {
55
55
  var _a, _b, _c, _d;
56
- const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setShowAuthFlow, setCallback, setNetwork, } = useInternalDynamicContext.useInternalDynamicContext();
57
- const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
56
+ const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setNetwork, } = useInternalDynamicContext.useInternalDynamicContext();
58
57
  const finishConnectAndSign = useConnectAndSign.useConnectAndSign();
59
58
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
59
+ const onChainChange = (network) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
60
+ if (isSupportedNetwork.isSupportedNetwork({ network, walletConnector })) {
61
+ finishConnectAndSign({
62
+ walletConnector: walletConnector,
63
+ });
64
+ }
65
+ });
66
+ // We can't listen on the network defined in the context,
67
+ // because events on the primaryWallet are defined after message is signed.
68
+ useWalletConnectorEvents.useWalletConnectorEvents(walletConnector, { onChainChange });
60
69
  if (!walletConnector) {
61
70
  return null;
62
71
  }
63
- const handleNetworkChange = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
64
- if (!onboardingOnlyJwt) {
65
- finishConnectAndSign({ walletConnector });
66
- return;
67
- }
68
- setCallback('authSuccess');
69
- yield updateUserProfileByJWT(onboardingOnlyJwt);
70
- setShowAuthFlow(false);
71
- });
72
72
  const userProfile = decodedOnboardingOnlyToken && createUserProfile.createUserProfile(decodedOnboardingOnlyToken);
73
73
  const evmNetworks = walletConnector.evmNetworks || [];
74
74
  const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
@@ -78,13 +78,13 @@ const NetworkNotSupported = () => {
78
78
  networkChainId: networkId,
79
79
  });
80
80
  setNetwork(networkId);
81
- handleNetworkChange();
81
+ finishConnectAndSign({ walletConnector });
82
82
  }
83
83
  catch (e) {
84
84
  logger.logger.debug(e);
85
85
  }
86
86
  });
87
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsxRuntime.jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker', customCallbackOnSuccess: handleNetworkChange })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
87
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsxRuntime.jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
88
88
  };
89
89
 
90
90
  exports.NetworkNotSupported = NetworkNotSupported;
@@ -35,6 +35,7 @@ import '../../context/MockContext/MockContext.js';
35
35
  import { useConnectAndSign } from '../../utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js';
36
36
  import '../../context/CaptchaContext/CaptchaContext.js';
37
37
  import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
38
+ import { useWalletConnectorEvents } from '../../utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.js';
38
39
  import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
39
40
  import '../../components/Popper/Popper/Popper.js';
40
41
  import '../../components/Popper/PopperContext/PopperContext.js';
@@ -44,27 +45,26 @@ import '../../components/InlineWidget/InlineWidget.js';
44
45
  import { NetworkPicker } from '../../components/NetworkPicker/NetworkPicker.js';
45
46
  import { UserAddress } from '../../components/UserAddress/UserAddress.js';
46
47
  import { AuthProviderIcon } from '../../components/AuthProviderIcon/AuthProviderIcon.js';
47
- import { useUpdateUserProfileByJWTCallback } from '../../utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
48
48
  import { SelectNetworkButton } from '../../components/SelectNetworkButton/SelectNetworkButton.js';
49
49
 
50
50
  const NetworkNotSupported = () => {
51
51
  var _a, _b, _c, _d;
52
- const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setShowAuthFlow, setCallback, setNetwork, } = useInternalDynamicContext();
53
- const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
52
+ const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setNetwork, } = useInternalDynamicContext();
54
53
  const finishConnectAndSign = useConnectAndSign();
55
54
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
55
+ const onChainChange = (network) => __awaiter(void 0, void 0, void 0, function* () {
56
+ if (isSupportedNetwork({ network, walletConnector })) {
57
+ finishConnectAndSign({
58
+ walletConnector: walletConnector,
59
+ });
60
+ }
61
+ });
62
+ // We can't listen on the network defined in the context,
63
+ // because events on the primaryWallet are defined after message is signed.
64
+ useWalletConnectorEvents(walletConnector, { onChainChange });
56
65
  if (!walletConnector) {
57
66
  return null;
58
67
  }
59
- const handleNetworkChange = () => __awaiter(void 0, void 0, void 0, function* () {
60
- if (!onboardingOnlyJwt) {
61
- finishConnectAndSign({ walletConnector });
62
- return;
63
- }
64
- setCallback('authSuccess');
65
- yield updateUserProfileByJWT(onboardingOnlyJwt);
66
- setShowAuthFlow(false);
67
- });
68
68
  const userProfile = decodedOnboardingOnlyToken && createUserProfile(decodedOnboardingOnlyToken);
69
69
  const evmNetworks = walletConnector.evmNetworks || [];
70
70
  const _isSupportedNetwork = isSupportedNetwork({ network, walletConnector });
@@ -74,13 +74,13 @@ const NetworkNotSupported = () => {
74
74
  networkChainId: networkId,
75
75
  });
76
76
  setNetwork(networkId);
77
- handleNetworkChange();
77
+ finishConnectAndSign({ walletConnector });
78
78
  }
79
79
  catch (e) {
80
80
  logger.debug(e);
81
81
  }
82
82
  });
83
- return (jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsx(AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsx(WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsx(UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker', customCallbackOnSuccess: handleNetworkChange })) })), jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
83
+ return (jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsx(AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsx(WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsx(UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
84
84
  };
85
85
 
86
86
  export { NetworkNotSupported };
@@ -41,6 +41,7 @@ require('../../context/MockContext/MockContext.cjs');
41
41
  var useConnectAndSign = require('../../utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
42
42
  require('../../context/CaptchaContext/CaptchaContext.cjs');
43
43
  require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
44
+ var useWalletConnectorEvents = require('../../utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.cjs');
44
45
  require('../../components/Popper/Popper/Popper.cjs');
45
46
  require('../../components/Popper/PopperContext/PopperContext.cjs');
46
47
  require('formik');
@@ -52,31 +53,26 @@ var useUpdateUserProfileByJWTCallback = require('../../utils/hooks/useUpdateUser
52
53
  // as the wallet does not support programmatic network change.
53
54
  const NetworkNotSupportedSwitchManual = () => {
54
55
  var _a, _b;
55
- const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
56
+ const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
56
57
  const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
57
- const finishSign = useConnectAndSign.useConnectAndSign();
58
- // Listen for network changes
59
- React.useEffect(() => {
60
- if (!walletConnector)
61
- return;
62
- const onChainChange = (network) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
63
- if (isSupportedNetwork.isSupportedNetwork({ network, walletConnector })) {
64
- if (onboardingOnlyJwt) {
65
- updateUserProfileByJWT(onboardingOnlyJwt);
66
- setShowAuthFlow(false);
67
- }
68
- else {
69
- finishSign({ walletConnector });
70
- }
71
- }
72
- });
73
- walletConnector.setupEventListeners({
74
- onChainChange,
75
- });
76
- return () => {
77
- walletConnector.teardownEventListeners();
78
- };
79
- }, [onboardingOnlyJwt, walletConnector, updateUserProfileByJWT]);
58
+ const finishConnectAndSign = useConnectAndSign.useConnectAndSign();
59
+ const onChainChange = React.useCallback((network) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
60
+ if (isSupportedNetwork.isSupportedNetwork({ network, walletConnector })) {
61
+ finishConnectAndSign({
62
+ walletConnector: walletConnector,
63
+ });
64
+ }
65
+ }),
66
+ // eslint-disable-next-line react-hooks/exhaustive-deps
67
+ [
68
+ finishConnectAndSign,
69
+ onboardingOnlyJwt,
70
+ updateUserProfileByJWT,
71
+ walletConnector,
72
+ ]);
73
+ // We can't listen on the network defined in the context,
74
+ // because events on the primaryWallet are defined after message is signed.
75
+ useWalletConnectorEvents.useWalletConnectorEvents(walletConnector, { onChainChange });
80
76
  const iconSize = 80;
81
77
  const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
82
78
  height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from '../../../../_virtual/_tslib.js';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useEffect } from 'react';
3
+ import { useCallback } from 'react';
4
4
  import { WalletIcon } from '@dynamic-labs/wallet-book';
5
5
  import { Typography } from '../../components/Typography/Typography.js';
6
6
  import '@dynamic-labs/sdk-api';
@@ -37,6 +37,7 @@ import '../../context/MockContext/MockContext.js';
37
37
  import { useConnectAndSign } from '../../utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js';
38
38
  import '../../context/CaptchaContext/CaptchaContext.js';
39
39
  import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
40
+ import { useWalletConnectorEvents } from '../../utils/hooks/useWalletConnectorEvents/useWalletConnectorEvents.js';
40
41
  import '../../components/Popper/Popper/Popper.js';
41
42
  import '../../components/Popper/PopperContext/PopperContext.js';
42
43
  import 'formik';
@@ -48,31 +49,26 @@ import { useUpdateUserProfileByJWTCallback } from '../../utils/hooks/useUpdateUs
48
49
  // as the wallet does not support programmatic network change.
49
50
  const NetworkNotSupportedSwitchManual = () => {
50
51
  var _a, _b;
51
- const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, setShowAuthFlow, } = useInternalDynamicContext();
52
+ const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, } = useInternalDynamicContext();
52
53
  const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
53
- const finishSign = useConnectAndSign();
54
- // Listen for network changes
55
- useEffect(() => {
56
- if (!walletConnector)
57
- return;
58
- const onChainChange = (network) => __awaiter(void 0, void 0, void 0, function* () {
59
- if (isSupportedNetwork({ network, walletConnector })) {
60
- if (onboardingOnlyJwt) {
61
- updateUserProfileByJWT(onboardingOnlyJwt);
62
- setShowAuthFlow(false);
63
- }
64
- else {
65
- finishSign({ walletConnector });
66
- }
67
- }
68
- });
69
- walletConnector.setupEventListeners({
70
- onChainChange,
71
- });
72
- return () => {
73
- walletConnector.teardownEventListeners();
74
- };
75
- }, [onboardingOnlyJwt, walletConnector, updateUserProfileByJWT]);
54
+ const finishConnectAndSign = useConnectAndSign();
55
+ const onChainChange = useCallback((network) => __awaiter(void 0, void 0, void 0, function* () {
56
+ if (isSupportedNetwork({ network, walletConnector })) {
57
+ finishConnectAndSign({
58
+ walletConnector: walletConnector,
59
+ });
60
+ }
61
+ }),
62
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
+ [
64
+ finishConnectAndSign,
65
+ onboardingOnlyJwt,
66
+ updateUserProfileByJWT,
67
+ walletConnector,
68
+ ]);
69
+ // We can't listen on the network defined in the context,
70
+ // because events on the primaryWallet are defined after message is signed.
71
+ useWalletConnectorEvents(walletConnector, { onChainChange });
76
72
  const iconSize = 80;
77
73
  const icon = (jsx(WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
78
74
  height: pixelToRem(iconSize * iconRatio),
@@ -33,7 +33,7 @@ var WalletListItem = require('./WalletListItem/WalletListItem.cjs');
33
33
  localStorage.LocalStorage.setToLS(localStorage$1.WALLET_PICKER_SEARCH_KEY, '');
34
34
  const WalletList = ({ isWalletConnectList = false, }) => {
35
35
  var _a;
36
- const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, connectedWallets, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
36
+ const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
37
37
  const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
38
38
  const { error } = ErrorContext.useErrorContext();
39
39
  const { view } = ViewContext.useViewContext();
@@ -78,7 +78,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
78
78
  };
79
79
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-list__container' }, { children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsxRuntime.jsx(Search.Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('wallet-list__scroll-container', {
80
80
  'wallet-list__scroll-container--full-height': isSearchEnabled,
81
- }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
81
+ }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
82
82
  'wallet-list__tiny-footer--hidden': footerIsVisible,
83
83
  }), "data-testid": 'wallet-list-tiny-footer' }))] }));
84
84
  };
@@ -29,7 +29,7 @@ import { WalletListItem } from './WalletListItem/WalletListItem.js';
29
29
  LocalStorage.setToLS(WALLET_PICKER_SEARCH_KEY, '');
30
30
  const WalletList = ({ isWalletConnectList = false, }) => {
31
31
  var _a;
32
- const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, connectedWallets, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext();
32
+ const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext();
33
33
  const { walletBook } = useWalletBookContext();
34
34
  const { error } = useErrorContext();
35
35
  const { view } = useViewContext();
@@ -74,7 +74,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
74
74
  };
75
75
  return (jsxs(Fragment, { children: [jsxs("div", Object.assign({ className: 'wallet-list__container' }, { children: [error && jsx(ErrorContainer, { children: error }), !projectSettings ? (jsx(Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsx(Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxs("div", Object.assign({ className: classNames('wallet-list__scroll-container', {
76
76
  'wallet-list__scroll-container--full-height': isSearchEnabled,
77
- }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
77
+ }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
78
78
  'wallet-list__tiny-footer--hidden': footerIsVisible,
79
79
  }), "data-testid": 'wallet-list-tiny-footer' }))] }));
80
80
  };
@@ -1,7 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { Wallet, WalletOption } from '../../../shared';
2
+ import { WalletOption } from '../../../shared';
3
3
  export type WalletListItemProps = {
4
- connectedWallets: Wallet[];
5
4
  onResetSearchValue?: (newSearchValue: string) => void;
6
5
  tile?: WalletListItemTile;
7
6
  usingMultiWallet: boolean;