@dynamic-labs/sdk-react-core 1.0.0-alpha.8 → 1.0.0
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 +69 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +12 -11
- package/src/index.cjs +41 -34
- package/src/index.d.ts +3 -1
- package/src/index.js +26 -22
- package/src/lib/Main.cjs +24 -22
- package/src/lib/Main.js +24 -22
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +18 -17
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +18 -17
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +19 -18
- package/src/lib/components/AnimatePresence/AnimatePresence.js +19 -18
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +15 -14
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +15 -14
- package/src/lib/components/Divider/Divider.cjs +16 -15
- package/src/lib/components/Divider/Divider.js +16 -15
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +16 -15
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +16 -15
- package/src/lib/components/Modal/Modal.cjs +17 -16
- package/src/lib/components/Modal/Modal.js +17 -16
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +21 -19
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +21 -19
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +17 -16
- package/src/lib/components/NetworkPicker/NetworkPicker.js +17 -16
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +15 -14
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +15 -14
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +17 -16
- package/src/lib/components/NetworkPicker/components/Network/Network.js +17 -16
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +16 -15
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +16 -15
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +16 -15
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +16 -15
- package/src/lib/components/OverlayCard/OverlayCard.cjs +17 -16
- package/src/lib/components/OverlayCard/OverlayCard.js +17 -16
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +16 -15
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +16 -15
- package/src/lib/components/Popper/PopperContext/PopperContext.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +17 -16
- package/src/lib/components/Portal/Portal.js +17 -16
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs +1 -1
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +2 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +2 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +16 -15
- package/src/lib/components/SocialSignIn/SocialSignIn.js +16 -15
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +15 -14
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +15 -14
- package/src/lib/components/Tooltip/Tooltip.cjs +15 -14
- package/src/lib/components/Tooltip/Tooltip.js +15 -14
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +14 -13
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +14 -13
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +18 -17
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +18 -17
- package/src/lib/components/UserAddress/UserAddress.cjs +16 -15
- package/src/lib/components/UserAddress/UserAddress.js +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +16 -15
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +16 -15
- package/src/lib/context/AccessDeniedContext/AccessDeniedContext.js +1 -1
- package/src/lib/context/AccountExistsContext/AccountExistsContext.js +1 -1
- package/src/lib/context/CaptchaContext/CaptchaContext.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +44 -38
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +44 -39
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.d.ts +2 -2
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.js +3 -3
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.d.ts +2 -2
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.js +3 -3
- package/src/lib/context/DynamicContext/types/index.d.ts +1 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +18 -17
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +18 -17
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -5
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +2 -5
- package/src/lib/context/EmailVerificationContext/EmailVerificationContext.js +1 -1
- package/src/lib/context/FundingContext/FundingContext.cjs +35 -27
- package/src/lib/context/FundingContext/FundingContext.d.ts +4 -0
- package/src/lib/context/FundingContext/FundingContext.js +36 -28
- package/src/lib/context/FundingContext/index.d.ts +1 -0
- package/src/lib/context/FundingContext/useFunding/index.d.ts +1 -0
- package/src/lib/context/FundingContext/useFunding/useFunding.cjs +39 -0
- package/src/lib/context/FundingContext/useFunding/useFunding.d.ts +9 -0
- package/src/lib/context/FundingContext/useFunding/useFunding.js +35 -0
- package/src/lib/context/LoadingContext/LoadingContext.js +1 -1
- package/src/lib/context/MockContext/MockContext.cjs +13 -11
- package/src/lib/context/MockContext/MockContext.js +13 -11
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +18 -17
- package/src/lib/context/QrCodeContext/QrCodeContext.js +18 -17
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +15 -14
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +15 -14
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +31 -16
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +32 -17
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +16 -15
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +16 -15
- package/src/lib/context/UserWalletsContext/UserWalletsContext.cjs +52 -0
- package/src/lib/context/UserWalletsContext/UserWalletsContext.d.ts +21 -0
- package/src/lib/context/UserWalletsContext/UserWalletsContext.js +45 -0
- package/src/lib/context/UserWalletsContext/index.d.ts +1 -0
- package/src/lib/context/ViewContext/ViewContext.js +1 -1
- package/src/lib/data/api.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +14 -13
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +14 -13
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +15 -14
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +15 -14
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +15 -14
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +15 -14
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +16 -15
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +16 -15
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +15 -14
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +15 -14
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +17 -15
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +17 -15
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +16 -15
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +16 -15
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +16 -15
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +16 -15
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +16 -15
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +16 -15
- package/src/lib/locale/en/translation.cjs +4 -4
- package/src/lib/locale/en/translation.d.ts +2 -2
- package/src/lib/locale/en/translation.js +4 -4
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.cjs +16 -15
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.js +16 -15
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +16 -15
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +16 -15
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +17 -16
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +17 -16
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.types.d.ts +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +15 -10
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.d.ts +4 -2
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +15 -10
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +16 -16
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +16 -16
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +16 -15
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +16 -15
- package/src/lib/shared/types/index.d.ts +9 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +4 -2
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.d.ts +2 -2
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js +4 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.cjs +39 -0
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.d.ts +3 -0
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.js +35 -0
- package/src/lib/utils/functions/createOwnerWallet/index.d.ts +1 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +1 -1
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +1 -1
- package/src/lib/utils/functions/index.d.ts +2 -0
- package/src/lib/utils/functions/isAccountAbstractionWallet/index.d.ts +1 -0
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.cjs +18 -0
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.d.ts +2 -0
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.js +14 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +9 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +9 -2
- package/src/lib/utils/hooks/index.d.ts +35 -35
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +4 -3
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +4 -3
- package/src/lib/utils/hooks/useConnectWallet/updateUserWalletsFromConnectedWallets/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectWallet/updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.cjs +37 -0
- package/src/lib/utils/hooks/useConnectWallet/updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.d.ts +8 -0
- package/src/lib/utils/hooks/useConnectWallet/updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.js +33 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -7
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +14 -7
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +8 -5
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +1 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +8 -5
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +6 -3
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +6 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +14 -11
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +14 -11
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +16 -1
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +16 -1
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +2 -2
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +6 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +7 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.cjs +34 -5
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +33 -1
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.js +34 -5
- package/src/lib/utils/hooks/useWalletConnectorOptions/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useWallets/useWallets.cjs → useWalletConnectorOptions/useWalletConnectorOptions.cjs} +8 -8
- package/src/lib/utils/hooks/{useWallets/useWallets.d.ts → useWalletConnectorOptions/useWalletConnectorOptions.d.ts} +2 -2
- package/src/lib/utils/hooks/{useWallets/useWallets.js → useWalletConnectorOptions/useWalletConnectorOptions.js} +8 -8
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/errors/ConnectorSetupError.cjs +13 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/errors/ConnectorSetupError.d.ts +4 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/errors/ConnectorSetupError.js +9 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/errors/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useWallets → useWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +3 -5
- package/src/lib/utils/hooks/{useWallets → useWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.d.ts +0 -3
- package/src/lib/utils/hooks/{useWallets → useWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +4 -4
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyRequiredConnectorsAreSetup/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs +13 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.d.ts +3 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js +9 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +32 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.d.ts +3 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +28 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +17 -15
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +3 -7
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +17 -15
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +5 -4
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +5 -4
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +3 -3
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +3 -3
- package/src/lib/utils/hooks/useWalletConnectors/utils/updateUserWalletsFromLinkedWallets/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/updateUserWalletsFromLinkedWallets/updateUserWalletsFromLinkedWallets.cjs +34 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/updateUserWalletsFromLinkedWallets/updateUserWalletsFromLinkedWallets.d.ts +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/updateUserWalletsFromLinkedWallets/updateUserWalletsFromLinkedWallets.js +30 -0
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -4
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -4
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +9 -8
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +9 -8
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +13 -12
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +13 -12
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +18 -17
- package/src/lib/views/AccountExistsView/AccountExistsView.js +18 -17
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +16 -15
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +16 -15
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +17 -16
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +17 -16
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +19 -18
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +19 -18
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +17 -16
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +17 -16
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +17 -16
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +17 -16
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +15 -14
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +15 -14
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +16 -15
- package/src/lib/views/EmailUpdate/EmailUpdate.js +16 -15
- package/src/lib/views/EmailVerification/EmailVerification.cjs +20 -19
- package/src/lib/views/EmailVerification/EmailVerification.js +20 -19
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +15 -14
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +15 -14
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +17 -16
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +17 -16
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +17 -16
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +17 -16
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +17 -16
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +17 -16
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +15 -14
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +15 -14
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +16 -15
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +16 -15
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +2 -2
- package/src/lib/views/LoginView/useLoginView.cjs +9 -2
- package/src/lib/views/LoginView/useLoginView.js +9 -2
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +16 -15
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +16 -15
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +19 -18
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +19 -18
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +19 -18
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +19 -18
- package/src/lib/views/NoAccess/NoAccess.cjs +16 -15
- package/src/lib/views/NoAccess/NoAccess.js +16 -15
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +16 -15
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +16 -15
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +16 -15
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +16 -15
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs +16 -15
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.js +16 -15
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +21 -20
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +21 -20
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +37 -20
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +38 -21
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +24 -18
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +24 -18
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +26 -20
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +26 -20
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +12 -7
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +12 -7
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +16 -15
- package/src/lib/views/PendingConnectView/PendingConnectView.js +16 -15
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +16 -15
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +16 -15
- package/src/lib/views/QrCodeView/QRCode.cjs +17 -16
- package/src/lib/views/QrCodeView/QRCode.js +17 -16
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +14 -13
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +14 -13
- package/src/lib/views/QrCodeView/QrCodeView.cjs +14 -13
- package/src/lib/views/QrCodeView/QrCodeView.js +14 -13
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +17 -16
- package/src/lib/views/SendBalanceView/SendBalanceView.js +17 -16
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +17 -17
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +17 -17
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +17 -16
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +17 -16
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +17 -16
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +17 -16
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +21 -25
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +21 -25
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.types.d.ts +4 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +19 -12
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.d.ts +2 -11
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +19 -12
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +19 -18
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +19 -18
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +16 -15
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +16 -15
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +16 -15
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +16 -15
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +16 -15
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +16 -15
- package/src/lib/views/WalletList/WalletList.cjs +4 -4
- package/src/lib/views/WalletList/WalletList.js +4 -4
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +16 -15
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +16 -15
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +16 -15
- package/src/lib/views/WalletLockedView/WalletLockedView.js +16 -15
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +14 -13
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +14 -13
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +18 -17
- package/src/lib/views/WalletUsedView/WalletUsedView.js +18 -17
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +17 -16
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +17 -16
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +16 -15
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +13 -12
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +13 -12
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +15 -14
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +15 -14
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +17 -16
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +17 -16
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +18 -16
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +18 -16
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +17 -16
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +13 -12
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +13 -12
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +24 -18
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +24 -18
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +15 -14
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +15 -14
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +17 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +17 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +18 -17
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +18 -17
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +17 -16
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +17 -16
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.js +16 -15
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +13 -12
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +13 -12
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +16 -15
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +17 -16
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +7 -7
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +7 -7
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +13 -12
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +13 -12
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +15 -14
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +15 -14
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +14 -13
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +14 -13
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +16 -15
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +15 -14
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +15 -14
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +15 -14
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +15 -14
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +18 -17
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +18 -17
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +28 -29
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +28 -29
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +17 -16
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +16 -15
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +16 -15
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +17 -16
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +17 -16
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +16 -15
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +16 -15
- package/src/lib/utils/hooks/useWallets/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWallets/utils/index.d.ts +0 -1
- package/src/lib/views/Passkey/passkey.types.d.ts +0 -8
- /package/src/lib/utils/hooks/{useWallets → useWalletConnectorOptions}/utils/verifyMagicIsSetup/index.d.ts +0 -0
|
@@ -30,7 +30,7 @@ var useCreateDynamicEmbeddedWalletMutation = require('../useCreateDynamicEmbedde
|
|
|
30
30
|
|
|
31
31
|
// Hook exposed to customers and used internally to trigger embedded wallet creation
|
|
32
32
|
const useEmbeddedWallet = () => {
|
|
33
|
-
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId,
|
|
33
|
+
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, primaryWallet, environmentId, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
34
34
|
const { setView } = ViewContext.useViewContext();
|
|
35
35
|
const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
|
|
36
36
|
const userHasEmbeddedWallet = () => {
|
|
@@ -46,7 +46,7 @@ const useEmbeddedWallet = () => {
|
|
|
46
46
|
authToken: jwt,
|
|
47
47
|
decodedJwt,
|
|
48
48
|
environmentId,
|
|
49
|
-
|
|
49
|
+
walletConnectorOptions,
|
|
50
50
|
withAuthenticator: false,
|
|
51
51
|
});
|
|
52
52
|
internalSetShowAuthFlow(false); // close email otp pin modal
|
|
@@ -57,7 +57,7 @@ const useEmbeddedWallet = () => {
|
|
|
57
57
|
}), [
|
|
58
58
|
createDynamicEmbeddedWalletMutation,
|
|
59
59
|
environmentId,
|
|
60
|
-
|
|
60
|
+
walletConnectorOptions,
|
|
61
61
|
internalSetShowAuthFlow,
|
|
62
62
|
internalEvents,
|
|
63
63
|
]);
|
|
@@ -79,9 +79,9 @@ const useEmbeddedWallet = () => {
|
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
81
|
const returnEmbeddedWallet = (jwt, embeddedWalletVerifiedCredential) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
-
var _a, _b, _c;
|
|
82
|
+
var _a, _b, _c, _d;
|
|
83
83
|
const decodedJwt = decodeJwt.decodeJwt(jwt);
|
|
84
|
-
const turnkeyWallet = findTurnkeyWallet.findTurnkeyWallet(
|
|
84
|
+
const turnkeyWallet = findTurnkeyWallet.findTurnkeyWallet(walletConnectorOptions);
|
|
85
85
|
// if user already has embedded wallet, set it as primary wallet
|
|
86
86
|
if (decodedJwt) {
|
|
87
87
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
@@ -90,7 +90,7 @@ const useEmbeddedWallet = () => {
|
|
|
90
90
|
yield smartWallet.initializeSmartWallet({
|
|
91
91
|
account: smartWallet$1,
|
|
92
92
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
93
|
-
|
|
93
|
+
walletConnectorOptions,
|
|
94
94
|
});
|
|
95
95
|
setPrimaryWalletId(smartWallet$1.id);
|
|
96
96
|
}
|
|
@@ -98,9 +98,12 @@ const useEmbeddedWallet = () => {
|
|
|
98
98
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
/** It's not authenticated if it still hasn't created a passkey */
|
|
102
|
+
const authenticated = Boolean((_b = embeddedWalletVerifiedCredential.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached);
|
|
101
103
|
const passkeyWallet = {
|
|
102
|
-
address: (yield ((
|
|
103
|
-
|
|
104
|
+
address: (yield ((_c = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _c === void 0 ? void 0 : _c.fetchPublicAddress())) || '',
|
|
105
|
+
authenticated,
|
|
106
|
+
chain: ((_d = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _d === void 0 ? void 0 : _d.connectedChain) || '',
|
|
104
107
|
connected: true,
|
|
105
108
|
connector: (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) || {},
|
|
106
109
|
id: embeddedWalletVerifiedCredential.id,
|
|
@@ -108,8 +111,8 @@ const useEmbeddedWallet = () => {
|
|
|
108
111
|
return Promise.resolve(passkeyWallet);
|
|
109
112
|
});
|
|
110
113
|
const createEmbeddedWallet = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
-
var
|
|
112
|
-
const jwt = (
|
|
114
|
+
var _e, _f, _g;
|
|
115
|
+
const jwt = (_e = getAuthToken.getAuthToken()) !== null && _e !== void 0 ? _e : onboardingOnlyJwt;
|
|
113
116
|
const decodedJwt = decodeJwt.decodeJwt(jwt);
|
|
114
117
|
if (!jwt || !decodedJwt) {
|
|
115
118
|
throw new Error('User is not logged in');
|
|
@@ -120,7 +123,7 @@ const useEmbeddedWallet = () => {
|
|
|
120
123
|
const userWaletsCredentials = getUserWalletsFromVerifiedCredentials.getUserWalletsFromVerifiedCredentials(jwt);
|
|
121
124
|
// if user doesn't have a wallet yet, show the passkey view to create an embedded wallet
|
|
122
125
|
if (!(userWaletsCredentials === null || userWaletsCredentials === void 0 ? void 0 : userWaletsCredentials.length)) {
|
|
123
|
-
if (((
|
|
126
|
+
if (((_g = (_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWalletSecurityMethods) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0) === 0) {
|
|
124
127
|
return startPregeneratedWalletCreationFlow(jwt, decodedJwt);
|
|
125
128
|
}
|
|
126
129
|
return startEmbeddedWalletCreationFlow();
|
|
@@ -26,7 +26,7 @@ import { useCreateDynamicEmbeddedWalletMutation } from '../useCreateDynamicEmbed
|
|
|
26
26
|
|
|
27
27
|
// Hook exposed to customers and used internally to trigger embedded wallet creation
|
|
28
28
|
const useEmbeddedWallet = () => {
|
|
29
|
-
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId,
|
|
29
|
+
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, primaryWallet, environmentId, } = useInternalDynamicContext();
|
|
30
30
|
const { setView } = useViewContext();
|
|
31
31
|
const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation();
|
|
32
32
|
const userHasEmbeddedWallet = () => {
|
|
@@ -42,7 +42,7 @@ const useEmbeddedWallet = () => {
|
|
|
42
42
|
authToken: jwt,
|
|
43
43
|
decodedJwt,
|
|
44
44
|
environmentId,
|
|
45
|
-
|
|
45
|
+
walletConnectorOptions,
|
|
46
46
|
withAuthenticator: false,
|
|
47
47
|
});
|
|
48
48
|
internalSetShowAuthFlow(false); // close email otp pin modal
|
|
@@ -53,7 +53,7 @@ const useEmbeddedWallet = () => {
|
|
|
53
53
|
}), [
|
|
54
54
|
createDynamicEmbeddedWalletMutation,
|
|
55
55
|
environmentId,
|
|
56
|
-
|
|
56
|
+
walletConnectorOptions,
|
|
57
57
|
internalSetShowAuthFlow,
|
|
58
58
|
internalEvents,
|
|
59
59
|
]);
|
|
@@ -75,9 +75,9 @@ const useEmbeddedWallet = () => {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
const returnEmbeddedWallet = (jwt, embeddedWalletVerifiedCredential) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
-
var _a, _b, _c;
|
|
78
|
+
var _a, _b, _c, _d;
|
|
79
79
|
const decodedJwt = decodeJwt(jwt);
|
|
80
|
-
const turnkeyWallet = findTurnkeyWallet(
|
|
80
|
+
const turnkeyWallet = findTurnkeyWallet(walletConnectorOptions);
|
|
81
81
|
// if user already has embedded wallet, set it as primary wallet
|
|
82
82
|
if (decodedJwt) {
|
|
83
83
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
@@ -86,7 +86,7 @@ const useEmbeddedWallet = () => {
|
|
|
86
86
|
yield initializeSmartWallet({
|
|
87
87
|
account: smartWallet,
|
|
88
88
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
89
|
-
|
|
89
|
+
walletConnectorOptions,
|
|
90
90
|
});
|
|
91
91
|
setPrimaryWalletId(smartWallet.id);
|
|
92
92
|
}
|
|
@@ -94,9 +94,12 @@ const useEmbeddedWallet = () => {
|
|
|
94
94
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
/** It's not authenticated if it still hasn't created a passkey */
|
|
98
|
+
const authenticated = Boolean((_b = embeddedWalletVerifiedCredential.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached);
|
|
97
99
|
const passkeyWallet = {
|
|
98
|
-
address: (yield ((
|
|
99
|
-
|
|
100
|
+
address: (yield ((_c = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _c === void 0 ? void 0 : _c.fetchPublicAddress())) || '',
|
|
101
|
+
authenticated,
|
|
102
|
+
chain: ((_d = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _d === void 0 ? void 0 : _d.connectedChain) || '',
|
|
100
103
|
connected: true,
|
|
101
104
|
connector: (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) || {},
|
|
102
105
|
id: embeddedWalletVerifiedCredential.id,
|
|
@@ -104,8 +107,8 @@ const useEmbeddedWallet = () => {
|
|
|
104
107
|
return Promise.resolve(passkeyWallet);
|
|
105
108
|
});
|
|
106
109
|
const createEmbeddedWallet = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
-
var
|
|
108
|
-
const jwt = (
|
|
110
|
+
var _e, _f, _g;
|
|
111
|
+
const jwt = (_e = getAuthToken()) !== null && _e !== void 0 ? _e : onboardingOnlyJwt;
|
|
109
112
|
const decodedJwt = decodeJwt(jwt);
|
|
110
113
|
if (!jwt || !decodedJwt) {
|
|
111
114
|
throw new Error('User is not logged in');
|
|
@@ -116,7 +119,7 @@ const useEmbeddedWallet = () => {
|
|
|
116
119
|
const userWaletsCredentials = getUserWalletsFromVerifiedCredentials(jwt);
|
|
117
120
|
// if user doesn't have a wallet yet, show the passkey view to create an embedded wallet
|
|
118
121
|
if (!(userWaletsCredentials === null || userWaletsCredentials === void 0 ? void 0 : userWaletsCredentials.length)) {
|
|
119
|
-
if (((
|
|
122
|
+
if (((_g = (_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWalletSecurityMethods) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0) === 0) {
|
|
120
123
|
return startPregeneratedWalletCreationFlow(jwt, decodedJwt);
|
|
121
124
|
}
|
|
122
125
|
return startEmbeddedWalletCreationFlow();
|
|
@@ -22,10 +22,25 @@ const useIsTurnkeyWallet = () => {
|
|
|
22
22
|
}
|
|
23
23
|
return turnkeyVC;
|
|
24
24
|
};
|
|
25
|
+
const getUnclaimedTurnkeyTheSignerOfScw = () => {
|
|
26
|
+
if (!primaryWallet || !user) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const unclaimedTurnkeyVc = user.verifiedCredentials.find((vc) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
return ((_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('turnkey')) &&
|
|
32
|
+
((_b = vc.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached) === false;
|
|
33
|
+
});
|
|
34
|
+
const smartContractWalletWithUnclaimedTurnkeySigner = user.verifiedCredentials.find((vc) => unclaimedTurnkeyVc && vc.signerRefId === unclaimedTurnkeyVc.id);
|
|
35
|
+
return smartContractWalletWithUnclaimedTurnkeySigner;
|
|
36
|
+
};
|
|
25
37
|
const turnkeyVerifiedCredential = getTurnkeyVerifiedCredential();
|
|
38
|
+
const unclaimedTurnkeyTheSignerOfScw = getUnclaimedTurnkeyTheSignerOfScw();
|
|
26
39
|
const isTurnkeyWallet = Boolean(turnkeyVerifiedCredential);
|
|
40
|
+
const isUnclaimedTurnkeyTheSignerOfScw = Boolean(unclaimedTurnkeyTheSignerOfScw);
|
|
27
41
|
const hasTurnkeyVerifiedCredentialAuthenticator = Boolean((_a = turnkeyVerifiedCredential === null || turnkeyVerifiedCredential === void 0 ? void 0 : turnkeyVerifiedCredential.walletProperties) === null || _a === void 0 ? void 0 : _a.isAuthenticatorAttached);
|
|
28
|
-
const isTurnkeyWalletWithoutAuthenticator = isTurnkeyWallet && !hasTurnkeyVerifiedCredentialAuthenticator
|
|
42
|
+
const isTurnkeyWalletWithoutAuthenticator = (isTurnkeyWallet && !hasTurnkeyVerifiedCredentialAuthenticator) ||
|
|
43
|
+
isUnclaimedTurnkeyTheSignerOfScw;
|
|
29
44
|
return {
|
|
30
45
|
hasTurnkeyVerifiedCredentialAuthenticator,
|
|
31
46
|
isTurnkeyWallet,
|
|
@@ -18,10 +18,25 @@ const useIsTurnkeyWallet = () => {
|
|
|
18
18
|
}
|
|
19
19
|
return turnkeyVC;
|
|
20
20
|
};
|
|
21
|
+
const getUnclaimedTurnkeyTheSignerOfScw = () => {
|
|
22
|
+
if (!primaryWallet || !user) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const unclaimedTurnkeyVc = user.verifiedCredentials.find((vc) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return ((_a = vc.walletName) === null || _a === void 0 ? void 0 : _a.startsWith('turnkey')) &&
|
|
28
|
+
((_b = vc.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached) === false;
|
|
29
|
+
});
|
|
30
|
+
const smartContractWalletWithUnclaimedTurnkeySigner = user.verifiedCredentials.find((vc) => unclaimedTurnkeyVc && vc.signerRefId === unclaimedTurnkeyVc.id);
|
|
31
|
+
return smartContractWalletWithUnclaimedTurnkeySigner;
|
|
32
|
+
};
|
|
21
33
|
const turnkeyVerifiedCredential = getTurnkeyVerifiedCredential();
|
|
34
|
+
const unclaimedTurnkeyTheSignerOfScw = getUnclaimedTurnkeyTheSignerOfScw();
|
|
22
35
|
const isTurnkeyWallet = Boolean(turnkeyVerifiedCredential);
|
|
36
|
+
const isUnclaimedTurnkeyTheSignerOfScw = Boolean(unclaimedTurnkeyTheSignerOfScw);
|
|
23
37
|
const hasTurnkeyVerifiedCredentialAuthenticator = Boolean((_a = turnkeyVerifiedCredential === null || turnkeyVerifiedCredential === void 0 ? void 0 : turnkeyVerifiedCredential.walletProperties) === null || _a === void 0 ? void 0 : _a.isAuthenticatorAttached);
|
|
24
|
-
const isTurnkeyWalletWithoutAuthenticator = isTurnkeyWallet && !hasTurnkeyVerifiedCredentialAuthenticator
|
|
38
|
+
const isTurnkeyWalletWithoutAuthenticator = (isTurnkeyWallet && !hasTurnkeyVerifiedCredentialAuthenticator) ||
|
|
39
|
+
isUnclaimedTurnkeyTheSignerOfScw;
|
|
25
40
|
return {
|
|
26
41
|
hasTurnkeyVerifiedCredentialAuthenticator,
|
|
27
42
|
isTurnkeyWallet,
|
|
@@ -26,7 +26,7 @@ var useEmbeddedWallet = require('../useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
|
26
26
|
|
|
27
27
|
// Hook exposed to customers and used internally to trigger passkey recovery
|
|
28
28
|
const usePasskeyRecovery = () => {
|
|
29
|
-
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId,
|
|
29
|
+
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
30
30
|
const { userHasEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
31
31
|
const { setView } = ViewContext.useViewContext();
|
|
32
32
|
const initPasskeyRecoveryProcess = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -57,7 +57,7 @@ const usePasskeyRecovery = () => {
|
|
|
57
57
|
projectSettings,
|
|
58
58
|
setPrimaryWalletId,
|
|
59
59
|
setView,
|
|
60
|
-
|
|
60
|
+
walletConnectorOptions,
|
|
61
61
|
]);
|
|
62
62
|
return {
|
|
63
63
|
initPasskeyRecoveryProcess,
|
|
@@ -22,7 +22,7 @@ import { useEmbeddedWallet } from '../useEmbeddedWallet/useEmbeddedWallet.js';
|
|
|
22
22
|
|
|
23
23
|
// Hook exposed to customers and used internally to trigger passkey recovery
|
|
24
24
|
const usePasskeyRecovery = () => {
|
|
25
|
-
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId,
|
|
25
|
+
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, internalEvents, } = useInternalDynamicContext();
|
|
26
26
|
const { userHasEmbeddedWallet } = useEmbeddedWallet();
|
|
27
27
|
const { setView } = useViewContext();
|
|
28
28
|
const initPasskeyRecoveryProcess = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -53,7 +53,7 @@ const usePasskeyRecovery = () => {
|
|
|
53
53
|
projectSettings,
|
|
54
54
|
setPrimaryWalletId,
|
|
55
55
|
setView,
|
|
56
|
-
|
|
56
|
+
walletConnectorOptions,
|
|
57
57
|
]);
|
|
58
58
|
return {
|
|
59
59
|
initPasskeyRecoveryProcess,
|
|
@@ -308,6 +308,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
308
308
|
// start pooling oauth result
|
|
309
309
|
shouldPool.current = true;
|
|
310
310
|
poolOauthResult(provider, state);
|
|
311
|
+
// if this is mobile, set a longer timeout to allow the user to login to the provider in the browser
|
|
312
|
+
let authWindowTimeout = sessionTimeout;
|
|
313
|
+
if (utils.isMobile()) {
|
|
314
|
+
authWindowTimeout = authWindowTimeout * 3;
|
|
315
|
+
}
|
|
311
316
|
authWindowInterval.current = setInterval(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
312
317
|
var _g;
|
|
313
318
|
shouldPool.current = false;
|
|
@@ -319,7 +324,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
319
324
|
clearInterval(authWindowInterval.current);
|
|
320
325
|
setIsProcessing(false);
|
|
321
326
|
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
322
|
-
}),
|
|
327
|
+
}), authWindowTimeout);
|
|
323
328
|
}
|
|
324
329
|
});
|
|
325
330
|
return {
|
|
@@ -2,7 +2,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
2
2
|
import { useState, useRef } from 'react';
|
|
3
3
|
import { OauthResultStatus } from '@dynamic-labs/sdk-api';
|
|
4
4
|
import { SocialOAuthErrorCode } from '@dynamic-labs/types';
|
|
5
|
-
import { SocialAccountAlreadyExistsError, NoAccessError } from '@dynamic-labs/utils';
|
|
5
|
+
import { isMobile, SocialAccountAlreadyExistsError, NoAccessError } from '@dynamic-labs/utils';
|
|
6
6
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
7
7
|
import { getOAuthResult, verifyOAuth, signInOAuth } from '../../../data/api.js';
|
|
8
8
|
import { useUpdateUserProfileByJWTCallback } from '../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
|
|
@@ -304,6 +304,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
304
304
|
// start pooling oauth result
|
|
305
305
|
shouldPool.current = true;
|
|
306
306
|
poolOauthResult(provider, state);
|
|
307
|
+
// if this is mobile, set a longer timeout to allow the user to login to the provider in the browser
|
|
308
|
+
let authWindowTimeout = sessionTimeout;
|
|
309
|
+
if (isMobile()) {
|
|
310
|
+
authWindowTimeout = authWindowTimeout * 3;
|
|
311
|
+
}
|
|
307
312
|
authWindowInterval.current = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
308
313
|
var _g;
|
|
309
314
|
shouldPool.current = false;
|
|
@@ -315,7 +320,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
315
320
|
clearInterval(authWindowInterval.current);
|
|
316
321
|
setIsProcessing(false);
|
|
317
322
|
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
318
|
-
}),
|
|
323
|
+
}), authWindowTimeout);
|
|
319
324
|
}
|
|
320
325
|
});
|
|
321
326
|
return {
|
|
@@ -38,7 +38,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
38
38
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
39
39
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
40
40
|
const { setErrorMessage, setError } = ErrorContext.useErrorContext();
|
|
41
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement,
|
|
41
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallets, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, eventsCallbacks, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
42
|
// If the user is not already logged it means that we only need to verify
|
|
43
43
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
44
44
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -136,7 +136,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
136
136
|
setView('account-exists');
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
if (
|
|
139
|
+
if (connectedWallets.length && authMode === 'connect-only') {
|
|
140
140
|
throw new utils.DynamicError(e.message);
|
|
141
141
|
}
|
|
142
142
|
goToInitialView();
|
|
@@ -34,7 +34,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
34
34
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
35
35
|
const { setView, goToInitialView } = useViewContext();
|
|
36
36
|
const { setErrorMessage, setError } = useErrorContext();
|
|
37
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement,
|
|
37
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallets, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, eventsCallbacks, } = useInternalDynamicContext();
|
|
38
38
|
// If the user is not already logged it means that we only need to verify
|
|
39
39
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
40
40
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -132,7 +132,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
132
132
|
setView('account-exists');
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
if (
|
|
135
|
+
if (connectedWallets.length && authMode === 'connect-only') {
|
|
136
136
|
throw new DynamicError(e.message);
|
|
137
137
|
}
|
|
138
138
|
goToInitialView();
|
|
@@ -3,13 +3,42 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs');
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Hook for handling events from a WalletConnector or an array of WalletConnectors.
|
|
9
|
+
* This hook allows you to specify an event to listen to and a handler function that will be called
|
|
10
|
+
* whenever the event is emitted. The handler will receive the event arguments followed by the instance
|
|
11
|
+
* of the WalletConnector that emitted the event.
|
|
12
|
+
*
|
|
13
|
+
* @template Event - The type of the event to listen for, which should be a key of WalletConnectorEventTypes.
|
|
14
|
+
*
|
|
15
|
+
* @param eventEmitters - The WalletConnector instance(s) to attach the event listener to.
|
|
16
|
+
* If an array is provided, the event listener is attached to all provided connectors.
|
|
17
|
+
* @param eventName - The name of the event to listen for.
|
|
18
|
+
* @param handler - The callback function to execute when the event is emitted.
|
|
19
|
+
* The arguments to the callback are the arguments emitted with the event, followed by the WalletConnector instance
|
|
20
|
+
* that emitted the event.
|
|
21
|
+
*
|
|
22
|
+
* @returns {void} This hook does not return anything.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Example usage of useWalletConnectorEvent
|
|
26
|
+
* const { primaryWallet } = useDynamicContext();
|
|
27
|
+
*
|
|
28
|
+
* useWalletConnectorEvent(
|
|
29
|
+
* primaryWallet?.connector,
|
|
30
|
+
* 'accountChange',
|
|
31
|
+
* ({ accounts }, connector) => {
|
|
32
|
+
* console.group('accountChange');
|
|
33
|
+
* console.log('accounts', accounts);
|
|
34
|
+
* console.log('connector that emitted', connector);
|
|
35
|
+
* console.groupEnd();
|
|
36
|
+
* },
|
|
37
|
+
* );
|
|
38
|
+
*/
|
|
8
39
|
const useWalletConnectorEvent = (eventEmitters, eventName, handler) => {
|
|
9
40
|
const callbackRef = React.useRef(handler);
|
|
10
|
-
|
|
11
|
-
callbackRef.current = handler;
|
|
12
|
-
}, [handler]);
|
|
41
|
+
callbackRef.current = handler;
|
|
13
42
|
React.useEffect(() => {
|
|
14
43
|
if (!eventEmitters)
|
|
15
44
|
return;
|
|
@@ -24,7 +53,7 @@ const useWalletConnectorEvent = (eventEmitters, eventName, handler) => {
|
|
|
24
53
|
const uniqueEventEmitters = Array.from(new Set(eventEmittersArray));
|
|
25
54
|
const unsubscribeCallbacks = uniqueEventEmitters.map((emitter) => {
|
|
26
55
|
const callback = (...args) => {
|
|
27
|
-
callbackRef.current(
|
|
56
|
+
callbackRef.current(...args, emitter);
|
|
28
57
|
};
|
|
29
58
|
emitter.on(eventName, callback);
|
|
30
59
|
return () => emitter.off(eventName, callback);
|
|
@@ -8,5 +8,37 @@ type ArgumentMap<T extends object> = {
|
|
|
8
8
|
[K in keyof T]: T[K] extends (...args: any[]) => void ? Parameters<T[K]> : T[K] extends any[] ? T[K] : any[];
|
|
9
9
|
};
|
|
10
10
|
type EventArg<Event extends keyof WalletConnectorEventTypes> = ArgumentMap<WalletConnectorEventTypes>[Extract<Event, keyof WalletConnectorEventTypes>];
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Hook for handling events from a WalletConnector or an array of WalletConnectors.
|
|
13
|
+
* This hook allows you to specify an event to listen to and a handler function that will be called
|
|
14
|
+
* whenever the event is emitted. The handler will receive the event arguments followed by the instance
|
|
15
|
+
* of the WalletConnector that emitted the event.
|
|
16
|
+
*
|
|
17
|
+
* @template Event - The type of the event to listen for, which should be a key of WalletConnectorEventTypes.
|
|
18
|
+
*
|
|
19
|
+
* @param eventEmitters - The WalletConnector instance(s) to attach the event listener to.
|
|
20
|
+
* If an array is provided, the event listener is attached to all provided connectors.
|
|
21
|
+
* @param eventName - The name of the event to listen for.
|
|
22
|
+
* @param handler - The callback function to execute when the event is emitted.
|
|
23
|
+
* The arguments to the callback are the arguments emitted with the event, followed by the WalletConnector instance
|
|
24
|
+
* that emitted the event.
|
|
25
|
+
*
|
|
26
|
+
* @returns {void} This hook does not return anything.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Example usage of useWalletConnectorEvent
|
|
30
|
+
* const { primaryWallet } = useDynamicContext();
|
|
31
|
+
*
|
|
32
|
+
* useWalletConnectorEvent(
|
|
33
|
+
* primaryWallet?.connector,
|
|
34
|
+
* 'accountChange',
|
|
35
|
+
* ({ accounts }, connector) => {
|
|
36
|
+
* console.group('accountChange');
|
|
37
|
+
* console.log('accounts', accounts);
|
|
38
|
+
* console.log('connector that emitted', connector);
|
|
39
|
+
* console.groupEnd();
|
|
40
|
+
* },
|
|
41
|
+
* );
|
|
42
|
+
*/
|
|
43
|
+
export declare const useWalletConnectorEvent: <Event_1 extends keyof WalletConnectorEventTypes = keyof WalletConnectorEventTypes>(eventEmitters: WalletConnector | WalletConnector[] | undefined, eventName: Event_1, handler: (...args: [...EventArg<Event_1>, import("@dynamic-labs/wallet-connector-core").WalletConnectorCore.WalletConnector]) => void) => void;
|
|
12
44
|
export {};
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
import { useRef, useEffect } from 'react';
|
|
2
|
-
import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
|
|
3
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Hook for handling events from a WalletConnector or an array of WalletConnectors.
|
|
5
|
+
* This hook allows you to specify an event to listen to and a handler function that will be called
|
|
6
|
+
* whenever the event is emitted. The handler will receive the event arguments followed by the instance
|
|
7
|
+
* of the WalletConnector that emitted the event.
|
|
8
|
+
*
|
|
9
|
+
* @template Event - The type of the event to listen for, which should be a key of WalletConnectorEventTypes.
|
|
10
|
+
*
|
|
11
|
+
* @param eventEmitters - The WalletConnector instance(s) to attach the event listener to.
|
|
12
|
+
* If an array is provided, the event listener is attached to all provided connectors.
|
|
13
|
+
* @param eventName - The name of the event to listen for.
|
|
14
|
+
* @param handler - The callback function to execute when the event is emitted.
|
|
15
|
+
* The arguments to the callback are the arguments emitted with the event, followed by the WalletConnector instance
|
|
16
|
+
* that emitted the event.
|
|
17
|
+
*
|
|
18
|
+
* @returns {void} This hook does not return anything.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Example usage of useWalletConnectorEvent
|
|
22
|
+
* const { primaryWallet } = useDynamicContext();
|
|
23
|
+
*
|
|
24
|
+
* useWalletConnectorEvent(
|
|
25
|
+
* primaryWallet?.connector,
|
|
26
|
+
* 'accountChange',
|
|
27
|
+
* ({ accounts }, connector) => {
|
|
28
|
+
* console.group('accountChange');
|
|
29
|
+
* console.log('accounts', accounts);
|
|
30
|
+
* console.log('connector that emitted', connector);
|
|
31
|
+
* console.groupEnd();
|
|
32
|
+
* },
|
|
33
|
+
* );
|
|
34
|
+
*/
|
|
4
35
|
const useWalletConnectorEvent = (eventEmitters, eventName, handler) => {
|
|
5
36
|
const callbackRef = useRef(handler);
|
|
6
|
-
|
|
7
|
-
callbackRef.current = handler;
|
|
8
|
-
}, [handler]);
|
|
37
|
+
callbackRef.current = handler;
|
|
9
38
|
useEffect(() => {
|
|
10
39
|
if (!eventEmitters)
|
|
11
40
|
return;
|
|
@@ -20,7 +49,7 @@ const useWalletConnectorEvent = (eventEmitters, eventName, handler) => {
|
|
|
20
49
|
const uniqueEventEmitters = Array.from(new Set(eventEmittersArray));
|
|
21
50
|
const unsubscribeCallbacks = uniqueEventEmitters.map((emitter) => {
|
|
22
51
|
const callback = (...args) => {
|
|
23
|
-
callbackRef.current(
|
|
52
|
+
callbackRef.current(...args, emitter);
|
|
24
53
|
};
|
|
25
54
|
emitter.on(eventName, callback);
|
|
26
55
|
return () => emitter.off(eventName, callback);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useWalletConnectorOptions } from './useWalletConnectorOptions';
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var data = require('../../../views/WalletList/data.cjs');
|
|
7
|
-
var
|
|
7
|
+
var verifyRequiredConnectorsAreSetup = require('./utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs');
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
|
|
10
|
+
const walletConnectorOptions = React.useMemo(() => {
|
|
11
11
|
if (!projectSettings ||
|
|
12
12
|
!Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
|
|
13
13
|
!networkConfigurations)
|
|
@@ -42,11 +42,11 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference,
|
|
|
42
42
|
networkConfigurations,
|
|
43
43
|
]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
|
-
if (!projectSettings ||
|
|
45
|
+
if (!projectSettings || walletConnectorOptions.length === 0)
|
|
46
46
|
return;
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
return {
|
|
47
|
+
verifyRequiredConnectorsAreSetup.verifyRequiredConnectorsAreSetup(projectSettings, walletConnectorOptions.map(({ walletConnector }) => walletConnector));
|
|
48
|
+
}, [walletConnectorOptions, projectSettings]);
|
|
49
|
+
return { walletConnectorOptions };
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
exports.
|
|
52
|
+
exports.useWalletConnectorOptions = useWalletConnectorOptions;
|
|
@@ -16,7 +16,7 @@ type Props = {
|
|
|
16
16
|
walletUiUtils: WalletUiUtils<WalletConnector>;
|
|
17
17
|
walletConnectorExtensions?: WalletConnectorExtension[];
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
19
|
+
export declare const useWalletConnectorOptions: ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }: Props) => {
|
|
20
|
+
walletConnectorOptions: import("../../../shared").WalletOption[];
|
|
21
21
|
};
|
|
22
22
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMemo, useEffect } from 'react';
|
|
2
2
|
import { getWallets } from '../../../views/WalletList/data.js';
|
|
3
|
-
import {
|
|
3
|
+
import { verifyRequiredConnectorsAreSetup } from './utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
|
|
6
|
+
const walletConnectorOptions = useMemo(() => {
|
|
7
7
|
if (!projectSettings ||
|
|
8
8
|
!Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
|
|
9
9
|
!networkConfigurations)
|
|
@@ -38,11 +38,11 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference,
|
|
|
38
38
|
networkConfigurations,
|
|
39
39
|
]);
|
|
40
40
|
useEffect(() => {
|
|
41
|
-
if (!projectSettings ||
|
|
41
|
+
if (!projectSettings || walletConnectorOptions.length === 0)
|
|
42
42
|
return;
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
return {
|
|
43
|
+
verifyRequiredConnectorsAreSetup(projectSettings, walletConnectorOptions.map(({ walletConnector }) => walletConnector));
|
|
44
|
+
}, [walletConnectorOptions, projectSettings]);
|
|
45
|
+
return { walletConnectorOptions };
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export {
|
|
48
|
+
export { useWalletConnectorOptions };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils = require('@dynamic-labs/utils');
|
|
6
|
+
|
|
7
|
+
class ConnectorSetupError extends utils.DynamicError {
|
|
8
|
+
constructor(providerName, connectorName) {
|
|
9
|
+
super(`${providerName} is enabled but ${connectorName} is not in your walletConnectors list. See https://docs.dynamic.xyz/react-sdk/wallet-connectors for more information.`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.ConnectorSetupError = ConnectorSetupError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
2
|
+
|
|
3
|
+
class ConnectorSetupError extends DynamicError {
|
|
4
|
+
constructor(providerName, connectorName) {
|
|
5
|
+
super(`${providerName} is enabled but ${connectorName} is not in your walletConnectors list. See https://docs.dynamic.xyz/react-sdk/wallet-connectors for more information.`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ConnectorSetupError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConnectorSetupError } from './ConnectorSetupError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './verifyRequiredConnectorsAreSetup';
|