@dynamic-labs/sdk-react-core 0.17.0-RC.3 → 0.17.0-RC.31
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 +326 -0
- package/package.cjs +9 -10
- package/package.js +9 -10
- package/package.json +17 -14
- package/src/index.cjs +33 -5
- package/src/index.d.ts +6 -2
- package/src/index.js +21 -4
- package/src/lib/Main.cjs +22 -9
- package/src/lib/Main.js +21 -8
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +12 -2
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +12 -2
- package/src/lib/components/Alert/Alert.cjs +29 -0
- package/src/lib/components/Alert/Alert.js +25 -0
- package/src/lib/components/Alert/Alert.types.d.ts +4 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +12 -2
- package/src/lib/components/AnimatePresence/AnimatePresence.js +12 -2
- package/src/lib/components/AppOriginTile/AppOriginTile.types.d.ts +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +88 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.d.ts +10 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +84 -0
- package/src/lib/components/AuthProviderIcon/index.d.ts +1 -0
- package/src/lib/components/ChainCard/ChainCard.d.ts +7 -0
- package/src/lib/components/Checkbox/Checkbox.cjs +3 -1
- package/src/lib/components/Checkbox/Checkbox.js +3 -1
- package/src/lib/components/Chip/Chip.cjs +13 -0
- package/src/lib/components/Chip/Chip.d.ts +7 -0
- package/src/lib/components/Chip/Chip.js +9 -0
- package/src/lib/components/Chip/index.d.ts +1 -0
- package/src/lib/components/Divider/Divider.cjs +17 -4
- package/src/lib/components/Divider/Divider.d.ts +7 -3
- package/src/lib/components/Divider/Divider.js +18 -5
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +5 -3
- package/src/lib/components/ErrorContainer/ErrorContainer.d.ts +3 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +5 -3
- package/src/lib/components/FormFieldLabel/FormFieldLabel.cjs +10 -0
- package/src/lib/components/FormFieldLabel/FormFieldLabel.d.ts +8 -0
- package/src/lib/components/FormFieldLabel/FormFieldLabel.js +6 -0
- package/src/lib/components/FormFieldLabel/index.d.ts +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +5 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +5 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +4 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +4 -1
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +4 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +4 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +11 -5
- package/src/lib/components/IconWithStatus/IconWithStatus.d.ts +2 -1
- package/src/lib/components/IconWithStatus/IconWithStatus.js +11 -5
- package/src/lib/components/Input/Input.cjs +13 -6
- package/src/lib/components/Input/Input.js +13 -6
- package/src/lib/components/Input/Input.types.d.ts +4 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +9 -3
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +3 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +9 -3
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +12 -2
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +12 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +18 -8
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +18 -8
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +14 -4
- package/src/lib/components/NetworkPicker/components/Network/Network.js +14 -4
- 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 +13 -3
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +13 -3
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.js +3 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +19 -8
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +19 -8
- package/src/lib/components/OverlayCard/OverlayCard.cjs +12 -2
- package/src/lib/components/OverlayCard/OverlayCard.js +12 -2
- package/src/lib/components/Popper/Popper/Popper.cjs +54 -0
- package/src/lib/components/Popper/Popper/Popper.d.ts +12 -0
- package/src/lib/components/Popper/Popper/Popper.js +50 -0
- package/src/lib/components/Popper/Popper/index.d.ts +1 -0
- package/src/lib/components/Popper/Popper.types.d.ts +6 -0
- package/src/lib/components/Popper/PopperContent/PopperContent.cjs +18 -0
- package/src/lib/components/Popper/PopperContent/PopperContent.d.ts +9 -0
- package/src/lib/components/Popper/PopperContent/PopperContent.js +14 -0
- package/src/lib/components/Popper/PopperContent/index.d.ts +1 -0
- package/src/lib/components/Popper/PopperContext/PopperContext.cjs +26 -0
- package/src/lib/components/Popper/PopperContext/PopperContext.d.ts +8 -0
- package/src/lib/components/Popper/PopperContext/PopperContext.js +20 -0
- package/src/lib/components/Popper/PopperContext/index.d.ts +1 -0
- package/src/lib/components/Popper/index.d.ts +2 -0
- package/src/lib/components/Popper/utils/getChildPosition/getChildPosition.cjs +14 -0
- package/src/lib/components/Popper/utils/getChildPosition/getChildPosition.d.ts +2 -0
- package/src/lib/components/Popper/utils/getChildPosition/getChildPosition.js +10 -0
- package/src/lib/components/Popper/utils/getChildPosition/index.d.ts +1 -0
- package/src/lib/components/Popper/utils/index.d.ts +3 -0
- package/src/lib/components/Popper/utils/isScrollable/index.d.ts +1 -0
- package/src/lib/components/Popper/utils/isScrollable/isScrollable.cjs +16 -0
- package/src/lib/components/Popper/utils/isScrollable/isScrollable.d.ts +1 -0
- package/src/lib/components/Popper/utils/isScrollable/isScrollable.js +12 -0
- package/src/lib/components/Popper/utils/watchToScrollInHierarchy/index.d.ts +1 -0
- package/src/lib/components/Popper/utils/watchToScrollInHierarchy/watchToScrollInHierarchy.cjs +24 -0
- package/src/lib/components/Popper/utils/watchToScrollInHierarchy/watchToScrollInHierarchy.d.ts +1 -0
- package/src/lib/components/Popper/utils/watchToScrollInHierarchy/watchToScrollInHierarchy.js +20 -0
- package/src/lib/components/Portal/Portal.cjs +12 -3
- package/src/lib/components/Portal/Portal.js +12 -3
- package/src/lib/components/Select/Select.cjs +3 -1
- package/src/lib/components/Select/Select.js +3 -1
- package/src/lib/components/SelectNetworkButton/SelectNetworkButton.cjs +13 -0
- package/src/lib/components/SelectNetworkButton/SelectNetworkButton.d.ts +8 -0
- package/src/lib/components/SelectNetworkButton/SelectNetworkButton.js +9 -0
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.d.ts +8 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +61 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +11 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +57 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +50 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +19 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +46 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +25 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +8 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +21 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/components/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/index.d.ts +2 -0
- package/src/lib/components/ShadowDOM/utils.cjs +3 -1
- package/src/lib/components/ShadowDOM/utils.js +3 -1
- package/src/lib/components/Spinner/spinner.cjs +3 -1
- package/src/lib/components/Spinner/spinner.js +3 -1
- package/src/lib/components/Toolkit/Toolkit.cjs +4 -1
- package/src/lib/components/Toolkit/Toolkit.js +4 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +3 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +3 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +12 -2
- package/src/lib/components/Tooltip/Tooltip.js +12 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +40 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +17 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +36 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +11 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +12 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +7 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/index.d.ts +2 -0
- package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +11 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +56 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +12 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +52 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +12 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +12 -2
- package/src/lib/components/UserAddress/UserAddress.cjs +7 -7
- package/src/lib/components/UserAddress/UserAddress.js +8 -8
- package/src/lib/components/UserProfile/UserProfile.cjs +16 -8
- package/src/lib/components/UserProfile/UserProfile.js +12 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +14 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +14 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +5 -3
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.d.ts +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +5 -3
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +14 -4
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +14 -4
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +32 -13
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +32 -13
- package/src/lib/components/index.d.ts +5 -0
- package/src/lib/context/AccessDeniedContext/AccessDeniedContext.cjs +30 -0
- package/src/lib/context/AccessDeniedContext/AccessDeniedContext.d.ts +13 -0
- package/src/lib/context/AccessDeniedContext/AccessDeniedContext.js +24 -0
- package/src/lib/context/AccessDeniedContext/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +84 -33
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +20 -11
- package/src/lib/context/DynamicContext/DynamicContext.js +79 -28
- package/src/lib/context/DynamicContext/helpers.cjs +3 -1
- package/src/lib/context/DynamicContext/helpers.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +4 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +4 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +84 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.d.ts +11 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +80 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.types.d.ts +4 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.cjs +27 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.d.ts +14 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.js +23 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +12 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +12 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -1
- package/src/lib/context/DynamicContext/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/DynamicContext/validators.cjs +3 -1
- package/src/lib/context/DynamicContext/validators.js +3 -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/MockContext/MockContext.cjs +4 -1
- package/src/lib/context/MockContext/MockContext.js +4 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +12 -2
- package/src/lib/context/QrCodeContext/QrCodeContext.js +12 -2
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +73 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.d.ts +4 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.errors.cjs +11 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.errors.d.ts +3 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.errors.js +6 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +68 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.types.d.ts +9 -0
- package/src/lib/context/SendBalanceContext/index.d.ts +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +109 -22
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +4 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +109 -22
- package/src/lib/context/ThemeContext/themesData.cjs +21 -19
- package/src/lib/context/ThemeContext/themesData.d.ts +3 -3
- package/src/lib/context/ThemeContext/themesData.js +21 -19
- package/src/lib/context/ViewContext/ViewContext.cjs +21 -12
- package/src/lib/context/ViewContext/ViewContext.d.ts +10 -8
- package/src/lib/context/ViewContext/ViewContext.js +22 -13
- package/src/lib/data/api.cjs +38 -19
- package/src/lib/data/api.d.ts +10 -3
- package/src/lib/data/api.js +23 -5
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +14 -4
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +14 -4
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +13 -3
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +13 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +13 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +13 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +14 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +13 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +14 -5
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +12 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +16 -6
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +16 -6
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +23 -10
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +23 -10
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +66 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.d.ts +10 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +62 -0
- package/src/lib/modals/SendBalanceModal/index.d.ts +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +20 -10
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +20 -10
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +35 -99
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +37 -101
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -4
- package/src/lib/modals/index.d.ts +1 -0
- package/src/lib/shared/assets/add.cjs +8 -9
- package/src/lib/shared/assets/add.js +8 -9
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/send.cjs +56 -0
- package/src/lib/shared/assets/send.js +32 -0
- package/src/lib/shared/types/index.d.ts +14 -4
- package/src/lib/shared/utils/functions/ceil/ceil.cjs +10 -0
- package/src/lib/shared/utils/functions/ceil/ceil.d.ts +1 -0
- package/src/lib/shared/utils/functions/ceil/ceil.js +6 -0
- package/src/lib/shared/utils/functions/ceil/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +1 -1
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +1 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +21 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.d.ts +2 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +17 -0
- package/src/lib/shared/utils/functions/formatBigNumber/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +5 -10
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +3 -8
- package/src/lib/shared/utils/functions/index.d.ts +3 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.cjs +27 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.d.ts +6 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.js +23 -0
- package/src/lib/shared/utils/functions/trimEnd/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.cjs +13 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.js +9 -0
- package/src/lib/shared/utils/hooks/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +3 -1
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +3 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/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/getAppOrigin/getAppOrigin.cjs +12 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.d.ts +1 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +8 -0
- package/src/lib/utils/functions/getAppOrigin/index.d.ts +1 -0
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +3 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +3 -1
- package/src/lib/utils/functions/getEnabledKYC/index.cjs +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.d.ts +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.js +5 -0
- package/src/lib/utils/functions/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/getReferencedAccount/getReferencedAccount.cjs +29 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.d.ts +7 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.js +25 -0
- package/src/lib/utils/functions/getReferencedAccount/index.d.ts +1 -0
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.cjs +78 -0
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +29 -0
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.js +72 -0
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +2 -0
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -0
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +2 -0
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +2 -2
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +1 -1
- package/src/lib/utils/functions/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 +6 -3
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +4 -1
- package/src/lib/utils/functions/hasWalletGroupFlag/hasWalletGroupFlag.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +3 -0
- package/src/lib/utils/functions/isNetworkUnsupported/index.d.ts +1 -0
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.cjs +12 -0
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.d.ts +2 -0
- package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.js +8 -0
- 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/isSameWalletName/isSameWalletName.cjs +2 -2
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +1 -1
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +3 -3
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +1 -1
- package/src/lib/utils/functions/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/isWalletConnected/isWalletConnected.cjs +2 -2
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +1 -1
- package/src/lib/utils/functions/isWalletLinked/index.d.ts +1 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +15 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.d.ts +2 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +11 -0
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.cjs +6 -3
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.d.ts +2 -0
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +4 -1
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs +2 -2
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +6 -7
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +7 -5
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +4 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +4 -0
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/multiWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs +0 -2
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js +0 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +67 -8
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +10 -3
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +68 -9
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +5 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +5 -1
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +7 -3
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +5 -1
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +1 -1
- package/src/lib/utils/hooks/useColorSchemePreference/index.d.ts +1 -0
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.cjs +27 -0
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.d.ts +1 -0
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.js +23 -0
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.cjs +6 -1
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.js +6 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +6 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -1
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +3 -1
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +3 -1
- package/src/lib/utils/hooks/useConnectedAccountWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +30 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +2 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +26 -0
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +4 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +4 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +56 -32
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +5 -5
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +57 -33
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +4 -2
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +3 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +5 -2
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +4 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.cjs +3 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.js +3 -1
- package/src/lib/utils/hooks/useGetSocialIcon/index.d.ts +1 -0
- package/src/lib/utils/hooks/useGetSocialIcon/useGetSocialIcon.cjs +17 -0
- package/src/lib/utils/hooks/useGetSocialIcon/useGetSocialIcon.d.ts +2 -0
- package/src/lib/utils/hooks/useGetSocialIcon/useGetSocialIcon.js +13 -0
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +25 -2
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +25 -2
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +16 -6
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.d.ts +5 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +16 -6
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +3 -1
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +3 -1
- package/src/lib/utils/hooks/useMutation/useMutation.cjs +4 -4
- package/src/lib/utils/hooks/useMutation/useMutation.js +1 -1
- package/src/lib/utils/hooks/usePrevious/usePrevious.cjs +0 -1
- package/src/lib/utils/hooks/usePrevious/usePrevious.d.ts +1 -1
- package/src/lib/utils/hooks/usePrevious/usePrevious.js +0 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +8 -5
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +2 -2
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +10 -7
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs +7 -0
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.d.ts +7 -0
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js +7 -0
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +6 -4
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +5 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs +4 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js +4 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +30 -20
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +26 -16
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +37 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +33 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +54 -75
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +53 -74
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +55 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.d.ts +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +51 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/index.d.ts +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/primaryWalletIdValidator/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/primaryWalletIdValidator/primaryWalletIdValidator.cjs +7 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/primaryWalletIdValidator/primaryWalletIdValidator.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/primaryWalletIdValidator/primaryWalletIdValidator.js +3 -0
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +92 -55
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +6 -4
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +91 -54
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +17 -15
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +15 -13
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +50 -14
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +50 -14
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +28 -34
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +6 -6
- package/src/lib/utils/hooks/useWallets/useWallets.js +29 -35
- package/src/lib/utils/hooks/useWalletsConnectionState/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +46 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +14 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +42 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +13 -4
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +13 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +19 -9
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +19 -9
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.cjs → OnboardingUserDataForm/OnboardingUserDataForm.cjs} +22 -11
- 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} +22 -11
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/index.d.ts +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +14 -5
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +14 -5
- package/src/lib/views/CollectUserDataView/fieldsConfig.cjs +5 -3
- package/src/lib/views/CollectUserDataView/fieldsConfig.js +5 -3
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +15 -5
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +15 -5
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +16 -6
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +15 -5
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +14 -4
- package/src/lib/views/EmailUpdate/EmailUpdate.js +14 -4
- package/src/lib/views/EmailVerification/EmailVerification.cjs +24 -11
- package/src/lib/views/EmailVerification/EmailVerification.js +23 -10
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +13 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +12 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +14 -7
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +14 -7
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +13 -3
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +13 -3
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +14 -7
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +14 -7
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +28 -11
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +28 -11
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +38 -10
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +38 -10
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +15 -5
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +15 -5
- package/src/lib/views/NoAccess/NoAccess.cjs +27 -30
- package/src/lib/views/NoAccess/NoAccess.js +28 -31
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +12 -3
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +12 -3
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +13 -3
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +13 -3
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +15 -6
- package/src/lib/views/PendingConnectView/PendingConnectView.js +14 -5
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +16 -7
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +16 -7
- package/src/lib/views/QrCodeView/QRCode.cjs +2 -2
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +14 -4
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +13 -3
- package/src/lib/views/QrCodeView/QrCodeView.cjs +13 -4
- package/src/lib/views/QrCodeView/QrCodeView.js +13 -4
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +116 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.d.ts +13 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +112 -0
- package/src/lib/views/SendBalanceView/index.d.ts +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +19 -13
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +19 -13
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +61 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.d.ts +2 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +57 -0
- package/src/lib/views/SocialWrongAccountView/index.d.ts +1 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +94 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +14 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +90 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.cjs +7 -1
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.d.ts +1 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +18 -0
- package/src/lib/views/TransactionConfirmationView/hooks/index.d.ts +1 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/index.d.ts +1 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.cjs +91 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.d.ts +18 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.js +87 -0
- package/src/lib/views/TransactionConfirmationView/index.d.ts +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +13 -3
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +13 -3
- package/src/lib/views/WalletList/WalletList.cjs +6 -3
- package/src/lib/views/WalletList/WalletList.js +6 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +12 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +12 -3
- package/src/lib/views/WalletList/data.cjs +10 -7
- package/src/lib/views/WalletList/data.d.ts +3 -3
- package/src/lib/views/WalletList/data.js +10 -7
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +14 -5
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +14 -5
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +15 -6
- package/src/lib/views/WalletUsedView/WalletUsedView.js +13 -4
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +13 -3
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +13 -3
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +20 -10
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +20 -10
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +79 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +75 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +14 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +18 -30
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.d.ts +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +19 -31
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +17 -6
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +17 -6
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.types.d.ts +3 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +18 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +17 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.d.ts +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +14 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +48 -26
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.d.ts +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +50 -28
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +18 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +18 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +13 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +13 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +13 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +13 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +16 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +16 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +16 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +16 -8
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +14 -4
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +25 -4
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +25 -4
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +13 -3
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +13 -3
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +14 -4
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +37 -21
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.d.ts +2 -3
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +37 -21
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +4 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +42 -6
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +43 -7
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +14 -12
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.d.ts +1 -5
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +15 -13
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +4 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +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/DefaultPromptModal/DefaultPromptModal.cjs +46 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +13 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +42 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +14 -4
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +60 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +56 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +17 -36
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +18 -37
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +44 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +40 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +70 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.d.ts +8 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +66 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +60 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +56 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +63 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +59 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +67 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +63 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +5 -33
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +3 -31
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +16 -9
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +17 -10
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +14 -4
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +17 -9
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +17 -9
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +21 -9
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +20 -8
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +14 -4
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +14 -4
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +19 -9
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +19 -9
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.cjs +15 -0
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.js +11 -0
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.cjs +10 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.d.ts +2 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.js +6 -0
- package/src/lib/widgets/FundingWidget/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +63 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.d.ts +5 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +58 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/index.d.ts +1 -0
- package/src/lib/widgets/index.d.ts +1 -0
- package/src/polyfills.cjs +11 -0
- package/src/polyfills.d.ts +1 -0
- package/src/polyfills.js +9 -0
- package/src/shim/process.cjs +238 -0
- package/src/shim/process.d.ts +34 -0
- package/src/shim/process.js +234 -0
- package/src/lib/modals/TransactionConfirmationModal/helpers/transactionErrorMessage.js +0 -12
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.cjs +0 -22
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.d.ts +0 -3
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.js +0 -18
- package/src/lib/utils/functions/getSocialIcon/index.d.ts +0 -1
- 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
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +0 -43
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +0 -39
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.types.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +0 -64
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +0 -60
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +0 -55
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.d.ts +0 -6
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +0 -51
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/index.d.ts +0 -1
- /package/src/lib/widgets/DynamicWidget/{components → prompts/PendingSignModal}/DefaultPendingSignModalContent/index.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import '../../constants/colors.js';
|
|
4
|
+
import '@dynamic-labs/multi-wallet';
|
|
5
|
+
import '@dynamic-labs/utils';
|
|
6
|
+
import '@dynamic-labs/sdk-api';
|
|
7
|
+
import '../../../shared/logger.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import 'react';
|
|
12
|
+
import 'ethers';
|
|
13
|
+
import { getReferencedAccount } from '../../functions/getReferencedAccount/getReferencedAccount.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This function will use a referenced account to kick off the social wallet
|
|
17
|
+
* authentication. This is useful in the multiwallet scenario where the user
|
|
18
|
+
* wants to set their disconnected social wallet as their primary wallet, in
|
|
19
|
+
* which case the wallet needs to be reconnected
|
|
20
|
+
*/
|
|
21
|
+
const reconnectSocialWallet = (jwt, wallet) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
if (!isSocialWalletConnector(wallet.connector)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const socialAccountDataForWallet = getReferencedAccount(jwt, wallet.id);
|
|
26
|
+
if (!socialAccountDataForWallet ||
|
|
27
|
+
!socialAccountDataForWallet.oauthProvider) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
yield wallet.connector.connect(socialAccountDataForWallet.oauthProvider);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export { reconnectSocialWallet };
|
|
@@ -4,99 +4,56 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
9
|
+
require('@dynamic-labs/sdk-api');
|
|
9
10
|
var logger = require('../../../shared/logger.cjs');
|
|
10
11
|
require('@dynamic-labs/iconic');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
13
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
14
|
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
14
15
|
require('../../constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
16
18
|
require('../../../shared/consts/index.cjs');
|
|
17
|
-
var isWalletConnected = require('../../functions/isWalletConnected/isWalletConnected.cjs');
|
|
18
19
|
var isSameWalletName = require('../../functions/isSameWalletName/isSameWalletName.cjs');
|
|
19
|
-
require('
|
|
20
|
-
var
|
|
20
|
+
var useWalletsConnectionState = require('../useWalletsConnectionState/useWalletsConnectionState.cjs');
|
|
21
|
+
var primaryWalletIdValidator = require('./utils/primaryWalletIdValidator/primaryWalletIdValidator.cjs');
|
|
22
|
+
var createLinkedWalletsFromWalletOptions = require('./utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs');
|
|
23
|
+
var reconnectSocialWallet = require('./reconnectSocialWallet.cjs');
|
|
21
24
|
|
|
22
25
|
const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWalletWidgetState, setDesktopUri, setMultiWalletWidgetState, setQrcodeUri, }) => {
|
|
23
26
|
const [showQrcodeModal, setShowQrcodeModal] = React.useState(false);
|
|
24
|
-
const [
|
|
25
|
-
const
|
|
27
|
+
const [primaryWalletId, setPrimaryWalletIdState, clearPrimaryWalletId] = useLocalStorage.useLocalStorage(localStorage$1.PRIMARY_WALLET_ID, undefined, primaryWalletIdValidator.primaryWalletIdValidator);
|
|
28
|
+
const linkedWallets = React.useMemo(() => {
|
|
29
|
+
if (!authToken) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
return createLinkedWalletsFromWalletOptions.createLinkedWalletsFromWalletOptions({
|
|
33
|
+
authToken,
|
|
34
|
+
primaryWalletId,
|
|
35
|
+
walletOptions: availableWallets,
|
|
36
|
+
});
|
|
37
|
+
}, [availableWallets, primaryWalletId, authToken]);
|
|
38
|
+
const { connectedWalletMap, computeConnectedStateForWallets, didConnectedStateLoad, } = useWalletsConnectionState.useWalletsConnectionState(linkedWallets);
|
|
39
|
+
const wallets = React.useMemo(() => linkedWallets.map((wallet) => (Object.assign(Object.assign({}, wallet), { connected: Boolean(connectedWalletMap[wallet.id]) }))), [connectedWalletMap, linkedWallets]);
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
computeConnectedStateForWallets();
|
|
42
|
+
}, [primaryWalletId, computeConnectedStateForWallets]);
|
|
26
43
|
const setPrimaryWalletId = React.useCallback((walletId) => {
|
|
27
44
|
setPrimaryWalletIdState(walletId);
|
|
28
45
|
}, [setPrimaryWalletIdState]);
|
|
29
|
-
const
|
|
30
|
-
setWallets([]);
|
|
31
|
-
clearPrimaryWalletId();
|
|
32
|
-
}, [clearPrimaryWalletId]);
|
|
33
|
-
const getPrimaryWallet = React.useCallback(() => {
|
|
34
|
-
const primaryWallet = wallets.find((wallet) => wallet.id === primaryWalletId);
|
|
35
|
-
if (!primaryWallet) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
return primaryWallet;
|
|
39
|
-
}, [primaryWalletId, wallets]);
|
|
46
|
+
const getPrimaryWallet = React.useCallback(() => { var _a; return (_a = wallets.find((wallet) => wallet.id === primaryWalletId)) !== null && _a !== void 0 ? _a : null; }, [primaryWalletId, wallets]);
|
|
40
47
|
const getSecondaryWallets = React.useCallback(() => wallets.filter((wallet) => wallet.id !== primaryWalletId), [primaryWalletId, wallets]);
|
|
41
|
-
React.useEffect(() => {
|
|
42
|
-
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
43
|
-
// wallet state should be null while loading all the wallets or when there is no user
|
|
44
|
-
if (!availableWallets || !decodedJwt) {
|
|
45
|
-
setWallets([]);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
Promise.all(decodedJwt.verifiedCredentials.map((account) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
const wallet = availableWallets.find((wallet) => account.walletName &&
|
|
50
|
-
isSameWalletName.isSameWalletName(wallet.name, account.walletName));
|
|
51
|
-
// this probably shouldn't happen. this would mean that the user has an account linked
|
|
52
|
-
// with wallet W, but the customer has toggled off wallet W or the chain that
|
|
53
|
-
// supports wallet W
|
|
54
|
-
/* istanbul ignore next */
|
|
55
|
-
if (!wallet)
|
|
56
|
-
return null;
|
|
57
|
-
if (account.id === primaryWalletId &&
|
|
58
|
-
shouldManuallyReconnectOnRefresh.shouldManuallyReconnectOnRefresh(wallet.walletConnector)) {
|
|
59
|
-
yield wallet.walletConnector.connect();
|
|
60
|
-
}
|
|
61
|
-
if (account.address && account.chain) {
|
|
62
|
-
return {
|
|
63
|
-
address: account.address,
|
|
64
|
-
chain: account.chain,
|
|
65
|
-
connected: yield isWalletConnected.isWalletConnected({
|
|
66
|
-
address: account.address,
|
|
67
|
-
chain: account.chain,
|
|
68
|
-
connector: wallet.walletConnector,
|
|
69
|
-
}),
|
|
70
|
-
connector: wallet.walletConnector,
|
|
71
|
-
id: account.id,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
}))).then((result) => {
|
|
76
|
-
setWallets(result.filter((wc) => wc !== null));
|
|
77
|
-
return null;
|
|
78
|
-
});
|
|
79
|
-
}, [availableWallets, primaryWalletId, authToken]);
|
|
80
|
-
const computeConnectedStateForWallets = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
if (!primaryWalletId)
|
|
82
|
-
return;
|
|
83
|
-
const connectionMap = {};
|
|
84
|
-
for (const wallet of wallets) {
|
|
85
|
-
connectionMap[wallet.id] = yield isWalletConnected.isWalletConnected(wallet);
|
|
86
|
-
}
|
|
87
|
-
setWallets((currentWallets) => currentWallets.map((wallet) => (Object.assign(Object.assign({}, wallet), { connected: connectionMap[wallet.id] }))));
|
|
88
|
-
}), [primaryWalletId, wallets]);
|
|
89
48
|
const getSelectedWallet = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
90
49
|
const newWallet = wallets.find(({ id }) => id === walletId);
|
|
91
50
|
if (!newWallet) {
|
|
92
|
-
throw new
|
|
51
|
+
throw new utils.DynamicError(`Wallet with id: ${walletId} not found`);
|
|
93
52
|
}
|
|
94
53
|
const connectedAccounts = yield newWallet.connector.getConnectedAccounts();
|
|
95
54
|
return { connectedAccounts, newWallet };
|
|
96
55
|
}), [wallets]);
|
|
97
|
-
const checkIfAccountChangeIsRequired = React.useCallback((primaryWallet, newPrimaryWallet) => {
|
|
98
|
-
if (!primaryWallet)
|
|
99
|
-
return;
|
|
56
|
+
const checkIfAccountChangeIsRequired = React.useCallback((primaryWallet, newPrimaryWallet, connectedAccounts) => {
|
|
100
57
|
/**
|
|
101
58
|
* we need to check multiWalletWidgetState here because `setPrimaryWallet` currently gets
|
|
102
59
|
* called twice: once when the user clicks "make active" and once when the user performs
|
|
@@ -104,8 +61,12 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
104
61
|
* (https://github.com/dynamic-labs/DynamicAuth/pull/550) is merged, since setting the
|
|
105
62
|
* primary wallet will be simpler, so we won't need to call `setPrimaryWallet` twice.
|
|
106
63
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
64
|
+
if (!primaryWallet || multiWalletWidgetState !== 'idle')
|
|
65
|
+
return;
|
|
66
|
+
const accountIsNotConnectedInSecondaryWallet = connectedAccounts &&
|
|
67
|
+
!connectedAccounts.find((connectedAccount) => connectedAccount.toLowerCase() ===
|
|
68
|
+
newPrimaryWallet.address.toLowerCase());
|
|
69
|
+
return (isSameWalletName.isSameWalletName(newPrimaryWallet.connector.name, primaryWallet.connector.name) || accountIsNotConnectedInSecondaryWallet);
|
|
109
70
|
}, [multiWalletWidgetState]);
|
|
110
71
|
const checkIfShowQrCodeModal = React.useCallback((wallet) => !wallet.connector.isInstalledOnBrowser() &&
|
|
111
72
|
!wallet.connector.canConnectViaCustodialService, []);
|
|
@@ -120,20 +81,26 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
120
81
|
return;
|
|
121
82
|
const primaryWallet = getPrimaryWallet();
|
|
122
83
|
if (checkIfAccountChangeIsRequired(primaryWallet, newPrimaryWallet)) {
|
|
123
|
-
|
|
84
|
+
yield newPrimaryWallet.connector.connect();
|
|
85
|
+
setPrimaryWalletId(walletId);
|
|
124
86
|
return;
|
|
125
87
|
}
|
|
126
88
|
if (!connectedAccounts.length) {
|
|
127
89
|
setMultiWalletWidgetState('awaiting_connection');
|
|
128
90
|
setShowQrcodeModal(checkIfShowQrCodeModal(newPrimaryWallet));
|
|
129
91
|
}
|
|
130
|
-
if (
|
|
92
|
+
if (walletConnectorCore.isEmailWalletConnector(newPrimaryWallet.connector)) {
|
|
131
93
|
const emailConnector = newPrimaryWallet.connector;
|
|
132
94
|
const email = localStorage.getItem('magic-link-email');
|
|
133
95
|
if (email) {
|
|
134
96
|
emailConnector.setEmail(email);
|
|
135
97
|
}
|
|
136
98
|
}
|
|
99
|
+
if (walletConnectorCore.isSocialWalletConnector(newPrimaryWallet.connector) &&
|
|
100
|
+
!newPrimaryWallet.connected) {
|
|
101
|
+
reconnectSocialWallet.reconnectSocialWallet(authToken, newPrimaryWallet);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
137
104
|
/* istanbul ignore next */
|
|
138
105
|
const publicAddress = yield newPrimaryWallet.connector.fetchPublicAddress({
|
|
139
106
|
onDesktopUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -143,6 +110,16 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
143
110
|
setQrcodeUri(uri);
|
|
144
111
|
}),
|
|
145
112
|
});
|
|
113
|
+
/**
|
|
114
|
+
* need to check for connected account again for wallets that disconnect on refresh
|
|
115
|
+
* and only reconnect upon fetching public address above
|
|
116
|
+
*/
|
|
117
|
+
const updatedConnectedAccounts = yield newPrimaryWallet.connector.getConnectedAccounts();
|
|
118
|
+
if (checkIfAccountChangeIsRequired(primaryWallet, newPrimaryWallet, updatedConnectedAccounts) &&
|
|
119
|
+
!walletConnectorCore.isEmailWalletConnector(newPrimaryWallet.connector)) {
|
|
120
|
+
setMultiWalletWidgetState('awaiting_account_switch', 'switching_primary');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
146
123
|
if (publicAddress) {
|
|
147
124
|
setPrimaryWalletId(walletId);
|
|
148
125
|
setMultiWalletWidgetState('idle');
|
|
@@ -151,6 +128,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
151
128
|
logger.logger.error('Failed to connect to wallet');
|
|
152
129
|
}
|
|
153
130
|
}), [
|
|
131
|
+
authToken,
|
|
154
132
|
checkIfAccountChangeIsRequired,
|
|
155
133
|
checkIfShowQrCodeModal,
|
|
156
134
|
getPrimaryWallet,
|
|
@@ -163,8 +141,9 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
163
141
|
]);
|
|
164
142
|
const walletConnectors = wallets.map((wallet) => wallet.connector);
|
|
165
143
|
return {
|
|
166
|
-
|
|
144
|
+
clearPrimaryWalletId,
|
|
167
145
|
computeConnectedStateForWallets,
|
|
146
|
+
didConnectedStateLoad,
|
|
168
147
|
getPrimaryWallet,
|
|
169
148
|
getSecondaryWallets,
|
|
170
149
|
primaryWallet: getPrimaryWallet(),
|
|
@@ -11,8 +11,9 @@ type Props = {
|
|
|
11
11
|
wallets: WalletOption[];
|
|
12
12
|
};
|
|
13
13
|
export interface UseWalletConnectors {
|
|
14
|
-
|
|
14
|
+
clearPrimaryWalletId: () => void;
|
|
15
15
|
computeConnectedStateForWallets: () => Promise<void>;
|
|
16
|
+
didConnectedStateLoad: boolean;
|
|
16
17
|
getPrimaryWallet: () => Wallet | null;
|
|
17
18
|
getSecondaryWallets: () => Wallet[];
|
|
18
19
|
primaryWallet: Wallet | null;
|
|
@@ -1,87 +1,46 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
-
import { useState,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
3
|
+
import { isEmailWalletConnector, isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
|
+
import '@dynamic-labs/sdk-api';
|
|
5
6
|
import { logger } from '../../../shared/logger.js';
|
|
6
7
|
import '@dynamic-labs/iconic';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
10
|
import { PRIMARY_WALLET_ID } from '../../constants/localStorage.js';
|
|
10
11
|
import '../../constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
12
14
|
import '../../../shared/consts/index.js';
|
|
13
|
-
import { isWalletConnected } from '../../functions/isWalletConnected/isWalletConnected.js';
|
|
14
15
|
import { isSameWalletName } from '../../functions/isSameWalletName/isSameWalletName.js';
|
|
15
|
-
import '
|
|
16
|
-
import {
|
|
16
|
+
import { useWalletsConnectionState } from '../useWalletsConnectionState/useWalletsConnectionState.js';
|
|
17
|
+
import { primaryWalletIdValidator } from './utils/primaryWalletIdValidator/primaryWalletIdValidator.js';
|
|
18
|
+
import { createLinkedWalletsFromWalletOptions } from './utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js';
|
|
19
|
+
import { reconnectSocialWallet } from './reconnectSocialWallet.js';
|
|
17
20
|
|
|
18
21
|
const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWalletWidgetState, setDesktopUri, setMultiWalletWidgetState, setQrcodeUri, }) => {
|
|
19
22
|
const [showQrcodeModal, setShowQrcodeModal] = useState(false);
|
|
20
|
-
const [
|
|
21
|
-
const
|
|
23
|
+
const [primaryWalletId, setPrimaryWalletIdState, clearPrimaryWalletId] = useLocalStorage(PRIMARY_WALLET_ID, undefined, primaryWalletIdValidator);
|
|
24
|
+
const linkedWallets = useMemo(() => {
|
|
25
|
+
if (!authToken) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
return createLinkedWalletsFromWalletOptions({
|
|
29
|
+
authToken,
|
|
30
|
+
primaryWalletId,
|
|
31
|
+
walletOptions: availableWallets,
|
|
32
|
+
});
|
|
33
|
+
}, [availableWallets, primaryWalletId, authToken]);
|
|
34
|
+
const { connectedWalletMap, computeConnectedStateForWallets, didConnectedStateLoad, } = useWalletsConnectionState(linkedWallets);
|
|
35
|
+
const wallets = useMemo(() => linkedWallets.map((wallet) => (Object.assign(Object.assign({}, wallet), { connected: Boolean(connectedWalletMap[wallet.id]) }))), [connectedWalletMap, linkedWallets]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
computeConnectedStateForWallets();
|
|
38
|
+
}, [primaryWalletId, computeConnectedStateForWallets]);
|
|
22
39
|
const setPrimaryWalletId = useCallback((walletId) => {
|
|
23
40
|
setPrimaryWalletIdState(walletId);
|
|
24
41
|
}, [setPrimaryWalletIdState]);
|
|
25
|
-
const
|
|
26
|
-
setWallets([]);
|
|
27
|
-
clearPrimaryWalletId();
|
|
28
|
-
}, [clearPrimaryWalletId]);
|
|
29
|
-
const getPrimaryWallet = useCallback(() => {
|
|
30
|
-
const primaryWallet = wallets.find((wallet) => wallet.id === primaryWalletId);
|
|
31
|
-
if (!primaryWallet) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return primaryWallet;
|
|
35
|
-
}, [primaryWalletId, wallets]);
|
|
42
|
+
const getPrimaryWallet = useCallback(() => { var _a; return (_a = wallets.find((wallet) => wallet.id === primaryWalletId)) !== null && _a !== void 0 ? _a : null; }, [primaryWalletId, wallets]);
|
|
36
43
|
const getSecondaryWallets = useCallback(() => wallets.filter((wallet) => wallet.id !== primaryWalletId), [primaryWalletId, wallets]);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
const decodedJwt = decodeJwt(authToken);
|
|
39
|
-
// wallet state should be null while loading all the wallets or when there is no user
|
|
40
|
-
if (!availableWallets || !decodedJwt) {
|
|
41
|
-
setWallets([]);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
Promise.all(decodedJwt.verifiedCredentials.map((account) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
const wallet = availableWallets.find((wallet) => account.walletName &&
|
|
46
|
-
isSameWalletName(wallet.name, account.walletName));
|
|
47
|
-
// this probably shouldn't happen. this would mean that the user has an account linked
|
|
48
|
-
// with wallet W, but the customer has toggled off wallet W or the chain that
|
|
49
|
-
// supports wallet W
|
|
50
|
-
/* istanbul ignore next */
|
|
51
|
-
if (!wallet)
|
|
52
|
-
return null;
|
|
53
|
-
if (account.id === primaryWalletId &&
|
|
54
|
-
shouldManuallyReconnectOnRefresh(wallet.walletConnector)) {
|
|
55
|
-
yield wallet.walletConnector.connect();
|
|
56
|
-
}
|
|
57
|
-
if (account.address && account.chain) {
|
|
58
|
-
return {
|
|
59
|
-
address: account.address,
|
|
60
|
-
chain: account.chain,
|
|
61
|
-
connected: yield isWalletConnected({
|
|
62
|
-
address: account.address,
|
|
63
|
-
chain: account.chain,
|
|
64
|
-
connector: wallet.walletConnector,
|
|
65
|
-
}),
|
|
66
|
-
connector: wallet.walletConnector,
|
|
67
|
-
id: account.id,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}))).then((result) => {
|
|
72
|
-
setWallets(result.filter((wc) => wc !== null));
|
|
73
|
-
return null;
|
|
74
|
-
});
|
|
75
|
-
}, [availableWallets, primaryWalletId, authToken]);
|
|
76
|
-
const computeConnectedStateForWallets = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
-
if (!primaryWalletId)
|
|
78
|
-
return;
|
|
79
|
-
const connectionMap = {};
|
|
80
|
-
for (const wallet of wallets) {
|
|
81
|
-
connectionMap[wallet.id] = yield isWalletConnected(wallet);
|
|
82
|
-
}
|
|
83
|
-
setWallets((currentWallets) => currentWallets.map((wallet) => (Object.assign(Object.assign({}, wallet), { connected: connectionMap[wallet.id] }))));
|
|
84
|
-
}), [primaryWalletId, wallets]);
|
|
85
44
|
const getSelectedWallet = useCallback((walletId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
45
|
const newWallet = wallets.find(({ id }) => id === walletId);
|
|
87
46
|
if (!newWallet) {
|
|
@@ -90,9 +49,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
90
49
|
const connectedAccounts = yield newWallet.connector.getConnectedAccounts();
|
|
91
50
|
return { connectedAccounts, newWallet };
|
|
92
51
|
}), [wallets]);
|
|
93
|
-
const checkIfAccountChangeIsRequired = useCallback((primaryWallet, newPrimaryWallet) => {
|
|
94
|
-
if (!primaryWallet)
|
|
95
|
-
return;
|
|
52
|
+
const checkIfAccountChangeIsRequired = useCallback((primaryWallet, newPrimaryWallet, connectedAccounts) => {
|
|
96
53
|
/**
|
|
97
54
|
* we need to check multiWalletWidgetState here because `setPrimaryWallet` currently gets
|
|
98
55
|
* called twice: once when the user clicks "make active" and once when the user performs
|
|
@@ -100,8 +57,12 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
100
57
|
* (https://github.com/dynamic-labs/DynamicAuth/pull/550) is merged, since setting the
|
|
101
58
|
* primary wallet will be simpler, so we won't need to call `setPrimaryWallet` twice.
|
|
102
59
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
60
|
+
if (!primaryWallet || multiWalletWidgetState !== 'idle')
|
|
61
|
+
return;
|
|
62
|
+
const accountIsNotConnectedInSecondaryWallet = connectedAccounts &&
|
|
63
|
+
!connectedAccounts.find((connectedAccount) => connectedAccount.toLowerCase() ===
|
|
64
|
+
newPrimaryWallet.address.toLowerCase());
|
|
65
|
+
return (isSameWalletName(newPrimaryWallet.connector.name, primaryWallet.connector.name) || accountIsNotConnectedInSecondaryWallet);
|
|
105
66
|
}, [multiWalletWidgetState]);
|
|
106
67
|
const checkIfShowQrCodeModal = useCallback((wallet) => !wallet.connector.isInstalledOnBrowser() &&
|
|
107
68
|
!wallet.connector.canConnectViaCustodialService, []);
|
|
@@ -116,7 +77,8 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
116
77
|
return;
|
|
117
78
|
const primaryWallet = getPrimaryWallet();
|
|
118
79
|
if (checkIfAccountChangeIsRequired(primaryWallet, newPrimaryWallet)) {
|
|
119
|
-
|
|
80
|
+
yield newPrimaryWallet.connector.connect();
|
|
81
|
+
setPrimaryWalletId(walletId);
|
|
120
82
|
return;
|
|
121
83
|
}
|
|
122
84
|
if (!connectedAccounts.length) {
|
|
@@ -130,6 +92,11 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
130
92
|
emailConnector.setEmail(email);
|
|
131
93
|
}
|
|
132
94
|
}
|
|
95
|
+
if (isSocialWalletConnector(newPrimaryWallet.connector) &&
|
|
96
|
+
!newPrimaryWallet.connected) {
|
|
97
|
+
reconnectSocialWallet(authToken, newPrimaryWallet);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
133
100
|
/* istanbul ignore next */
|
|
134
101
|
const publicAddress = yield newPrimaryWallet.connector.fetchPublicAddress({
|
|
135
102
|
onDesktopUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -139,6 +106,16 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
139
106
|
setQrcodeUri(uri);
|
|
140
107
|
}),
|
|
141
108
|
});
|
|
109
|
+
/**
|
|
110
|
+
* need to check for connected account again for wallets that disconnect on refresh
|
|
111
|
+
* and only reconnect upon fetching public address above
|
|
112
|
+
*/
|
|
113
|
+
const updatedConnectedAccounts = yield newPrimaryWallet.connector.getConnectedAccounts();
|
|
114
|
+
if (checkIfAccountChangeIsRequired(primaryWallet, newPrimaryWallet, updatedConnectedAccounts) &&
|
|
115
|
+
!isEmailWalletConnector(newPrimaryWallet.connector)) {
|
|
116
|
+
setMultiWalletWidgetState('awaiting_account_switch', 'switching_primary');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
142
119
|
if (publicAddress) {
|
|
143
120
|
setPrimaryWalletId(walletId);
|
|
144
121
|
setMultiWalletWidgetState('idle');
|
|
@@ -147,6 +124,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
147
124
|
logger.error('Failed to connect to wallet');
|
|
148
125
|
}
|
|
149
126
|
}), [
|
|
127
|
+
authToken,
|
|
150
128
|
checkIfAccountChangeIsRequired,
|
|
151
129
|
checkIfShowQrCodeModal,
|
|
152
130
|
getPrimaryWallet,
|
|
@@ -159,8 +137,9 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
|
|
|
159
137
|
]);
|
|
160
138
|
const walletConnectors = wallets.map((wallet) => wallet.connector);
|
|
161
139
|
return {
|
|
162
|
-
|
|
140
|
+
clearPrimaryWalletId,
|
|
163
141
|
computeConnectedStateForWallets,
|
|
142
|
+
didConnectedStateLoad,
|
|
164
143
|
getPrimaryWallet,
|
|
165
144
|
getSecondaryWallets,
|
|
166
145
|
primaryWallet: getPrimaryWallet(),
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var decodeJwt = require('../../../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
6
|
+
require('../../../../../shared/logger.cjs');
|
|
7
|
+
require('@dynamic-labs/iconic');
|
|
8
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
9
|
+
require('react/jsx-runtime');
|
|
10
|
+
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
11
|
+
require('react');
|
|
12
|
+
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../../constants/colors.cjs');
|
|
14
|
+
require('ethers');
|
|
15
|
+
require('../../../../../shared/consts/index.cjs');
|
|
16
|
+
var isSameWalletName = require('../../../../functions/isSameWalletName/isSameWalletName.cjs');
|
|
17
|
+
require('@dynamic-labs/multi-wallet');
|
|
18
|
+
require('@dynamic-labs/sdk-api');
|
|
19
|
+
var shouldManuallyReconnectOnRefresh = require('../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
20
|
+
|
|
21
|
+
const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
|
|
22
|
+
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
23
|
+
// wallet state should be null while loading all the wallets or when there is no user
|
|
24
|
+
if (!walletOptions || !decodedJwt) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
return decodedJwt.verifiedCredentials
|
|
28
|
+
.map((account) => {
|
|
29
|
+
const wallet = walletOptions.find((wallet) => account.walletName &&
|
|
30
|
+
isSameWalletName.isSameWalletName(wallet.name, account.walletName));
|
|
31
|
+
// this probably shouldn't happen. this would mean that the user has an account linked
|
|
32
|
+
// with wallet W, but the customer has toggled off wallet W or the chain that
|
|
33
|
+
// supports wallet W
|
|
34
|
+
/* istanbul ignore next */
|
|
35
|
+
if (!wallet)
|
|
36
|
+
return null;
|
|
37
|
+
if (account.id === primaryWalletId &&
|
|
38
|
+
shouldManuallyReconnectOnRefresh.shouldManuallyReconnectOnRefresh(wallet.walletConnector)) {
|
|
39
|
+
wallet.walletConnector.connect();
|
|
40
|
+
}
|
|
41
|
+
if (account.address && account.chain) {
|
|
42
|
+
return {
|
|
43
|
+
address: account.address,
|
|
44
|
+
chain: account.chain,
|
|
45
|
+
connected: false,
|
|
46
|
+
connector: wallet.walletConnector,
|
|
47
|
+
id: account.id,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
})
|
|
52
|
+
.filter((wc) => wc !== null);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.createLinkedWalletsFromWalletOptions = createLinkedWalletsFromWalletOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Wallet, WalletOption } from '../../../../../shared';
|
|
2
|
+
type CreateWalletsFromWalletOptionsProps = {
|
|
3
|
+
authToken: string;
|
|
4
|
+
primaryWalletId: string | undefined;
|
|
5
|
+
walletOptions: WalletOption[] | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const createLinkedWalletsFromWalletOptions: ({ authToken, walletOptions, primaryWalletId, }: CreateWalletsFromWalletOptionsProps) => Wallet[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { decodeJwt } from '../../../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
2
|
+
import '../../../../../shared/logger.js';
|
|
3
|
+
import '@dynamic-labs/iconic';
|
|
4
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import '../../../../../context/ViewContext/ViewContext.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../../constants/colors.js';
|
|
10
|
+
import 'ethers';
|
|
11
|
+
import '../../../../../shared/consts/index.js';
|
|
12
|
+
import { isSameWalletName } from '../../../../functions/isSameWalletName/isSameWalletName.js';
|
|
13
|
+
import '@dynamic-labs/multi-wallet';
|
|
14
|
+
import '@dynamic-labs/sdk-api';
|
|
15
|
+
import { shouldManuallyReconnectOnRefresh } from '../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
16
|
+
|
|
17
|
+
const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
|
|
18
|
+
const decodedJwt = decodeJwt(authToken);
|
|
19
|
+
// wallet state should be null while loading all the wallets or when there is no user
|
|
20
|
+
if (!walletOptions || !decodedJwt) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return decodedJwt.verifiedCredentials
|
|
24
|
+
.map((account) => {
|
|
25
|
+
const wallet = walletOptions.find((wallet) => account.walletName &&
|
|
26
|
+
isSameWalletName(wallet.name, account.walletName));
|
|
27
|
+
// this probably shouldn't happen. this would mean that the user has an account linked
|
|
28
|
+
// with wallet W, but the customer has toggled off wallet W or the chain that
|
|
29
|
+
// supports wallet W
|
|
30
|
+
/* istanbul ignore next */
|
|
31
|
+
if (!wallet)
|
|
32
|
+
return null;
|
|
33
|
+
if (account.id === primaryWalletId &&
|
|
34
|
+
shouldManuallyReconnectOnRefresh(wallet.walletConnector)) {
|
|
35
|
+
wallet.walletConnector.connect();
|
|
36
|
+
}
|
|
37
|
+
if (account.address && account.chain) {
|
|
38
|
+
return {
|
|
39
|
+
address: account.address,
|
|
40
|
+
chain: account.chain,
|
|
41
|
+
connected: false,
|
|
42
|
+
connector: wallet.walletConnector,
|
|
43
|
+
id: account.id,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
})
|
|
48
|
+
.filter((wc) => wc !== null);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { createLinkedWalletsFromWalletOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createLinkedWalletsFromWalletOptions } from './createLinkedWalletsFromWalletOptions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { primaryWalletIdValidator } from './primaryWalletIdValidator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const primaryWalletIdValidator: (value: string | unknown) => value is string | undefined;
|