@dynamic-labs/sdk-react-core 0.17.0-RC.6 → 0.17.0-RC.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/package.cjs +4 -4
- package/package.js +4 -4
- package/package.json +10 -7
- package/src/index.cjs +4 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +3 -0
- package/src/lib/Main.cjs +3 -0
- package/src/lib/Main.js +3 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +4 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +4 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +4 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +4 -1
- package/src/lib/components/Divider/Divider.cjs +3 -0
- package/src/lib/components/Divider/Divider.js +3 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +2 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +2 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
- 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 +4 -1
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +4 -1
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +7 -4
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +7 -4
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +3 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +3 -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 +3 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +3 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +3 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +3 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +4 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +4 -1
- package/src/lib/components/Portal/Portal.cjs +4 -2
- package/src/lib/components/Portal/Portal.js +4 -2
- package/src/lib/components/Toolkit/Toolkit.cjs +1 -0
- package/src/lib/components/Toolkit/Toolkit.js +1 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +3 -0
- package/src/lib/components/Tooltip/Tooltip.js +3 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +4 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +4 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +4 -6
- package/src/lib/components/UserAddress/UserAddress.js +5 -7
- package/src/lib/components/UserProfile/UserProfile.cjs +1 -0
- package/src/lib/components/UserProfile/UserProfile.js +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +3 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +3 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +3 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +3 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +3 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +3 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +37 -21
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +7 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +31 -15
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
- 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 +4 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +4 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.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 +4 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +4 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +3 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +3 -0
- package/src/lib/data/api.cjs +31 -16
- package/src/lib/data/api.d.ts +8 -1
- package/src/lib/data/api.js +16 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +3 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +4 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +3 -1
- package/src/lib/shared/types/index.d.ts +4 -2
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +2 -7
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +2 -7
- 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/generateMessages/index.cjs +4 -3
- package/src/lib/utils/functions/generateMessages/index.js +2 -1
- 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/handleUnlinkHelper/handleUnlinkHelper.cjs +4 -3
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +2 -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/functions/walletListBuilder/walletListBuilder.cjs +0 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +0 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +1 -0
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +1 -0
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +4 -3
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +2 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +1 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -0
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +1 -0
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +1 -0
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +52 -31
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +5 -5
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +52 -31
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +3 -2
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +2 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +3 -2
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +2 -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 +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/useUserDataForm/useUserDataForm.cjs +5 -4
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +4 -3
- 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 +34 -32
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +30 -28
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +2 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -0
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -0
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -16
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -4
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -16
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +3 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +3 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +7 -3
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +7 -3
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.cjs → OnboardingUserDataForm/OnboardingUserDataForm.cjs} +10 -7
- 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} +10 -7
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/index.d.ts +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +3 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +3 -0
- 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 +3 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +3 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +3 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +3 -0
- 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 +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +3 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +3 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +3 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +3 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +15 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +15 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +13 -5
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +13 -5
- package/src/lib/views/NoAccess/NoAccess.cjs +3 -0
- package/src/lib/views/NoAccess/NoAccess.js +3 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +3 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +3 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +3 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +3 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +3 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +3 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +3 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +3 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +3 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +3 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +3 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +3 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +3 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +3 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +3 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +3 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +3 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +3 -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 +3 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +3 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +6 -3
- package/src/lib/views/WalletUsedView/WalletUsedView.js +4 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +6 -4
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +12 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +12 -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 +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
- 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 +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +54 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +50 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +5 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +5 -1
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +3 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +3 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +3 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +3 -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 +56 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.d.ts +5 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +51 -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
|
@@ -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
|
};
|
|
@@ -5,10 +5,11 @@ 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/multi-wallet');
|
|
12
13
|
require('react/jsx-runtime');
|
|
13
14
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
15
|
var index = require('../../../shared/utils/functions/getValueByKey/index.cjs');
|
|
@@ -48,7 +49,7 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
48
49
|
return;
|
|
49
50
|
try {
|
|
50
51
|
if (!(userProfile === null || userProfile === void 0 ? void 0 : userProfile.environmentId))
|
|
51
|
-
throw new
|
|
52
|
+
throw new utils.DynamicError('Invalid environment ID');
|
|
52
53
|
setFetch(true);
|
|
53
54
|
let updatedUserFields = values;
|
|
54
55
|
if (enforcePolicies) {
|
|
@@ -60,10 +61,10 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
60
61
|
catch (e) {
|
|
61
62
|
logger.logger.error(e);
|
|
62
63
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
63
|
-
if (e
|
|
64
|
+
if (e instanceof utils.EmailAlreadyExistsError) {
|
|
64
65
|
formikHelper.setErrors({ email: 'Email already exists' });
|
|
65
66
|
}
|
|
66
|
-
else if (e
|
|
67
|
+
else if (e instanceof utils.UsernameAlreadyExistsError) {
|
|
67
68
|
formikHelper.setErrors({ username: 'Username already exists' });
|
|
68
69
|
}
|
|
69
70
|
else {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useMemo, useCallback } from 'react';
|
|
3
3
|
import { object } from 'yup';
|
|
4
|
-
import { DynamicError } from '@dynamic-labs/
|
|
4
|
+
import { DynamicError, EmailAlreadyExistsError, UsernameAlreadyExistsError } from '@dynamic-labs/utils';
|
|
5
5
|
import '@dynamic-labs/sdk-api';
|
|
6
6
|
import { logger } from '../../../shared/logger.js';
|
|
7
7
|
import '@dynamic-labs/iconic';
|
|
8
|
+
import '@dynamic-labs/multi-wallet';
|
|
8
9
|
import 'react/jsx-runtime';
|
|
9
10
|
import '../../../context/ViewContext/ViewContext.js';
|
|
10
11
|
import { getValueByKey } from '../../../shared/utils/functions/getValueByKey/index.js';
|
|
@@ -56,10 +57,10 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
56
57
|
catch (e) {
|
|
57
58
|
logger.error(e);
|
|
58
59
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
59
|
-
if (e
|
|
60
|
+
if (e instanceof EmailAlreadyExistsError) {
|
|
60
61
|
formikHelper.setErrors({ email: 'Email already exists' });
|
|
61
62
|
}
|
|
62
|
-
else if (e
|
|
63
|
+
else if (e instanceof UsernameAlreadyExistsError) {
|
|
63
64
|
formikHelper.setErrors({ username: 'Username already exists' });
|
|
64
65
|
}
|
|
65
66
|
else {
|
|
@@ -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,
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
|
-
var
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
var api = require('../../../data/api.cjs');
|
|
8
8
|
var index = require('../../functions/storeAuthToken/index.cjs');
|
|
9
|
+
require('@dynamic-labs/multi-wallet');
|
|
9
10
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
10
11
|
require('../../constants/colors.cjs');
|
|
11
12
|
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
@@ -29,7 +30,7 @@ require('../../../shared/consts/index.cjs');
|
|
|
29
30
|
// This logic is used to both verify or link a wallet
|
|
30
31
|
// Since we are re-using the different screens to authenticate or link the wallet.
|
|
31
32
|
// This logic is the best place to determine whether we should verify or verify and link.
|
|
32
|
-
const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, setIsSingleWalletAccount, }) => {
|
|
33
|
+
const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, projectSettings, setIsSingleWalletAccount, }) => {
|
|
33
34
|
const { setView } = ViewContext.useViewContext();
|
|
34
35
|
const { setErrorMessage, setError } = ErrorContext.useErrorContext();
|
|
35
36
|
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, loginWithEmail, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -41,7 +42,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
41
42
|
let Jwt;
|
|
42
43
|
const nonce = consumeNonce();
|
|
43
44
|
if (nonce === undefined)
|
|
44
|
-
throw new
|
|
45
|
+
throw new utils.DynamicError('Missing nonce');
|
|
45
46
|
const verifyArgs = yield getVerifyArgs.getVerifyArgs({
|
|
46
47
|
displayTermsOfService,
|
|
47
48
|
environmentId,
|
|
@@ -58,20 +59,20 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
58
59
|
else {
|
|
59
60
|
Jwt = yield api.linkWallet(environmentId, verifyArgs, authToken);
|
|
60
61
|
}
|
|
61
|
-
if (Jwt === undefined)
|
|
62
|
-
throw new
|
|
63
|
-
|
|
62
|
+
if (Jwt === undefined)
|
|
63
|
+
throw new utils.DynamicError('Could not obtain a valid JWT');
|
|
64
|
+
// TODO DYN-523: add verification here that the JWT is valid with the publicKey
|
|
64
65
|
return Jwt;
|
|
65
66
|
});
|
|
66
67
|
// Overrides the stored primary wallet id when the
|
|
67
68
|
// user logs in for the first time.
|
|
68
69
|
// Or when the user is linking an additional
|
|
69
70
|
// account on the same wallet as the primary wallet.
|
|
70
|
-
const updatePrimaryWalletId = (walletConnector,
|
|
71
|
-
const newSelectedCredentialWallet =
|
|
71
|
+
const updatePrimaryWalletId = (walletConnector, user) => {
|
|
72
|
+
const newSelectedCredentialWallet = user.verifiedCredentials.find((cred) => cred.id === user.lastVerifiedCredentialId &&
|
|
72
73
|
cred.format === 'blockchain');
|
|
73
74
|
if (newSelectedCredentialWallet) {
|
|
74
|
-
const currentPrimaryWallet =
|
|
75
|
+
const currentPrimaryWallet = user.verifiedCredentials.find((a) => a.id === primaryWalletId);
|
|
75
76
|
if (verifyOnly ||
|
|
76
77
|
primaryWalletId === undefined ||
|
|
77
78
|
(multiWalletWidgetState === 'awaiting_signature' &&
|
|
@@ -86,7 +87,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
86
87
|
const handleError = (e, walletConnector) => {
|
|
87
88
|
// This is a special case where the user is trying to link a wallet
|
|
88
89
|
// and the wallet is already linked and we don't want to kill the session.
|
|
89
|
-
if (e
|
|
90
|
+
if (e instanceof utils.WalletUsedError) {
|
|
90
91
|
setShowAuthFlow(true);
|
|
91
92
|
setView('wallet-used');
|
|
92
93
|
setIsSingleWalletAccount(false);
|
|
@@ -96,16 +97,16 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
99
|
walletConnector.endSession();
|
|
99
|
-
if (e
|
|
100
|
+
if (e instanceof utils.ChainalysisError) {
|
|
100
101
|
setView('chainalysis-blocked-wallet');
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
103
|
-
if (e
|
|
104
|
+
if (e instanceof utils.NoAccessError) {
|
|
104
105
|
setView('no-access');
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
if (connectedWallet && authMode === 'connect-only') {
|
|
108
|
-
throw new
|
|
109
|
+
throw new utils.DynamicError(e.message);
|
|
109
110
|
}
|
|
110
111
|
setView(loginWithEmail ? 'login-with-email-or-wallet' : 'wallet-list');
|
|
111
112
|
logger.logger.error(e);
|
|
@@ -127,19 +128,31 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
127
128
|
const Jwt = yield generateJWT(walletConnector, walletProvider, fetchPublicAddressOpts, publicWalletAddress, captchaToken);
|
|
128
129
|
const decodedJwt = decodeJwt.decodeJwt(Jwt);
|
|
129
130
|
if (decodedJwt === undefined)
|
|
130
|
-
throw new
|
|
131
|
-
|
|
132
|
-
updatePrimaryWalletId(walletConnector, decodedJwt);
|
|
131
|
+
throw new utils.DynamicError('Invalid token!');
|
|
132
|
+
const user = yield createUserProfile.createUserProfile(decodedJwt);
|
|
133
133
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
setOnboardingOnlyJwt(Jwt);
|
|
135
|
+
setToLS.setToLS(localStorage.LAST_USED_WALLET, walletConnector.name);
|
|
136
|
+
updatePrimaryWalletId(walletConnector, user);
|
|
137
|
+
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
138
|
+
if (projectSettings &&
|
|
139
|
+
verifyOnly &&
|
|
140
|
+
!_isSupportedNetwork &&
|
|
141
|
+
!isKycRequired) {
|
|
142
|
+
if (isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
143
|
+
return setView('network-not-supported');
|
|
144
|
+
}
|
|
145
|
+
return setView('network-not-supported-manual');
|
|
146
|
+
}
|
|
147
|
+
// TODO: how can projectSettings be undefined?
|
|
148
|
+
if (verifyOnly && projectSettings && isKycRequired) {
|
|
136
149
|
setShowAuthFlow(true);
|
|
137
|
-
setView('collect-user-data');
|
|
138
|
-
return;
|
|
150
|
+
return setView('collect-user-data');
|
|
139
151
|
}
|
|
140
|
-
const user = yield createUserProfile.createUserProfile(decodedJwt);
|
|
141
152
|
index.storeAuthToken(Jwt);
|
|
153
|
+
setOnboardingOnlyJwt(undefined);
|
|
142
154
|
setUser(user); // The user should only be set if no KYC is needed.
|
|
155
|
+
setShowAuthFlow(false);
|
|
143
156
|
/* istanbul ignore else */
|
|
144
157
|
if (verifyOnly) {
|
|
145
158
|
setCallback('authSuccess');
|
|
@@ -148,17 +161,6 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
148
161
|
setView('wallet-list');
|
|
149
162
|
setCallback('linkSuccess');
|
|
150
163
|
}
|
|
151
|
-
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
152
|
-
if (!_isSupportedNetwork) {
|
|
153
|
-
if (isProgrammableNetworkSwitchSupported.isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
154
|
-
setView('network-not-supported');
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
setView('network-not-supported-manual');
|
|
158
|
-
}
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
setShowAuthFlow(false);
|
|
162
164
|
}
|
|
163
165
|
catch (e) {
|
|
164
166
|
handleError(e, walletConnector);
|
|
@@ -5,5 +5,5 @@ type UseVerifyWalletArgs = VerifyProps & ProjectSettingsProps & {
|
|
|
5
5
|
displayTermsOfService: boolean;
|
|
6
6
|
setIsSingleWalletAccount: Dispatch<SetStateAction<boolean>>;
|
|
7
7
|
};
|
|
8
|
-
export declare const useVerifyWallet: ({ consumeNonce, displayTermsOfService, environmentId, setIsSingleWalletAccount, }: UseVerifyWalletArgs) => ({ walletConnector, fetchPublicAddressOpts, publicWalletAddress, captchaToken, }: VerifyCallbackArgs) => Promise<void>;
|
|
8
|
+
export declare const useVerifyWallet: ({ consumeNonce, displayTermsOfService, environmentId, projectSettings, setIsSingleWalletAccount, }: UseVerifyWalletArgs) => ({ walletConnector, fetchPublicAddressOpts, publicWalletAddress, captchaToken, }: VerifyCallbackArgs) => Promise<void>;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
-
import { DynamicError } from '@dynamic-labs/
|
|
2
|
+
import { DynamicError, WalletUsedError, ChainalysisError, NoAccessError } from '@dynamic-labs/utils';
|
|
3
3
|
import { verifyWallet, linkWallet } from '../../../data/api.js';
|
|
4
4
|
import { storeAuthToken } from '../../functions/storeAuthToken/index.js';
|
|
5
|
+
import '@dynamic-labs/multi-wallet';
|
|
5
6
|
import { LAST_USED_WALLET } from '../../constants/localStorage.js';
|
|
6
7
|
import '../../constants/colors.js';
|
|
7
8
|
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
@@ -25,7 +26,7 @@ import '../../../shared/consts/index.js';
|
|
|
25
26
|
// This logic is used to both verify or link a wallet
|
|
26
27
|
// Since we are re-using the different screens to authenticate or link the wallet.
|
|
27
28
|
// This logic is the best place to determine whether we should verify or verify and link.
|
|
28
|
-
const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, setIsSingleWalletAccount, }) => {
|
|
29
|
+
const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, projectSettings, setIsSingleWalletAccount, }) => {
|
|
29
30
|
const { setView } = useViewContext();
|
|
30
31
|
const { setErrorMessage, setError } = useErrorContext();
|
|
31
32
|
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, loginWithEmail, } = useInternalDynamicContext();
|
|
@@ -54,20 +55,20 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
54
55
|
else {
|
|
55
56
|
Jwt = yield linkWallet(environmentId, verifyArgs, authToken);
|
|
56
57
|
}
|
|
57
|
-
if (Jwt === undefined)
|
|
58
|
+
if (Jwt === undefined)
|
|
58
59
|
throw new DynamicError('Could not obtain a valid JWT');
|
|
59
|
-
|
|
60
|
+
// TODO DYN-523: add verification here that the JWT is valid with the publicKey
|
|
60
61
|
return Jwt;
|
|
61
62
|
});
|
|
62
63
|
// Overrides the stored primary wallet id when the
|
|
63
64
|
// user logs in for the first time.
|
|
64
65
|
// Or when the user is linking an additional
|
|
65
66
|
// account on the same wallet as the primary wallet.
|
|
66
|
-
const updatePrimaryWalletId = (walletConnector,
|
|
67
|
-
const newSelectedCredentialWallet =
|
|
67
|
+
const updatePrimaryWalletId = (walletConnector, user) => {
|
|
68
|
+
const newSelectedCredentialWallet = user.verifiedCredentials.find((cred) => cred.id === user.lastVerifiedCredentialId &&
|
|
68
69
|
cred.format === 'blockchain');
|
|
69
70
|
if (newSelectedCredentialWallet) {
|
|
70
|
-
const currentPrimaryWallet =
|
|
71
|
+
const currentPrimaryWallet = user.verifiedCredentials.find((a) => a.id === primaryWalletId);
|
|
71
72
|
if (verifyOnly ||
|
|
72
73
|
primaryWalletId === undefined ||
|
|
73
74
|
(multiWalletWidgetState === 'awaiting_signature' &&
|
|
@@ -82,7 +83,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
82
83
|
const handleError = (e, walletConnector) => {
|
|
83
84
|
// This is a special case where the user is trying to link a wallet
|
|
84
85
|
// and the wallet is already linked and we don't want to kill the session.
|
|
85
|
-
if (e
|
|
86
|
+
if (e instanceof WalletUsedError) {
|
|
86
87
|
setShowAuthFlow(true);
|
|
87
88
|
setView('wallet-used');
|
|
88
89
|
setIsSingleWalletAccount(false);
|
|
@@ -92,11 +93,11 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
95
|
walletConnector.endSession();
|
|
95
|
-
if (e
|
|
96
|
+
if (e instanceof ChainalysisError) {
|
|
96
97
|
setView('chainalysis-blocked-wallet');
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
|
-
if (e
|
|
100
|
+
if (e instanceof NoAccessError) {
|
|
100
101
|
setView('no-access');
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
@@ -124,18 +125,30 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
124
125
|
const decodedJwt = decodeJwt(Jwt);
|
|
125
126
|
if (decodedJwt === undefined)
|
|
126
127
|
throw new DynamicError('Invalid token!');
|
|
127
|
-
|
|
128
|
-
updatePrimaryWalletId(walletConnector, decodedJwt);
|
|
128
|
+
const user = yield createUserProfile(decodedJwt);
|
|
129
129
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
setOnboardingOnlyJwt(Jwt);
|
|
131
|
+
setToLS(LAST_USED_WALLET, walletConnector.name);
|
|
132
|
+
updatePrimaryWalletId(walletConnector, user);
|
|
133
|
+
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
134
|
+
if (projectSettings &&
|
|
135
|
+
verifyOnly &&
|
|
136
|
+
!_isSupportedNetwork &&
|
|
137
|
+
!isKycRequired) {
|
|
138
|
+
if (isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
139
|
+
return setView('network-not-supported');
|
|
140
|
+
}
|
|
141
|
+
return setView('network-not-supported-manual');
|
|
142
|
+
}
|
|
143
|
+
// TODO: how can projectSettings be undefined?
|
|
144
|
+
if (verifyOnly && projectSettings && isKycRequired) {
|
|
132
145
|
setShowAuthFlow(true);
|
|
133
|
-
setView('collect-user-data');
|
|
134
|
-
return;
|
|
146
|
+
return setView('collect-user-data');
|
|
135
147
|
}
|
|
136
|
-
const user = yield createUserProfile(decodedJwt);
|
|
137
148
|
storeAuthToken(Jwt);
|
|
149
|
+
setOnboardingOnlyJwt(undefined);
|
|
138
150
|
setUser(user); // The user should only be set if no KYC is needed.
|
|
151
|
+
setShowAuthFlow(false);
|
|
139
152
|
/* istanbul ignore else */
|
|
140
153
|
if (verifyOnly) {
|
|
141
154
|
setCallback('authSuccess');
|
|
@@ -144,17 +157,6 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, s
|
|
|
144
157
|
setView('wallet-list');
|
|
145
158
|
setCallback('linkSuccess');
|
|
146
159
|
}
|
|
147
|
-
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
148
|
-
if (!_isSupportedNetwork) {
|
|
149
|
-
if (isProgrammableNetworkSwitchSupported(walletConnector)) {
|
|
150
|
-
setView('network-not-supported');
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
setView('network-not-supported-manual');
|
|
154
|
-
}
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
setShowAuthFlow(false);
|
|
158
160
|
}
|
|
159
161
|
catch (e) {
|
|
160
162
|
handleError(e, walletConnector);
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var multiWallet = require('@dynamic-labs/multi-wallet');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
9
|
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
9
10
|
var logger = require('../../../shared/logger.cjs');
|
|
10
11
|
require('@dynamic-labs/iconic');
|
|
@@ -89,7 +90,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
89
90
|
const getSelectedWallet = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
90
91
|
const newWallet = wallets.find(({ id }) => id === walletId);
|
|
91
92
|
if (!newWallet) {
|
|
92
|
-
throw new
|
|
93
|
+
throw new utils.DynamicError(`Wallet with id: ${walletId} not found`);
|
|
93
94
|
}
|
|
94
95
|
const connectedAccounts = yield newWallet.connector.getConnectedAccounts();
|
|
95
96
|
return { connectedAccounts, newWallet };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { isEmailWalletConnector } from '@dynamic-labs/multi-wallet';
|
|
4
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
4
5
|
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
5
6
|
import { logger } from '../../../shared/logger.js';
|
|
6
7
|
import '@dynamic-labs/iconic';
|
|
@@ -18,6 +18,6 @@ export type UseWalletEventListenersArgs = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const useWalletEventListeners: ({ computeConnectedStateForWallets, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, user, setPrimaryWalletId, connectWalletByAddressAndChain, }: UseWalletEventListenersArgs) => {
|
|
20
20
|
loadingNetwork: boolean;
|
|
21
|
-
network: number | undefined;
|
|
22
|
-
setNetwork: import("react").Dispatch<import("react").SetStateAction<number | undefined>>;
|
|
21
|
+
network: string | number | undefined;
|
|
22
|
+
setNetwork: import("react").Dispatch<import("react").SetStateAction<string | number | undefined>>;
|
|
23
23
|
};
|
|
@@ -10,6 +10,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useInte
|
|
|
10
10
|
var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
11
11
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
12
|
require('../../constants/colors.cjs');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
13
14
|
require('@dynamic-labs/sdk-api');
|
|
14
15
|
require('../../../shared/logger.cjs');
|
|
15
16
|
require('@dynamic-labs/iconic');
|