@dynamic-labs/sdk-react-core 0.19.0-alpha.7 → 0.19.0-alpha.8

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 (169) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.cjs +3 -3
  3. package/package.js +3 -3
  4. package/package.json +10 -10
  5. package/src/index.d.ts +1 -1
  6. package/src/lib/Main.cjs +1 -0
  7. package/src/lib/Main.js +1 -0
  8. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +2 -2
  9. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +2 -2
  10. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +3 -3
  11. package/src/lib/components/IconWithStatus/IconWithStatus.d.ts +2 -2
  12. package/src/lib/components/IconWithStatus/IconWithStatus.js +3 -3
  13. package/src/lib/components/MockedQrCode/MockedQrCode.cjs +1 -1
  14. package/src/lib/components/MockedQrCode/MockedQrCode.js +1 -1
  15. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +2 -2
  16. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -1
  17. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +2 -2
  18. package/src/lib/components/SocialSignIn/SocialSignIn.cjs +26 -14
  19. package/src/lib/components/SocialSignIn/SocialSignIn.d.ts +8 -7
  20. package/src/lib/components/SocialSignIn/SocialSignIn.js +26 -14
  21. package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +1 -1
  22. package/src/lib/components/UserProfile/UserProfile.cjs +4 -1
  23. package/src/lib/components/UserProfile/UserProfile.js +4 -1
  24. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +15 -13
  25. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +15 -13
  26. package/src/lib/context/DynamicContext/helpers.cjs +22 -10
  27. package/src/lib/context/DynamicContext/helpers.d.ts +4 -2
  28. package/src/lib/context/DynamicContext/helpers.js +20 -10
  29. package/src/lib/context/ErrorContext/ErrorContext.cjs +4 -1
  30. package/src/lib/context/ErrorContext/ErrorContext.js +4 -1
  31. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +7 -4
  32. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +5 -5
  33. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +7 -4
  34. package/src/lib/data/api.cjs +48 -16
  35. package/src/lib/data/api.d.ts +1 -0
  36. package/src/lib/data/api.js +50 -19
  37. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +1 -1
  38. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +1 -1
  39. package/src/lib/locale/en/translation.cjs +2 -4
  40. package/src/lib/locale/en/translation.js +2 -4
  41. package/src/lib/shared/types/index.d.ts +4 -0
  42. package/src/lib/shared/utils/functions/wallet/createWallet.cjs +1 -1
  43. package/src/lib/shared/utils/functions/wallet/createWallet.js +1 -1
  44. package/src/lib/styles/index.shadow.cjs +1 -1
  45. package/src/lib/styles/index.shadow.js +1 -1
  46. package/src/lib/utils/constants/localStorage.cjs +4 -2
  47. package/src/lib/utils/constants/localStorage.d.ts +2 -1
  48. package/src/lib/utils/constants/localStorage.js +3 -2
  49. package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.cjs +11 -0
  50. package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.d.ts +2 -0
  51. package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.js +7 -0
  52. package/src/lib/utils/functions/getActiveOauthCredential/index.d.ts +1 -0
  53. package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.d.ts +2 -0
  54. package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/index.d.ts +1 -0
  55. package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.cjs +19 -0
  56. package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.d.ts +2 -0
  57. package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.js +15 -0
  58. package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/index.d.ts +1 -0
  59. package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.cjs +19 -0
  60. package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.d.ts +2 -0
  61. package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.js +15 -0
  62. package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/index.d.ts +1 -0
  63. package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.cjs +19 -0
  64. package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.d.ts +2 -0
  65. package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.js +15 -0
  66. package/src/lib/utils/functions/getSocialSignInProviderFromString/index.d.ts +1 -0
  67. package/src/lib/utils/functions/index.d.ts +5 -0
  68. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +2 -1
  69. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +2 -1
  70. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +3 -3
  71. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -4
  72. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +10 -1
  73. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +10 -1
  74. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +10 -164
  75. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +2 -2
  76. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +12 -166
  77. package/src/lib/utils/hooks/useSocialAuth/index.d.ts +1 -0
  78. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +278 -0
  79. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +20 -0
  80. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +274 -0
  81. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +13 -3
  82. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +13 -3
  83. package/src/lib/views/AccountExistsView/AccountExistsView.cjs +4 -2
  84. package/src/lib/views/AccountExistsView/AccountExistsView.js +4 -2
  85. package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
  86. package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
  87. package/src/lib/views/LoginView/LoginView.cjs +1 -1
  88. package/src/lib/views/LoginView/LoginView.js +1 -1
  89. package/src/lib/views/LoginView/sections/LoginWidget.d.ts +5 -0
  90. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +77 -0
  91. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.d.ts +3 -0
  92. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +73 -0
  93. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/index.d.ts +1 -0
  94. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +3 -2
  95. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.d.ts +2 -1
  96. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +3 -2
  97. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +18 -4
  98. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.d.ts +6 -1
  99. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +18 -4
  100. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +3 -2
  101. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +3 -2
  102. package/src/lib/views/LoginView/useLoginView.cjs +9 -10
  103. package/src/lib/views/LoginView/useLoginView.js +9 -10
  104. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -1
  105. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -1
  106. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -1
  107. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -1
  108. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -1
  109. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -1
  110. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +2 -2
  111. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +2 -2
  112. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -1
  113. package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -1
  114. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -1
  115. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -1
  116. package/src/lib/views/QrCodeView/QRCode.cjs +3 -3
  117. package/src/lib/views/QrCodeView/QRCode.d.ts +2 -2
  118. package/src/lib/views/QrCodeView/QRCode.js +3 -3
  119. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -2
  120. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.d.ts +2 -1
  121. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -2
  122. package/src/lib/views/QrCodeView/QrCodeView.cjs +2 -2
  123. package/src/lib/views/QrCodeView/QrCodeView.js +2 -2
  124. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
  125. package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
  126. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +4 -6
  127. package/src/lib/views/SocialRedirectView/SocialRedirectView.d.ts +1 -1
  128. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +4 -6
  129. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +1 -1
  130. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +1 -1
  131. package/src/lib/views/WalletGroupView/WalletGroupView.cjs +1 -1
  132. package/src/lib/views/WalletGroupView/WalletGroupView.js +1 -1
  133. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
  134. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
  135. package/src/lib/views/WalletLockedView/WalletLockedView.cjs +1 -1
  136. package/src/lib/views/WalletLockedView/WalletLockedView.js +1 -1
  137. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -2
  138. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -2
  139. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
  140. package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
  141. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +2 -2
  142. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.d.ts +1 -1
  143. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +2 -2
  144. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
  145. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -1
  146. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
  147. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +1 -1
  148. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +18 -3
  149. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +18 -3
  150. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +9 -1
  151. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.d.ts +1 -1
  152. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +9 -1
  153. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +2 -2
  154. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.d.ts +2 -2
  155. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +2 -2
  156. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +3 -3
  157. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +3 -3
  158. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +1 -1
  159. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +1 -1
  160. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
  161. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
  162. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -1
  163. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -1
  164. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -1
  165. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -1
  166. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -1
  167. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -1
  168. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +6 -5
  169. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +6 -5
@@ -141,7 +141,7 @@ const WalletUsedView = () => {
141
141
  setMultiWalletWidgetState('idle');
142
142
  }
143
143
  });
144
- return (jsxs("div", Object.assign({ className: 'wallet-used-view__container' }, { children: [jsx("div", Object.assign({ className: 'wallet-used-view__icon' }, { children: jsx(WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, width: 64, height: 64 }) })), jsx(Typography, Object.assign({ className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary' }, { children: _shortenWalletAddress })), jsx(Typography, Object.assign({ className: 'wallet-used-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium' }, { children: "Your wallet is already linked to another account" })), jsx(Typography, Object.assign({ className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: "Linking your wallet to this account will unlink it from its previously associated account" })), isSingleWalletAccount && (jsxs("label", Object.assign({ htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label' }, { children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: "I understand that linking this wallet means that I will lose access to the other account." }))] }))), jsx(Button, Object.assign({ buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', buttonRounded: 'default', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet' }, { children: "Link wallet to current account" })), jsx(Button, Object.assign({ dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', buttonRounded: 'small', onClick: handleLogOut }, { children: "Log out" }))] })));
144
+ return (jsxs("div", Object.assign({ className: 'wallet-used-view__container' }, { children: [jsx("div", Object.assign({ className: 'wallet-used-view__icon' }, { children: jsx(WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) })), jsx(Typography, Object.assign({ className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'regular', color: 'primary' }, { children: _shortenWalletAddress })), jsx(Typography, Object.assign({ className: 'wallet-used-view__title', as: 'h6', variant: 'title', color: 'primary', weight: 'medium' }, { children: "Your wallet is already linked to another account" })), jsx(Typography, Object.assign({ className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: "Linking your wallet to this account will unlink it from its previously associated account" })), isSingleWalletAccount && (jsxs("label", Object.assign({ htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label' }, { children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: "I understand that linking this wallet means that I will lose access to the other account." }))] }))), jsx(Button, Object.assign({ buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', buttonRounded: 'default', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet' }, { children: "Link wallet to current account" })), jsx(Button, Object.assign({ dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', buttonRounded: 'small', onClick: handleLogOut }, { children: "Log out" }))] })));
145
145
  };
146
146
 
147
147
  export { WalletUsedView };
@@ -50,7 +50,7 @@ require('../../../../components/OverlayCard/OverlayCard.context.cjs');
50
50
  var DotsMenu = require('../../../DynamicWidget/components/DotsMenu/DotsMenu.cjs');
51
51
  var useFetchNameService = require('../../../DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs');
52
52
 
53
- const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletName, onUnlinkClick }) => {
53
+ const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletKey, onUnlinkClick }) => {
54
54
  const nameService = useFetchNameService.useFetchNameService(walletAddress);
55
55
  const options = [
56
56
  {
@@ -72,7 +72,7 @@ const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletName,
72
72
  text: 'Disconnect',
73
73
  },
74
74
  ];
75
- return (jsxRuntime.jsx(WalletInformationCard.WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName }), balance: walletBalance, menu: jsxRuntime.jsx(DotsMenu.DotsMenu, { options: options }) }));
75
+ return (jsxRuntime.jsx(WalletInformationCard.WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsxRuntime.jsx(DotsMenu.DotsMenu, { options: options }) }));
76
76
  };
77
77
 
78
78
  exports.DynamicBridgeWalletCardBody = DynamicBridgeWalletCardBody;
@@ -1,6 +1,6 @@
1
1
  import { FC, ReactElement } from 'react';
2
2
  export type DynamicBridgeWalletCardBodyProps = {
3
- walletName: string;
3
+ walletKey: string;
4
4
  walletAddress: string;
5
5
  walletBalance?: ReactElement;
6
6
  onUnlinkClick?: () => void;
@@ -46,7 +46,7 @@ import '../../../../components/OverlayCard/OverlayCard.context.js';
46
46
  import { DotsMenu } from '../../../DynamicWidget/components/DotsMenu/DotsMenu.js';
47
47
  import { useFetchNameService } from '../../../DynamicWidget/hooks/useFetchNameService/useFetchNameService.js';
48
48
 
49
- const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletName, onUnlinkClick }) => {
49
+ const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletKey, onUnlinkClick }) => {
50
50
  const nameService = useFetchNameService(walletAddress);
51
51
  const options = [
52
52
  {
@@ -68,7 +68,7 @@ const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletName,
68
68
  text: 'Disconnect',
69
69
  },
70
70
  ];
71
- return (jsx(WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsx(WalletIcon, { walletName: walletName }), balance: walletBalance, menu: jsx(DotsMenu, { options: options }) }));
71
+ return (jsx(WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsx(WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsx(DotsMenu, { options: options }) }));
72
72
  };
73
73
 
74
74
  export { DynamicBridgeWalletCardBody };
@@ -64,7 +64,7 @@ const WalletsView = () => {
64
64
  const WalletIcon = getChainIcon.getChainIcon(chain);
65
65
  const walletInfo = walletConnectorCore.getChainInfo(chain);
66
66
  // Wallets info for chains with connected wallets
67
- return chainWallets.map(({ connector, address, id }) => (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, Object.assign({ networkIcon: jsxRuntime.jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName }, { children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletName: connector.name, walletAddress: address, walletBalance: jsxRuntime.jsx(Balance.Balance, { address: address, connector: connector, network: chain }), onUnlinkClick: () => unlinkConnectedWallet(id) }) }), id)));
67
+ return chainWallets.map(({ connector, address, id }) => (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, Object.assign({ networkIcon: jsxRuntime.jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName }, { children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletKey: connector.key, walletAddress: address, walletBalance: jsxRuntime.jsx(Balance.Balance, { address: address, connector: connector, network: chain }), onUnlinkClick: () => unlinkConnectedWallet(id) }) }), id)));
68
68
  }) })), jsxRuntime.jsx(DynamicWidgetFooter.DynamicWidgetFooter, { children: jsxRuntime.jsx(LogoutButton.LogoutButton, { buttonClassName: 'dynamic-bridge-widget-wallets-view__logout-button', isTextButton: true }) })] }));
69
69
  };
70
70
 
@@ -60,7 +60,7 @@ const WalletsView = () => {
60
60
  const WalletIcon = getChainIcon(chain);
61
61
  const walletInfo = getChainInfo(chain);
62
62
  // Wallets info for chains with connected wallets
63
- return chainWallets.map(({ connector, address, id }) => (jsx(DynamicBridgeWalletCard, Object.assign({ networkIcon: jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName }, { children: jsx(DynamicBridgeWalletCardBody, { walletName: connector.name, walletAddress: address, walletBalance: jsx(Balance, { address: address, connector: connector, network: chain }), onUnlinkClick: () => unlinkConnectedWallet(id) }) }), id)));
63
+ return chainWallets.map(({ connector, address, id }) => (jsx(DynamicBridgeWalletCard, Object.assign({ networkIcon: jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName }, { children: jsx(DynamicBridgeWalletCardBody, { walletKey: connector.key, walletAddress: address, walletBalance: jsx(Balance, { address: address, connector: connector, network: chain }), onUnlinkClick: () => unlinkConnectedWallet(id) }) }), id)));
64
64
  }) })), jsx(DynamicWidgetFooter, { children: jsx(LogoutButton, { buttonClassName: 'dynamic-bridge-widget-wallets-view__logout-button', isTextButton: true }) })] }));
65
65
  };
66
66
 
@@ -31,7 +31,7 @@ const SecondaryWallets = ({ hideUnlinkAction = false }) => {
31
31
  const wallet = getConnectedWalletById('connect-wallet-1');
32
32
  const NetworkIcon = wallet && getChainIcon.getChainIcon(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
33
33
  const networkInfo = wallet && walletConnectorCore.getChainInfo(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
34
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!wallet && (jsxRuntime.jsx(DynamicBridgeWidgetEmptyCard.DynamicBridgeWidgetEmptyCard, { chain: walletsByChain === null || walletsByChain === void 0 ? void 0 : walletsByChain[1].chain })), wallet && NetworkIcon && (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, Object.assign({ networkIcon: jsxRuntime.jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName }, { children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletName: wallet.connector.name, walletAddress: wallet.address, walletBalance:
34
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!wallet && (jsxRuntime.jsx(DynamicBridgeWidgetEmptyCard.DynamicBridgeWidgetEmptyCard, { chain: walletsByChain === null || walletsByChain === void 0 ? void 0 : walletsByChain[1].chain })), wallet && NetworkIcon && (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, Object.assign({ networkIcon: jsxRuntime.jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName }, { children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
35
35
  // eslint-disable-next-line react/jsx-wrap-multilines
36
36
  jsxRuntime.jsx(Balance.Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }), onUnlinkClick: !hideUnlinkAction
37
37
  ? () => unlinkConnectedWallet(wallet.id)
@@ -23,7 +23,7 @@ const SecondaryWallets = ({ hideUnlinkAction = false }) => {
23
23
  const wallet = getConnectedWalletById('connect-wallet-1');
24
24
  const NetworkIcon = wallet && getChainIcon(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
25
25
  const networkInfo = wallet && getChainInfo(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
26
- return (jsxs(Fragment, { children: [!wallet && (jsx(DynamicBridgeWidgetEmptyCard, { chain: walletsByChain === null || walletsByChain === void 0 ? void 0 : walletsByChain[1].chain })), wallet && NetworkIcon && (jsx(DynamicBridgeWalletCard, Object.assign({ networkIcon: jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName }, { children: jsx(DynamicBridgeWalletCardBody, { walletName: wallet.connector.name, walletAddress: wallet.address, walletBalance:
26
+ return (jsxs(Fragment, { children: [!wallet && (jsx(DynamicBridgeWidgetEmptyCard, { chain: walletsByChain === null || walletsByChain === void 0 ? void 0 : walletsByChain[1].chain })), wallet && NetworkIcon && (jsx(DynamicBridgeWalletCard, Object.assign({ networkIcon: jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName }, { children: jsx(DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
27
27
  // eslint-disable-next-line react/jsx-wrap-multilines
28
28
  jsx(Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }), onUnlinkClick: !hideUnlinkAction
29
29
  ? () => unlinkConnectedWallet(wallet.id)
@@ -22,6 +22,7 @@ var classNames = require('../../../../utils/functions/classNames/classNames.cjs'
22
22
  var Typography = require('../../../../components/Typography/Typography.cjs');
23
23
  require('../../../../shared/consts/index.cjs');
24
24
  require('@dynamic-labs/multi-wallet');
25
+ var getActiveOauthCredential = require('../../../../utils/functions/getActiveOauthCredential/getActiveOauthCredential.cjs');
25
26
  require('../../../../components/ShadowDOM/ShadowDOM.cjs');
26
27
  require('../../../../context/ThemeContext/ThemeContext.cjs');
27
28
  var Icon = require('../../../../components/Icon/Icon.cjs');
@@ -61,12 +62,26 @@ const AccountControl = ({ className }) => {
61
62
  const { isOpen, setIsOpen } = DynamicWidgetContext.useWidgetContext();
62
63
  const address = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
63
64
  const nameService = useFetchNameService.useFetchNameService(address);
65
+ const renderUserIdentifier = () => {
66
+ if (nameService === null || nameService === void 0 ? void 0 : nameService.name) {
67
+ return nameService === null || nameService === void 0 ? void 0 : nameService.name;
68
+ }
69
+ if (address) {
70
+ return shortenWalletAddress.shortenWalletAddress(address, 3, 3);
71
+ }
72
+ const oauthCredential = getActiveOauthCredential.getActiveOauthCredential(user);
73
+ if (oauthCredential === null || oauthCredential === void 0 ? void 0 : oauthCredential.publicIdentifier) {
74
+ return oauthCredential.publicIdentifier;
75
+ }
76
+ if (user === null || user === void 0 ? void 0 : user.email) {
77
+ return shortenEmail.shortenEmail(user === null || user === void 0 ? void 0 : user.email);
78
+ }
79
+ return 'My Profile';
80
+ };
64
81
  return (jsxRuntime.jsxs("button", Object.assign({ "data-testid": 'AccountControl', onClick: () => setIsOpen(!isOpen), className: classNames.classNames('account-control__container', {
65
82
  'account-control__container--active': isOpen,
66
83
  'account-control__container--multiwallet-disabled': true,
67
- }, className) }, { children: [jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: authToken, iconSize: 16 }), jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'account-control__name', as: 'p' }, { children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ||
68
- shortenWalletAddress.shortenWalletAddress(address, 3, 3) ||
69
- shortenEmail.shortenEmail(user === null || user === void 0 ? void 0 : user.email) })), jsxRuntime.jsx(Icon.Icon, Object.assign({ className: 'account-control__icon', color: 'text-primary' }, { children: jsxRuntime.jsx(threeDots.ReactComponent, {}) }))] })));
84
+ }, className) }, { children: [jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: authToken, iconSize: 16 }), jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'account-control__name', as: 'p' }, { children: renderUserIdentifier() })), jsxRuntime.jsx(Icon.Icon, Object.assign({ className: 'account-control__icon', color: 'text-primary' }, { children: jsxRuntime.jsx(threeDots.ReactComponent, {}) }))] })));
70
85
  };
71
86
 
72
87
  exports.AccountControl = AccountControl;
@@ -18,6 +18,7 @@ import { classNames } from '../../../../utils/functions/classNames/classNames.js
18
18
  import { Typography } from '../../../../components/Typography/Typography.js';
19
19
  import '../../../../shared/consts/index.js';
20
20
  import '@dynamic-labs/multi-wallet';
21
+ import { getActiveOauthCredential } from '../../../../utils/functions/getActiveOauthCredential/getActiveOauthCredential.js';
21
22
  import '../../../../components/ShadowDOM/ShadowDOM.js';
22
23
  import '../../../../context/ThemeContext/ThemeContext.js';
23
24
  import { Icon } from '../../../../components/Icon/Icon.js';
@@ -57,12 +58,26 @@ const AccountControl = ({ className }) => {
57
58
  const { isOpen, setIsOpen } = useWidgetContext();
58
59
  const address = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
59
60
  const nameService = useFetchNameService(address);
61
+ const renderUserIdentifier = () => {
62
+ if (nameService === null || nameService === void 0 ? void 0 : nameService.name) {
63
+ return nameService === null || nameService === void 0 ? void 0 : nameService.name;
64
+ }
65
+ if (address) {
66
+ return shortenWalletAddress(address, 3, 3);
67
+ }
68
+ const oauthCredential = getActiveOauthCredential(user);
69
+ if (oauthCredential === null || oauthCredential === void 0 ? void 0 : oauthCredential.publicIdentifier) {
70
+ return oauthCredential.publicIdentifier;
71
+ }
72
+ if (user === null || user === void 0 ? void 0 : user.email) {
73
+ return shortenEmail(user === null || user === void 0 ? void 0 : user.email);
74
+ }
75
+ return 'My Profile';
76
+ };
60
77
  return (jsxs("button", Object.assign({ "data-testid": 'AccountControl', onClick: () => setIsOpen(!isOpen), className: classNames('account-control__container', {
61
78
  'account-control__container--active': isOpen,
62
79
  'account-control__container--multiwallet-disabled': true,
63
- }, className) }, { children: [jsx(AuthProviderIcon, { jwt: authToken, iconSize: 16 }), jsx(Typography, Object.assign({ className: 'account-control__name', as: 'p' }, { children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ||
64
- shortenWalletAddress(address, 3, 3) ||
65
- shortenEmail(user === null || user === void 0 ? void 0 : user.email) })), jsx(Icon, Object.assign({ className: 'account-control__icon', color: 'text-primary' }, { children: jsx(SvgThreeDots, {}) }))] })));
80
+ }, className) }, { children: [jsx(AuthProviderIcon, { jwt: authToken, iconSize: 16 }), jsx(Typography, Object.assign({ className: 'account-control__name', as: 'p' }, { children: renderUserIdentifier() })), jsx(Icon, Object.assign({ className: 'account-control__icon', color: 'text-primary' }, { children: jsx(SvgThreeDots, {}) }))] })));
66
81
  };
67
82
 
68
83
  export { AccountControl };
@@ -20,6 +20,7 @@ require('ethers');
20
20
  require('../../../../../shared/consts/index.cjs');
21
21
  var useInternalDynamicContext = require('../../../../../context/DynamicContext/useInternalDynamicContext.cjs');
22
22
  require('@dynamic-labs/multi-wallet');
23
+ var getActiveOauthCredential = require('../../../../../utils/functions/getActiveOauthCredential/getActiveOauthCredential.cjs');
23
24
  require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
24
25
  require('../../../../../context/ThemeContext/ThemeContext.cjs');
25
26
  var Icon = require('../../../../../components/Icon/Icon.cjs');
@@ -81,12 +82,19 @@ const DynamicWidgetWalletHeader = ({ variant, }) => {
81
82
  setDynamicWidgetView('send-balance');
82
83
  }
83
84
  };
85
+ const renderEmailOrSocialHeader = () => {
86
+ const oauthCredential = getActiveOauthCredential.getActiveOauthCredential(user);
87
+ if (oauthCredential === null || oauthCredential === void 0 ? void 0 : oauthCredential.publicIdentifier) {
88
+ return oauthCredential.publicIdentifier;
89
+ }
90
+ return shortenEmail.shortenEmail(user === null || user === void 0 ? void 0 : user.email);
91
+ };
84
92
  const isActionsVisible = isSendBalanceEnabled || fundingEnabled;
85
93
  return (jsxRuntime.jsxs("div", Object.assign({ className: 'dynamic-widget-wallet-header', "data-testid": 'dynamic-widget-wallet-header' }, { children: [primaryWallet ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_small', color: 'secondary', className: 'dynamic-widget-wallets__title' }, { children: "Active wallet" })), jsxRuntime.jsx(ActiveWalletInformation.ActiveWalletInformation, {})] })) : (jsxRuntime.jsx("div", Object.assign({ className: 'dynamic-widget-wallet-header__icon-container' }, { children: jsxRuntime.jsx(iconic.UserProfileIcon, {}) }))), primaryWallet ? (jsxRuntime.jsx("div", Object.assign({ "data-testid": 'primaryWalletStatus', className: 'dynamic-widget-wallet-header__wallet-info' }, { children: isActionsVisible && (jsxRuntime.jsxs("div", Object.assign({ className: 'dynamic-widget-wallet-header__wallet-actions' }, { children: [fundingEnabled && (jsxRuntime.jsx(Button.Button, Object.assign({ expanded: true, dataTestId: 'buy-crypto-button', buttonPadding: 'small', buttonVariant: 'primary', buttonRounded: 'small', onClick: () => setShowFunding(true), disabled: !supportsFunding, startSlot:
86
94
  // eslint-disable-next-line react/jsx-wrap-multilines
87
95
  jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsxRuntime.jsx(add.ReactComponent, {}) })) }, { children: "Buy" }))), isSendBalanceEnabled && (jsxRuntime.jsx(Button.Button, Object.assign({ expanded: true, dataTestId: 'send-balance-button', buttonPadding: 'small', buttonVariant: 'primary', buttonRounded: 'small', onClick: handleOnClickSend, startSlot:
88
96
  // eslint-disable-next-line react/jsx-wrap-multilines
89
- jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsxRuntime.jsx(send.ReactComponent, {}) })) }, { children: "Send" })))] }))) }))) : (jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'dynamic-widget-wallet-header__email', variant: 'body_normal', weight: 'regular' }, { children: shortenEmail.shortenEmail(user === null || user === void 0 ? void 0 : user.email) })))] })));
97
+ jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsxRuntime.jsx(send.ReactComponent, {}) })) }, { children: "Send" })))] }))) }))) : (jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'dynamic-widget-wallet-header__email', variant: 'body_normal', weight: 'regular' }, { children: renderEmailOrSocialHeader() })))] })));
90
98
  };
91
99
  React__default["default"].memo(DynamicWidgetWalletHeader);
92
100
 
@@ -4,4 +4,4 @@ type DynamicWidgetWalletHeaderProps = {
4
4
  };
5
5
  export declare const DynamicWidgetWalletHeader: FC<DynamicWidgetWalletHeaderProps>;
6
6
  export declare const MemoizedDynamicWidgetWalletHeader: React.NamedExoticComponent<DynamicWidgetWalletHeaderProps>;
7
- export default MemoizedDynamicWidgetWalletHeader;
7
+ export {};
@@ -16,6 +16,7 @@ import 'ethers';
16
16
  import '../../../../../shared/consts/index.js';
17
17
  import { useInternalDynamicContext } from '../../../../../context/DynamicContext/useInternalDynamicContext.js';
18
18
  import '@dynamic-labs/multi-wallet';
19
+ import { getActiveOauthCredential } from '../../../../../utils/functions/getActiveOauthCredential/getActiveOauthCredential.js';
19
20
  import '../../../../../components/ShadowDOM/ShadowDOM.js';
20
21
  import '../../../../../context/ThemeContext/ThemeContext.js';
21
22
  import { Icon } from '../../../../../components/Icon/Icon.js';
@@ -73,12 +74,19 @@ const DynamicWidgetWalletHeader = ({ variant, }) => {
73
74
  setDynamicWidgetView('send-balance');
74
75
  }
75
76
  };
77
+ const renderEmailOrSocialHeader = () => {
78
+ const oauthCredential = getActiveOauthCredential(user);
79
+ if (oauthCredential === null || oauthCredential === void 0 ? void 0 : oauthCredential.publicIdentifier) {
80
+ return oauthCredential.publicIdentifier;
81
+ }
82
+ return shortenEmail(user === null || user === void 0 ? void 0 : user.email);
83
+ };
76
84
  const isActionsVisible = isSendBalanceEnabled || fundingEnabled;
77
85
  return (jsxs("div", Object.assign({ className: 'dynamic-widget-wallet-header', "data-testid": 'dynamic-widget-wallet-header' }, { children: [primaryWallet ? (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_small', color: 'secondary', className: 'dynamic-widget-wallets__title' }, { children: "Active wallet" })), jsx(ActiveWalletInformation, {})] })) : (jsx("div", Object.assign({ className: 'dynamic-widget-wallet-header__icon-container' }, { children: jsx(UserProfileIcon, {}) }))), primaryWallet ? (jsx("div", Object.assign({ "data-testid": 'primaryWalletStatus', className: 'dynamic-widget-wallet-header__wallet-info' }, { children: isActionsVisible && (jsxs("div", Object.assign({ className: 'dynamic-widget-wallet-header__wallet-actions' }, { children: [fundingEnabled && (jsx(Button, Object.assign({ expanded: true, dataTestId: 'buy-crypto-button', buttonPadding: 'small', buttonVariant: 'primary', buttonRounded: 'small', onClick: () => setShowFunding(true), disabled: !supportsFunding, startSlot:
78
86
  // eslint-disable-next-line react/jsx-wrap-multilines
79
87
  jsx(Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsx(SvgAdd, {}) })) }, { children: "Buy" }))), isSendBalanceEnabled && (jsx(Button, Object.assign({ expanded: true, dataTestId: 'send-balance-button', buttonPadding: 'small', buttonVariant: 'primary', buttonRounded: 'small', onClick: handleOnClickSend, startSlot:
80
88
  // eslint-disable-next-line react/jsx-wrap-multilines
81
- jsx(Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsx(SvgSend, {}) })) }, { children: "Send" })))] }))) }))) : (jsx(Typography, Object.assign({ className: 'dynamic-widget-wallet-header__email', variant: 'body_normal', weight: 'regular' }, { children: shortenEmail(user === null || user === void 0 ? void 0 : user.email) })))] })));
89
+ jsx(Icon, Object.assign({ size: 'small', color: 'text-secondary' }, { children: jsx(SvgSend, {}) })) }, { children: "Send" })))] }))) }))) : (jsx(Typography, Object.assign({ className: 'dynamic-widget-wallet-header__email', variant: 'body_normal', weight: 'regular' }, { children: renderEmailOrSocialHeader() })))] })));
82
90
  };
83
91
  React__default.memo(DynamicWidgetWalletHeader);
84
92
 
@@ -20,10 +20,10 @@ require('@dynamic-labs/multi-wallet');
20
20
  var pixelToRem = require('../../../../utils/functions/pixelToRem/pixelToRem.cjs');
21
21
  var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
22
22
 
23
- const WalletIconWithStatus = ({ iconSize = 24, walletName, connected, variant = 'primary', }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-icon-with-status__container' }, { children: [jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: {
23
+ const WalletIconWithStatus = ({ iconSize = 24, walletKey, connected, variant = 'primary', }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-icon-with-status__container' }, { children: [jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey, style: {
24
24
  height: pixelToRem.pixelToRem(iconSize),
25
25
  width: pixelToRem.pixelToRem(iconSize),
26
- } }, walletName), jsxRuntime.jsx("div", Object.assign({ "data-testid": 'status-dot-container', className: classNames.classNames('wallet-icon-with-status__dot-container', variant === 'secondary'
26
+ } }, walletKey), jsxRuntime.jsx("div", Object.assign({ "data-testid": 'status-dot-container', className: classNames.classNames('wallet-icon-with-status__dot-container', variant === 'secondary'
27
27
  ? 'wallet-icon-with-status__dot-container--secondary'
28
28
  : '') }, { children: jsxRuntime.jsx(StatusDot.StatusDot, { variant: connected ? 'green' : 'red' }) }))] })));
29
29
 
@@ -3,7 +3,7 @@ type Props = {
3
3
  connected?: boolean;
4
4
  iconSize?: number;
5
5
  variant?: 'primary' | 'secondary';
6
- walletName: string;
6
+ walletKey: string;
7
7
  };
8
- export declare const WalletIconWithStatus: ({ iconSize, walletName, connected, variant, }: Props) => JSX.Element;
8
+ export declare const WalletIconWithStatus: ({ iconSize, walletKey, connected, variant, }: Props) => JSX.Element;
9
9
  export {};
@@ -16,10 +16,10 @@ import '@dynamic-labs/multi-wallet';
16
16
  import { pixelToRem } from '../../../../utils/functions/pixelToRem/pixelToRem.js';
17
17
  import { classNames } from '../../../../utils/functions/classNames/classNames.js';
18
18
 
19
- const WalletIconWithStatus = ({ iconSize = 24, walletName, connected, variant = 'primary', }) => (jsxs("div", Object.assign({ className: 'wallet-icon-with-status__container' }, { children: [jsx(WalletIcon, { walletName: walletName, style: {
19
+ const WalletIconWithStatus = ({ iconSize = 24, walletKey, connected, variant = 'primary', }) => (jsxs("div", Object.assign({ className: 'wallet-icon-with-status__container' }, { children: [jsx(WalletIcon, { walletKey: walletKey, style: {
20
20
  height: pixelToRem(iconSize),
21
21
  width: pixelToRem(iconSize),
22
- } }, walletName), jsx("div", Object.assign({ "data-testid": 'status-dot-container', className: classNames('wallet-icon-with-status__dot-container', variant === 'secondary'
22
+ } }, walletKey), jsx("div", Object.assign({ "data-testid": 'status-dot-container', className: classNames('wallet-icon-with-status__dot-container', variant === 'secondary'
23
23
  ? 'wallet-icon-with-status__dot-container--secondary'
24
24
  : '') }, { children: jsx(StatusDot, { variant: connected ? 'green' : 'red' }) }))] })));
25
25
 
@@ -58,14 +58,14 @@ const NoQrNotInstalledModalView = () => {
58
58
  if (!selectedWalletConnector) {
59
59
  return null;
60
60
  }
61
- const walletName = walletBook.getWalletBookWallet(walletBook$1, selectedWalletConnector.name).name;
62
- const walletLinks = walletBook.getWalletLinks(walletBook$1, selectedWalletConnector.name);
61
+ const walletName = walletBook.getWalletBookWallet(walletBook$1, selectedWalletConnector.key).name;
62
+ const walletLinks = walletBook.getWalletLinks(walletBook$1, selectedWalletConnector.key);
63
63
  const { currentDesktopUrl, userBrowser } = parseWalletLinks.parseWalletLinks(walletLinks);
64
64
  const downloadLinks = userBrowser && currentDesktopUrl ? (jsxRuntime.jsx(WalletHelpLink.WalletHelpLink, { name: userBrowser, link: currentDesktopUrl, Icon: getBrowserIcon.getBrowserIcon(userBrowser) }, userBrowser)) : (Object.entries(walletLinks)
65
65
  .filter(([, link]) => link !== '')
66
66
  .filter(([name]) => name !== 'ios' && name !== 'android')
67
67
  .map(([name, link]) => (jsxRuntime.jsx(WalletHelpLink.WalletHelpLink, { name: name, link: link, Icon: getBrowserIcon.getBrowserIcon(name) }, name))));
68
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view', "data-testid": 'no-qr-code-not-installed' }, { children: [jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector.name, style: { height: pixelToRem.pixelToRem(64), width: pixelToRem.pixelToRem(64) } }), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: ["We can\u2019t detect ", walletName, " extension"] })), Array.isArray(downloadLinks) && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary' }, { children: "Select from your preferred options below:" }))), jsxRuntime.jsx("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view__links-section' }, { children: downloadLinks })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_mini', color: 'secondary' }, { children: "Refresh the page once installed" }))] })));
68
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view', "data-testid": 'no-qr-code-not-installed' }, { children: [jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem.pixelToRem(64), width: pixelToRem.pixelToRem(64) } }), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: ["We can\u2019t detect ", walletName, " extension"] })), Array.isArray(downloadLinks) && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary' }, { children: "Select from your preferred options below:" }))), jsxRuntime.jsx("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view__links-section' }, { children: downloadLinks })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_mini', color: 'secondary' }, { children: "Refresh the page once installed" }))] })));
69
69
  };
70
70
 
71
71
  exports.NoQrNotInstalledModalView = NoQrNotInstalledModalView;
@@ -54,14 +54,14 @@ const NoQrNotInstalledModalView = () => {
54
54
  if (!selectedWalletConnector) {
55
55
  return null;
56
56
  }
57
- const walletName = getWalletBookWallet(walletBook, selectedWalletConnector.name).name;
58
- const walletLinks = getWalletLinks(walletBook, selectedWalletConnector.name);
57
+ const walletName = getWalletBookWallet(walletBook, selectedWalletConnector.key).name;
58
+ const walletLinks = getWalletLinks(walletBook, selectedWalletConnector.key);
59
59
  const { currentDesktopUrl, userBrowser } = parseWalletLinks(walletLinks);
60
60
  const downloadLinks = userBrowser && currentDesktopUrl ? (jsx(WalletHelpLink, { name: userBrowser, link: currentDesktopUrl, Icon: getBrowserIcon(userBrowser) }, userBrowser)) : (Object.entries(walletLinks)
61
61
  .filter(([, link]) => link !== '')
62
62
  .filter(([name]) => name !== 'ios' && name !== 'android')
63
63
  .map(([name, link]) => (jsx(WalletHelpLink, { name: name, link: link, Icon: getBrowserIcon(name) }, name))));
64
- return (jsxs("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view', "data-testid": 'no-qr-code-not-installed' }, { children: [jsx(WalletIcon, { walletName: selectedWalletConnector.name, style: { height: pixelToRem(64), width: pixelToRem(64) } }), jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: ["We can\u2019t detect ", walletName, " extension"] })), Array.isArray(downloadLinks) && (jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary' }, { children: "Select from your preferred options below:" }))), jsx("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view__links-section' }, { children: downloadLinks })), jsx(Typography, Object.assign({ variant: 'body_mini', color: 'secondary' }, { children: "Refresh the page once installed" }))] })));
64
+ return (jsxs("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view', "data-testid": 'no-qr-code-not-installed' }, { children: [jsx(WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem(64), width: pixelToRem(64) } }), jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: ["We can\u2019t detect ", walletName, " extension"] })), Array.isArray(downloadLinks) && (jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary' }, { children: "Select from your preferred options below:" }))), jsx("div", Object.assign({ className: 'no-qr-code-not-installed-modal-view__links-section' }, { children: downloadLinks })), jsx(Typography, Object.assign({ variant: 'body_mini', color: 'secondary' }, { children: "Refresh the page once installed" }))] })));
65
65
  };
66
66
 
67
67
  export { NoQrNotInstalledModalView };
@@ -30,7 +30,7 @@ const PendingAccountSwitchModal = () => {
30
30
  });
31
31
  disconnectAndConnect();
32
32
  }, [selectedConnector]);
33
- return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.name }), title: `Switch wallet in ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}` }, { children: isSameWallet || !connectedWallet ? (jsxRuntime.jsx(SwitchAccountView.SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsxRuntime.jsx(SwitchOrUseActiveAccountView.SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) })));
33
+ return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key }), title: `Switch wallet in ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}` }, { children: isSameWallet || !connectedWallet ? (jsxRuntime.jsx(SwitchAccountView.SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsxRuntime.jsx(SwitchOrUseActiveAccountView.SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) })));
34
34
  };
35
35
 
36
36
  exports.PendingAccountSwitchModal = PendingAccountSwitchModal;
@@ -26,7 +26,7 @@ const PendingAccountSwitchModal = () => {
26
26
  });
27
27
  disconnectAndConnect();
28
28
  }, [selectedConnector]);
29
- return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.name }), title: `Switch wallet in ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}` }, { children: isSameWallet || !connectedWallet ? (jsx(SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsx(SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) })));
29
+ return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedConnector === null || selectedConnector === void 0 ? void 0 : selectedConnector.key }), title: `Switch wallet in ${selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet.connector.name}` }, { children: isSameWallet || !connectedWallet ? (jsx(SwitchAccountView, { selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) : (jsx(SwitchOrUseActiveAccountView, { connectedWallet: connectedWallet, selectedWalletToSwitchTo: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet })) })));
30
30
  };
31
31
 
32
32
  export { PendingAccountSwitchModal };
@@ -74,7 +74,7 @@ const SwitchOrUseActiveAccountView = ({ connectedWallet, selectedWalletToSwitchT
74
74
  computeConnectedStateForWallets,
75
75
  setSelectedWalletConnector,
76
76
  ]);
77
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) })), ' ', "is not active in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, ". To make active, open your ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " wallet and switch to this account."] })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: "Use your active wallet" })), jsxRuntime.jsxs(Button.Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onUseActiveWalletClick, dataTestId: 'use-active-wallet-button' }, { children: ["Select", ' ', jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'xsmall' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name }) })), ' ', shortenWalletAddress.shortenWalletAddress(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.address, 3, 3)] }))] }));
77
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) })), ' ', "is not active in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, ". To make active, open your ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " wallet and switch to this account."] })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: "Use your active wallet" })), jsxRuntime.jsxs(Button.Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onUseActiveWalletClick, dataTestId: 'use-active-wallet-button' }, { children: ["Select", ' ', jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'xsmall' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.key }) })), ' ', shortenWalletAddress.shortenWalletAddress(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.address, 3, 3)] }))] }));
78
78
  };
79
79
 
80
80
  exports.SwitchOrUseActiveAccountView = SwitchOrUseActiveAccountView;
@@ -70,7 +70,7 @@ const SwitchOrUseActiveAccountView = ({ connectedWallet, selectedWalletToSwitchT
70
70
  computeConnectedStateForWallets,
71
71
  setSelectedWalletConnector,
72
72
  ]);
73
- return (jsxs(Fragment, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) })), ' ', "is not active in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, ". To make active, open your ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " wallet and switch to this account."] })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: "Use your active wallet" })), jsxs(Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onUseActiveWalletClick, dataTestId: 'use-active-wallet-button' }, { children: ["Select", ' ', jsx(Icon, Object.assign({ size: 'xsmall' }, { children: jsx(WalletIcon, { walletName: selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name }) })), ' ', shortenWalletAddress(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.address, 3, 3)] }))] }));
73
+ return (jsxs(Fragment, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.address, 3, 3) })), ' ', "is not active in ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, ". To make active, open your ", selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.name, " wallet and switch to this account."] })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary' }, { children: "Use your active wallet" })), jsxs(Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onUseActiveWalletClick, dataTestId: 'use-active-wallet-button' }, { children: ["Select", ' ', jsx(Icon, Object.assign({ size: 'xsmall' }, { children: jsx(WalletIcon, { walletKey: selectedWalletToSwitchTo === null || selectedWalletToSwitchTo === void 0 ? void 0 : selectedWalletToSwitchTo.connector.key }) })), ' ', shortenWalletAddress(connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.address, 3, 3)] }))] }));
74
74
  };
75
75
 
76
76
  export { SwitchOrUseActiveAccountView };
@@ -64,7 +64,7 @@ const PendingAccountSwitchToLinkModal = () => {
64
64
  });
65
65
  disconnectAndConnect();
66
66
  }, [selectedWalletConnector]);
67
- return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
67
+ return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
68
68
  };
69
69
 
70
70
  exports.PendingAccountSwitchToLinkModal = PendingAccountSwitchToLinkModal;
@@ -60,7 +60,7 @@ const PendingAccountSwitchToLinkModal = () => {
60
60
  });
61
61
  disconnectAndConnect();
62
62
  }, [selectedWalletConnector]);
63
- return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
63
+ return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
64
64
  };
65
65
 
66
66
  export { PendingAccountSwitchToLinkModal };
@@ -70,7 +70,7 @@ const DefaultPendingSignModalContent = () => {
70
70
  setMultiWalletWidgetState('idle');
71
71
  }
72
72
  });
73
- return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), utils.isMobile() &&
73
+ return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), utils.isMobile() &&
74
74
  !(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
75
75
  };
76
76
 
@@ -66,7 +66,7 @@ const DefaultPendingSignModalContent = () => {
66
66
  setMultiWalletWidgetState('idle');
67
67
  }
68
68
  });
69
- return (jsxs(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), isMobile() &&
69
+ return (jsxs(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), isMobile() &&
70
70
  !(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsx(Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
71
71
  };
72
72
 
@@ -55,7 +55,7 @@ var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs')
55
55
  const PrimaryNotConnectedModal = () => {
56
56
  var _a;
57
57
  const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
58
- return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
58
+ return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
59
59
  };
60
60
 
61
61
  exports.PrimaryNotConnectedModal = PrimaryNotConnectedModal;
@@ -51,7 +51,7 @@ import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js'
51
51
  const PrimaryNotConnectedModal = () => {
52
52
  var _a;
53
53
  const { primaryWallet } = useInternalDynamicContext();
54
- return (jsxs(DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
54
+ return (jsxs(DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
55
55
  };
56
56
 
57
57
  export { PrimaryNotConnectedModal };
@@ -57,25 +57,26 @@ require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
57
57
  require('../../../../components/OverlayCard/OverlayCard.context.cjs');
58
58
 
59
59
  const QrCodeModalView = ({ walletId }) => {
60
- var _a;
60
+ var _a, _b;
61
61
  const { secondaryWallets, qrcodeUri, desktopUri } = useInternalDynamicContext.useInternalDynamicContext();
62
62
  const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
63
63
  const newPrimaryWallet = secondaryWallets.find(({ id }) => id === walletId);
64
- const walletName = ((_a = newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name) || '';
64
+ const walletKey = ((_a = newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key) || '';
65
+ const walletName = ((_b = newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector) === null || _b === void 0 ? void 0 : _b.name) || '';
65
66
  const { theme } = ThemeContext.useThemeContext();
66
67
  const qrCodeColorsByTheme = {
67
68
  dark: {
68
69
  accentColor: 'var(--dynamic-text-primary)',
69
70
  },
70
71
  light: {
71
- accentColor: walletBook.getWalletPrimaryColor(walletBook$1, walletName) ||
72
+ accentColor: walletBook.getWalletPrimaryColor(walletBook$1, walletKey) ||
72
73
  'var(--dynamic-text-primary)',
73
74
  },
74
75
  };
75
76
  // can't use theme because it's string instead of 'light' | 'dark'
76
77
  const typedTheme = theme.theme.name === 'light' ? 'light' : 'dark';
77
- const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: { height: pixelToRem.pixelToRem(24), width: pixelToRem.pixelToRem(24) } }));
78
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletName: walletConnectorCore.normalizeWalletName(walletName) })) : (
78
+ const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey, style: { height: pixelToRem.pixelToRem(24), width: pixelToRem.pixelToRem(24) } }));
79
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletKey: walletConnectorCore.normalizeWalletName(walletKey) })) : (
79
80
  // this div exists to give the parent a child, so that the parent
80
81
  // takes on its given width and height. the result is stable
81
82
  // rendering of this component, without this there is a brief flash