@dynamic-labs/sdk-react-core 0.17.0-RC.7 → 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 +22 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +8 -8
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -0
- package/src/lib/Main.cjs +2 -0
- package/src/lib/Main.js +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +3 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +3 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +3 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +3 -1
- package/src/lib/components/Divider/Divider.cjs +2 -0
- package/src/lib/components/Divider/Divider.js +2 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
- 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 +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +3 -1
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +1 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +3 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +3 -1
- package/src/lib/components/Portal/Portal.cjs +3 -1
- package/src/lib/components/Portal/Portal.js +3 -1
- 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 +2 -0
- package/src/lib/components/Tooltip/Tooltip.js +2 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +3 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +3 -1
- 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 +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +13 -16
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -6
- package/src/lib/context/DynamicContext/DynamicContext.js +7 -10
- 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/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +3 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +3 -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/QrCodeContext/QrCodeContext.cjs +3 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +3 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -0
- package/src/lib/data/api.cjs +17 -16
- package/src/lib/data/api.js +2 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +3 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +2 -1
- package/src/lib/shared/types/index.d.ts +1 -1
- 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/functions/generateMessages/index.cjs +4 -3
- package/src/lib/utils/functions/generateMessages/index.js +2 -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/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 +15 -20
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +1 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +15 -20
- 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/useUserDataForm/useUserDataForm.cjs +5 -4
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +4 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +9 -8
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +5 -4
- 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/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 -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 +2 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +7 -4
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.d.ts +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +7 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +3 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -0
- package/src/lib/views/NoAccess/NoAccess.js +2 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +2 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +2 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +2 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +5 -3
- package/src/lib/views/WalletUsedView/WalletUsedView.js +3 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +3 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +3 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +3 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +3 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -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 +3 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +3 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +2 -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 +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +4 -1
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
|
@@ -3,11 +3,12 @@
|
|
|
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/multi-wallet');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
@@ -31,28 +32,23 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
31
32
|
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
33
|
// Stringify the objects for easy comparison
|
|
33
34
|
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
35
|
+
const handleRemoveLsNetworks = React.useCallback(() => {
|
|
36
|
+
removeLsNetworks();
|
|
37
|
+
setlsNetworksExists(false);
|
|
38
|
+
}, [removeLsNetworks]);
|
|
34
39
|
React.useEffect(() => {
|
|
35
40
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
36
|
-
|
|
37
|
-
setlsNetworksExists(false);
|
|
41
|
+
handleRemoveLsNetworks();
|
|
38
42
|
}
|
|
39
43
|
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
40
|
-
|
|
41
|
-
setlsNetworksExists(false);
|
|
44
|
+
handleRemoveLsNetworks();
|
|
42
45
|
}
|
|
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
|
-
]);
|
|
46
|
+
}, [environmentId, handleRemoveLsNetworks, lsNetworks, removeLsNetworks]);
|
|
50
47
|
React.useEffect(() => {
|
|
51
48
|
if (!authToken) {
|
|
52
|
-
|
|
53
|
-
setlsNetworksExists(false);
|
|
49
|
+
handleRemoveLsNetworks();
|
|
54
50
|
}
|
|
55
|
-
}, [authToken,
|
|
51
|
+
}, [authToken, handleRemoveLsNetworks]);
|
|
56
52
|
React.useEffect(() => {
|
|
57
53
|
var _a, _b;
|
|
58
54
|
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
@@ -60,8 +56,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
60
56
|
if (localStorageNetworksJson) {
|
|
61
57
|
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
62
58
|
if (!fullMatch) {
|
|
63
|
-
|
|
64
|
-
setlsNetworksExists(false);
|
|
59
|
+
handleRemoveLsNetworks();
|
|
65
60
|
}
|
|
66
61
|
setCompleted(true);
|
|
67
62
|
}
|
|
@@ -69,10 +64,10 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
69
64
|
}, [
|
|
70
65
|
lsNetworksExists,
|
|
71
66
|
customerEvmNetworksJson,
|
|
72
|
-
removeLsNetworks,
|
|
73
67
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
74
68
|
completed,
|
|
75
69
|
setCompleted,
|
|
70
|
+
handleRemoveLsNetworks,
|
|
76
71
|
]);
|
|
77
72
|
React.useEffect(() => {
|
|
78
73
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
@@ -81,7 +76,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
81
76
|
.then((response) => {
|
|
82
77
|
var _a, _b, _c, _d;
|
|
83
78
|
if (!response)
|
|
84
|
-
throw new
|
|
79
|
+
throw new utils.DynamicError('Configuration is not defined');
|
|
85
80
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
86
81
|
const evm = response.find((configurations) => configurations.chainName === 'evm');
|
|
87
82
|
const solana = response.find((configurations) => configurations.chainName === 'solana');
|
|
@@ -154,7 +149,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
154
149
|
]);
|
|
155
150
|
return {
|
|
156
151
|
configurations: lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
157
|
-
|
|
152
|
+
handleRemoveLsNetworks,
|
|
158
153
|
};
|
|
159
154
|
};
|
|
160
155
|
|
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,9 +1,10 @@
|
|
|
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/multi-wallet';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { NETWORKS_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
@@ -27,28 +28,23 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
27
28
|
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
29
|
// Stringify the objects for easy comparison
|
|
29
30
|
const customerEvmNetworksJson = customerEvmNetworks === null || customerEvmNetworks === void 0 ? void 0 : customerEvmNetworks.map((network) => JSON.stringify(network));
|
|
31
|
+
const handleRemoveLsNetworks = useCallback(() => {
|
|
32
|
+
removeLsNetworks();
|
|
33
|
+
setlsNetworksExists(false);
|
|
34
|
+
}, [removeLsNetworks]);
|
|
30
35
|
useEffect(() => {
|
|
31
36
|
if (lsNetworks && (lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.environmentId) !== environmentId) {
|
|
32
|
-
|
|
33
|
-
setlsNetworksExists(false);
|
|
37
|
+
handleRemoveLsNetworks();
|
|
34
38
|
}
|
|
35
39
|
if (lsNetworks && lsNetworks.version !== VERSION) {
|
|
36
|
-
|
|
37
|
-
setlsNetworksExists(false);
|
|
40
|
+
handleRemoveLsNetworks();
|
|
38
41
|
}
|
|
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
|
-
]);
|
|
42
|
+
}, [environmentId, handleRemoveLsNetworks, lsNetworks, removeLsNetworks]);
|
|
46
43
|
useEffect(() => {
|
|
47
44
|
if (!authToken) {
|
|
48
|
-
|
|
49
|
-
setlsNetworksExists(false);
|
|
45
|
+
handleRemoveLsNetworks();
|
|
50
46
|
}
|
|
51
|
-
}, [authToken,
|
|
47
|
+
}, [authToken, handleRemoveLsNetworks]);
|
|
52
48
|
useEffect(() => {
|
|
53
49
|
var _a, _b;
|
|
54
50
|
if (lsNetworksExists && customerEvmNetworksJson && !completed) {
|
|
@@ -56,8 +52,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
56
52
|
if (localStorageNetworksJson) {
|
|
57
53
|
const fullMatch = customerEvmNetworksJson.every((network) => localStorageNetworksJson.indexOf(network) !== -1);
|
|
58
54
|
if (!fullMatch) {
|
|
59
|
-
|
|
60
|
-
setlsNetworksExists(false);
|
|
55
|
+
handleRemoveLsNetworks();
|
|
61
56
|
}
|
|
62
57
|
setCompleted(true);
|
|
63
58
|
}
|
|
@@ -65,10 +60,10 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
65
60
|
}, [
|
|
66
61
|
lsNetworksExists,
|
|
67
62
|
customerEvmNetworksJson,
|
|
68
|
-
removeLsNetworks,
|
|
69
63
|
(_a = lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations) === null || _a === void 0 ? void 0 : _a.evm,
|
|
70
64
|
completed,
|
|
71
65
|
setCompleted,
|
|
66
|
+
handleRemoveLsNetworks,
|
|
72
67
|
]);
|
|
73
68
|
useEffect(() => {
|
|
74
69
|
if (!lsNetworksExists && !loading && retries < maxRetries) {
|
|
@@ -150,7 +145,7 @@ const useFetchNetworkConfigurations = ({ authToken, environmentId, evmNetworks:
|
|
|
150
145
|
]);
|
|
151
146
|
return {
|
|
152
147
|
configurations: lsNetworks === null || lsNetworks === void 0 ? void 0 : lsNetworks.configurations,
|
|
153
|
-
|
|
148
|
+
handleRemoveLsNetworks,
|
|
154
149
|
};
|
|
155
150
|
};
|
|
156
151
|
|
|
@@ -3,11 +3,12 @@
|
|
|
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/multi-wallet');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
@@ -32,7 +33,7 @@ const useFetchNonce = (environmentId, maxRetries = 2) => {
|
|
|
32
33
|
api.fetchNonce(environmentId)
|
|
33
34
|
.then((response) => {
|
|
34
35
|
if (!response)
|
|
35
|
-
throw new
|
|
36
|
+
throw new utils.DynamicError('Nonce is not defined');
|
|
36
37
|
const expiry = new Date().getTime() + 60000 * 60 * 24;
|
|
37
38
|
setLsNonce({ environmentId, expiry: expiry, value: response });
|
|
38
39
|
})
|
|
@@ -1,9 +1,10 @@
|
|
|
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/multi-wallet';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { NONCE_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
@@ -3,11 +3,12 @@
|
|
|
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/multi-wallet');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage = require('../../constants/localStorage.cjs');
|
|
@@ -41,7 +42,7 @@ const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, })
|
|
|
41
42
|
api.fetchProjectSettings(environmentId)
|
|
42
43
|
.then((response) => {
|
|
43
44
|
if (!response)
|
|
44
|
-
throw new
|
|
45
|
+
throw new utils.DynamicError('Settings are not defined');
|
|
45
46
|
const expiry = new Date().getTime() + 60000 * 5;
|
|
46
47
|
setLsSettings({
|
|
47
48
|
environmentId,
|
|
@@ -1,9 +1,10 @@
|
|
|
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/multi-wallet';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { PROJECT_SETTINGS_STORAGE_KEY } from '../../constants/localStorage.js';
|
|
@@ -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({
|
|
@@ -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 {
|
|
@@ -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');
|
|
@@ -41,7 +42,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
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,
|
|
@@ -59,7 +60,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
59
60
|
Jwt = yield api.linkWallet(environmentId, verifyArgs, authToken);
|
|
60
61
|
}
|
|
61
62
|
if (Jwt === undefined)
|
|
62
|
-
throw new
|
|
63
|
+
throw new utils.DynamicError('Could not obtain a valid JWT');
|
|
63
64
|
// TODO DYN-523: add verification here that the JWT is valid with the publicKey
|
|
64
65
|
return Jwt;
|
|
65
66
|
});
|
|
@@ -86,7 +87,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
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, p
|
|
|
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,7 +128,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
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
|
+
throw new utils.DynamicError('Invalid token!');
|
|
131
132
|
const user = yield createUserProfile.createUserProfile(decodedJwt);
|
|
132
133
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
133
134
|
setOnboardingOnlyJwt(Jwt);
|
|
@@ -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';
|
|
@@ -82,7 +83,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
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, p
|
|
|
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
|
}
|
|
@@ -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';
|
|
@@ -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');
|
|
@@ -6,6 +6,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useIn
|
|
|
6
6
|
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
7
7
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
8
8
|
import '../../constants/colors.js';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import '@dynamic-labs/sdk-api';
|
|
10
11
|
import '../../../shared/logger.js';
|
|
11
12
|
import '@dynamic-labs/iconic';
|
|
@@ -10,6 +10,7 @@ var TransactionConfirmationModal = require('../../../modals/TransactionConfirmat
|
|
|
10
10
|
var useConfirmationModal = require('../useConfirmationModal/useConfirmationModal.cjs');
|
|
11
11
|
require('../../constants/colors.cjs');
|
|
12
12
|
require('@dynamic-labs/multi-wallet');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
13
14
|
var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
|
|
14
15
|
require('@dynamic-labs/sdk-api');
|
|
15
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { WalletUiUtils } from '@dynamic-labs/
|
|
2
|
+
import { WalletUiUtils } from '@dynamic-labs/types';
|
|
3
3
|
import { WalletUiUtilsHookProps } from './useWalletUiUtils.types';
|
|
4
4
|
export declare const useWalletUiUtils: ({ appLogoUrl, appName, getAppOrigin, }: WalletUiUtilsHookProps) => [ReactNode | undefined, WalletUiUtils];
|
|
@@ -6,6 +6,7 @@ import { TransactionConfirmationModal } from '../../../modals/TransactionConfirm
|
|
|
6
6
|
import { useConfirmationModal } from '../useConfirmationModal/useConfirmationModal.js';
|
|
7
7
|
import '../../constants/colors.js';
|
|
8
8
|
import '@dynamic-labs/multi-wallet';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
9
10
|
import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
|
|
10
11
|
import '@dynamic-labs/sdk-api';
|
|
11
12
|
|
|
@@ -6,7 +6,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var data = require('../../../views/WalletList/data.cjs');
|
|
8
8
|
|
|
9
|
-
const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfigurations,
|
|
9
|
+
const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfigurations, walletUiUtils, }) => {
|
|
10
10
|
const [wallets, setWallets] = React.useState([]);
|
|
11
11
|
React.useEffect(() => {
|
|
12
12
|
const getWalletList = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -14,21 +14,17 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfiguration
|
|
|
14
14
|
const installedWallets = yield data.getInstalledWallets(projectSettings, {
|
|
15
15
|
appLogoUrl,
|
|
16
16
|
appName,
|
|
17
|
-
|
|
17
|
+
customerApiProviders: projectSettings.providers || [],
|
|
18
18
|
networkConfigurations,
|
|
19
|
-
providers: projectSettings.providers || [],
|
|
20
19
|
skipMemo: true,
|
|
21
|
-
vendorCredentials,
|
|
22
20
|
walletUiUtils,
|
|
23
21
|
});
|
|
24
22
|
const notInstalledWallets = yield data.getNotInstalledWallets(projectSettings, {
|
|
25
23
|
appLogoUrl,
|
|
26
24
|
appName,
|
|
27
|
-
|
|
25
|
+
customerApiProviders: projectSettings.providers || [],
|
|
28
26
|
networkConfigurations,
|
|
29
|
-
providers: projectSettings.providers || [],
|
|
30
27
|
skipMemo: true,
|
|
31
|
-
vendorCredentials,
|
|
32
28
|
walletUiUtils,
|
|
33
29
|
});
|
|
34
30
|
const unfilteredWallets = [...installedWallets, ...notInstalledWallets];
|
|
@@ -36,13 +32,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, networkConfiguration
|
|
|
36
32
|
}
|
|
37
33
|
});
|
|
38
34
|
getWalletList();
|
|
39
|
-
}, [
|
|
40
|
-
projectSettings,
|
|
41
|
-
appLogoUrl,
|
|
42
|
-
appName,
|
|
43
|
-
vendorCredentials,
|
|
44
|
-
networkConfigurations,
|
|
45
|
-
]);
|
|
35
|
+
}, [projectSettings, appLogoUrl, appName, networkConfigurations]);
|
|
46
36
|
return { wallets };
|
|
47
37
|
};
|
|
48
38
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { MagicLinkConfig, VendorCredentials, WalletUiUtils } from '@dynamic-labs/multi-wallet';
|
|
2
1
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
3
|
-
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
2
|
+
import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
|
|
4
3
|
import { WalletOption } from '../../../shared';
|
|
5
4
|
type Props = {
|
|
6
5
|
appLogoUrl?: string;
|
|
7
6
|
appName?: string;
|
|
8
|
-
magicLinkConfig?: MagicLinkConfig;
|
|
9
7
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
10
8
|
projectSettings: ProjectSettings | undefined;
|
|
11
|
-
vendorCredentials?: VendorCredentials;
|
|
12
9
|
walletUiUtils: WalletUiUtils;
|
|
13
10
|
};
|
|
14
|
-
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, networkConfigurations,
|
|
11
|
+
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, networkConfigurations, walletUiUtils, }: Props) => {
|
|
15
12
|
wallets: WalletOption[];
|
|
16
13
|
};
|
|
17
14
|
export {};
|