@dynamic-labs/sdk-react-core 0.19.0-alpha.7 → 0.19.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +10 -10
- package/src/index.cjs +14 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +8 -3
- package/src/lib/Main.cjs +3 -1
- package/src/lib/Main.js +3 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +3 -3
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +3 -3
- package/src/lib/components/Divider/Divider.cjs +1 -1
- package/src/lib/components/Divider/Divider.js +1 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +4 -3
- package/src/lib/components/IconWithStatus/IconWithStatus.d.ts +2 -2
- package/src/lib/components/IconWithStatus/IconWithStatus.js +4 -3
- package/src/lib/components/MockedQrCode/MockedQrCode.cjs +1 -1
- package/src/lib/components/MockedQrCode/MockedQrCode.js +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +1 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.js +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +2 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +2 -2
- package/src/lib/components/SignMessagePreview/SignMessagePreview.cjs +27 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.d.ts +6 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.js +23 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.types.d.ts +8 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.cjs +44 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.d.ts +8 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.js +40 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/components/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.cjs +17 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.d.ts +2 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.js +13 -0
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +26 -14
- package/src/lib/components/SocialSignIn/SocialSignIn.d.ts +8 -7
- package/src/lib/components/SocialSignIn/SocialSignIn.js +26 -14
- package/src/lib/components/Toolkit/Toolkit.cjs +2 -1
- package/src/lib/components/Toolkit/Toolkit.js +2 -1
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.cjs +1 -1
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.d.ts +1 -2
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.js +1 -1
- package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/UserAvatar/UserAvatar.cjs +22 -0
- package/src/lib/components/UserAvatar/UserAvatar.d.ts +7 -0
- package/src/lib/components/UserAvatar/UserAvatar.js +18 -0
- package/src/lib/components/UserProfile/UserProfile.cjs +12 -2
- package/src/lib/components/UserProfile/UserProfile.js +12 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +16 -14
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +16 -14
- package/src/lib/components/UserProfileForm/UserProfileForm.cjs +1 -0
- package/src/lib/components/UserProfileForm/UserProfileForm.js +1 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -3
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -3
- package/src/lib/context/DynamicContext/helpers.cjs +22 -10
- package/src/lib/context/DynamicContext/helpers.d.ts +4 -2
- package/src/lib/context/DynamicContext/helpers.js +20 -10
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +1 -0
- package/src/lib/context/ErrorContext/ErrorContext.cjs +4 -1
- package/src/lib/context/ErrorContext/ErrorContext.js +4 -1
- package/src/lib/context/FundingContext/FundingContext.cjs +1 -0
- package/src/lib/context/FundingContext/FundingContext.js +1 -0
- package/src/lib/context/MockContext/MockContext.cjs +1 -1
- package/src/lib/context/MockContext/MockContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +7 -4
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +5 -5
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +7 -4
- package/src/lib/context/ViewContext/ViewContext.cjs +4 -19
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/context/ViewContext/ViewContext.js +5 -20
- package/src/lib/context/WalletContext/WalletContext.cjs +1 -1
- package/src/lib/context/WalletContext/WalletContext.js +1 -1
- package/src/lib/data/api.cjs +67 -29
- package/src/lib/data/api.d.ts +6 -3
- package/src/lib/data/api.js +68 -31
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +5 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.cjs +5 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.js +5 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +4 -3
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +4 -3
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +61 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +57 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +3 -3
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +3 -3
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +1 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -1
- package/src/lib/locale/en/translation.cjs +43 -5
- package/src/lib/locale/en/translation.js +41 -6
- package/src/lib/locale/locale.cjs +17 -4
- package/src/lib/locale/locale.d.ts +1 -0
- package/src/lib/locale/locale.js +17 -4
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -1
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +3 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +3 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +1 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +1 -1
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +1 -1
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +1 -1
- package/src/lib/shared/assets/android-face-id.cjs +61 -0
- package/src/lib/shared/assets/android-face-id.js +37 -0
- package/src/lib/shared/assets/index.d.ts +6 -0
- package/src/lib/shared/assets/iphone-face-id.cjs +53 -0
- package/src/lib/shared/assets/iphone-face-id.js +29 -0
- package/src/lib/shared/assets/iphone-touch-id.cjs +72 -0
- package/src/lib/shared/assets/iphone-touch-id.js +48 -0
- package/src/lib/shared/assets/passkey-intro-icon.cjs +97 -0
- package/src/lib/shared/assets/passkey-intro-icon.js +73 -0
- package/src/lib/shared/assets/passkey-success-icon.cjs +94 -0
- package/src/lib/shared/assets/passkey-success-icon.js +70 -0
- package/src/lib/shared/assets/user-account-2.cjs +53 -0
- package/src/lib/shared/assets/user-account-2.js +29 -0
- package/src/lib/shared/types/index.d.ts +5 -0
- package/src/lib/shared/utils/functions/wallet/createWallet.cjs +7 -5
- package/src/lib/shared/utils/functions/wallet/createWallet.js +7 -5
- 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 +4 -2
- package/src/lib/utils/constants/localStorage.d.ts +2 -1
- package/src/lib/utils/constants/localStorage.js +3 -2
- package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.cjs +11 -0
- package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.d.ts +2 -0
- package/src/lib/utils/functions/getActiveOauthCredential/getActiveOauthCredential.js +7 -0
- package/src/lib/utils/functions/getActiveOauthCredential/index.d.ts +1 -0
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.d.ts +2 -0
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/index.d.ts +1 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +72 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.d.ts +2 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +68 -0
- package/src/lib/utils/functions/getOauthLoginUrl/index.d.ts +1 -0
- package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.cjs +19 -0
- package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.d.ts +2 -0
- package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/getProviderEnumForSocialSignInProvider.js +15 -0
- package/src/lib/utils/functions/getProviderEnumForSocialSignInProvider/index.d.ts +1 -0
- package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.cjs +19 -0
- package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.d.ts +2 -0
- package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/getSocialSignInProviderForProviderEnum.js +15 -0
- package/src/lib/utils/functions/getSocialSignInProviderForProviderEnum/index.d.ts +1 -0
- package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.cjs +19 -0
- package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.d.ts +2 -0
- package/src/lib/utils/functions/getSocialSignInProviderFromString/getSocialSignInProviderFromString.js +15 -0
- package/src/lib/utils/functions/getSocialSignInProviderFromString/index.d.ts +1 -0
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -1
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +3 -0
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +3 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +1 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +1 -0
- package/src/lib/utils/functions/index.d.ts +6 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -23
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +9 -24
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +7 -3
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +7 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +4 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +5 -4
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +1 -0
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +1 -0
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +1 -0
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +1 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +10 -5
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.d.ts +3 -1
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +10 -5
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +11 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +11 -1
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +15 -1
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +15 -1
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +1 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +1 -0
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +0 -4
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +0 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +1 -0
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +15 -165
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +2 -2
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +17 -167
- package/src/lib/utils/hooks/useSocialAuth/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +277 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +20 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +273 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +1 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +1 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +14 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +14 -3
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +1 -0
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +15 -26
- package/src/lib/utils/hooks/useWallets/useWallets.js +16 -27
- package/src/lib/utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +1 -0
- package/src/lib/utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +1 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +1 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +1 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +5 -3
- package/src/lib/views/AccountExistsView/AccountExistsView.js +5 -3
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +1 -1
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +1 -1
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +4 -3
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +4 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -0
- package/src/lib/views/LoginView/LoginView.cjs +1 -1
- package/src/lib/views/LoginView/LoginView.js +1 -1
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +12 -4
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +12 -4
- package/src/lib/views/LoginView/sections/LoginWidget.d.ts +5 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +77 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.d.ts +3 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +73 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +4 -3
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.d.ts +2 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +4 -3
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +19 -4
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.d.ts +6 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +19 -4
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +4 -3
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +4 -3
- package/src/lib/views/LoginView/useLoginView.cjs +9 -10
- package/src/lib/views/LoginView/useLoginView.js +9 -10
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +2 -1
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +2 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -2
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +3 -3
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +3 -3
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +1 -1
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +1 -1
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.cjs +90 -0
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.d.ts +2 -0
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.js +86 -0
- package/src/lib/views/PasskeyIntroView/index.d.ts +1 -0
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.cjs +63 -0
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.d.ts +2 -0
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.js +59 -0
- package/src/lib/views/PasskeySuccessView/index.d.ts +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +2 -2
- package/src/lib/views/PendingConnectView/PendingConnectView.js +2 -2
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +2 -2
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +2 -2
- package/src/lib/views/QrCodeView/QRCode.cjs +3 -3
- package/src/lib/views/QrCodeView/QRCode.d.ts +2 -2
- package/src/lib/views/QrCodeView/QRCode.js +3 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +3 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.d.ts +2 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +3 -3
- package/src/lib/views/QrCodeView/QrCodeView.cjs +3 -3
- package/src/lib/views/QrCodeView/QrCodeView.js +3 -3
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -7
- package/src/lib/views/SocialRedirectView/SocialRedirectView.d.ts +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -7
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +1 -1
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +4 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +4 -2
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.js +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +1 -4
- package/src/lib/views/WalletList/WalletList.js +1 -4
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +3 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +3 -3
- package/src/lib/views/WalletList/data.cjs +3 -15
- package/src/lib/views/WalletList/data.d.ts +4 -2
- package/src/lib/views/WalletList/data.js +3 -14
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +3 -3
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +3 -3
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -1
- package/src/lib/views/viewToComponentMap.cjs +4 -0
- package/src/lib/views/viewToComponentMap.js +4 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.d.ts +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +4 -4
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +4 -4
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +19 -4
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +19 -4
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +13 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +13 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +3 -2
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +3 -2
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +7 -10
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +8 -11
- package/src/lib/widgets/DynamicWidget/hooks/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.cjs +17 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.js +13 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +4 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +8 -7
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +8 -7
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.js +2 -3
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +4 -4
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +1 -1
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +1 -1
- package/src/lib/widgets/index.d.ts +0 -1
- package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs +0 -33
- package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.js +0 -29
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs +0 -13
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.d.ts +0 -2
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.js +0 -9
- package/src/lib/widgets/OAuthIFrameContainer/index.d.ts +0 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { useState, useRef } from 'react';
|
|
3
|
+
import { OauthResultStatus } from '@dynamic-labs/sdk-api';
|
|
4
|
+
import { SocialOAuthErrorCode } from '@dynamic-labs/types';
|
|
5
|
+
import { SocialAccountAlreadyExistsError, NoAccessError } from '@dynamic-labs/utils';
|
|
6
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
7
|
+
import { getOAuthResult, verifyOAuth, signInOAuth } from '../../../data/api.js';
|
|
8
|
+
import { useUpdateUserProfileByJWTCallback } from '../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
|
|
9
|
+
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
10
|
+
import '@dynamic-labs/iconic';
|
|
11
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
12
|
+
import 'react/jsx-runtime';
|
|
13
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import { logger } from '../../../shared/logger.js';
|
|
15
|
+
import '@dynamic-labs/wallet-book';
|
|
16
|
+
import '../../constants/colors.js';
|
|
17
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
18
|
+
import 'ethers';
|
|
19
|
+
import '../../../shared/consts/index.js';
|
|
20
|
+
import '@dynamic-labs/multi-wallet';
|
|
21
|
+
import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
|
|
22
|
+
import { randomString } from '../../functions/randomString/randomString.js';
|
|
23
|
+
import { stringifyURIQuery } from '../../functions/stringifyURIQuery/stringifyURIQuery.js';
|
|
24
|
+
import { digestSHA256 } from '../../functions/digestSHA256/digestSHA256.js';
|
|
25
|
+
import { encodeBase64URL } from '../../functions/encodeBase64URL/encodeBase64URL.js';
|
|
26
|
+
import { getOauthLoginUrl } from '../../functions/getOauthLoginUrl/getOauthLoginUrl.js';
|
|
27
|
+
import { useCreateUserProfileByJWTCallback } from '../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js';
|
|
28
|
+
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
29
|
+
|
|
30
|
+
const socialProviders = [
|
|
31
|
+
'discord',
|
|
32
|
+
'facebook',
|
|
33
|
+
'github',
|
|
34
|
+
'google',
|
|
35
|
+
'instagram',
|
|
36
|
+
'twitch',
|
|
37
|
+
'twitter',
|
|
38
|
+
];
|
|
39
|
+
// pkce params are only required for twitter and break if added for other providers, like google
|
|
40
|
+
// so we should only add provider that support pkce to this list
|
|
41
|
+
const providersRequiringPkce = ['twitter', 'github'];
|
|
42
|
+
const providersWithoutWindowOpenerRefence = ['twitter'];
|
|
43
|
+
// Hook to handle common social auth logic (for social linking and social sign in)
|
|
44
|
+
const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, setIsVerificationInProgress, projectSettings, } = useInternalDynamicContext();
|
|
47
|
+
const { setView } = useViewContext();
|
|
48
|
+
const { setErrorMessage, setError: setContextError } = useErrorContext();
|
|
49
|
+
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
50
|
+
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback();
|
|
51
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
52
|
+
const [error, setError] = useState();
|
|
53
|
+
const providersWaitingOauthMessage = useRef({});
|
|
54
|
+
const authWindowInterval = useRef();
|
|
55
|
+
const shouldPool = useRef(false);
|
|
56
|
+
const userJwt = (_a = getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
57
|
+
const clearError = () => {
|
|
58
|
+
setError(undefined);
|
|
59
|
+
setContextError(undefined);
|
|
60
|
+
};
|
|
61
|
+
const handleError = (code, message) => {
|
|
62
|
+
logger.error(message);
|
|
63
|
+
setIsProcessing(false);
|
|
64
|
+
setError({ code, message });
|
|
65
|
+
setErrorMessage(code);
|
|
66
|
+
onError === null || onError === void 0 ? void 0 : onError();
|
|
67
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
68
|
+
};
|
|
69
|
+
const poolOauthResult = (provider, state) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
+
if (!shouldPool.current) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const result = yield getOAuthResult(environmentId, provider, {
|
|
74
|
+
state,
|
|
75
|
+
});
|
|
76
|
+
if ((result === null || result === void 0 ? void 0 : result.status) !== OauthResultStatus.Completed) {
|
|
77
|
+
setTimeout(() => poolOauthResult(provider, state), 1000);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
shouldPool.current = false;
|
|
81
|
+
const authMessage = {
|
|
82
|
+
code: result === null || result === void 0 ? void 0 : result.code,
|
|
83
|
+
error: result === null || result === void 0 ? void 0 : result.error,
|
|
84
|
+
provider,
|
|
85
|
+
type: 'authorization_response',
|
|
86
|
+
};
|
|
87
|
+
window.postMessage(authMessage, '*');
|
|
88
|
+
});
|
|
89
|
+
const checkValidProvider = (provider) => {
|
|
90
|
+
if (!provider) {
|
|
91
|
+
handleError(SocialOAuthErrorCode.NO_PROVIDER, 'Provider is required');
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!socialProviders.includes(provider)) {
|
|
95
|
+
handleError(SocialOAuthErrorCode.INVALID_PROVIDER, `Invalid social provider. Valid providers are: ${socialProviders.join(', ')}`);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
};
|
|
100
|
+
const linkAccount = (provider, code, verifier, state) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
+
try {
|
|
102
|
+
const jwt = yield verifyOAuth(environmentId, provider, {
|
|
103
|
+
code,
|
|
104
|
+
codeVerifier: verifier,
|
|
105
|
+
state,
|
|
106
|
+
}, String(userJwt));
|
|
107
|
+
if (!jwt) {
|
|
108
|
+
handleError(SocialOAuthErrorCode.VERIFICATION_ERROR, `Failed to link social account: ${provider}`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
yield updateUserProfileByJWT(jwt);
|
|
112
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (error instanceof SocialAccountAlreadyExistsError) {
|
|
116
|
+
handleError(SocialOAuthErrorCode.ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_PROFILE, `Social account already linked to a different profile: ${provider}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const signInAccount = (provider, code, verifier, state) => __awaiter(void 0, void 0, void 0, function* () {
|
|
121
|
+
try {
|
|
122
|
+
const jwt = yield signInOAuth(environmentId, provider, {
|
|
123
|
+
code,
|
|
124
|
+
codeVerifier: verifier,
|
|
125
|
+
state,
|
|
126
|
+
});
|
|
127
|
+
if (!jwt) {
|
|
128
|
+
handleError(SocialOAuthErrorCode.SIGNIN_ERROR, `Failed to sign-in with social account: ${provider}`);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
setIsVerificationInProgress(true);
|
|
132
|
+
const decodedJwt = decodeJwt(jwt);
|
|
133
|
+
if (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields.length) {
|
|
134
|
+
setOnboardingOnlyJwt(jwt);
|
|
135
|
+
setView('collect-user-data-login-with-email');
|
|
136
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
setCallback('authSuccess');
|
|
140
|
+
yield createUserProfileByJWT(jwt);
|
|
141
|
+
setShowAuthFlow(false);
|
|
142
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
if (error instanceof NoAccessError) {
|
|
146
|
+
setView('no-access');
|
|
147
|
+
}
|
|
148
|
+
handleError(SocialOAuthErrorCode.GENERAL_ERROR, error);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
const connectSocialAccount = (provider, validator) => __awaiter(void 0, void 0, void 0, function* () {
|
|
152
|
+
var _b, _c;
|
|
153
|
+
clearInterval(authWindowInterval.current);
|
|
154
|
+
clearError();
|
|
155
|
+
setIsProcessing(true);
|
|
156
|
+
if (!checkValidProvider(provider)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
// invalid connect request
|
|
160
|
+
if (validator && !validator(provider)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const authWindow = window.open('', '_blank', 'width=500,height=600');
|
|
164
|
+
const state = randomString(8);
|
|
165
|
+
const verifier = randomString(43);
|
|
166
|
+
const clearListeners = () => {
|
|
167
|
+
window.removeEventListener('message', handleAuthWindowMessage);
|
|
168
|
+
providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: false });
|
|
169
|
+
};
|
|
170
|
+
const handleAuthWindowMessage = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
171
|
+
var _d;
|
|
172
|
+
const message = event.data;
|
|
173
|
+
const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
|
|
174
|
+
if (isAuthorizationMessage) {
|
|
175
|
+
logger.debug('Message received', { data: message });
|
|
176
|
+
}
|
|
177
|
+
const isValidMessage = isAuthorizationMessage && (message === null || message === void 0 ? void 0 : message.provider) === provider;
|
|
178
|
+
// don't process invalid messages for provider
|
|
179
|
+
if (!isValidMessage) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
setIsProcessing(true);
|
|
183
|
+
if (!((_d = providersWaitingOauthMessage.current) === null || _d === void 0 ? void 0 : _d[provider])) {
|
|
184
|
+
handleError(SocialOAuthErrorCode.SESSION_TIMEOUT, `Connecting ${provider} account session timeout.`);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
clearListeners();
|
|
188
|
+
const { code, error } = message;
|
|
189
|
+
if (error && error !== 'undefined') {
|
|
190
|
+
handleError(SocialOAuthErrorCode.OAUTH_ERROR, `Failed to connect ${provider} social account: ${error}`);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (!code) {
|
|
194
|
+
handleError(SocialOAuthErrorCode.NO_AUTH_CODE, `Failed to connect ${provider} social account: no authorization code`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (authMode === 'signin') {
|
|
198
|
+
yield signInAccount(provider, code, verifier, state);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
yield linkAccount(provider, code, verifier, state);
|
|
202
|
+
}
|
|
203
|
+
setIsProcessing(false);
|
|
204
|
+
});
|
|
205
|
+
const loginUrl = getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider, environmentId);
|
|
206
|
+
if (!loginUrl) {
|
|
207
|
+
handleError(SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
let oauthLoginUrl = loginUrl;
|
|
211
|
+
if (providersRequiringPkce.includes(provider)) {
|
|
212
|
+
const digest = yield digestSHA256(verifier);
|
|
213
|
+
const pkceParams = stringifyURIQuery({
|
|
214
|
+
code_challenge: encodeBase64URL(digest),
|
|
215
|
+
code_challenge_method: 'S256',
|
|
216
|
+
state: state,
|
|
217
|
+
});
|
|
218
|
+
oauthLoginUrl = `${loginUrl}&${pkceParams}`;
|
|
219
|
+
}
|
|
220
|
+
if (!((_c = providersWaitingOauthMessage.current) === null || _c === void 0 ? void 0 : _c[provider])) {
|
|
221
|
+
window.addEventListener('message', handleAuthWindowMessage);
|
|
222
|
+
providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: true });
|
|
223
|
+
}
|
|
224
|
+
authWindow === null || authWindow === void 0 ? void 0 : authWindow.location.assign(oauthLoginUrl);
|
|
225
|
+
if (!providersWithoutWindowOpenerRefence.includes(provider)) {
|
|
226
|
+
// For provider that support window.opener, we need to clear all states/listeners when the window is closed
|
|
227
|
+
authWindowInterval.current = setInterval(() => {
|
|
228
|
+
var _a;
|
|
229
|
+
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed)) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
clearInterval(authWindowInterval.current);
|
|
233
|
+
setIsProcessing(false);
|
|
234
|
+
// user didn't complete oauth
|
|
235
|
+
if ((_a = providersWaitingOauthMessage.current) === null || _a === void 0 ? void 0 : _a[provider]) {
|
|
236
|
+
onError === null || onError === void 0 ? void 0 : onError();
|
|
237
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
238
|
+
}
|
|
239
|
+
}, 2000);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
// For provider that don't support window.opener, we need to use a timeout to pool the oauth result
|
|
243
|
+
// If we don't get a valid result in {async sessionTimeout} ms, we'll assume the user closed the window
|
|
244
|
+
// and we'll clear all states/listeners
|
|
245
|
+
// start pooling oauth result
|
|
246
|
+
shouldPool.current = true;
|
|
247
|
+
poolOauthResult(provider, state);
|
|
248
|
+
authWindowInterval.current = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
|
+
var _e;
|
|
250
|
+
shouldPool.current = false;
|
|
251
|
+
// clear all states/listeners, assuming user closed the window before completing oauth
|
|
252
|
+
if ((_e = providersWaitingOauthMessage.current) === null || _e === void 0 ? void 0 : _e[provider]) {
|
|
253
|
+
clearListeners();
|
|
254
|
+
handleError(SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Connecting ${provider} account window timeout.`);
|
|
255
|
+
}
|
|
256
|
+
clearInterval(authWindowInterval.current);
|
|
257
|
+
setIsProcessing(false);
|
|
258
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
259
|
+
}), sessionTimeout);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
return {
|
|
263
|
+
checkValidProvider,
|
|
264
|
+
connectSocialAccount,
|
|
265
|
+
error,
|
|
266
|
+
handleError,
|
|
267
|
+
isProcessing,
|
|
268
|
+
setError,
|
|
269
|
+
setIsProcessing,
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export { useSocialAuth };
|
|
@@ -24,6 +24,7 @@ var isEmailVerificationRequired = require('../../../functions/authenication/isEm
|
|
|
24
24
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
25
25
|
require('@dynamic-labs/multi-wallet');
|
|
26
26
|
require('@dynamic-labs/sdk-api');
|
|
27
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
27
28
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
29
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
29
30
|
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
@@ -20,6 +20,7 @@ import { isEmailVerificationRequired } from '../../../functions/authenication/is
|
|
|
20
20
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
21
21
|
import '@dynamic-labs/multi-wallet';
|
|
22
22
|
import '@dynamic-labs/sdk-api';
|
|
23
|
+
import '../../../../config/ApiEndpoint.js';
|
|
23
24
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
25
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
25
26
|
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
@@ -23,6 +23,7 @@ require('../../../shared/consts/index.cjs');
|
|
|
23
23
|
var getVerifyArgs = require('../../functions/getVerifyArgs/getVerifyArgs.cjs');
|
|
24
24
|
var createUserProfile = require('../../functions/createUserProfile/createUserProfile.cjs');
|
|
25
25
|
require('@dynamic-labs/sdk-api');
|
|
26
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
26
27
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
27
28
|
var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
28
29
|
var getSiweStatement = require('../../functions/getSiweStatement/getSiweStatement.cjs');
|
|
@@ -38,7 +39,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
38
39
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
39
40
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
40
41
|
const { setErrorMessage, setError } = ErrorContext.useErrorContext();
|
|
41
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, eventsCallbacks, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
43
|
// If the user is not already logged it means that we only need to verify
|
|
43
44
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
44
45
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -68,7 +69,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
68
69
|
if (Jwt === undefined)
|
|
69
70
|
throw new utils.DynamicError('Could not obtain a valid JWT');
|
|
70
71
|
// TODO DYN-523: add verification here that the JWT is valid with the publicKey
|
|
71
|
-
return Jwt;
|
|
72
|
+
return { Jwt, verifyArgs };
|
|
72
73
|
});
|
|
73
74
|
// Overrides the stored primary wallet id when the
|
|
74
75
|
// user logs in for the first time.
|
|
@@ -149,13 +150,23 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
149
150
|
}
|
|
150
151
|
};
|
|
151
152
|
return ({ walletConnector, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
153
|
+
var _a;
|
|
152
154
|
const walletProvider = getWalletProvider.getWalletProvider(walletConnector);
|
|
153
155
|
try {
|
|
154
156
|
setIsVerificationInProgress(true);
|
|
155
|
-
const Jwt = yield generateJWT(walletConnector, walletProvider, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth);
|
|
157
|
+
const { Jwt, verifyArgs } = yield generateJWT(walletConnector, walletProvider, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth);
|
|
156
158
|
const decodedJwt = decodeJwt.decodeJwt(Jwt);
|
|
157
159
|
if (decodedJwt === undefined)
|
|
158
160
|
throw new utils.DynamicError('Invalid token!');
|
|
161
|
+
try {
|
|
162
|
+
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onSignedMessage) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, {
|
|
163
|
+
messageToSign: verifyArgs.messageToSign,
|
|
164
|
+
signedMessage: verifyArgs.signedMessage,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
catch (_b) {
|
|
168
|
+
logger.logger.warn('Error calling onSignedMessage callback');
|
|
169
|
+
}
|
|
159
170
|
const user = yield createUserProfile.createUserProfile(decodedJwt);
|
|
160
171
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
161
172
|
setOnboardingOnlyJwt(Jwt);
|
|
@@ -19,6 +19,7 @@ import '../../../shared/consts/index.js';
|
|
|
19
19
|
import { getVerifyArgs } from '../../functions/getVerifyArgs/getVerifyArgs.js';
|
|
20
20
|
import { createUserProfile } from '../../functions/createUserProfile/createUserProfile.js';
|
|
21
21
|
import '@dynamic-labs/sdk-api';
|
|
22
|
+
import '../../../config/ApiEndpoint.js';
|
|
22
23
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
23
24
|
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
24
25
|
import { getSiweStatement } from '../../functions/getSiweStatement/getSiweStatement.js';
|
|
@@ -34,7 +35,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
34
35
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
35
36
|
const { setView, goToInitialView } = useViewContext();
|
|
36
37
|
const { setErrorMessage, setError } = useErrorContext();
|
|
37
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, } = useInternalDynamicContext();
|
|
38
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, removeConnectedWalletsInfo, setIsVerificationInProgress, eventsCallbacks, } = useInternalDynamicContext();
|
|
38
39
|
// If the user is not already logged it means that we only need to verify
|
|
39
40
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
40
41
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -64,7 +65,7 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
64
65
|
if (Jwt === undefined)
|
|
65
66
|
throw new DynamicError('Could not obtain a valid JWT');
|
|
66
67
|
// TODO DYN-523: add verification here that the JWT is valid with the publicKey
|
|
67
|
-
return Jwt;
|
|
68
|
+
return { Jwt, verifyArgs };
|
|
68
69
|
});
|
|
69
70
|
// Overrides the stored primary wallet id when the
|
|
70
71
|
// user logs in for the first time.
|
|
@@ -145,13 +146,23 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
145
146
|
}
|
|
146
147
|
};
|
|
147
148
|
return ({ walletConnector, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
|
+
var _a;
|
|
148
150
|
const walletProvider = getWalletProvider(walletConnector);
|
|
149
151
|
try {
|
|
150
152
|
setIsVerificationInProgress(true);
|
|
151
|
-
const Jwt = yield generateJWT(walletConnector, walletProvider, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth);
|
|
153
|
+
const { Jwt, verifyArgs } = yield generateJWT(walletConnector, walletProvider, fetchPublicAddressOpts, publicWalletAddress, captchaToken, oauth);
|
|
152
154
|
const decodedJwt = decodeJwt(Jwt);
|
|
153
155
|
if (decodedJwt === undefined)
|
|
154
156
|
throw new DynamicError('Invalid token!');
|
|
157
|
+
try {
|
|
158
|
+
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onSignedMessage) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, {
|
|
159
|
+
messageToSign: verifyArgs.messageToSign,
|
|
160
|
+
signedMessage: verifyArgs.signedMessage,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
catch (_b) {
|
|
164
|
+
logger.warn('Error calling onSignedMessage callback');
|
|
165
|
+
}
|
|
155
166
|
const user = yield createUserProfile(decodedJwt);
|
|
156
167
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
157
168
|
setOnboardingOnlyJwt(Jwt);
|
|
@@ -18,6 +18,7 @@ require('ethers');
|
|
|
18
18
|
require('../../../shared/consts/index.cjs');
|
|
19
19
|
require('@dynamic-labs/multi-wallet');
|
|
20
20
|
var getReferencedAccount = require('../../functions/getReferencedAccount/getReferencedAccount.cjs');
|
|
21
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* This function will use a referenced account to kick off the social wallet
|
|
@@ -14,6 +14,7 @@ import 'ethers';
|
|
|
14
14
|
import '../../../shared/consts/index.js';
|
|
15
15
|
import '@dynamic-labs/multi-wallet';
|
|
16
16
|
import { getReferencedAccount } from '../../functions/getReferencedAccount/getReferencedAccount.js';
|
|
17
|
+
import '../../../config/ApiEndpoint.js';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* This function will use a referenced account to kick off the social wallet
|
|
@@ -19,6 +19,7 @@ var isSameWalletName = require('../../../../functions/isSameWalletName/isSameWal
|
|
|
19
19
|
require('@dynamic-labs/multi-wallet');
|
|
20
20
|
require('@dynamic-labs/sdk-api');
|
|
21
21
|
var shouldManuallyReconnectOnRefresh = require('../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
22
|
+
require('../../../../../config/ApiEndpoint.cjs');
|
|
22
23
|
|
|
23
24
|
const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
|
|
24
25
|
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
@@ -15,6 +15,7 @@ import { isSameWalletName } from '../../../../functions/isSameWalletName/isSameW
|
|
|
15
15
|
import '@dynamic-labs/multi-wallet';
|
|
16
16
|
import '@dynamic-labs/sdk-api';
|
|
17
17
|
import { shouldManuallyReconnectOnRefresh } from '../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
18
|
+
import '../../../../../config/ApiEndpoint.js';
|
|
18
19
|
|
|
19
20
|
const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
|
|
20
21
|
const decodedJwt = decodeJwt(authToken);
|
|
@@ -21,9 +21,9 @@ require('ethers');
|
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
23
|
var requiresTwoStepAuthentication = require('../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs');
|
|
24
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
24
25
|
var isSelectedWalletAlreadyConnected = require('../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs');
|
|
25
26
|
var useConnectAndSign = require('../authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
|
|
26
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
27
27
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
28
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
29
29
|
var useConnectAndSignSplitSteps = require('../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
@@ -17,9 +17,9 @@ import 'ethers';
|
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
19
|
import { requiresTwoStepAuthentication } from '../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js';
|
|
20
|
+
import '../../../config/ApiEndpoint.js';
|
|
20
21
|
import { isSelectedWalletAlreadyConnected } from '../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js';
|
|
21
22
|
import { useConnectAndSign } from '../authenticationHooks/useConnectAndSign/useConnectAndSign.js';
|
|
22
|
-
import '../../../config/ApiEndpoint.js';
|
|
23
23
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
24
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
25
25
|
import { useConnectAndSignSplitSteps } from '../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
@@ -20,6 +20,7 @@ require('ethers');
|
|
|
20
20
|
require('../../../shared/consts/index.cjs');
|
|
21
21
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
23
24
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
24
25
|
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
25
26
|
require('react-dom');
|
|
@@ -27,7 +28,6 @@ require('react-focus-lock');
|
|
|
27
28
|
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
28
29
|
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
29
30
|
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
30
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
31
31
|
require('@dynamic-labs/rpc-providers');
|
|
32
32
|
require('../useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
33
33
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
@@ -16,6 +16,7 @@ import 'ethers';
|
|
|
16
16
|
import '../../../shared/consts/index.js';
|
|
17
17
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
|
+
import '../../../config/ApiEndpoint.js';
|
|
19
20
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
20
21
|
import '../../../context/ThemeContext/ThemeContext.js';
|
|
21
22
|
import 'react-dom';
|
|
@@ -23,7 +24,6 @@ import 'react-focus-lock';
|
|
|
23
24
|
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
24
25
|
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
25
26
|
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
26
|
-
import '../../../config/ApiEndpoint.js';
|
|
27
27
|
import '@dynamic-labs/rpc-providers';
|
|
28
28
|
import '../useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
29
29
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
@@ -10,33 +10,22 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference,
|
|
|
10
10
|
const wallets = React.useMemo(() => {
|
|
11
11
|
if (!projectSettings || !Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length)
|
|
12
12
|
return [];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
return data.getWallets({
|
|
14
|
+
getSupportedWalletOpts: {
|
|
15
|
+
appLogoUrl,
|
|
16
|
+
appName,
|
|
17
|
+
customerApiProviders: projectSettings.providers || [],
|
|
18
|
+
deepLinkPreference,
|
|
19
|
+
flowNetwork,
|
|
20
|
+
networkConfigurations,
|
|
21
|
+
skipMemo: true,
|
|
22
|
+
walletBook,
|
|
23
|
+
walletConnectV1Bridge,
|
|
24
|
+
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
25
|
+
walletUiUtils,
|
|
26
|
+
},
|
|
27
|
+
settings: projectSettings,
|
|
25
28
|
});
|
|
26
|
-
const notInstalledWallets = data.getNotInstalledWallets(projectSettings, {
|
|
27
|
-
appLogoUrl,
|
|
28
|
-
appName,
|
|
29
|
-
customerApiProviders: projectSettings.providers || [],
|
|
30
|
-
deepLinkPreference,
|
|
31
|
-
flowNetwork,
|
|
32
|
-
networkConfigurations,
|
|
33
|
-
skipMemo: true,
|
|
34
|
-
walletBook,
|
|
35
|
-
walletConnectV1Bridge,
|
|
36
|
-
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
37
|
-
walletUiUtils,
|
|
38
|
-
});
|
|
39
|
-
return [...installedWallets, ...notInstalledWallets];
|
|
40
29
|
// Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
|
|
41
30
|
}, [
|
|
42
31
|
appLogoUrl,
|
|
@@ -1,38 +1,27 @@
|
|
|
1
1
|
import { useMemo, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { getWallets } from '../../../views/WalletList/data.js';
|
|
3
3
|
import { verifyMagicIsSetup } from './utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
4
4
|
|
|
5
5
|
const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
6
6
|
const wallets = useMemo(() => {
|
|
7
7
|
if (!projectSettings || !Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length)
|
|
8
8
|
return [];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
return getWallets({
|
|
10
|
+
getSupportedWalletOpts: {
|
|
11
|
+
appLogoUrl,
|
|
12
|
+
appName,
|
|
13
|
+
customerApiProviders: projectSettings.providers || [],
|
|
14
|
+
deepLinkPreference,
|
|
15
|
+
flowNetwork,
|
|
16
|
+
networkConfigurations,
|
|
17
|
+
skipMemo: true,
|
|
18
|
+
walletBook,
|
|
19
|
+
walletConnectV1Bridge,
|
|
20
|
+
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
21
|
+
walletUiUtils,
|
|
22
|
+
},
|
|
23
|
+
settings: projectSettings,
|
|
21
24
|
});
|
|
22
|
-
const notInstalledWallets = getNotInstalledWallets(projectSettings, {
|
|
23
|
-
appLogoUrl,
|
|
24
|
-
appName,
|
|
25
|
-
customerApiProviders: projectSettings.providers || [],
|
|
26
|
-
deepLinkPreference,
|
|
27
|
-
flowNetwork,
|
|
28
|
-
networkConfigurations,
|
|
29
|
-
skipMemo: true,
|
|
30
|
-
walletBook,
|
|
31
|
-
walletConnectV1Bridge,
|
|
32
|
-
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
33
|
-
walletUiUtils,
|
|
34
|
-
});
|
|
35
|
-
return [...installedWallets, ...notInstalledWallets];
|
|
36
25
|
// Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
|
|
37
26
|
}, [
|
|
38
27
|
appLogoUrl,
|
|
@@ -17,6 +17,7 @@ require('ethers');
|
|
|
17
17
|
require('../../../../../shared/consts/index.cjs');
|
|
18
18
|
require('@dynamic-labs/multi-wallet');
|
|
19
19
|
var isProviderEnabled = require('../../../../functions/isProviderEnabled/isProviderEnabled.cjs');
|
|
20
|
+
require('../../../../../config/ApiEndpoint.cjs');
|
|
20
21
|
|
|
21
22
|
const MissingMagicSetupError = new utils.DynamicError('Magic is enabled but @dynamic-labs/magic package is not set up.\nSee https://docs.dynamic.xyz/docs/reduce-bundle-size-with-modular-sdk for more information');
|
|
22
23
|
const magicEmailOtpWalletConnectorKey = 'magicemailotp';
|
|
@@ -13,6 +13,7 @@ import 'ethers';
|
|
|
13
13
|
import '../../../../../shared/consts/index.js';
|
|
14
14
|
import '@dynamic-labs/multi-wallet';
|
|
15
15
|
import { isProviderEnabled } from '../../../../functions/isProviderEnabled/isProviderEnabled.js';
|
|
16
|
+
import '../../../../../config/ApiEndpoint.js';
|
|
16
17
|
|
|
17
18
|
const MissingMagicSetupError = new DynamicError('Magic is enabled but @dynamic-labs/magic package is not set up.\nSee https://docs.dynamic.xyz/docs/reduce-bundle-size-with-modular-sdk for more information');
|
|
18
19
|
const magicEmailOtpWalletConnectorKey = 'magicemailotp';
|
|
@@ -18,6 +18,7 @@ require('ethers');
|
|
|
18
18
|
require('../../../shared/consts/index.cjs');
|
|
19
19
|
require('@dynamic-labs/multi-wallet');
|
|
20
20
|
var isWalletConnected = require('../../functions/isWalletConnected/isWalletConnected.cjs');
|
|
21
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
21
22
|
|
|
22
23
|
const connectedWalletStateReducer = (state, connectedWalletsMap) => {
|
|
23
24
|
const isConnectedWalletsMapEmpty = Object.values(connectedWalletsMap).length === 0;
|
|
@@ -14,6 +14,7 @@ import 'ethers';
|
|
|
14
14
|
import '../../../shared/consts/index.js';
|
|
15
15
|
import '@dynamic-labs/multi-wallet';
|
|
16
16
|
import { isWalletConnected } from '../../functions/isWalletConnected/isWalletConnected.js';
|
|
17
|
+
import '../../../config/ApiEndpoint.js';
|
|
17
18
|
|
|
18
19
|
const connectedWalletStateReducer = (state, connectedWalletsMap) => {
|
|
19
20
|
const isConnectedWalletsMapEmpty = Object.values(connectedWalletsMap).length === 0;
|