@dynamic-labs/sdk-react-core 0.17.0-RC.6 → 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 +31 -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/useUserUpdateRequest/useUserUpdateRequest.cjs +17 -19
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.d.ts +8 -6
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js +17 -19
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +25 -24
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +25 -24
- 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} +4 -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} +4 -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 +2 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -1
- 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 +13 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +13 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +11 -5
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +11 -5
- 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
|
};
|
|
@@ -32,23 +32,7 @@ const useUserUpdateRequestInternal = ({ validationSchemaStripUnknown, }) => {
|
|
|
32
32
|
const { verifyEmail: verifyEmailFn } = useEmailVerificationRequest.useEmailVerificationRequest();
|
|
33
33
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
34
34
|
const updateUser = React.useCallback((userFields, userEnvironmentId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
|
|
36
|
-
var _a, _b;
|
|
37
|
-
setEmail((_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.email);
|
|
38
|
-
setVerificationUUID((_b = updateUserProfileResponse.emailVerification) === null || _b === void 0 ? void 0 : _b.verificationUUID);
|
|
39
|
-
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
40
|
-
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
41
|
-
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
42
|
-
const scopedVerifyEmailFn = (verificationToken) => {
|
|
43
|
-
var _a;
|
|
44
|
-
return verifyEmailFn(verificationToken, (_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.verificationUUID);
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
48
|
-
updateUserProfileResponse,
|
|
49
|
-
verifyEmailFn: scopedVerifyEmailFn,
|
|
50
|
-
};
|
|
51
|
-
});
|
|
35
|
+
var _a, _b;
|
|
52
36
|
const validatedUserFields = yield userFieldsSchema.validate(userFields, {
|
|
53
37
|
stripUnknown: validationSchemaStripUnknown,
|
|
54
38
|
});
|
|
@@ -58,11 +42,25 @@ const useUserUpdateRequestInternal = ({ validationSchemaStripUnknown, }) => {
|
|
|
58
42
|
// If email verification is not needed then we can update the user profile immediately.
|
|
59
43
|
updateUserProfileByJWT(updateUserProfileResponse.jwt);
|
|
60
44
|
return {
|
|
61
|
-
isEmailVerificationRequired:
|
|
45
|
+
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
62
46
|
updateUserProfileResponse,
|
|
63
47
|
};
|
|
64
48
|
}
|
|
65
|
-
|
|
49
|
+
// We update EmailContext to use this information in the Email Verification view
|
|
50
|
+
setEmail((_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.email);
|
|
51
|
+
setVerificationUUID((_b = updateUserProfileResponse.emailVerification) === null || _b === void 0 ? void 0 : _b.verificationUUID);
|
|
52
|
+
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
53
|
+
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
54
|
+
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
55
|
+
const scopedVerifyEmailFn = (verificationToken) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return verifyEmailFn(verificationToken, (_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.verificationUUID);
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
61
|
+
updateUserProfileResponse,
|
|
62
|
+
verifyEmailFn: scopedVerifyEmailFn,
|
|
63
|
+
};
|
|
66
64
|
}), [
|
|
67
65
|
environmentId,
|
|
68
66
|
jwtToken,
|
|
@@ -4,21 +4,23 @@ export declare const useUserUpdateRequestInternal: ({ validationSchemaStripUnkno
|
|
|
4
4
|
validationSchemaStripUnknown: boolean;
|
|
5
5
|
}) => {
|
|
6
6
|
updateUser: (userFields: UpdateUserFieldsArg, userEnvironmentId?: string) => Promise<{
|
|
7
|
-
isEmailVerificationRequired:
|
|
7
|
+
isEmailVerificationRequired: false;
|
|
8
8
|
updateUserProfileResponse: import("@dynamic-labs/sdk-api").UpdateSelfResponse;
|
|
9
|
-
verifyEmailFn
|
|
9
|
+
verifyEmailFn?: undefined;
|
|
10
10
|
} | {
|
|
11
|
-
isEmailVerificationRequired:
|
|
11
|
+
isEmailVerificationRequired: true;
|
|
12
12
|
updateUserProfileResponse: import("@dynamic-labs/sdk-api").UpdateSelfResponse;
|
|
13
|
+
verifyEmailFn: (verificationToken: string) => Promise<import("@dynamic-labs/sdk-api").UpdateSelfResponse>;
|
|
13
14
|
}>;
|
|
14
15
|
};
|
|
15
16
|
export declare const useUserUpdateRequest: () => {
|
|
16
17
|
updateUser: (userFields: UpdateUserFieldsArg, userEnvironmentId?: string) => Promise<{
|
|
17
|
-
isEmailVerificationRequired:
|
|
18
|
+
isEmailVerificationRequired: false;
|
|
18
19
|
updateUserProfileResponse: import("@dynamic-labs/sdk-api").UpdateSelfResponse;
|
|
19
|
-
verifyEmailFn
|
|
20
|
+
verifyEmailFn?: undefined;
|
|
20
21
|
} | {
|
|
21
|
-
isEmailVerificationRequired:
|
|
22
|
+
isEmailVerificationRequired: true;
|
|
22
23
|
updateUserProfileResponse: import("@dynamic-labs/sdk-api").UpdateSelfResponse;
|
|
24
|
+
verifyEmailFn: (verificationToken: string) => Promise<import("@dynamic-labs/sdk-api").UpdateSelfResponse>;
|
|
23
25
|
}>;
|
|
24
26
|
};
|
|
@@ -28,23 +28,7 @@ const useUserUpdateRequestInternal = ({ validationSchemaStripUnknown, }) => {
|
|
|
28
28
|
const { verifyEmail: verifyEmailFn } = useEmailVerificationRequest();
|
|
29
29
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
30
30
|
const updateUser = useCallback((userFields, userEnvironmentId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
|
|
32
|
-
var _a, _b;
|
|
33
|
-
setEmail((_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.email);
|
|
34
|
-
setVerificationUUID((_b = updateUserProfileResponse.emailVerification) === null || _b === void 0 ? void 0 : _b.verificationUUID);
|
|
35
|
-
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
36
|
-
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
37
|
-
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
38
|
-
const scopedVerifyEmailFn = (verificationToken) => {
|
|
39
|
-
var _a;
|
|
40
|
-
return verifyEmailFn(verificationToken, (_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.verificationUUID);
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
44
|
-
updateUserProfileResponse,
|
|
45
|
-
verifyEmailFn: scopedVerifyEmailFn,
|
|
46
|
-
};
|
|
47
|
-
});
|
|
31
|
+
var _a, _b;
|
|
48
32
|
const validatedUserFields = yield userFieldsSchema.validate(userFields, {
|
|
49
33
|
stripUnknown: validationSchemaStripUnknown,
|
|
50
34
|
});
|
|
@@ -54,11 +38,25 @@ const useUserUpdateRequestInternal = ({ validationSchemaStripUnknown, }) => {
|
|
|
54
38
|
// If email verification is not needed then we can update the user profile immediately.
|
|
55
39
|
updateUserProfileByJWT(updateUserProfileResponse.jwt);
|
|
56
40
|
return {
|
|
57
|
-
isEmailVerificationRequired:
|
|
41
|
+
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
58
42
|
updateUserProfileResponse,
|
|
59
43
|
};
|
|
60
44
|
}
|
|
61
|
-
|
|
45
|
+
// We update EmailContext to use this information in the Email Verification view
|
|
46
|
+
setEmail((_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.email);
|
|
47
|
+
setVerificationUUID((_b = updateUserProfileResponse.emailVerification) === null || _b === void 0 ? void 0 : _b.verificationUUID);
|
|
48
|
+
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
49
|
+
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
50
|
+
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
51
|
+
const scopedVerifyEmailFn = (verificationToken) => {
|
|
52
|
+
var _a;
|
|
53
|
+
return verifyEmailFn(verificationToken, (_a = updateUserProfileResponse.emailVerification) === null || _a === void 0 ? void 0 : _a.verificationUUID);
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
isEmailVerificationRequired: _isEmailVerificationRequired,
|
|
57
|
+
updateUserProfileResponse,
|
|
58
|
+
verifyEmailFn: scopedVerifyEmailFn,
|
|
59
|
+
};
|
|
62
60
|
}), [
|
|
63
61
|
environmentId,
|
|
64
62
|
jwtToken,
|