@dynamic-labs/sdk-react-core 0.17.0-RC.5 → 0.17.0-RC.7
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 +39 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +9 -6
- package/src/index.cjs +2 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +1 -0
- package/src/lib/Main.js +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -0
- package/src/lib/components/Divider/Divider.cjs +1 -0
- package/src/lib/components/Divider/Divider.js +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +3 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +3 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +3 -2
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +1 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +6 -4
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +6 -4
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +1 -0
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.d.ts +4 -4
- package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +1 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -0
- package/src/lib/components/Portal/Portal.cjs +1 -1
- package/src/lib/components/Portal/Portal.js +1 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -0
- package/src/lib/components/Tooltip/Tooltip.js +1 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -0
- package/src/lib/components/UserAddress/UserAddress.cjs +4 -6
- package/src/lib/components/UserAddress/UserAddress.js +5 -7
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +25 -6
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +7 -5
- package/src/lib/context/DynamicContext/DynamicContext.js +25 -6
- package/src/lib/context/DynamicContext/hooks/useNameService/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +82 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.d.ts +11 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +78 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.types.d.ts +4 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -0
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/FundingContext/FundingContext.cjs +69 -0
- package/src/lib/context/FundingContext/FundingContext.d.ts +14 -0
- package/src/lib/context/FundingContext/FundingContext.js +63 -0
- package/src/lib/context/FundingContext/index.d.ts +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +1 -0
- package/src/lib/data/api.cjs +14 -0
- package/src/lib/data/api.d.ts +8 -1
- package/src/lib/data/api.js +14 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +1 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +1 -0
- package/src/lib/shared/types/index.d.ts +3 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/localStorage.cjs +3 -1
- package/src/lib/utils/constants/localStorage.d.ts +1 -0
- package/src/lib/utils/constants/localStorage.js +3 -2
- package/src/lib/utils/functions/getNetwork/getNetwork.cjs +1 -6
- package/src/lib/utils/functions/getNetwork/getNetwork.d.ts +1 -1
- package/src/lib/utils/functions/getNetwork/getNetwork.js +1 -6
- package/src/lib/utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.cjs +1 -1
- package/src/lib/utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.d.ts +1 -2
- package/src/lib/utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.js +1 -1
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.cjs +16 -1
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.d.ts +6 -0
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.js +16 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.cjs +6 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.d.ts +1 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.js +6 -1
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.cjs +1 -0
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.d.ts +2 -0
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +1 -0
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +50 -24
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +4 -4
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +50 -24
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +6 -5
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +2 -2
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +8 -7
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -2
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +2 -4
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -1
- package/src/lib/utils/hooks/useWallets/useWallets.js +2 -4
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +5 -3
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +5 -3
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.cjs → OnboardingUserDataForm/OnboardingUserDataForm.cjs} +6 -4
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.d.ts → OnboardingUserDataForm/OnboardingUserDataForm.d.ts} +1 -1
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.js → OnboardingUserDataForm/OnboardingUserDataForm.js} +6 -4
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/index.d.ts +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +1 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +3 -2
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +3 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +3 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +3 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +5 -5
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +5 -5
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
- package/src/lib/views/NoAccess/NoAccess.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +1 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
- package/src/lib/views/WalletList/data.cjs +2 -1
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletList/data.js +2 -1
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +4 -4
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +10 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +10 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +3 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +3 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +22 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +18 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +52 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +48 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +1 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.cjs +10 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.d.ts +2 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.js +6 -0
- package/src/lib/widgets/FundingWidget/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +54 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.d.ts +5 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +49 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/index.d.ts +1 -0
- package/src/lib/widgets/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.cjs +0 -12
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.d.ts +0 -2
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.js +0 -8
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWallets/utils/index.d.ts +0 -1
- package/src/lib/views/CollectUserDataView/UserDataForm/index.d.ts +0 -1
|
@@ -17,47 +17,69 @@ require('../../../shared/consts/index.cjs');
|
|
|
17
17
|
var validators = require('../../../context/DynamicContext/validators.cjs');
|
|
18
18
|
|
|
19
19
|
const MAX_RETRIES = 2;
|
|
20
|
-
const useFetchNetworkConfigurations = ({ authToken, environmentId,
|
|
20
|
+
const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks: customerEvmNetworks, maxRetries = MAX_RETRIES, }) => {
|
|
21
21
|
var _a;
|
|
22
|
+
/**
|
|
23
|
+
* This is the version of the local storage object. If the version changes, the local storage object will be removed.
|
|
24
|
+
* This is used in case we need to change the structure of the local storage object.
|
|
25
|
+
*/
|
|
26
|
+
const VERSION = 2;
|
|
22
27
|
const [lsNetworks, setLsNetworks, removeLsNetworks] = useLocalStorage.useLocalStorage(localStorage.NETWORKS_STORAGE_KEY, undefined, validators.validateLocalStorageExpiry);
|
|
23
28
|
const [loading, setLoading] = React.useState(false);
|
|
24
29
|
const [retries, setRetries] = React.useState(0);
|
|
25
|
-
const
|
|
30
|
+
const [completed, setCompleted] = React.useState(false);
|
|
31
|
+
const [lsNetworksExists, setlsNetworksExists] = React.useState(Boolean(lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.version) === VERSION);
|
|
26
32
|
// Stringify the objects for easy comparison
|
|
27
|
-
const
|
|
33
|
+
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
28
34
|
React.useEffect(() => {
|
|
29
35
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
30
36
|
removeLsNetworks();
|
|
37
|
+
setlsNetworksExists(false);
|
|
31
38
|
}
|
|
32
|
-
|
|
39
|
+
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
40
|
+
removeLsNetworks();
|
|
41
|
+
setlsNetworksExists(false);
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
environmentId,
|
|
45
|
+
lsNetworks,
|
|
46
|
+
lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
47
|
+
lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.version,
|
|
48
|
+
removeLsNetworks,
|
|
49
|
+
]);
|
|
33
50
|
React.useEffect(() => {
|
|
34
51
|
if (!authToken) {
|
|
35
52
|
removeLsNetworks();
|
|
53
|
+
setlsNetworksExists(false);
|
|
36
54
|
}
|
|
37
|
-
}, [authToken]);
|
|
55
|
+
}, [authToken, removeLsNetworks, setlsNetworksExists]);
|
|
38
56
|
React.useEffect(() => {
|
|
39
57
|
var _a, _b;
|
|
40
|
-
if (lsNetworksExists &&
|
|
58
|
+
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
41
59
|
const localStorageNetworksJson = (_b = (_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm) === null || _b === void 0 ? void 0 : _b.map((network) => JSON.stringify(network));
|
|
42
60
|
if (localStorageNetworksJson) {
|
|
43
|
-
const fullMatch =
|
|
61
|
+
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
44
62
|
if (!fullMatch) {
|
|
45
63
|
removeLsNetworks();
|
|
64
|
+
setlsNetworksExists(false);
|
|
46
65
|
}
|
|
66
|
+
setCompleted(true);
|
|
47
67
|
}
|
|
48
68
|
}
|
|
49
69
|
}, [
|
|
50
70
|
lsNetworksExists,
|
|
51
|
-
|
|
71
|
+
customerEvmNetworksJson,
|
|
52
72
|
removeLsNetworks,
|
|
53
73
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
74
|
+
completed,
|
|
75
|
+
setCompleted,
|
|
54
76
|
]);
|
|
55
77
|
React.useEffect(() => {
|
|
56
78
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
57
79
|
setLoading(true);
|
|
58
80
|
api.fetchNetworkSettings(environmentId)
|
|
59
81
|
.then((response) => {
|
|
60
|
-
var _a, _b;
|
|
82
|
+
var _a, _b, _c, _d;
|
|
61
83
|
if (!response)
|
|
62
84
|
throw new multiWallet.DynamicError('Configuration is not defined');
|
|
63
85
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
@@ -66,31 +88,33 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
66
88
|
const cosmos = response.find((configurations) => configurations.chainName === 'cosmos');
|
|
67
89
|
const starknet = response.find((configurations) => configurations.chainName === 'starknet');
|
|
68
90
|
let mergedEvmNetworks;
|
|
69
|
-
const
|
|
91
|
+
const createNetwork = (network, parser = (input) => input) => ({
|
|
70
92
|
blockExplorerUrls: network.blockExplorerUrls,
|
|
71
|
-
chainId:
|
|
72
|
-
chainName: network.name,
|
|
93
|
+
chainId: parser(network.chainId),
|
|
73
94
|
iconUrls: network.iconUrls,
|
|
74
95
|
lcdUrl: network.lcdUrl,
|
|
96
|
+
name: network.name,
|
|
75
97
|
nativeCurrency: network.nativeCurrency,
|
|
76
|
-
networkId:
|
|
98
|
+
networkId: parser(network.networkId),
|
|
77
99
|
privateCustomerRpcUrls: network.privateCustomerRpcUrls,
|
|
78
100
|
rpcUrls: network.rpcUrls,
|
|
79
101
|
vanityName: network.vanityName,
|
|
80
102
|
});
|
|
81
|
-
const cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map(
|
|
82
|
-
const serverNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map(
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
const cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, parseInt));
|
|
104
|
+
const serverNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, parseInt));
|
|
105
|
+
const starknetNetworks = (_c = starknet === null || starknet === void 0 ? void 0 : starknet.networks) === null || _c === void 0 ? void 0 : _c.map((net) => createNetwork(net));
|
|
106
|
+
const solanaNetworks = (_d = solana === null || solana === void 0 ? void 0 : solana.networks) === null || _d === void 0 ? void 0 : _d.map((net) => createNetwork(net));
|
|
107
|
+
if (!serverNetworks && (customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.length)) {
|
|
108
|
+
mergedEvmNetworks = customerEvmNetworks;
|
|
85
109
|
}
|
|
86
|
-
if (!
|
|
110
|
+
if (!customerEvmNetworks && (serverNetworks === null || serverNetworks === void 0 ? void 0 : serverNetworks.length)) {
|
|
87
111
|
mergedEvmNetworks = serverNetworks;
|
|
88
112
|
}
|
|
89
113
|
if (serverNetworks !== undefined &&
|
|
90
114
|
serverNetworks.length &&
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
mergedEvmNetworks =
|
|
115
|
+
customerEvmNetworks !== undefined &&
|
|
116
|
+
customerEvmNetworks.length) {
|
|
117
|
+
mergedEvmNetworks = customerEvmNetworks.slice();
|
|
94
118
|
serverNetworks.forEach((network) => {
|
|
95
119
|
const existingNetwork = mergedEvmNetworks === null || mergedEvmNetworks === void 0 ? void 0 : mergedEvmNetworks.find((item) => item.chainId === network.chainId);
|
|
96
120
|
if (!existingNetwork) {
|
|
@@ -102,12 +126,14 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
102
126
|
configurations: {
|
|
103
127
|
cosmos: cosmosNetworks,
|
|
104
128
|
evm: mergedEvmNetworks,
|
|
105
|
-
solana:
|
|
106
|
-
starknet:
|
|
129
|
+
solana: solanaNetworks,
|
|
130
|
+
starknet: starknetNetworks,
|
|
107
131
|
},
|
|
108
132
|
environmentId,
|
|
109
133
|
expiry,
|
|
134
|
+
version: VERSION,
|
|
110
135
|
});
|
|
136
|
+
setlsNetworksExists(true);
|
|
111
137
|
})
|
|
112
138
|
.catch((e) => {
|
|
113
139
|
setRetries((currentRetries) => currentRetries + 1);
|
|
@@ -120,7 +146,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
120
146
|
authToken,
|
|
121
147
|
environmentId,
|
|
122
148
|
loading,
|
|
123
|
-
|
|
149
|
+
customerEvmNetworks,
|
|
124
150
|
lsNetworksExists,
|
|
125
151
|
maxRetries,
|
|
126
152
|
retries,
|
package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GenericNetwork } from '@dynamic-labs/types';
|
|
2
2
|
export type fetchNetworkConfigurationsProps = {
|
|
3
3
|
authToken: string | undefined;
|
|
4
4
|
environmentId: string;
|
|
5
|
-
|
|
5
|
+
evmNetworks?: GenericNetwork[];
|
|
6
6
|
maxRetries?: number;
|
|
7
7
|
};
|
|
8
|
-
export declare const useFetchNetworkConfigurations: ({ authToken, environmentId,
|
|
9
|
-
configurations: import("@dynamic-labs/
|
|
8
|
+
export declare const useFetchNetworkConfigurations: ({ authToken, environmentId, evmNetworks: customerEvmNetworks, maxRetries, }: fetchNetworkConfigurationsProps) => {
|
|
9
|
+
configurations: import("@dynamic-labs/types").NetworkConfigurationMap | undefined;
|
|
10
10
|
removeLsNetworks: () => void;
|
|
11
11
|
};
|
|
@@ -13,47 +13,69 @@ import '../../../shared/consts/index.js';
|
|
|
13
13
|
import { validateLocalStorageExpiry } from '../../../context/DynamicContext/validators.js';
|
|
14
14
|
|
|
15
15
|
const MAX_RETRIES = 2;
|
|
16
|
-
const useFetchNetworkConfigurations = ({ authToken, environmentId,
|
|
16
|
+
const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks: customerEvmNetworks, maxRetries = MAX_RETRIES, }) => {
|
|
17
17
|
var _a;
|
|
18
|
+
/**
|
|
19
|
+
* This is the version of the local storage object. If the version changes, the local storage object will be removed.
|
|
20
|
+
* This is used in case we need to change the structure of the local storage object.
|
|
21
|
+
*/
|
|
22
|
+
const VERSION = 2;
|
|
18
23
|
const [lsNetworks, setLsNetworks, removeLsNetworks] = useLocalStorage(NETWORKS_STORAGE_KEY, undefined, validateLocalStorageExpiry);
|
|
19
24
|
const [loading, setLoading] = useState(false);
|
|
20
25
|
const [retries, setRetries] = useState(0);
|
|
21
|
-
const
|
|
26
|
+
const [completed, setCompleted] = useState(false);
|
|
27
|
+
const [lsNetworksExists, setlsNetworksExists] = useState(Boolean(lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.version) === VERSION);
|
|
22
28
|
// Stringify the objects for easy comparison
|
|
23
|
-
const
|
|
29
|
+
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
24
30
|
useEffect(() => {
|
|
25
31
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
26
32
|
removeLsNetworks();
|
|
33
|
+
setlsNetworksExists(false);
|
|
27
34
|
}
|
|
28
|
-
|
|
35
|
+
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
36
|
+
removeLsNetworks();
|
|
37
|
+
setlsNetworksExists(false);
|
|
38
|
+
}
|
|
39
|
+
}, [
|
|
40
|
+
environmentId,
|
|
41
|
+
lsNetworks,
|
|
42
|
+
lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
43
|
+
lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.version,
|
|
44
|
+
removeLsNetworks,
|
|
45
|
+
]);
|
|
29
46
|
useEffect(() => {
|
|
30
47
|
if (!authToken) {
|
|
31
48
|
removeLsNetworks();
|
|
49
|
+
setlsNetworksExists(false);
|
|
32
50
|
}
|
|
33
|
-
}, [authToken]);
|
|
51
|
+
}, [authToken, removeLsNetworks, setlsNetworksExists]);
|
|
34
52
|
useEffect(() => {
|
|
35
53
|
var _a, _b;
|
|
36
|
-
if (lsNetworksExists &&
|
|
54
|
+
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
37
55
|
const localStorageNetworksJson = (_b = (_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm) === null || _b === void 0 ? void 0 : _b.map((network) => JSON.stringify(network));
|
|
38
56
|
if (localStorageNetworksJson) {
|
|
39
|
-
const fullMatch =
|
|
57
|
+
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
40
58
|
if (!fullMatch) {
|
|
41
59
|
removeLsNetworks();
|
|
60
|
+
setlsNetworksExists(false);
|
|
42
61
|
}
|
|
62
|
+
setCompleted(true);
|
|
43
63
|
}
|
|
44
64
|
}
|
|
45
65
|
}, [
|
|
46
66
|
lsNetworksExists,
|
|
47
|
-
|
|
67
|
+
customerEvmNetworksJson,
|
|
48
68
|
removeLsNetworks,
|
|
49
69
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
70
|
+
completed,
|
|
71
|
+
setCompleted,
|
|
50
72
|
]);
|
|
51
73
|
useEffect(() => {
|
|
52
74
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
53
75
|
setLoading(true);
|
|
54
76
|
fetchNetworkSettings(environmentId)
|
|
55
77
|
.then((response) => {
|
|
56
|
-
var _a, _b;
|
|
78
|
+
var _a, _b, _c, _d;
|
|
57
79
|
if (!response)
|
|
58
80
|
throw new DynamicError('Configuration is not defined');
|
|
59
81
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
@@ -62,31 +84,33 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
62
84
|
const cosmos = response.find((configurations) => configurations.chainName === 'cosmos');
|
|
63
85
|
const starknet = response.find((configurations) => configurations.chainName === 'starknet');
|
|
64
86
|
let mergedEvmNetworks;
|
|
65
|
-
const
|
|
87
|
+
const createNetwork = (network, parser = (input) => input) => ({
|
|
66
88
|
blockExplorerUrls: network.blockExplorerUrls,
|
|
67
|
-
chainId:
|
|
68
|
-
chainName: network.name,
|
|
89
|
+
chainId: parser(network.chainId),
|
|
69
90
|
iconUrls: network.iconUrls,
|
|
70
91
|
lcdUrl: network.lcdUrl,
|
|
92
|
+
name: network.name,
|
|
71
93
|
nativeCurrency: network.nativeCurrency,
|
|
72
|
-
networkId:
|
|
94
|
+
networkId: parser(network.networkId),
|
|
73
95
|
privateCustomerRpcUrls: network.privateCustomerRpcUrls,
|
|
74
96
|
rpcUrls: network.rpcUrls,
|
|
75
97
|
vanityName: network.vanityName,
|
|
76
98
|
});
|
|
77
|
-
const cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map(
|
|
78
|
-
const serverNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map(
|
|
79
|
-
|
|
80
|
-
|
|
99
|
+
const cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, parseInt));
|
|
100
|
+
const serverNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, parseInt));
|
|
101
|
+
const starknetNetworks = (_c = starknet === null || starknet === void 0 ? void 0 : starknet.networks) === null || _c === void 0 ? void 0 : _c.map((net) => createNetwork(net));
|
|
102
|
+
const solanaNetworks = (_d = solana === null || solana === void 0 ? void 0 : solana.networks) === null || _d === void 0 ? void 0 : _d.map((net) => createNetwork(net));
|
|
103
|
+
if (!serverNetworks && (customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.length)) {
|
|
104
|
+
mergedEvmNetworks = customerEvmNetworks;
|
|
81
105
|
}
|
|
82
|
-
if (!
|
|
106
|
+
if (!customerEvmNetworks && (serverNetworks === null || serverNetworks === void 0 ? void 0 : serverNetworks.length)) {
|
|
83
107
|
mergedEvmNetworks = serverNetworks;
|
|
84
108
|
}
|
|
85
109
|
if (serverNetworks !== undefined &&
|
|
86
110
|
serverNetworks.length &&
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
mergedEvmNetworks =
|
|
111
|
+
customerEvmNetworks !== undefined &&
|
|
112
|
+
customerEvmNetworks.length) {
|
|
113
|
+
mergedEvmNetworks = customerEvmNetworks.slice();
|
|
90
114
|
serverNetworks.forEach((network) => {
|
|
91
115
|
const existingNetwork = mergedEvmNetworks === null || mergedEvmNetworks === void 0 ? void 0 : mergedEvmNetworks.find((item) => item.chainId === network.chainId);
|
|
92
116
|
if (!existingNetwork) {
|
|
@@ -98,12 +122,14 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
98
122
|
configurations: {
|
|
99
123
|
cosmos: cosmosNetworks,
|
|
100
124
|
evm: mergedEvmNetworks,
|
|
101
|
-
solana:
|
|
102
|
-
starknet:
|
|
125
|
+
solana: solanaNetworks,
|
|
126
|
+
starknet: starknetNetworks,
|
|
103
127
|
},
|
|
104
128
|
environmentId,
|
|
105
129
|
expiry,
|
|
130
|
+
version: VERSION,
|
|
106
131
|
});
|
|
132
|
+
setlsNetworksExists(true);
|
|
107
133
|
})
|
|
108
134
|
.catch((e) => {
|
|
109
135
|
setRetries((currentRetries) => currentRetries + 1);
|
|
@@ -116,7 +142,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, localNetworks
|
|
|
116
142
|
authToken,
|
|
117
143
|
environmentId,
|
|
118
144
|
loading,
|
|
119
|
-
|
|
145
|
+
customerEvmNetworks,
|
|
120
146
|
lsNetworksExists,
|
|
121
147
|
maxRetries,
|
|
122
148
|
retries,
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var rpcProviders = require('@dynamic-labs/rpc-providers');
|
|
7
7
|
require('@dynamic-labs/sdk-api');
|
|
8
8
|
var logger = require('../../../shared/logger.cjs');
|
|
9
9
|
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/multi-wallet');
|
|
10
11
|
require('react/jsx-runtime');
|
|
11
12
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
13
|
require('../../constants/colors.cjs');
|
|
@@ -19,7 +20,7 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
19
20
|
React.useEffect(() => {
|
|
20
21
|
try {
|
|
21
22
|
if (networkConfigurations) {
|
|
22
|
-
setProviders(
|
|
23
|
+
setProviders(rpcProviders.ChainRpcProviders.getProviders(networkConfigurations));
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
catch (error) {
|
|
@@ -30,12 +31,12 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
30
31
|
if (!networkConfigurations) {
|
|
31
32
|
return undefined;
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return rpcProviders.ChainRpcProviders.getEvmProviderByChainId(networkConfigurations, chainId);
|
|
34
35
|
}, [networkConfigurations]);
|
|
35
36
|
React.useEffect(() => {
|
|
36
37
|
try {
|
|
37
38
|
if (networkConfigurations) {
|
|
38
|
-
setEvmDefaultProvider(
|
|
39
|
+
setEvmDefaultProvider(rpcProviders.ChainRpcProviders.getEvmProviderByChainId(networkConfigurations, 1));
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
|
@@ -45,7 +46,7 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
45
46
|
React.useEffect(() => {
|
|
46
47
|
try {
|
|
47
48
|
if (networkConfigurations) {
|
|
48
|
-
setSolanaDefaultProvider(
|
|
49
|
+
setSolanaDefaultProvider(rpcProviders.ChainRpcProviders.getSolanaRpcProviderByChainId(networkConfigurations, '101'));
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NetworkConfigurationMap } from '@dynamic-labs/
|
|
1
|
+
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
2
2
|
import { DynamicRPCProviders } from '../../../shared';
|
|
3
3
|
type Props = {
|
|
4
4
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
5
|
-
networkId: number | undefined;
|
|
5
|
+
networkId: string | number | undefined;
|
|
6
6
|
};
|
|
7
7
|
export declare const useRpcProviders: ({ networkConfigurations, }: Props) => DynamicRPCProviders;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
3
3
|
import '@dynamic-labs/sdk-api';
|
|
4
4
|
import { logger } from '../../../shared/logger.js';
|
|
5
5
|
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/multi-wallet';
|
|
6
7
|
import 'react/jsx-runtime';
|
|
7
8
|
import '../../../context/ViewContext/ViewContext.js';
|
|
8
9
|
import '../../constants/colors.js';
|
|
@@ -15,23 +16,23 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
try {
|
|
17
18
|
if (networkConfigurations) {
|
|
18
|
-
setProviders(
|
|
19
|
+
setProviders(ChainRpcProviders.getProviders(networkConfigurations));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
catch (error) {
|
|
22
23
|
logger.error(error);
|
|
23
24
|
}
|
|
24
25
|
}, [networkConfigurations]);
|
|
25
|
-
const getEvmRpcProviderByChainId
|
|
26
|
+
const getEvmRpcProviderByChainId = useCallback((chainId) => {
|
|
26
27
|
if (!networkConfigurations) {
|
|
27
28
|
return undefined;
|
|
28
29
|
}
|
|
29
|
-
return
|
|
30
|
+
return ChainRpcProviders.getEvmProviderByChainId(networkConfigurations, chainId);
|
|
30
31
|
}, [networkConfigurations]);
|
|
31
32
|
useEffect(() => {
|
|
32
33
|
try {
|
|
33
34
|
if (networkConfigurations) {
|
|
34
|
-
setEvmDefaultProvider(
|
|
35
|
+
setEvmDefaultProvider(ChainRpcProviders.getEvmProviderByChainId(networkConfigurations, 1));
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
@@ -41,7 +42,7 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
41
42
|
useEffect(() => {
|
|
42
43
|
try {
|
|
43
44
|
if (networkConfigurations) {
|
|
44
|
-
setSolanaDefaultProvider(
|
|
45
|
+
setSolanaDefaultProvider(ChainRpcProviders.getSolanaRpcProviderByChainId(networkConfigurations, '101'));
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
catch (error) {
|
|
@@ -51,7 +52,7 @@ const useRpcProviders = ({ networkConfigurations, }) => {
|
|
|
51
52
|
return {
|
|
52
53
|
evmDefaultProvider,
|
|
53
54
|
evmProviders: providers === null || providers === void 0 ? void 0 : providers.evm,
|
|
54
|
-
getEvmRpcProviderByChainId
|
|
55
|
+
getEvmRpcProviderByChainId,
|
|
55
56
|
solanaDefaultProvider,
|
|
56
57
|
solanaProviders: providers === null || providers === void 0 ? void 0 : providers.solana,
|
|
57
58
|
};
|
|
@@ -138,8 +138,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
138
138
|
verifyOnly &&
|
|
139
139
|
!_isSupportedNetwork &&
|
|
140
140
|
!isKycRequired) {
|
|
141
|
-
|
|
142
|
-
if (_isProgrammableNetworkSwitchSupported) {
|
|
141
|
+
if (isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
143
142
|
return setView('network-not-supported');
|
|
144
143
|
}
|
|
145
144
|
return setView('network-not-supported-manual');
|
|
@@ -134,8 +134,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
134
134
|
verifyOnly &&
|
|
135
135
|
!_isSupportedNetwork &&
|
|
136
136
|
!isKycRequired) {
|
|
137
|
-
|
|
138
|
-
if (_isProgrammableNetworkSwitchSupported) {
|
|
137
|
+
if (isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
139
138
|
return setView('network-not-supported');
|
|
140
139
|
}
|
|
141
140
|
return setView('network-not-supported-manual');
|
|
@@ -18,6 +18,6 @@ export type UseWalletEventListenersArgs = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const useWalletEventListeners: ({ computeConnectedStateForWallets, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, user, setPrimaryWalletId, connectWalletByAddressAndChain, }: UseWalletEventListenersArgs) => {
|
|
20
20
|
loadingNetwork: boolean;
|
|
21
|
-
network: number | undefined;
|
|
22
|
-
setNetwork: import("react").Dispatch<import("react").SetStateAction<number | undefined>>;
|
|
21
|
+
network: string | number | undefined;
|
|
22
|
+
setNetwork: import("react").Dispatch<import("react").SetStateAction<string | number | undefined>>;
|
|
23
23
|
};
|
|
@@ -5,20 +5,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var data = require('../../../views/WalletList/data.cjs');
|
|
8
|
-
var getMagicLinkApiKeyFromProviders = require('./utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.cjs');
|
|
9
8
|
|
|
10
9
|
const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfigurations, vendorCredentials, walletUiUtils, magicLinkConfig, }) => {
|
|
11
10
|
const [wallets, setWallets] = React.useState([]);
|
|
12
11
|
React.useEffect(() => {
|
|
13
12
|
const getWalletList = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
13
|
if (projectSettings) {
|
|
15
|
-
const magicLinkApiKey = getMagicLinkApiKeyFromProviders.getMagicLinkApiKeyFromProviders((projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) || []);
|
|
16
14
|
const installedWallets = yield data.getInstalledWallets(projectSettings, {
|
|
17
15
|
appLogoUrl,
|
|
18
16
|
appName,
|
|
19
|
-
magicLinkApiKey,
|
|
20
17
|
magicLinkConfig,
|
|
21
18
|
networkConfigurations,
|
|
19
|
+
providers: projectSettings.providers || [],
|
|
22
20
|
skipMemo: true,
|
|
23
21
|
vendorCredentials,
|
|
24
22
|
walletUiUtils,
|
|
@@ -26,9 +24,9 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfiguration
|
|
|
26
24
|
const notInstalledWallets = yield data.getNotInstalledWallets(projectSettings, {
|
|
27
25
|
appLogoUrl,
|
|
28
26
|
appName,
|
|
29
|
-
magicLinkApiKey,
|
|
30
27
|
magicLinkConfig,
|
|
31
28
|
networkConfigurations,
|
|
29
|
+
providers: projectSettings.providers || [],
|
|
32
30
|
skipMemo: true,
|
|
33
31
|
vendorCredentials,
|
|
34
32
|
walletUiUtils,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MagicLinkConfig,
|
|
1
|
+
import { MagicLinkConfig, VendorCredentials, WalletUiUtils } from '@dynamic-labs/multi-wallet';
|
|
2
2
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
3
|
+
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
3
4
|
import { WalletOption } from '../../../shared';
|
|
4
5
|
type Props = {
|
|
5
6
|
appLogoUrl?: string;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
import { getInstalledWallets, getNotInstalledWallets } from '../../../views/WalletList/data.js';
|
|
4
|
-
import { getMagicLinkApiKeyFromProviders } from './utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.js';
|
|
5
4
|
|
|
6
5
|
const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfigurations, vendorCredentials, walletUiUtils, magicLinkConfig, }) => {
|
|
7
6
|
const [wallets, setWallets] = useState([]);
|
|
8
7
|
useEffect(() => {
|
|
9
8
|
const getWalletList = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
9
|
if (projectSettings) {
|
|
11
|
-
const magicLinkApiKey = getMagicLinkApiKeyFromProviders((projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) || []);
|
|
12
10
|
const installedWallets = yield getInstalledWallets(projectSettings, {
|
|
13
11
|
appLogoUrl,
|
|
14
12
|
appName,
|
|
15
|
-
magicLinkApiKey,
|
|
16
13
|
magicLinkConfig,
|
|
17
14
|
networkConfigurations,
|
|
15
|
+
providers: projectSettings.providers || [],
|
|
18
16
|
skipMemo: true,
|
|
19
17
|
vendorCredentials,
|
|
20
18
|
walletUiUtils,
|
|
@@ -22,9 +20,9 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfiguration
|
|
|
22
20
|
const notInstalledWallets = yield getNotInstalledWallets(projectSettings, {
|
|
23
21
|
appLogoUrl,
|
|
24
22
|
appName,
|
|
25
|
-
magicLinkApiKey,
|
|
26
23
|
magicLinkConfig,
|
|
27
24
|
networkConfigurations,
|
|
25
|
+
providers: projectSettings.providers || [],
|
|
28
26
|
skipMemo: true,
|
|
29
27
|
vendorCredentials,
|
|
30
28
|
walletUiUtils,
|
|
@@ -23,6 +23,7 @@ require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
|
23
23
|
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
24
24
|
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
25
25
|
require('../../config/ApiEndpoint.cjs');
|
|
26
|
+
require('@dynamic-labs/rpc-providers');
|
|
26
27
|
var useVerifyWallet = require('../../utils/hooks/useVerifyWallet/useVerifyWallet.cjs');
|
|
27
28
|
require('ethers');
|
|
28
29
|
require('../../context/MockContext/MockContext.cjs');
|
|
@@ -19,6 +19,7 @@ import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
|
19
19
|
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
20
20
|
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
21
21
|
import '../../config/ApiEndpoint.js';
|
|
22
|
+
import '@dynamic-labs/rpc-providers';
|
|
22
23
|
import { useVerifyWallet } from '../../utils/hooks/useVerifyWallet/useVerifyWallet.js';
|
|
23
24
|
import 'ethers';
|
|
24
25
|
import '../../context/MockContext/MockContext.js';
|
|
@@ -25,6 +25,7 @@ require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
|
25
25
|
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
26
26
|
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
27
27
|
require('../../config/ApiEndpoint.cjs');
|
|
28
|
+
require('@dynamic-labs/rpc-providers');
|
|
28
29
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
29
30
|
require('ethers');
|
|
30
31
|
require('../../context/MockContext/MockContext.cjs');
|
|
@@ -35,19 +36,20 @@ require('../../components/IconButton/IconButton.cjs');
|
|
|
35
36
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
36
37
|
var NetworkPicker = require('../../components/NetworkPicker/NetworkPicker.cjs');
|
|
37
38
|
var UserAddress = require('../../components/UserAddress/UserAddress.cjs');
|
|
38
|
-
var
|
|
39
|
+
var useFetchNameService = require('../../widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs');
|
|
40
|
+
var OnboardingUserDataForm = require('./OnboardingUserDataForm/OnboardingUserDataForm.cjs');
|
|
39
41
|
|
|
40
42
|
const CollectUserDataView = () => {
|
|
41
|
-
var _a, _b;
|
|
42
43
|
const { appName, handleLogOut, projectSettings, network, decodedOnboardingOnlyToken, selectedWalletConnector: walletConnector, onboardingImageUrl, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
43
44
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
45
|
+
const nameService = useFetchNameService.useFetchNameService();
|
|
44
46
|
if (!walletConnector || !decodedOnboardingOnlyToken) {
|
|
45
47
|
return null;
|
|
46
48
|
}
|
|
47
49
|
const userProfile = createUserProfile.createUserProfile(decodedOnboardingOnlyToken);
|
|
48
50
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
49
51
|
const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
|
|
50
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data', "data-testid": 'collect-user-data-view' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ withIcon: false, className: 'collect-user-data__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data__form' }, { children: [jsxRuntime.jsxs(
|
|
52
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data', "data-testid": 'collect-user-data-view' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ withIcon: false, className: 'collect-user-data__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data__form' }, { children: [jsxRuntime.jsxs(OnboardingUserDataForm.OnboardingUserDataForm, Object.assign({ disableSubmit: !_isSupportedNetwork, userProfile: userProfile }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'collect-user-data__img-container' }, { children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletConnector.name, style: { height: pixelToRem.pixelToRem(64), width: pixelToRem.pixelToRem(64) } })) })), jsxRuntime.jsx(UserAddress.UserAddress, { userProfile: userProfile }), jsxRuntime.jsx("div", Object.assign({ className: 'collect-user-data__network-container' }, { children: jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' }) })), !_isSupportedNetwork ? (jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title' }, { children: "Update Network" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] }))) : (jsxRuntime.jsxs("div", Object.assign({ className: 'collect-user-data__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title' }, { children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
51
53
|
`Welcome to ${appName}` })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
52
54
|
'We need a bit of information to get started' }))] })))] })), jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'collect-user-data__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))] }))] })));
|
|
53
55
|
};
|