@dynamic-labs/sdk-react-core 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +7 -7
- package/src/index.js +2 -2
- package/src/lib/components/Alert/Alert.cjs +6 -3
- package/src/lib/components/Alert/Alert.d.ts +1 -0
- package/src/lib/components/Alert/Alert.js +6 -4
- package/src/lib/components/Alert/AlertText/AlertText.cjs +16 -0
- package/src/lib/components/Alert/AlertText/AlertText.d.ts +7 -0
- package/src/lib/components/Alert/AlertText/AlertText.js +12 -0
- package/src/lib/components/Alert/AlertText/index.d.ts +1 -0
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +11 -40
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.js +12 -41
- package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.cjs +6 -8
- package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.d.ts +2 -4
- package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.js +6 -8
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.cjs +67 -0
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.d.ts +14 -0
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.js +63 -0
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/index.d.ts +1 -0
- package/src/lib/components/NetworkPicker/components/{EvmNetworkControl/EvmNetworkControl.cjs → NetworkSwitchControl/NetworkSwitchControl.cjs} +27 -36
- package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.d.ts +16 -0
- package/src/lib/components/NetworkPicker/components/{EvmNetworkControl/EvmNetworkControl.js → NetworkSwitchControl/NetworkSwitchControl.js} +27 -35
- package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/index.d.ts +1 -0
- package/src/lib/components/Portal/Portal.cjs +3 -2
- package/src/lib/components/Portal/Portal.js +3 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
- package/src/lib/components/ShadowDOM/ShadowDOM.cjs +0 -2
- package/src/lib/components/ShadowDOM/ShadowDOM.js +1 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
- package/src/lib/components/UserProfile/UserProfile.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -12
- package/src/lib/context/DynamicContext/DynamicContext.js +15 -12
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +2 -2
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +3 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +0 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +0 -4
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +7 -2
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +7 -2
- package/src/lib/context/DynamicContext/hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.cjs +2 -2
- package/src/lib/context/DynamicContext/hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.js +3 -3
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +5 -2
- package/src/lib/context/ErrorContext/ErrorContext.cjs +7 -6
- package/src/lib/context/ErrorContext/ErrorContext.js +8 -7
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +3 -3
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +3 -3
- package/src/lib/context/ViewContext/ViewContext.cjs +7 -2
- package/src/lib/context/ViewContext/ViewContext.js +7 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +5 -64
- package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +2 -18
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +6 -61
- package/src/lib/data/api/wallets/wallets.cjs +1 -3
- package/src/lib/data/api/wallets/wallets.d.ts +1 -1
- package/src/lib/data/api/wallets/wallets.js +2 -4
- package/src/lib/events/embeddedWallet.d.ts +0 -4
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +2 -6
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +2 -6
- package/src/lib/locale/en/translation.cjs +13 -32
- package/src/lib/locale/en/translation.d.ts +12 -31
- package/src/lib/locale/en/translation.js +13 -32
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.cjs +8 -8
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.js +8 -8
- package/src/lib/modals/index.d.ts +0 -2
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/{currency.cjs → wallet-with-sunglasses.cjs} +14 -26
- package/src/lib/shared/assets/wallet-with-sunglasses.js +34 -0
- package/src/lib/shared/utils/functions/index.d.ts +0 -2
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +7 -5
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +8 -6
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +0 -5
- package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs +1 -1
- package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js +1 -1
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.cjs +2 -4
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.d.ts +2 -2
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.js +2 -4
- package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.cjs +1 -1
- package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +0 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +0 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +0 -2
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +3 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +16 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +16 -4
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -3
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +3 -3
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.cjs +1 -1
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.js +1 -1
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +1 -6
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +1 -6
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +1 -1
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +1 -1
- package/src/lib/utils/hooks/useElementById/useElementById.cjs +2 -2
- package/src/lib/utils/hooks/useElementById/useElementById.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +1 -13
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +1 -13
- package/src/lib/utils/hooks/useEmbeddedWallet/index.d.ts +0 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +7 -23
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +0 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +7 -23
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +3 -3
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.cjs +1 -0
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.js +1 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +1 -1
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +2 -2
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +2 -2
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +1 -1
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +1 -1
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +11 -18
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +12 -19
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +4 -4
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +4 -4
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs +4 -4
- package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js +4 -4
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +4 -4
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +4 -4
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +0 -3
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +0 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +0 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +0 -3
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +0 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +0 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -24
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -24
- package/src/lib/utils/validations/index.d.ts +0 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.cjs +2 -2
- package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +12 -34
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +13 -35
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +2 -2
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +1 -1
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +1 -1
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +1 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +3 -4
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +3 -4
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +11 -11
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +11 -11
- package/src/lib/views/viewToComponentMap.cjs +0 -4
- package/src/lib/views/viewToComponentMap.d.ts +0 -2
- package/src/lib/views/viewToComponentMap.js +0 -4
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +10 -15
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +11 -16
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -6
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.js +4 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useFundingMethods.cjs +19 -11
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useFundingMethods.js +19 -11
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.cjs +103 -50
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.js +99 -46
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.cjs +21 -10
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.js +21 -10
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/types.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.cjs +27 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.js +23 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/convert/convert.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/convert/convert.js +4 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.cjs +33 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.d.ts +8 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.js +29 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.cjs +27 -22
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.js +27 -22
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.cjs +32 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.js +28 -0
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useSubmitExternalWalletFunding/useSubmitExternalWalletFunding.cjs +14 -2
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useSubmitExternalWalletFunding/useSubmitExternalWalletFunding.js +14 -2
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useTokensForFunding/useTokensForFunding.cjs +27 -15
- package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useTokensForFunding/useTokensForFunding.js +27 -15
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.cjs +20 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.js +16 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +10 -23
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +11 -24
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +0 -23
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/index.d.ts +0 -1
- package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.cjs +0 -113
- package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.js +0 -109
- package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.cjs +0 -106
- package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.d.ts +0 -3
- package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.js +0 -102
- package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.types.d.ts +0 -5
- package/src/lib/modals/CreatePasswordModal/index.d.ts +0 -1
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.cjs +0 -106
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.d.ts +0 -3
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.js +0 -102
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.types.d.ts +0 -6
- package/src/lib/modals/EnterPasswordModal/index.d.ts +0 -1
- package/src/lib/shared/assets/alt-key.cjs +0 -55
- package/src/lib/shared/assets/alt-key.js +0 -31
- package/src/lib/shared/assets/currency.js +0 -46
- package/src/lib/shared/assets/lock.cjs +0 -55
- package/src/lib/shared/assets/lock.js +0 -31
- package/src/lib/shared/assets/save-password-hero.cjs +0 -128
- package/src/lib/shared/assets/save-password-hero.js +0 -104
- package/src/lib/shared/assets/wallet-claim-hero.cjs +0 -128
- package/src/lib/shared/assets/wallet-claim-hero.js +0 -104
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.cjs +0 -15
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.d.ts +0 -1
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.js +0 -11
- package/src/lib/shared/utils/functions/generateRandomPassword/index.d.ts +0 -1
- package/src/lib/shared/utils/functions/validatePassword/index.d.ts +0 -1
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.cjs +0 -60
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.d.ts +0 -13
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.js +0 -56
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.cjs +0 -8
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.d.ts +0 -2
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.js +0 -4
- package/src/lib/utils/functions/findCoinbaseMPCWallet/index.d.ts +0 -1
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +0 -53
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.d.ts +0 -9
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +0 -49
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/index.d.ts +0 -1
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.cjs +0 -14
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.js +0 -10
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/index.d.ts +0 -1
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.cjs +0 -16
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.d.ts +0 -2
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.js +0 -12
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/index.d.ts +0 -1
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.cjs +0 -39
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.d.ts +0 -2
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.js +0 -35
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/index.d.ts +0 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/index.d.ts +0 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +0 -229
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +0 -5
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +0 -225
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.cjs +0 -191
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +0 -18
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.js +0 -187
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/index.d.ts +0 -1
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +0 -141
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.d.ts +0 -4
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +0 -137
- package/src/lib/utils/validations/validateMPCProviderEnabled/index.d.ts +0 -1
- package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.cjs +0 -18
- package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.d.ts +0 -2
- package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.js +0 -14
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +0 -116
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.d.ts +0 -2
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +0 -112
- package/src/lib/views/CoinbaseMPCClaimIntro/index.d.ts +0 -1
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +0 -197
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.d.ts +0 -12
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +0 -193
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/index.d.ts +0 -1
- package/src/lib/views/CreatePasswordView/CreatePasswordView.cjs +0 -169
- package/src/lib/views/CreatePasswordView/CreatePasswordView.d.ts +0 -9
- package/src/lib/views/CreatePasswordView/CreatePasswordView.js +0 -165
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +0 -141
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.d.ts +0 -12
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +0 -137
- package/src/lib/views/CreatePasswordView/SavePasswordStep/index.d.ts +0 -1
- package/src/lib/views/CreatePasswordView/index.d.ts +0 -1
- package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +0 -141
- package/src/lib/views/EnterPasswordView/EnterPasswordView.d.ts +0 -8
- package/src/lib/views/EnterPasswordView/EnterPasswordView.js +0 -137
- package/src/lib/views/EnterPasswordView/index.d.ts +0 -1
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs
CHANGED
|
@@ -64,7 +64,6 @@ require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs')
|
|
|
64
64
|
require('@dynamic-labs/rpc-providers');
|
|
65
65
|
require('../../../../store/state/loadingAndLifecycle.cjs');
|
|
66
66
|
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
67
|
-
var helpers = require('../../helpers/helpers.cjs');
|
|
68
67
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
69
68
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
70
69
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
@@ -77,6 +76,7 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
77
76
|
require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
78
77
|
require('react-focus-lock');
|
|
79
78
|
var AuthProviderIcon = require('../../../../components/AuthProviderIcon/AuthProviderIcon.cjs');
|
|
79
|
+
var helpers = require('../../helpers/helpers.cjs');
|
|
80
80
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
81
81
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
82
82
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -114,12 +114,11 @@ var ActiveBitcoinWalletAddresses = require('./ActiveBitcoinWalletAddresses/Activ
|
|
|
114
114
|
var ActiveWalletAddress = require('./ActiveWalletAddress/ActiveWalletAddress.cjs');
|
|
115
115
|
var TokenBalanceList = require('./TokenBalanceList/TokenBalanceList.cjs');
|
|
116
116
|
|
|
117
|
-
const ICON_SIZE =
|
|
117
|
+
const ICON_SIZE = 32;
|
|
118
118
|
const DROPDOWN_ICON_SIZE = 16;
|
|
119
119
|
const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
120
|
-
var _a, _b, _c, _d
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
121
|
const { t } = reactI18next.useTranslation();
|
|
122
|
-
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
123
122
|
const [balanceIsExpanded, setBalanceIsExpanded] = React.useState(false);
|
|
124
123
|
const [hasShadow, setHasShadow] = React.useState(false);
|
|
125
124
|
const [detailsCardOpen, setDetailsCardOpen] = React.useState(false);
|
|
@@ -142,9 +141,10 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
142
141
|
const { showAlert } = PasskeyContext.usePasskeyContext();
|
|
143
142
|
const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
|
|
144
143
|
const isBitcoin = primaryWallet && walletConnectorCore.isBitcoinConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
145
|
-
const isEmbeddedWallet = Boolean(wallet &&
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
const isEmbeddedWallet = Boolean(wallet && ((_c = (_b = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _b === void 0 ? void 0 : _b.key) === null || _c === void 0 ? void 0 : _c.startsWith('turnkey')));
|
|
145
|
+
const openDetailsCard = React.useCallback(() => {
|
|
146
|
+
setTimeout(() => setDetailsCardOpen(true), 0);
|
|
147
|
+
}, []);
|
|
148
148
|
const options = [
|
|
149
149
|
{
|
|
150
150
|
Icon: jsxRuntime.jsx(copy.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE }),
|
|
@@ -154,9 +154,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
Icon: (jsxRuntime.jsx(eyeOutline.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
|
|
157
|
-
callback:
|
|
158
|
-
setDetailsCardOpen(true);
|
|
159
|
-
},
|
|
157
|
+
callback: openDetailsCard,
|
|
160
158
|
hide: !address,
|
|
161
159
|
text: t('dyn_active_wallet_info.options.view_address'),
|
|
162
160
|
},
|
|
@@ -175,9 +173,6 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
175
173
|
text: t('dyn_active_wallet_info.options.export'),
|
|
176
174
|
},
|
|
177
175
|
];
|
|
178
|
-
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
179
|
-
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector).evmNetworks) ||
|
|
180
|
-
[];
|
|
181
176
|
const showTestnetAlert = testnet && !isTurnkeyWalletWithoutAuthenticator;
|
|
182
177
|
const shouldHideNetwork = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
183
178
|
const activeWalletAddress = () => {
|
|
@@ -190,7 +185,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
190
185
|
};
|
|
191
186
|
const enableMultiAsset = (authMode === 'connect-and-sign' ||
|
|
192
187
|
(authMode === 'connect-only' &&
|
|
193
|
-
((
|
|
188
|
+
((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _d === void 0 ? void 0 : _d.connectOnlyMultiAsset))) &&
|
|
194
189
|
multiAsset;
|
|
195
190
|
const isNetworkMultiAssetSupported = isMultiAssetSupportedNetwork.isMultiAssetSupportedNetwork(primaryConnector, network);
|
|
196
191
|
const isTooManyRequests = errorTokenBalances === 'Too many requests fetching balances';
|
|
@@ -220,7 +215,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
220
215
|
}
|
|
221
216
|
return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsxRuntime.jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsx("div", { className: classNames.classNames('active-wallet-information__addresses-container', {
|
|
222
217
|
'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
223
|
-
}), children: activeWalletAddress() }), address && (jsxRuntime.jsx(WalletDetailsCard.WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector,
|
|
218
|
+
}), children: activeWalletAddress() }), address && (jsxRuntime.jsx(WalletDetailsCard.WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsxRuntime.jsx(Alert.Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsxRuntime.jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxRuntime.jsxs("div", { className: 'balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_active_wallet_info.balance') }), primaryWalletNativeBalance()] }))] }));
|
|
224
219
|
};
|
|
225
220
|
|
|
226
221
|
exports.ActiveWalletInformation = ActiveWalletInformation;
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { useState, useRef } from 'react';
|
|
4
|
+
import { useState, useRef, useCallback } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { isBitcoinConnector } from '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
@@ -60,7 +60,6 @@ import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
60
60
|
import '@dynamic-labs/rpc-providers';
|
|
61
61
|
import '../../../../store/state/loadingAndLifecycle.js';
|
|
62
62
|
import '../../../../store/state/walletOptions/walletOptions.js';
|
|
63
|
-
import { getExportKeysOption } from '../../helpers/helpers.js';
|
|
64
63
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
65
64
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
66
65
|
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
@@ -73,6 +72,7 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
73
72
|
import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
74
73
|
import 'react-focus-lock';
|
|
75
74
|
import { AuthProviderIcon } from '../../../../components/AuthProviderIcon/AuthProviderIcon.js';
|
|
75
|
+
import { getExportKeysOption } from '../../helpers/helpers.js';
|
|
76
76
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
77
77
|
import '../../../../components/IconButton/IconButton.js';
|
|
78
78
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -110,12 +110,11 @@ import { ActiveBitcoinWalletAddresses } from './ActiveBitcoinWalletAddresses/Act
|
|
|
110
110
|
import { ActiveWalletAddress } from './ActiveWalletAddress/ActiveWalletAddress.js';
|
|
111
111
|
import { TokenBalanceList } from './TokenBalanceList/TokenBalanceList.js';
|
|
112
112
|
|
|
113
|
-
const ICON_SIZE =
|
|
113
|
+
const ICON_SIZE = 32;
|
|
114
114
|
const DROPDOWN_ICON_SIZE = 16;
|
|
115
115
|
const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
116
|
-
var _a, _b, _c, _d
|
|
116
|
+
var _a, _b, _c, _d;
|
|
117
117
|
const { t } = useTranslation();
|
|
118
|
-
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
119
118
|
const [balanceIsExpanded, setBalanceIsExpanded] = useState(false);
|
|
120
119
|
const [hasShadow, setHasShadow] = useState(false);
|
|
121
120
|
const [detailsCardOpen, setDetailsCardOpen] = useState(false);
|
|
@@ -138,9 +137,10 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
138
137
|
const { showAlert } = usePasskeyContext();
|
|
139
138
|
const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
|
|
140
139
|
const isBitcoin = primaryWallet && isBitcoinConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
141
|
-
const isEmbeddedWallet = Boolean(wallet &&
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
const isEmbeddedWallet = Boolean(wallet && ((_c = (_b = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _b === void 0 ? void 0 : _b.key) === null || _c === void 0 ? void 0 : _c.startsWith('turnkey')));
|
|
141
|
+
const openDetailsCard = useCallback(() => {
|
|
142
|
+
setTimeout(() => setDetailsCardOpen(true), 0);
|
|
143
|
+
}, []);
|
|
144
144
|
const options = [
|
|
145
145
|
{
|
|
146
146
|
Icon: jsx(SvgCopy, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE }),
|
|
@@ -150,9 +150,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
Icon: (jsx(SvgEyeOutline, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
|
|
153
|
-
callback:
|
|
154
|
-
setDetailsCardOpen(true);
|
|
155
|
-
},
|
|
153
|
+
callback: openDetailsCard,
|
|
156
154
|
hide: !address,
|
|
157
155
|
text: t('dyn_active_wallet_info.options.view_address'),
|
|
158
156
|
},
|
|
@@ -171,9 +169,6 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
171
169
|
text: t('dyn_active_wallet_info.options.export'),
|
|
172
170
|
},
|
|
173
171
|
];
|
|
174
|
-
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
175
|
-
(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector).evmNetworks) ||
|
|
176
|
-
[];
|
|
177
172
|
const showTestnetAlert = testnet && !isTurnkeyWalletWithoutAuthenticator;
|
|
178
173
|
const shouldHideNetwork = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
179
174
|
const activeWalletAddress = () => {
|
|
@@ -186,7 +181,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
186
181
|
};
|
|
187
182
|
const enableMultiAsset = (authMode === 'connect-and-sign' ||
|
|
188
183
|
(authMode === 'connect-only' &&
|
|
189
|
-
((
|
|
184
|
+
((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _d === void 0 ? void 0 : _d.connectOnlyMultiAsset))) &&
|
|
190
185
|
multiAsset;
|
|
191
186
|
const isNetworkMultiAssetSupported = isMultiAssetSupportedNetwork(primaryConnector, network);
|
|
192
187
|
const isTooManyRequests = errorTokenBalances === 'Too many requests fetching balances';
|
|
@@ -216,7 +211,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
216
211
|
}
|
|
217
212
|
return (jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsx("div", { className: classNames('active-wallet-information__addresses-container', {
|
|
218
213
|
'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
219
|
-
}), children: activeWalletAddress() }), address && (jsx(WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector,
|
|
214
|
+
}), children: activeWalletAddress() }), address && (jsx(WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsx(Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsx(Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxs("div", { className: 'balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_active_wallet_info.balance') }), primaryWalletNativeBalance()] }))] }));
|
|
220
215
|
};
|
|
221
216
|
|
|
222
217
|
export { ActiveWalletInformation };
|
|
@@ -54,7 +54,6 @@ require('@dynamic-labs/rpc-providers');
|
|
|
54
54
|
require('../../../../store/state/loadingAndLifecycle.cjs');
|
|
55
55
|
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
56
56
|
require('react-i18next');
|
|
57
|
-
var helpers = require('../../helpers/helpers.cjs');
|
|
58
57
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
59
58
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
60
59
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
@@ -68,6 +67,7 @@ require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
|
68
67
|
require('react-focus-lock');
|
|
69
68
|
var useFetchBalance = require('../../hooks/useFetchBalance/useFetchBalance.cjs');
|
|
70
69
|
var useFetchCurrency = require('../../hooks/useFetchCurrency/useFetchCurrency.cjs');
|
|
70
|
+
var helpers = require('../../helpers/helpers.cjs');
|
|
71
71
|
require('../../context/DynamicWidgetContext.cjs');
|
|
72
72
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
73
73
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -50,7 +50,6 @@ import '@dynamic-labs/rpc-providers';
|
|
|
50
50
|
import '../../../../store/state/loadingAndLifecycle.js';
|
|
51
51
|
import '../../../../store/state/walletOptions/walletOptions.js';
|
|
52
52
|
import 'react-i18next';
|
|
53
|
-
import { roundBalance } from '../../helpers/helpers.js';
|
|
54
53
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
55
54
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
56
55
|
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
@@ -64,6 +63,7 @@ import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
|
64
63
|
import 'react-focus-lock';
|
|
65
64
|
import { useFetchBalance } from '../../hooks/useFetchBalance/useFetchBalance.js';
|
|
66
65
|
import { useFetchCurrency } from '../../hooks/useFetchCurrency/useFetchCurrency.js';
|
|
66
|
+
import { roundBalance } from '../../helpers/helpers.js';
|
|
67
67
|
import '../../context/DynamicWidgetContext.js';
|
|
68
68
|
import '../../../../components/IconButton/IconButton.js';
|
|
69
69
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
7
|
var AccountControl = require('../AccountControl/AccountControl.cjs');
|
|
8
|
+
require('react');
|
|
9
9
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
10
10
|
require('@dynamic-labs/sdk-api-core');
|
|
11
11
|
require('../../../../shared/logger.cjs');
|
|
@@ -95,16 +95,12 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
95
95
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
96
96
|
|
|
97
97
|
const DynamicNav = () => {
|
|
98
|
-
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
99
98
|
const { primaryWallet, projectSettings, network } = useInternalDynamicContext.useInternalDynamicContext();
|
|
100
99
|
const { inlineControlsRef } = DynamicWidgetContext.useWidgetContext();
|
|
101
|
-
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
102
|
-
primaryWallet.connector.evmNetworks) ||
|
|
103
|
-
[];
|
|
104
100
|
if (!projectSettings)
|
|
105
101
|
return null;
|
|
106
102
|
const shouldHideNetwork = projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
107
|
-
return (jsxRuntime.jsx(IsBrowser.IsBrowser, { children: jsxRuntime.jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true,
|
|
103
|
+
return (jsxRuntime.jsx(IsBrowser.IsBrowser, { children: jsxRuntime.jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox' }) })), jsxRuntime.jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsxRuntime.jsx(AccountControl.AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
108
104
|
};
|
|
109
105
|
const ShadowedDynamicNav = () => (jsxRuntime.jsx(ShadowDOM.ShadowDOM, { children: jsxRuntime.jsx(DynamicNav, {}) }));
|
|
110
106
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
import { AccountControl } from '../AccountControl/AccountControl.js';
|
|
4
|
+
import 'react';
|
|
5
5
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
6
6
|
import '@dynamic-labs/sdk-api-core';
|
|
7
7
|
import '../../../../shared/logger.js';
|
|
@@ -91,16 +91,12 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
91
91
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
92
92
|
|
|
93
93
|
const DynamicNav = () => {
|
|
94
|
-
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
95
94
|
const { primaryWallet, projectSettings, network } = useInternalDynamicContext();
|
|
96
95
|
const { inlineControlsRef } = useWidgetContext();
|
|
97
|
-
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
98
|
-
primaryWallet.connector.evmNetworks) ||
|
|
99
|
-
[];
|
|
100
96
|
if (!projectSettings)
|
|
101
97
|
return null;
|
|
102
98
|
const shouldHideNetwork = projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
103
|
-
return (jsx(IsBrowser, { children: jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsx(PopperProvider, { children: jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true,
|
|
99
|
+
return (jsx(IsBrowser, { children: jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsx(PopperProvider, { children: jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox' }) })), jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsx(AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
104
100
|
};
|
|
105
101
|
const ShadowedDynamicNav = () => (jsx(ShadowDOM, { children: jsx(DynamicNav, {}) }));
|
|
106
102
|
|
|
@@ -28,13 +28,13 @@ require('react-international-phone');
|
|
|
28
28
|
var shortenEmail = require('../../../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
29
29
|
require('../../../../store/state/nonce/nonce.cjs');
|
|
30
30
|
require('../../../../store/state/projectSettings/projectSettings.cjs');
|
|
31
|
-
require('../../../../config/ApiEndpoint.cjs');
|
|
32
|
-
require('../../../../store/state/user/user.cjs');
|
|
33
|
-
require('../../../../locale/locale.cjs');
|
|
34
31
|
var updatePrimaryWalletId = require('../../../../utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs');
|
|
35
32
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
36
33
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
37
34
|
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
35
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
36
|
+
require('../../../../store/state/user/user.cjs');
|
|
37
|
+
require('../../../../locale/locale.cjs');
|
|
38
38
|
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
39
39
|
require('react-dom');
|
|
40
40
|
require('../../../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -24,13 +24,13 @@ import 'react-international-phone';
|
|
|
24
24
|
import { shortenEmail } from '../../../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
25
25
|
import '../../../../store/state/nonce/nonce.js';
|
|
26
26
|
import '../../../../store/state/projectSettings/projectSettings.js';
|
|
27
|
-
import '../../../../config/ApiEndpoint.js';
|
|
28
|
-
import '../../../../store/state/user/user.js';
|
|
29
|
-
import '../../../../locale/locale.js';
|
|
30
27
|
import { updatePrimaryWalletId } from '../../../../utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js';
|
|
31
28
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
32
29
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
33
30
|
import '../../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
31
|
+
import '../../../../config/ApiEndpoint.js';
|
|
32
|
+
import '../../../../store/state/user/user.js';
|
|
33
|
+
import '../../../../locale/locale.js';
|
|
34
34
|
import '../../../../context/VerificationContext/VerificationContext.js';
|
|
35
35
|
import 'react-dom';
|
|
36
36
|
import '../../../../utils/functions/compareChains/compareChains.js';
|
package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs
CHANGED
|
@@ -56,7 +56,6 @@ require('@dynamic-labs/rpc-providers');
|
|
|
56
56
|
require('../../../../store/state/loadingAndLifecycle.cjs');
|
|
57
57
|
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
58
58
|
require('react-i18next');
|
|
59
|
-
var helpers = require('../../helpers/helpers.cjs');
|
|
60
59
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
61
60
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
62
61
|
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
@@ -66,6 +65,7 @@ require('../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTar
|
|
|
66
65
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
67
66
|
require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
68
67
|
require('react-focus-lock');
|
|
68
|
+
var helpers = require('../../helpers/helpers.cjs');
|
|
69
69
|
require('../../context/DynamicWidgetContext.cjs');
|
|
70
70
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
71
71
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -52,7 +52,6 @@ import '@dynamic-labs/rpc-providers';
|
|
|
52
52
|
import '../../../../store/state/loadingAndLifecycle.js';
|
|
53
53
|
import '../../../../store/state/walletOptions/walletOptions.js';
|
|
54
54
|
import 'react-i18next';
|
|
55
|
-
import { copyToClipboard } from '../../helpers/helpers.js';
|
|
56
55
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
57
56
|
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
58
57
|
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
@@ -62,6 +61,7 @@ import '../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarg
|
|
|
62
61
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
63
62
|
import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
64
63
|
import 'react-focus-lock';
|
|
64
|
+
import { copyToClipboard } from '../../helpers/helpers.js';
|
|
65
65
|
import '../../context/DynamicWidgetContext.js';
|
|
66
66
|
import '../../../../components/IconButton/IconButton.js';
|
|
67
67
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -113,7 +113,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
113
113
|
}, []);
|
|
114
114
|
const setHeaderAlert = React.useCallback((alert) => {
|
|
115
115
|
var _a;
|
|
116
|
-
const timeout = (_a = alert === null || alert === void 0 ? void 0 : alert.timeout) !== null && _a !== void 0 ? _a :
|
|
116
|
+
const timeout = (_a = alert === null || alert === void 0 ? void 0 : alert.timeout) !== null && _a !== void 0 ? _a : 10000;
|
|
117
117
|
_setHeaderAlert(alert);
|
|
118
118
|
headerAlertTimeoutRef.current = setTimeout(clearHeaderAlert, timeout);
|
|
119
119
|
}, [clearHeaderAlert]);
|
|
@@ -109,7 +109,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
109
109
|
}, []);
|
|
110
110
|
const setHeaderAlert = useCallback((alert) => {
|
|
111
111
|
var _a;
|
|
112
|
-
const timeout = (_a = alert === null || alert === void 0 ? void 0 : alert.timeout) !== null && _a !== void 0 ? _a :
|
|
112
|
+
const timeout = (_a = alert === null || alert === void 0 ? void 0 : alert.timeout) !== null && _a !== void 0 ? _a : 10000;
|
|
113
113
|
_setHeaderAlert(alert);
|
|
114
114
|
headerAlertTimeoutRef.current = setTimeout(clearHeaderAlert, timeout);
|
|
115
115
|
}, [clearHeaderAlert]);
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs
CHANGED
|
@@ -56,7 +56,6 @@ require('@dynamic-labs/rpc-providers');
|
|
|
56
56
|
require('../../../../store/state/loadingAndLifecycle.cjs');
|
|
57
57
|
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
58
58
|
require('react-i18next');
|
|
59
|
-
var helpers = require('../../helpers/helpers.cjs');
|
|
60
59
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
61
60
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
62
61
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
@@ -71,6 +70,7 @@ var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
|
71
70
|
var useCloseMultiWalletPrompt = require('../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.cjs');
|
|
72
71
|
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
73
72
|
var AuthProviderIcon = require('../../../../components/AuthProviderIcon/AuthProviderIcon.cjs');
|
|
73
|
+
var helpers = require('../../helpers/helpers.cjs');
|
|
74
74
|
require('../../context/DynamicWidgetContext.cjs');
|
|
75
75
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
76
76
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js
CHANGED
|
@@ -52,7 +52,6 @@ import '@dynamic-labs/rpc-providers';
|
|
|
52
52
|
import '../../../../store/state/loadingAndLifecycle.js';
|
|
53
53
|
import '../../../../store/state/walletOptions/walletOptions.js';
|
|
54
54
|
import 'react-i18next';
|
|
55
|
-
import { capitalize } from '../../helpers/helpers.js';
|
|
56
55
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
57
56
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
58
57
|
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
@@ -67,6 +66,7 @@ import { WidgetPortal } from '../../components/WidgetPortal/WidgetPortal.js';
|
|
|
67
66
|
import { useCloseMultiWalletPrompt } from '../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.js';
|
|
68
67
|
import { DefaultPromptLayout } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
69
68
|
import { AuthProviderIcon } from '../../../../components/AuthProviderIcon/AuthProviderIcon.js';
|
|
69
|
+
import { capitalize } from '../../helpers/helpers.js';
|
|
70
70
|
import '../../context/DynamicWidgetContext.js';
|
|
71
71
|
import '../../../../components/IconButton/IconButton.js';
|
|
72
72
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.cjs
CHANGED
|
@@ -27,6 +27,7 @@ require('@dynamic-labs/wallet-book');
|
|
|
27
27
|
require('../../../../utils/constants/colors.cjs');
|
|
28
28
|
require('../../../../utils/constants/values.cjs');
|
|
29
29
|
require('../../../../shared/consts/index.cjs');
|
|
30
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
30
31
|
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
31
32
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
32
33
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -100,9 +101,11 @@ const ChooseOnrampProviderView = () => {
|
|
|
100
101
|
const { t } = reactI18next.useTranslation();
|
|
101
102
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
102
103
|
const { enabledOnrampProviders } = OnrampContext.useOnrampContext();
|
|
104
|
+
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
103
105
|
const onrampOptions = React.useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => !isPaymentMethod), [enabledOnrampProviders]);
|
|
104
106
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: () => setDynamicWidgetView('choose-wallet-funding-method'), children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
105
|
-
return (jsxRuntime.jsxs("div", { className: 'deposit-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, description: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'choose-onramp-provider__header-description', children: t('dyn_wallet_funding.onramp_provider_selection.description') }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', children: t('dyn_wallet_funding.onramp_provider_selection.title') }) }), jsxRuntime.jsx("div", { className: 'choose-wallet-funding-method__options', children:
|
|
107
|
+
return (jsxRuntime.jsxs("div", { className: 'deposit-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, description: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'choose-onramp-provider__header-description', children: t('dyn_wallet_funding.onramp_provider_selection.description') }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', children: t('dyn_wallet_funding.onramp_provider_selection.title') }) }), jsxRuntime.jsx("div", { className: 'choose-wallet-funding-method__options', children: primaryWallet &&
|
|
108
|
+
onrampOptions.map((option) => (jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: () => option.onClick({ wallet: primaryWallet }), leading: jsxRuntime.jsx(Icon.Icon, { className: 'choose-onramp-provider__options__option__icon', children: jsxRuntime.jsx("img", { src: option.iconUrl, alt: option.displayName }) }), typographyProps: { variant: 'body_normal', weight: 'medium' }, buttonVariant: 'card', className: 'choose-wallet-funding-method__options__option', description: option.description, children: option.displayName }, option.id))) })] }));
|
|
106
109
|
};
|
|
107
110
|
|
|
108
111
|
exports.ChooseOnrampProviderView = ChooseOnrampProviderView;
|
package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.js
CHANGED
|
@@ -23,6 +23,7 @@ import '@dynamic-labs/wallet-book';
|
|
|
23
23
|
import '../../../../utils/constants/colors.js';
|
|
24
24
|
import '../../../../utils/constants/values.js';
|
|
25
25
|
import '../../../../shared/consts/index.js';
|
|
26
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
26
27
|
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
27
28
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
28
29
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -96,9 +97,11 @@ const ChooseOnrampProviderView = () => {
|
|
|
96
97
|
const { t } = useTranslation();
|
|
97
98
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
98
99
|
const { enabledOnrampProviders } = useOnrampContext();
|
|
100
|
+
const { primaryWallet } = useInternalDynamicContext();
|
|
99
101
|
const onrampOptions = useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => !isPaymentMethod), [enabledOnrampProviders]);
|
|
100
102
|
const backButton = (jsx(IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: () => setDynamicWidgetView('choose-wallet-funding-method'), children: jsx(SvgArrowLeft, {}) }));
|
|
101
|
-
return (jsxs("div", { className: 'deposit-view', children: [jsx(ModalHeader, { leading: backButton, description: jsx(Typography, { variant: 'body_small', color: 'secondary', className: 'choose-onramp-provider__header-description', children: t('dyn_wallet_funding.onramp_provider_selection.description') }), children: jsx(Typography, { variant: 'title', children: t('dyn_wallet_funding.onramp_provider_selection.title') }) }), jsx("div", { className: 'choose-wallet-funding-method__options', children:
|
|
103
|
+
return (jsxs("div", { className: 'deposit-view', children: [jsx(ModalHeader, { leading: backButton, description: jsx(Typography, { variant: 'body_small', color: 'secondary', className: 'choose-onramp-provider__header-description', children: t('dyn_wallet_funding.onramp_provider_selection.description') }), children: jsx(Typography, { variant: 'title', children: t('dyn_wallet_funding.onramp_provider_selection.title') }) }), jsx("div", { className: 'choose-wallet-funding-method__options', children: primaryWallet &&
|
|
104
|
+
onrampOptions.map((option) => (jsx(TypographyButton, { onClick: () => option.onClick({ wallet: primaryWallet }), leading: jsx(Icon, { className: 'choose-onramp-provider__options__option__icon', children: jsx("img", { src: option.iconUrl, alt: option.displayName }) }), typographyProps: { variant: 'body_normal', weight: 'medium' }, buttonVariant: 'card', className: 'choose-wallet-funding-method__options__option', description: option.description, children: option.displayName }, option.id))) })] }));
|
|
102
105
|
};
|
|
103
106
|
|
|
104
107
|
export { ChooseOnrampProviderView };
|
package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.cjs
CHANGED
|
@@ -23,7 +23,7 @@ const ChooseWalletFundingMethod = () => {
|
|
|
23
23
|
const { t } = reactI18next.useTranslation();
|
|
24
24
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: goToInitialDynamicWidgetView, children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
25
25
|
const methods = useFundingMethods.useFundingMethods();
|
|
26
|
-
return (jsxRuntime.jsxs("div", { className: 'choose-wallet-funding-method', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton,
|
|
26
|
+
return (jsxRuntime.jsxs("div", { className: 'choose-wallet-funding-method', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', children: t('dyn_wallet_funding.funding_method_selection.title') }) }), jsxRuntime.jsx("div", { className: 'choose-wallet-funding-method__options', children: methods.map((method) => {
|
|
27
27
|
var _a;
|
|
28
28
|
return (jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: method.onClick, description: method.description, leading: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', className: 'choose-wallet-funding-method__options__option__icon', children: method.icon }), trailing: jsxRuntime.jsx(MakeTrailing.MakeTrailing, { previewIcons: (_a = method.previewIcons) !== null && _a !== void 0 ? _a : [], showChevron: Boolean(method.showChevron) }), typographyProps: { variant: 'body_normal', weight: 'medium' }, buttonVariant: 'card', className: 'choose-wallet-funding-method__options__option', children: method.label }, method.key));
|
|
29
29
|
}) })] }));
|
package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.js
CHANGED
|
@@ -19,7 +19,7 @@ const ChooseWalletFundingMethod = () => {
|
|
|
19
19
|
const { t } = useTranslation();
|
|
20
20
|
const backButton = (jsx(IconButton, { type: 'button', id: 'back-button', "data-testid": 'back-button', onClick: goToInitialDynamicWidgetView, children: jsx(SvgArrowLeft, {}) }));
|
|
21
21
|
const methods = useFundingMethods();
|
|
22
|
-
return (jsxs("div", { className: 'choose-wallet-funding-method', children: [jsx(ModalHeader, { leading: backButton,
|
|
22
|
+
return (jsxs("div", { className: 'choose-wallet-funding-method', children: [jsx(ModalHeader, { leading: backButton, children: jsx(Typography, { variant: 'title', children: t('dyn_wallet_funding.funding_method_selection.title') }) }), jsx("div", { className: 'choose-wallet-funding-method__options', children: methods.map((method) => {
|
|
23
23
|
var _a;
|
|
24
24
|
return (jsx(TypographyButton, { onClick: method.onClick, description: method.description, leading: jsx(Icon, { color: 'text-tertiary', className: 'choose-wallet-funding-method__options__option__icon', children: method.icon }), trailing: jsx(MakeTrailing, { previewIcons: (_a = method.previewIcons) !== null && _a !== void 0 ? _a : [], showChevron: Boolean(method.showChevron) }), typographyProps: { variant: 'body_normal', weight: 'medium' }, buttonVariant: 'card', className: 'choose-wallet-funding-method__options__option', children: method.label }, method.key));
|
|
25
25
|
}) })] }));
|
|
@@ -124,9 +124,14 @@ const useFundingMethods = () => {
|
|
|
124
124
|
const onrampOptions = React.useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => !isPaymentMethod), [enabledOnrampProviders]);
|
|
125
125
|
const paymentMethods = React.useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => isPaymentMethod), [enabledOnrampProviders]);
|
|
126
126
|
const handleQrClick = React.useCallback(() => setDynamicWidgetView('deposit-view'), [setDynamicWidgetView]);
|
|
127
|
-
const handleBuyCryptoClick = React.useCallback(() =>
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
const handleBuyCryptoClick = React.useCallback(() => {
|
|
128
|
+
if (!primaryWallet) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
onrampOptions.length > 1
|
|
132
|
+
? setDynamicWidgetView('choose-onramp-provider')
|
|
133
|
+
: onrampOptions[0].onClick({ wallet: primaryWallet });
|
|
134
|
+
}, [onrampOptions, setDynamicWidgetView, primaryWallet]);
|
|
130
135
|
const previewWalletIcons = React.useMemo(() => {
|
|
131
136
|
if (!externalWalletFundingEnabled)
|
|
132
137
|
return [];
|
|
@@ -150,15 +155,17 @@ const useFundingMethods = () => {
|
|
|
150
155
|
showChevron: true,
|
|
151
156
|
},
|
|
152
157
|
];
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
if (primaryWallet) {
|
|
159
|
+
paymentMethods.forEach(({ id, iconUrl, displayName, onClick }) => {
|
|
160
|
+
methods.push({
|
|
161
|
+
icon: jsxRuntime.jsx("img", { src: iconUrl, alt: displayName }),
|
|
162
|
+
key: id,
|
|
163
|
+
label: displayName,
|
|
164
|
+
onClick: () => onClick({ wallet: primaryWallet }),
|
|
165
|
+
showChevron: false,
|
|
166
|
+
});
|
|
160
167
|
});
|
|
161
|
-
}
|
|
168
|
+
}
|
|
162
169
|
if (onrampOptions.length) {
|
|
163
170
|
methods.push({
|
|
164
171
|
icon: jsxRuntime.jsx(globe.ReactComponent, {}),
|
|
@@ -190,6 +197,7 @@ const useFundingMethods = () => {
|
|
|
190
197
|
externalWalletFundingEnabled,
|
|
191
198
|
startExternalWalletFunding,
|
|
192
199
|
previewWalletIcons,
|
|
200
|
+
primaryWallet,
|
|
193
201
|
]);
|
|
194
202
|
};
|
|
195
203
|
|
|
@@ -120,9 +120,14 @@ const useFundingMethods = () => {
|
|
|
120
120
|
const onrampOptions = useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => !isPaymentMethod), [enabledOnrampProviders]);
|
|
121
121
|
const paymentMethods = useMemo(() => enabledOnrampProviders.filter(({ isPaymentMethod }) => isPaymentMethod), [enabledOnrampProviders]);
|
|
122
122
|
const handleQrClick = useCallback(() => setDynamicWidgetView('deposit-view'), [setDynamicWidgetView]);
|
|
123
|
-
const handleBuyCryptoClick = useCallback(() =>
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
const handleBuyCryptoClick = useCallback(() => {
|
|
124
|
+
if (!primaryWallet) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
onrampOptions.length > 1
|
|
128
|
+
? setDynamicWidgetView('choose-onramp-provider')
|
|
129
|
+
: onrampOptions[0].onClick({ wallet: primaryWallet });
|
|
130
|
+
}, [onrampOptions, setDynamicWidgetView, primaryWallet]);
|
|
126
131
|
const previewWalletIcons = useMemo(() => {
|
|
127
132
|
if (!externalWalletFundingEnabled)
|
|
128
133
|
return [];
|
|
@@ -146,15 +151,17 @@ const useFundingMethods = () => {
|
|
|
146
151
|
showChevron: true,
|
|
147
152
|
},
|
|
148
153
|
];
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
if (primaryWallet) {
|
|
155
|
+
paymentMethods.forEach(({ id, iconUrl, displayName, onClick }) => {
|
|
156
|
+
methods.push({
|
|
157
|
+
icon: jsx("img", { src: iconUrl, alt: displayName }),
|
|
158
|
+
key: id,
|
|
159
|
+
label: displayName,
|
|
160
|
+
onClick: () => onClick({ wallet: primaryWallet }),
|
|
161
|
+
showChevron: false,
|
|
162
|
+
});
|
|
156
163
|
});
|
|
157
|
-
}
|
|
164
|
+
}
|
|
158
165
|
if (onrampOptions.length) {
|
|
159
166
|
methods.push({
|
|
160
167
|
icon: jsx(SvgGlobe, {}),
|
|
@@ -186,6 +193,7 @@ const useFundingMethods = () => {
|
|
|
186
193
|
externalWalletFundingEnabled,
|
|
187
194
|
startExternalWalletFunding,
|
|
188
195
|
previewWalletIcons,
|
|
196
|
+
primaryWallet,
|
|
189
197
|
]);
|
|
190
198
|
};
|
|
191
199
|
|