@dynamic-labs/sdk-react-core 0.17.0-RC.7 → 0.17.0-RC.9
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 +37 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +8 -8
- package/src/index.cjs +7 -2
- package/src/index.d.ts +2 -2
- package/src/index.js +5 -1
- package/src/lib/Main.cjs +6 -3
- package/src/lib/Main.js +5 -2
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +5 -2
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +5 -2
- package/src/lib/components/Alert/Alert.cjs +29 -0
- package/src/lib/components/Alert/Alert.js +25 -0
- package/src/lib/components/Alert/Alert.types.d.ts +4 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +5 -2
- package/src/lib/components/AnimatePresence/AnimatePresence.js +5 -2
- package/src/lib/components/Checkbox/Checkbox.cjs +3 -1
- package/src/lib/components/Checkbox/Checkbox.js +3 -1
- package/src/lib/components/Divider/Divider.cjs +5 -2
- package/src/lib/components/Divider/Divider.js +5 -2
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +3 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +3 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +3 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +3 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +4 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +4 -1
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +3 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +3 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +3 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +3 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +4 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +4 -2
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +5 -2
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +5 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +4 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +4 -2
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +5 -2
- package/src/lib/components/NetworkPicker/components/Network/Network.js +5 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +5 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +5 -2
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.js +3 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +5 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +5 -2
- package/src/lib/components/OverlayCard/OverlayCard.cjs +5 -2
- package/src/lib/components/OverlayCard/OverlayCard.js +5 -2
- package/src/lib/components/Portal/Portal.cjs +5 -2
- package/src/lib/components/Portal/Portal.js +5 -2
- package/src/lib/components/Select/Select.cjs +3 -1
- package/src/lib/components/Select/Select.js +3 -1
- package/src/lib/components/ShadowDOM/utils.cjs +3 -1
- package/src/lib/components/ShadowDOM/utils.js +3 -1
- package/src/lib/components/Spinner/spinner.cjs +3 -1
- package/src/lib/components/Spinner/spinner.js +3 -1
- package/src/lib/components/Toolkit/Toolkit.cjs +4 -1
- package/src/lib/components/Toolkit/Toolkit.js +4 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +3 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +3 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +5 -2
- package/src/lib/components/Tooltip/Tooltip.js +5 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +5 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +5 -2
- package/src/lib/components/UserAddress/UserAddress.cjs +3 -1
- package/src/lib/components/UserAddress/UserAddress.js +3 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +16 -8
- package/src/lib/components/UserProfile/UserProfile.js +12 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +5 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +5 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +3 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +3 -1
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +5 -2
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +5 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +5 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +5 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -16
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -6
- package/src/lib/context/DynamicContext/DynamicContext.js +9 -10
- package/src/lib/context/DynamicContext/helpers.cjs +3 -1
- package/src/lib/context/DynamicContext/helpers.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +3 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +3 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +3 -1
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +3 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +5 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +5 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -1
- package/src/lib/context/DynamicContext/validators.cjs +3 -1
- package/src/lib/context/DynamicContext/validators.js +3 -1
- package/src/lib/context/FundingContext/FundingContext.cjs +2 -2
- package/src/lib/context/FundingContext/FundingContext.js +1 -1
- package/src/lib/context/MockContext/MockContext.cjs +3 -1
- package/src/lib/context/MockContext/MockContext.js +3 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +5 -2
- package/src/lib/context/QrCodeContext/QrCodeContext.js +5 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +6 -3
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -2
- package/src/lib/context/ThemeContext/themesData.cjs +3 -1
- package/src/lib/context/ThemeContext/themesData.js +3 -1
- package/src/lib/data/api.cjs +19 -17
- package/src/lib/data/api.js +4 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +5 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +5 -2
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +5 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +6 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +7 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +4 -1
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +4 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +5 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +5 -2
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +5 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +5 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +27 -41
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +27 -41
- package/src/lib/modals/TransactionConfirmationModal/hooks/index.d.ts +1 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/index.d.ts +1 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.cjs +85 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.d.ts +18 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.js +81 -0
- package/src/lib/shared/types/index.d.ts +1 -1
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +1 -1
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +1 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +22 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.d.ts +2 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +18 -0
- package/src/lib/shared/utils/functions/formatBigNumber/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +5 -10
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +3 -8
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +3 -1
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +3 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/generateMessages/index.cjs +4 -3
- package/src/lib/utils/functions/generateMessages/index.js +2 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +3 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +3 -1
- package/src/lib/utils/functions/getEnabledKYC/index.cjs +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.d.ts +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.js +5 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.cjs +74 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.d.ts +29 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.js +68 -0
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +2 -2
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +6 -3
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +4 -1
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.cjs +2 -2
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +1 -1
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +3 -3
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +1 -1
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +2 -2
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +1 -1
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.cjs +5 -3
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +3 -1
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs +2 -2
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +6 -7
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +6 -4
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +3 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +3 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +2 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +4 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +4 -1
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +6 -3
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +4 -1
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +6 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -1
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +3 -1
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +3 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +4 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +4 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +16 -20
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +1 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +16 -20
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +4 -2
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +3 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +5 -2
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +4 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.cjs +3 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.js +3 -1
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +16 -6
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.d.ts +5 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +16 -6
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +3 -1
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +3 -1
- package/src/lib/utils/hooks/useMutation/useMutation.cjs +4 -4
- package/src/lib/utils/hooks/useMutation/useMutation.js +1 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +3 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +3 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +6 -4
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +5 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +11 -8
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +7 -4
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +6 -3
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +4 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +9 -7
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +3 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +6 -3
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -0
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -14
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -5
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -14
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +5 -2
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +5 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +5 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +5 -2
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +10 -6
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.d.ts +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +10 -6
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +7 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +7 -4
- package/src/lib/views/CollectUserDataView/fieldsConfig.cjs +3 -1
- package/src/lib/views/CollectUserDataView/fieldsConfig.js +3 -1
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +5 -2
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +5 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +6 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +5 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +5 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +5 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +6 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +5 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +6 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +5 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +4 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +4 -2
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +5 -2
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +5 -2
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +6 -3
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +5 -2
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +12 -5
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +12 -5
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +5 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +5 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -2
- package/src/lib/views/NoAccess/NoAccess.cjs +5 -2
- package/src/lib/views/NoAccess/NoAccess.js +5 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +5 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +5 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +5 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +5 -2
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +6 -3
- package/src/lib/views/PendingConnectView/PendingConnectView.js +5 -2
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +4 -1
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +4 -1
- package/src/lib/views/QrCodeView/QRCode.cjs +2 -2
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +6 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +5 -2
- package/src/lib/views/QrCodeView/QrCodeView.cjs +5 -2
- package/src/lib/views/QrCodeView/QrCodeView.js +5 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -2
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +5 -2
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +5 -2
- package/src/lib/views/WalletList/WalletList.cjs +3 -1
- package/src/lib/views/WalletList/WalletList.js +3 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +5 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +5 -2
- package/src/lib/views/WalletList/data.cjs +4 -1
- package/src/lib/views/WalletList/data.js +4 -1
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +5 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +5 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +7 -4
- package/src/lib/views/WalletUsedView/WalletUsedView.js +5 -2
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +7 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +3 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +5 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +3 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +4 -1
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +7 -3
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +7 -3
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +5 -2
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +12 -6
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +10 -4
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +5 -2
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +9 -7
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +9 -7
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +5 -2
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +5 -2
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useCallback, useEffect, useMemo } from 'react';
|
|
3
|
-
import { getWalletConnectorByName, isSameAddress } from '@dynamic-labs/
|
|
3
|
+
import { getWalletConnectorByName, isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import { CONNECTED_WALLET_CONNECTOR_DATA } from '../../constants/localStorage.js';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
12
14
|
import '../../../shared/consts/index.js';
|
|
13
15
|
import { getWalletProvider } from '../../functions/getWalletProvider/getWalletProvider.js';
|
|
14
16
|
import { createVisit } from '../../../data/api.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
15
18
|
import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
16
19
|
|
|
17
20
|
const useConnectWallet = (wallets, authMode, environmentId, enableVisitTrackingOnConnectOnly) => {
|
|
@@ -7,10 +7,12 @@ var React = require('react');
|
|
|
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/
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
13
14
|
require('../../constants/colors.cjs');
|
|
15
|
+
require('ethers');
|
|
14
16
|
require('../../../shared/consts/index.cjs');
|
|
15
17
|
var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
16
18
|
|
|
@@ -3,10 +3,12 @@ import { useState, useEffect } from 'react';
|
|
|
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/
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import '../../constants/colors.js';
|
|
11
|
+
import 'ethers';
|
|
10
12
|
import '../../../shared/consts/index.js';
|
|
11
13
|
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
12
14
|
|
package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs
CHANGED
|
@@ -8,11 +8,14 @@ var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
|
8
8
|
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
9
9
|
require('../../../shared/logger.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
|
-
require('@dynamic-labs/
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
12
|
require('react/jsx-runtime');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
13
14
|
require('../../constants/colors.cjs');
|
|
15
|
+
require('ethers');
|
|
14
16
|
require('../../../shared/consts/index.cjs');
|
|
15
17
|
var index = require('../../functions/storeAuthToken/index.cjs');
|
|
18
|
+
require('@dynamic-labs/multi-wallet');
|
|
16
19
|
var createUserProfile = require('../../functions/createUserProfile/createUserProfile.cjs');
|
|
17
20
|
require('@dynamic-labs/sdk-api');
|
|
18
21
|
|
package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js
CHANGED
|
@@ -4,11 +4,14 @@ import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
|
4
4
|
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
|
-
import '@dynamic-labs/
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import '../../constants/colors.js';
|
|
11
|
+
import 'ethers';
|
|
10
12
|
import '../../../shared/consts/index.js';
|
|
11
13
|
import { storeAuthToken } from '../../functions/storeAuthToken/index.js';
|
|
14
|
+
import '@dynamic-labs/multi-wallet';
|
|
12
15
|
import { createUserProfile } from '../../functions/createUserProfile/createUserProfile.js';
|
|
13
16
|
import '@dynamic-labs/sdk-api';
|
|
14
17
|
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
var api = require('../../../data/api.cjs');
|
|
8
8
|
require('@dynamic-labs/sdk-api');
|
|
9
9
|
require('../../../shared/logger.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
14
15
|
require('../../constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
16
18
|
require('../../../shared/consts/index.cjs');
|
|
17
19
|
var validators = require('../../../context/DynamicContext/validators.cjs');
|
|
@@ -31,28 +33,23 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
31
33
|
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);
|
|
32
34
|
// Stringify the objects for easy comparison
|
|
33
35
|
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
36
|
+
const handleRemoveLsNetworks = React.useCallback(() => {
|
|
37
|
+
removeLsNetworks();
|
|
38
|
+
setlsNetworksExists(false);
|
|
39
|
+
}, [removeLsNetworks]);
|
|
34
40
|
React.useEffect(() => {
|
|
35
41
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
36
|
-
|
|
37
|
-
setlsNetworksExists(false);
|
|
42
|
+
handleRemoveLsNetworks();
|
|
38
43
|
}
|
|
39
44
|
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
40
|
-
|
|
41
|
-
setlsNetworksExists(false);
|
|
45
|
+
handleRemoveLsNetworks();
|
|
42
46
|
}
|
|
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
|
-
]);
|
|
47
|
+
}, [environmentId, handleRemoveLsNetworks, lsNetworks, removeLsNetworks]);
|
|
50
48
|
React.useEffect(() => {
|
|
51
49
|
if (!authToken) {
|
|
52
|
-
|
|
53
|
-
setlsNetworksExists(false);
|
|
50
|
+
handleRemoveLsNetworks();
|
|
54
51
|
}
|
|
55
|
-
}, [authToken,
|
|
52
|
+
}, [authToken, handleRemoveLsNetworks]);
|
|
56
53
|
React.useEffect(() => {
|
|
57
54
|
var _a, _b;
|
|
58
55
|
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
@@ -60,8 +57,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
60
57
|
if (localStorageNetworksJson) {
|
|
61
58
|
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
62
59
|
if (!fullMatch) {
|
|
63
|
-
|
|
64
|
-
setlsNetworksExists(false);
|
|
60
|
+
handleRemoveLsNetworks();
|
|
65
61
|
}
|
|
66
62
|
setCompleted(true);
|
|
67
63
|
}
|
|
@@ -69,10 +65,10 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
69
65
|
}, [
|
|
70
66
|
lsNetworksExists,
|
|
71
67
|
customerEvmNetworksJson,
|
|
72
|
-
removeLsNetworks,
|
|
73
68
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
74
69
|
completed,
|
|
75
70
|
setCompleted,
|
|
71
|
+
handleRemoveLsNetworks,
|
|
76
72
|
]);
|
|
77
73
|
React.useEffect(() => {
|
|
78
74
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
@@ -81,7 +77,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
81
77
|
.then((response) => {
|
|
82
78
|
var _a, _b, _c, _d;
|
|
83
79
|
if (!response)
|
|
84
|
-
throw new
|
|
80
|
+
throw new utils.DynamicError('Configuration is not defined');
|
|
85
81
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
86
82
|
const evm = response.find((configurations) => configurations.chainName === 'evm');
|
|
87
83
|
const solana = response.find((configurations) => configurations.chainName === 'solana');
|
|
@@ -154,7 +150,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
154
150
|
]);
|
|
155
151
|
return {
|
|
156
152
|
configurations: lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
157
|
-
|
|
153
|
+
handleRemoveLsNetworks,
|
|
158
154
|
};
|
|
159
155
|
};
|
|
160
156
|
|
package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export type fetchNetworkConfigurationsProps = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const useFetchNetworkConfigurations: ({ authToken, environmentId, evmNetworks: customerEvmNetworks, maxRetries, }: fetchNetworkConfigurationsProps) => {
|
|
9
9
|
configurations: import("@dynamic-labs/types").NetworkConfigurationMap | undefined;
|
|
10
|
-
|
|
10
|
+
handleRemoveLsNetworks: () => void;
|
|
11
11
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { DynamicError } from '@dynamic-labs/
|
|
1
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
3
|
import { fetchNetworkSettings } from '../../../data/api.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { NETWORKS_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
12
14
|
import '../../../shared/consts/index.js';
|
|
13
15
|
import { validateLocalStorageExpiry } from '../../../context/DynamicContext/validators.js';
|
|
@@ -27,28 +29,23 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
27
29
|
const [lsNetworksExists, setlsNetworksExists] = useState(Boolean(lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.version) === VERSION);
|
|
28
30
|
// Stringify the objects for easy comparison
|
|
29
31
|
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
32
|
+
const handleRemoveLsNetworks = useCallback(() => {
|
|
33
|
+
removeLsNetworks();
|
|
34
|
+
setlsNetworksExists(false);
|
|
35
|
+
}, [removeLsNetworks]);
|
|
30
36
|
useEffect(() => {
|
|
31
37
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
32
|
-
|
|
33
|
-
setlsNetworksExists(false);
|
|
38
|
+
handleRemoveLsNetworks();
|
|
34
39
|
}
|
|
35
40
|
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
36
|
-
|
|
37
|
-
setlsNetworksExists(false);
|
|
41
|
+
handleRemoveLsNetworks();
|
|
38
42
|
}
|
|
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
|
-
]);
|
|
43
|
+
}, [environmentId, handleRemoveLsNetworks, lsNetworks, removeLsNetworks]);
|
|
46
44
|
useEffect(() => {
|
|
47
45
|
if (!authToken) {
|
|
48
|
-
|
|
49
|
-
setlsNetworksExists(false);
|
|
46
|
+
handleRemoveLsNetworks();
|
|
50
47
|
}
|
|
51
|
-
}, [authToken,
|
|
48
|
+
}, [authToken, handleRemoveLsNetworks]);
|
|
52
49
|
useEffect(() => {
|
|
53
50
|
var _a, _b;
|
|
54
51
|
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
@@ -56,8 +53,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
56
53
|
if (localStorageNetworksJson) {
|
|
57
54
|
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
58
55
|
if (!fullMatch) {
|
|
59
|
-
|
|
60
|
-
setlsNetworksExists(false);
|
|
56
|
+
handleRemoveLsNetworks();
|
|
61
57
|
}
|
|
62
58
|
setCompleted(true);
|
|
63
59
|
}
|
|
@@ -65,10 +61,10 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
65
61
|
}, [
|
|
66
62
|
lsNetworksExists,
|
|
67
63
|
customerEvmNetworksJson,
|
|
68
|
-
removeLsNetworks,
|
|
69
64
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
70
65
|
completed,
|
|
71
66
|
setCompleted,
|
|
67
|
+
handleRemoveLsNetworks,
|
|
72
68
|
]);
|
|
73
69
|
useEffect(() => {
|
|
74
70
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
@@ -150,7 +146,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
150
146
|
]);
|
|
151
147
|
return {
|
|
152
148
|
configurations: lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
153
|
-
|
|
149
|
+
handleRemoveLsNetworks,
|
|
154
150
|
};
|
|
155
151
|
};
|
|
156
152
|
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
var api = require('../../../data/api.cjs');
|
|
8
8
|
require('@dynamic-labs/sdk-api');
|
|
9
9
|
require('../../../shared/logger.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
14
15
|
require('../../constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
16
18
|
require('../../../shared/consts/index.cjs');
|
|
17
19
|
var validators = require('../../../context/DynamicContext/validators.cjs');
|
|
@@ -32,7 +34,7 @@ const useFetchNonce = (environmentId, maxRetries = 2) => {
|
|
|
32
34
|
api.fetchNonce(environmentId)
|
|
33
35
|
.then((response) => {
|
|
34
36
|
if (!response)
|
|
35
|
-
throw new
|
|
37
|
+
throw new utils.DynamicError('Nonce is not defined');
|
|
36
38
|
const expiry = new Date().getTime() + 60000 * 60 * 24;
|
|
37
39
|
setLsNonce({ environmentId, expiry: expiry, value: response });
|
|
38
40
|
})
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { DynamicError } from '@dynamic-labs/
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
3
|
import { fetchNonce } from '../../../data/api.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { NONCE_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
12
14
|
import '../../../shared/consts/index.js';
|
|
13
15
|
import { validateLocalStorageExpiry } from '../../../context/DynamicContext/validators.js';
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
var api = require('../../../data/api.cjs');
|
|
8
8
|
require('@dynamic-labs/sdk-api');
|
|
9
9
|
require('../../../shared/logger.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
14
15
|
require('../../constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
16
18
|
require('../../../shared/consts/index.cjs');
|
|
17
19
|
var validators = require('../../../context/DynamicContext/validators.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
18
21
|
var index = require('../../functions/getEnabledProviders/index.cjs');
|
|
19
22
|
|
|
20
23
|
const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, }) => {
|
|
@@ -41,7 +44,7 @@ const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, })
|
|
|
41
44
|
api.fetchProjectSettings(environmentId)
|
|
42
45
|
.then((response) => {
|
|
43
46
|
if (!response)
|
|
44
|
-
throw new
|
|
47
|
+
throw new utils.DynamicError('Settings are not defined');
|
|
45
48
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
46
49
|
setLsSettings({
|
|
47
50
|
environmentId,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import { DynamicError } from '@dynamic-labs/
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
3
|
import { fetchProjectSettings } from '../../../data/api.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { PROJECT_SETTINGS_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
12
14
|
import '../../../shared/consts/index.js';
|
|
13
15
|
import { validateLocalStorageExpiry } from '../../../context/DynamicContext/validators.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
14
17
|
import { getEnabledProviders } from '../../functions/getEnabledProviders/index.js';
|
|
15
18
|
|
|
16
19
|
const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, }) => {
|
|
@@ -6,10 +6,12 @@ var React = require('react');
|
|
|
6
6
|
require('@dynamic-labs/sdk-api');
|
|
7
7
|
require('../../../shared/logger.cjs');
|
|
8
8
|
require('@dynamic-labs/iconic');
|
|
9
|
-
require('@dynamic-labs/
|
|
9
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
require('react/jsx-runtime');
|
|
11
11
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
+
require('@dynamic-labs/utils');
|
|
12
13
|
require('../../constants/colors.cjs');
|
|
14
|
+
require('ethers');
|
|
13
15
|
var index = require('../../../shared/consts/index.cjs');
|
|
14
16
|
|
|
15
17
|
const useFetchWalletsForChainsMap = (propsWalletsChainsMap) => {
|
|
@@ -2,10 +2,12 @@ import { useEffect } from 'react';
|
|
|
2
2
|
import '@dynamic-labs/sdk-api';
|
|
3
3
|
import '../../../shared/logger.js';
|
|
4
4
|
import '@dynamic-labs/iconic';
|
|
5
|
-
import '@dynamic-labs/
|
|
5
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import '../../../context/ViewContext/ViewContext.js';
|
|
8
|
+
import '@dynamic-labs/utils';
|
|
8
9
|
import '../../constants/colors.js';
|
|
10
|
+
import 'ethers';
|
|
9
11
|
import { defaultWalletsForChains } from '../../../shared/consts/index.js';
|
|
10
12
|
|
|
11
13
|
const useFetchWalletsForChainsMap = (propsWalletsChainsMap) => {
|
|
@@ -3,15 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
6
|
-
var index = require('../../functions/getEnabledKYC/index.cjs');
|
|
7
6
|
var useOnlyConnectedMode = require('../useOnlyConnectedMode/useOnlyConnectedMode.cjs');
|
|
7
|
+
var getEnabledUserProfileFields = require('../../functions/getEnabledUserProfileFields/getEnabledUserProfileFields.cjs');
|
|
8
8
|
|
|
9
|
+
/* eslint-disable max-len */
|
|
10
|
+
/**
|
|
11
|
+
* A custom React hook that checks if KYC fields are enabled in the project settings or defined in the user profile.
|
|
12
|
+
*
|
|
13
|
+
* @returns {boolean} - A boolean value indicating whether the KYC fields are enabled in the project settings or defined in the user profile.
|
|
14
|
+
*/
|
|
9
15
|
const useKYCFlag = () => {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
const isOnlyConnectedMode = useOnlyConnectedMode.useOnlyConnectedMode();
|
|
17
|
+
const { projectSettings, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
18
|
+
if (isOnlyConnectedMode)
|
|
19
|
+
return false;
|
|
20
|
+
const hasAnyKYCFields = getEnabledUserProfileFields.getUserProfileFields({
|
|
21
|
+
projectSettingsKyc: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc,
|
|
22
|
+
user,
|
|
23
|
+
});
|
|
24
|
+
return hasAnyKYCFields.length > 0;
|
|
15
25
|
};
|
|
16
26
|
|
|
17
27
|
exports.useKYCFlag = useKYCFlag;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom React hook that checks if KYC fields are enabled in the project settings or defined in the user profile.
|
|
3
|
+
*
|
|
4
|
+
* @returns {boolean} - A boolean value indicating whether the KYC fields are enabled in the project settings or defined in the user profile.
|
|
5
|
+
*/
|
|
1
6
|
export declare const useKYCFlag: () => boolean;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
2
|
-
import { getEnabledKYC } from '../../functions/getEnabledKYC/index.js';
|
|
3
2
|
import { useOnlyConnectedMode } from '../useOnlyConnectedMode/useOnlyConnectedMode.js';
|
|
3
|
+
import { getUserProfileFields } from '../../functions/getEnabledUserProfileFields/getEnabledUserProfileFields.js';
|
|
4
4
|
|
|
5
|
+
/* eslint-disable max-len */
|
|
6
|
+
/**
|
|
7
|
+
* A custom React hook that checks if KYC fields are enabled in the project settings or defined in the user profile.
|
|
8
|
+
*
|
|
9
|
+
* @returns {boolean} - A boolean value indicating whether the KYC fields are enabled in the project settings or defined in the user profile.
|
|
10
|
+
*/
|
|
5
11
|
const useKYCFlag = () => {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
const isOnlyConnectedMode = useOnlyConnectedMode();
|
|
13
|
+
const { projectSettings, user } = useInternalDynamicContext();
|
|
14
|
+
if (isOnlyConnectedMode)
|
|
15
|
+
return false;
|
|
16
|
+
const hasAnyKYCFields = getUserProfileFields({
|
|
17
|
+
projectSettingsKyc: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc,
|
|
18
|
+
user,
|
|
19
|
+
});
|
|
20
|
+
return hasAnyKYCFields.length > 0;
|
|
11
21
|
};
|
|
12
22
|
|
|
13
23
|
export { useKYCFlag };
|
|
@@ -6,12 +6,14 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useInte
|
|
|
6
6
|
require('@dynamic-labs/sdk-api');
|
|
7
7
|
require('../../../shared/logger.cjs');
|
|
8
8
|
require('@dynamic-labs/iconic');
|
|
9
|
-
require('@dynamic-labs/
|
|
9
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
require('react/jsx-runtime');
|
|
11
11
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
12
|
require('react');
|
|
13
13
|
var isSSR = require('../../../shared/utils/functions/isSSR/isSSR.cjs');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
14
15
|
require('../../constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
require('../../../shared/consts/index.cjs');
|
|
16
18
|
var useOnlyConnectedMode = require('../useOnlyConnectedMode/useOnlyConnectedMode.cjs');
|
|
17
19
|
|
|
@@ -2,12 +2,14 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useIn
|
|
|
2
2
|
import '@dynamic-labs/sdk-api';
|
|
3
3
|
import '../../../shared/logger.js';
|
|
4
4
|
import '@dynamic-labs/iconic';
|
|
5
|
-
import '@dynamic-labs/
|
|
5
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import '../../../context/ViewContext/ViewContext.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import { isSSR } from '../../../shared/utils/functions/isSSR/isSSR.js';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import '../../../shared/consts/index.js';
|
|
12
14
|
import { useOnlyConnectedMode } from '../useOnlyConnectedMode/useOnlyConnectedMode.js';
|
|
13
15
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
8
|
|
|
9
9
|
const useMutation = (mutation, options = {}) => {
|
|
10
10
|
const [state, setState] = React.useState({
|
|
@@ -32,18 +32,18 @@ const useMutation = (mutation, options = {}) => {
|
|
|
32
32
|
(_a = options === null || options === void 0 ? void 0 : options.onSuccess) === null || _a === void 0 ? void 0 : _a.call(options, data, variables);
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
-
|
|
35
|
+
walletConnectorCore.logger.error(err);
|
|
36
36
|
}
|
|
37
37
|
return data;
|
|
38
38
|
}
|
|
39
39
|
catch (error) {
|
|
40
40
|
setState({ error: error, isLoading: false });
|
|
41
|
-
|
|
41
|
+
walletConnectorCore.logger.error(error);
|
|
42
42
|
try {
|
|
43
43
|
(_b = options === null || options === void 0 ? void 0 : options.onFailure) === null || _b === void 0 ? void 0 : _b.call(options, error, variables);
|
|
44
44
|
}
|
|
45
45
|
catch (err) {
|
|
46
|
-
|
|
46
|
+
walletConnectorCore.logger.error(err);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useCallback } from 'react';
|
|
3
|
-
import { logger } from '@dynamic-labs/
|
|
3
|
+
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
|
|
5
5
|
const useMutation = (mutation, options = {}) => {
|
|
6
6
|
const [state, setState] = useState({
|
|
@@ -7,10 +7,12 @@ 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/
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
13
14
|
require('../../constants/colors.cjs');
|
|
15
|
+
require('ethers');
|
|
14
16
|
require('../../../shared/consts/index.cjs');
|
|
15
17
|
|
|
16
18
|
const useRpcProviders = ({ networkConfigurations, }) => {
|
|
@@ -3,10 +3,12 @@ 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/
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import '../../constants/colors.js';
|
|
11
|
+
import 'ethers';
|
|
10
12
|
import '../../../shared/consts/index.js';
|
|
11
13
|
|
|
12
14
|
const useRpcProviders = ({ networkConfigurations, }) => {
|
|
@@ -5,14 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var yup = require('yup');
|
|
8
|
-
var
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
9
9
|
require('@dynamic-labs/sdk-api');
|
|
10
10
|
var logger = require('../../../shared/logger.cjs');
|
|
11
11
|
require('@dynamic-labs/iconic');
|
|
12
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
13
|
require('react/jsx-runtime');
|
|
13
14
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
15
|
var index = require('../../../shared/utils/functions/getValueByKey/index.cjs');
|
|
15
16
|
require('../../constants/colors.cjs');
|
|
17
|
+
require('ethers');
|
|
16
18
|
var index$1 = require('../../../shared/consts/index.cjs');
|
|
17
19
|
var fieldsConfig = require('../../../views/CollectUserDataView/fieldsConfig.cjs');
|
|
18
20
|
var MockContext = require('../../../context/MockContext/MockContext.cjs');
|
|
@@ -48,7 +50,7 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
48
50
|
return;
|
|
49
51
|
try {
|
|
50
52
|
if (!(userProfile === null || userProfile === void 0 ? void 0 : userProfile.environmentId))
|
|
51
|
-
throw new
|
|
53
|
+
throw new utils.DynamicError('Invalid environment ID');
|
|
52
54
|
setFetch(true);
|
|
53
55
|
let updatedUserFields = values;
|
|
54
56
|
if (enforcePolicies) {
|
|
@@ -60,10 +62,10 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
60
62
|
catch (e) {
|
|
61
63
|
logger.logger.error(e);
|
|
62
64
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
63
|
-
if (e
|
|
65
|
+
if (e instanceof utils.EmailAlreadyExistsError) {
|
|
64
66
|
formikHelper.setErrors({ email: 'Email already exists' });
|
|
65
67
|
}
|
|
66
|
-
else if (e
|
|
68
|
+
else if (e instanceof utils.UsernameAlreadyExistsError) {
|
|
67
69
|
formikHelper.setErrors({ username: 'Username already exists' });
|
|
68
70
|
}
|
|
69
71
|
else {
|