@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
package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var index = require('../../functions/storeAuthToken/index.cjs');
|
|
|
21
21
|
require('@dynamic-labs/multi-wallet');
|
|
22
22
|
var createUserProfile = require('../../functions/createUserProfile/createUserProfile.cjs');
|
|
23
23
|
require('@dynamic-labs/sdk-api');
|
|
24
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
24
25
|
|
|
25
26
|
const useCreateUserProfileByJWTCallback = () => {
|
|
26
27
|
const { setUser, handleLogOut } = useInternalDynamicContext.useInternalDynamicContext();
|
package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js
CHANGED
|
@@ -17,6 +17,7 @@ import { storeAuthToken } from '../../functions/storeAuthToken/index.js';
|
|
|
17
17
|
import '@dynamic-labs/multi-wallet';
|
|
18
18
|
import { createUserProfile } from '../../functions/createUserProfile/createUserProfile.js';
|
|
19
19
|
import '@dynamic-labs/sdk-api';
|
|
20
|
+
import '../../../config/ApiEndpoint.js';
|
|
20
21
|
|
|
21
22
|
const useCreateUserProfileByJWTCallback = () => {
|
|
22
23
|
const { setUser, handleLogOut } = useInternalDynamicContext();
|
|
@@ -6,7 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var reactI18next = require('react-i18next');
|
|
7
7
|
var iconic = require('@dynamic-labs/iconic');
|
|
8
8
|
|
|
9
|
-
const useDynamicLayoutData = ({ view }) => {
|
|
9
|
+
const useDynamicLayoutData = ({ view, authMode, }) => {
|
|
10
10
|
const { t } = reactI18next.useTranslation();
|
|
11
11
|
if (view === 'no-access') {
|
|
12
12
|
const headerData = {
|
|
@@ -21,14 +21,17 @@ const useDynamicLayoutData = ({ view }) => {
|
|
|
21
21
|
'login-with-wallet-only': {
|
|
22
22
|
heading: t('dyn_login.helper.wallet_only'),
|
|
23
23
|
},
|
|
24
|
+
'passkey-intro': {
|
|
25
|
+
heading: t('dyn_passkey_intro.helper.title'),
|
|
26
|
+
},
|
|
24
27
|
'pending-connect': {
|
|
25
|
-
heading: t('dyn_login.helper.pending_connect'),
|
|
28
|
+
heading: t('dyn_login.helper.pending_connect.title'),
|
|
26
29
|
},
|
|
27
30
|
'pending-signature': {
|
|
28
|
-
heading: t('dyn_login.helper.pending_signature'),
|
|
31
|
+
heading: t('dyn_login.helper.pending_signature.title'),
|
|
29
32
|
},
|
|
30
33
|
'pending-signature-without-back-button': {
|
|
31
|
-
heading: t('dyn_login.helper.pending_signature_without_back_button'),
|
|
34
|
+
heading: t('dyn_login.helper.pending_signature_without_back_button.title'),
|
|
32
35
|
},
|
|
33
36
|
'qr-code': {
|
|
34
37
|
heading: t('dyn_login.helper.qr_code.title'),
|
|
@@ -53,7 +56,9 @@ const useDynamicLayoutData = ({ view }) => {
|
|
|
53
56
|
heading: t('dyn_login.title.wallet_only'),
|
|
54
57
|
},
|
|
55
58
|
'multi-wallet-wallet-list': {
|
|
56
|
-
heading:
|
|
59
|
+
heading: authMode === 'connect-only'
|
|
60
|
+
? t('dyn_wallet_list.title.connect')
|
|
61
|
+
: t('dyn_wallet_list.title.link'),
|
|
57
62
|
},
|
|
58
63
|
'wallet-connect-mobile-wallets-list': {
|
|
59
64
|
heading: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(iconic.WalletConnectIcon, { style: { height: '1.5rem', width: '1.5rem' } }), ' ', t('dyn_wallet_conect.mobile.wallet_list.title')] })),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ViewType } from '../../../context/ViewContext';
|
|
3
|
+
import { AuthModeType } from '../../../shared';
|
|
3
4
|
interface FooterContentProps {
|
|
4
5
|
heading: string;
|
|
5
6
|
}
|
|
@@ -8,8 +9,9 @@ interface HeaderContentProps {
|
|
|
8
9
|
}
|
|
9
10
|
interface DynamicLayoutProps {
|
|
10
11
|
view: ViewType;
|
|
12
|
+
authMode: AuthModeType;
|
|
11
13
|
}
|
|
12
|
-
export declare const useDynamicLayoutData: ({ view }: DynamicLayoutProps) => {
|
|
14
|
+
export declare const useDynamicLayoutData: ({ view, authMode, }: DynamicLayoutProps) => {
|
|
13
15
|
headerData: {
|
|
14
16
|
heading: any;
|
|
15
17
|
};
|
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { WalletConnectIcon } from '@dynamic-labs/iconic';
|
|
4
4
|
|
|
5
|
-
const useDynamicLayoutData = ({ view }) => {
|
|
5
|
+
const useDynamicLayoutData = ({ view, authMode, }) => {
|
|
6
6
|
const { t } = useTranslation();
|
|
7
7
|
if (view === 'no-access') {
|
|
8
8
|
const headerData = {
|
|
@@ -17,14 +17,17 @@ const useDynamicLayoutData = ({ view }) => {
|
|
|
17
17
|
'login-with-wallet-only': {
|
|
18
18
|
heading: t('dyn_login.helper.wallet_only'),
|
|
19
19
|
},
|
|
20
|
+
'passkey-intro': {
|
|
21
|
+
heading: t('dyn_passkey_intro.helper.title'),
|
|
22
|
+
},
|
|
20
23
|
'pending-connect': {
|
|
21
|
-
heading: t('dyn_login.helper.pending_connect'),
|
|
24
|
+
heading: t('dyn_login.helper.pending_connect.title'),
|
|
22
25
|
},
|
|
23
26
|
'pending-signature': {
|
|
24
|
-
heading: t('dyn_login.helper.pending_signature'),
|
|
27
|
+
heading: t('dyn_login.helper.pending_signature.title'),
|
|
25
28
|
},
|
|
26
29
|
'pending-signature-without-back-button': {
|
|
27
|
-
heading: t('dyn_login.helper.pending_signature_without_back_button'),
|
|
30
|
+
heading: t('dyn_login.helper.pending_signature_without_back_button.title'),
|
|
28
31
|
},
|
|
29
32
|
'qr-code': {
|
|
30
33
|
heading: t('dyn_login.helper.qr_code.title'),
|
|
@@ -49,7 +52,9 @@ const useDynamicLayoutData = ({ view }) => {
|
|
|
49
52
|
heading: t('dyn_login.title.wallet_only'),
|
|
50
53
|
},
|
|
51
54
|
'multi-wallet-wallet-list': {
|
|
52
|
-
heading:
|
|
55
|
+
heading: authMode === 'connect-only'
|
|
56
|
+
? t('dyn_wallet_list.title.connect')
|
|
57
|
+
: t('dyn_wallet_list.title.link'),
|
|
53
58
|
},
|
|
54
59
|
'wallet-connect-mobile-wallets-list': {
|
|
55
60
|
heading: (jsxs(Fragment, { children: [jsx(WalletConnectIcon, { style: { height: '1.5rem', width: '1.5rem' } }), ' ', t('dyn_wallet_conect.mobile.wallet_list.title')] })),
|
|
@@ -21,6 +21,7 @@ require('../../../shared/consts/index.cjs');
|
|
|
21
21
|
var validators = require('../../../context/DynamicContext/validators.cjs');
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
23
|
var index = require('../../functions/getEnabledProviders/index.cjs');
|
|
24
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
24
25
|
|
|
25
26
|
const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, dynamicContextProps, }) => {
|
|
26
27
|
const [lsSettings, setLsSettings, removeLsSettings] = useLocalStorage.useLocalStorage(localStorage.PROJECT_SETTINGS_STORAGE_KEY, undefined, validators.validateLocalStorageExpiry);
|
|
@@ -44,7 +45,16 @@ const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, dyn
|
|
|
44
45
|
environmentId &&
|
|
45
46
|
retries < maxRetries) {
|
|
46
47
|
setLoading(true);
|
|
47
|
-
|
|
48
|
+
// we ReactNode components are not being serialized properly
|
|
49
|
+
// remove them for now and deal with them later
|
|
50
|
+
// context: https://linear.app/dynamic-labs/issue/GVTY-328/[starknet]-sdk-api-is-not-serializing-react-components
|
|
51
|
+
// future work: https://linear.app/dynamic-labs/issue/GVTY-330/bug-figure-out-why-react-components-are-not
|
|
52
|
+
const updatedDynamicProps = {
|
|
53
|
+
settings: Object.assign(Object.assign({}, dynamicContextProps.settings), { customPrivacyPolicy: Boolean(dynamicContextProps.settings.customPrivacyPolicy), customTermsOfServices: Boolean(dynamicContextProps.settings.customTermsOfServices), policiesConsentInnerComponent: Boolean(dynamicContextProps.settings.policiesConsentInnerComponent) }),
|
|
54
|
+
};
|
|
55
|
+
api.sendDynamicProps(environmentId, {
|
|
56
|
+
dynamicContextProps: updatedDynamicProps,
|
|
57
|
+
});
|
|
48
58
|
api.fetchProjectSettings(environmentId)
|
|
49
59
|
.then((response) => {
|
|
50
60
|
if (!response)
|
|
@@ -17,6 +17,7 @@ import '../../../shared/consts/index.js';
|
|
|
17
17
|
import { validateLocalStorageExpiry } from '../../../context/DynamicContext/validators.js';
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
19
|
import { getEnabledProviders } from '../../functions/getEnabledProviders/index.js';
|
|
20
|
+
import '../../../config/ApiEndpoint.js';
|
|
20
21
|
|
|
21
22
|
const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, dynamicContextProps, }) => {
|
|
22
23
|
const [lsSettings, setLsSettings, removeLsSettings] = useLocalStorage(PROJECT_SETTINGS_STORAGE_KEY, undefined, validateLocalStorageExpiry);
|
|
@@ -40,7 +41,16 @@ const useFetchProjectSettings = ({ authToken, environmentId, maxRetries = 2, dyn
|
|
|
40
41
|
environmentId &&
|
|
41
42
|
retries < maxRetries) {
|
|
42
43
|
setLoading(true);
|
|
43
|
-
|
|
44
|
+
// we ReactNode components are not being serialized properly
|
|
45
|
+
// remove them for now and deal with them later
|
|
46
|
+
// context: https://linear.app/dynamic-labs/issue/GVTY-328/[starknet]-sdk-api-is-not-serializing-react-components
|
|
47
|
+
// future work: https://linear.app/dynamic-labs/issue/GVTY-330/bug-figure-out-why-react-components-are-not
|
|
48
|
+
const updatedDynamicProps = {
|
|
49
|
+
settings: Object.assign(Object.assign({}, dynamicContextProps.settings), { customPrivacyPolicy: Boolean(dynamicContextProps.settings.customPrivacyPolicy), customTermsOfServices: Boolean(dynamicContextProps.settings.customTermsOfServices), policiesConsentInnerComponent: Boolean(dynamicContextProps.settings.policiesConsentInnerComponent) }),
|
|
50
|
+
};
|
|
51
|
+
sendDynamicProps(environmentId, {
|
|
52
|
+
dynamicContextProps: updatedDynamicProps,
|
|
53
|
+
});
|
|
44
54
|
fetchProjectSettings(environmentId)
|
|
45
55
|
.then((response) => {
|
|
46
56
|
if (!response)
|
|
@@ -6,7 +6,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useInte
|
|
|
6
6
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
7
7
|
|
|
8
8
|
const useHandleWalletsToConnect = () => {
|
|
9
|
-
const { walletsToConnectByChain, setWalletsToConnectByChain, setShowAuthFlow, setIsFullyConnected, isFullyConnected, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
9
|
+
const { walletsToConnectByChain, setWalletsToConnectByChain, setShowAuthFlow, setIsFullyConnected, selectedWalletConnector, isFullyConnected, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
10
10
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
11
11
|
const handleWalletsToConnect = () => {
|
|
12
12
|
if (!walletsToConnectByChain) {
|
|
@@ -19,6 +19,20 @@ const useHandleWalletsToConnect = () => {
|
|
|
19
19
|
setShowAuthFlow(false);
|
|
20
20
|
return goToInitialView();
|
|
21
21
|
}
|
|
22
|
+
if (!selectedWalletConnector || !selectedWalletConnector.connectedChain) {
|
|
23
|
+
setShowAuthFlow(false);
|
|
24
|
+
return goToInitialView();
|
|
25
|
+
}
|
|
26
|
+
// Assuming based on the logic above that we have at least one more chain/wallet to connect
|
|
27
|
+
// If the current connected wallet is already connected to the bridge,
|
|
28
|
+
// we can go directly to bridge-next-wallet-connection since we know there is a different chain to connect
|
|
29
|
+
const walletChainsToConnect = walletsToConnectByChain
|
|
30
|
+
.filter((wallet) => wallet.numberOfWallets > 0)
|
|
31
|
+
.map((wallet) => wallet.chain.toString());
|
|
32
|
+
if (!walletChainsToConnect.includes(selectedWalletConnector.connectedChain)) {
|
|
33
|
+
setView('bridge-next-wallet-connection');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
22
36
|
const [firstWallet, ...restOfTheWallets] = walletsToConnectByChain;
|
|
23
37
|
if (firstWallet.numberOfWallets > 1) {
|
|
24
38
|
const updatedWallets = [
|
|
@@ -2,7 +2,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useIn
|
|
|
2
2
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
3
3
|
|
|
4
4
|
const useHandleWalletsToConnect = () => {
|
|
5
|
-
const { walletsToConnectByChain, setWalletsToConnectByChain, setShowAuthFlow, setIsFullyConnected, isFullyConnected, } = useInternalDynamicContext();
|
|
5
|
+
const { walletsToConnectByChain, setWalletsToConnectByChain, setShowAuthFlow, setIsFullyConnected, selectedWalletConnector, isFullyConnected, } = useInternalDynamicContext();
|
|
6
6
|
const { setView, goToInitialView } = useViewContext();
|
|
7
7
|
const handleWalletsToConnect = () => {
|
|
8
8
|
if (!walletsToConnectByChain) {
|
|
@@ -15,6 +15,20 @@ const useHandleWalletsToConnect = () => {
|
|
|
15
15
|
setShowAuthFlow(false);
|
|
16
16
|
return goToInitialView();
|
|
17
17
|
}
|
|
18
|
+
if (!selectedWalletConnector || !selectedWalletConnector.connectedChain) {
|
|
19
|
+
setShowAuthFlow(false);
|
|
20
|
+
return goToInitialView();
|
|
21
|
+
}
|
|
22
|
+
// Assuming based on the logic above that we have at least one more chain/wallet to connect
|
|
23
|
+
// If the current connected wallet is already connected to the bridge,
|
|
24
|
+
// we can go directly to bridge-next-wallet-connection since we know there is a different chain to connect
|
|
25
|
+
const walletChainsToConnect = walletsToConnectByChain
|
|
26
|
+
.filter((wallet) => wallet.numberOfWallets > 0)
|
|
27
|
+
.map((wallet) => wallet.chain.toString());
|
|
28
|
+
if (!walletChainsToConnect.includes(selectedWalletConnector.connectedChain)) {
|
|
29
|
+
setView('bridge-next-wallet-connection');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
18
32
|
const [firstWallet, ...restOfTheWallets] = walletsToConnectByChain;
|
|
19
33
|
if (firstWallet.numberOfWallets > 1) {
|
|
20
34
|
const updatedWallets = [
|
|
@@ -20,6 +20,7 @@ require('ethers');
|
|
|
20
20
|
require('../../../shared/consts/index.cjs');
|
|
21
21
|
require('@dynamic-labs/multi-wallet');
|
|
22
22
|
var isSocialKycEnabled = require('../../functions/isSocialKycEnabled/isSocialKycEnabled.cjs');
|
|
23
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
23
24
|
|
|
24
25
|
/* eslint-disable max-len */
|
|
25
26
|
/**
|
|
@@ -16,6 +16,7 @@ import 'ethers';
|
|
|
16
16
|
import '../../../shared/consts/index.js';
|
|
17
17
|
import '@dynamic-labs/multi-wallet';
|
|
18
18
|
import { isSocialKycEnabled } from '../../functions/isSocialKycEnabled/isSocialKycEnabled.js';
|
|
19
|
+
import '../../../config/ApiEndpoint.js';
|
|
19
20
|
|
|
20
21
|
/* eslint-disable max-len */
|
|
21
22
|
/**
|
|
@@ -17,7 +17,6 @@ require('../../constants/colors.cjs');
|
|
|
17
17
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
18
|
require('ethers');
|
|
19
19
|
require('../../../shared/consts/index.cjs');
|
|
20
|
-
var useOnlyConnectedMode = require('../useOnlyConnectedMode/useOnlyConnectedMode.cjs');
|
|
21
20
|
|
|
22
21
|
const isMultiWalletEnabledInURL = () => {
|
|
23
22
|
const flag = 'multiwallet.widget';
|
|
@@ -30,9 +29,6 @@ const isMultiWalletEnabledInURL = () => {
|
|
|
30
29
|
};
|
|
31
30
|
const useMultiWalletFlag = () => {
|
|
32
31
|
const { multiWallet: isMultiWalletEnabled } = useInternalDynamicContext.useInternalDynamicContext();
|
|
33
|
-
const isOnlyConnected = useOnlyConnectedMode.useOnlyConnectedMode();
|
|
34
|
-
if (isOnlyConnected)
|
|
35
|
-
return false;
|
|
36
32
|
return isMultiWalletEnabled && isMultiWalletEnabledInURL();
|
|
37
33
|
};
|
|
38
34
|
|
|
@@ -13,7 +13,6 @@ import '../../constants/colors.js';
|
|
|
13
13
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
14
|
import 'ethers';
|
|
15
15
|
import '../../../shared/consts/index.js';
|
|
16
|
-
import { useOnlyConnectedMode } from '../useOnlyConnectedMode/useOnlyConnectedMode.js';
|
|
17
16
|
|
|
18
17
|
const isMultiWalletEnabledInURL = () => {
|
|
19
18
|
const flag = 'multiwallet.widget';
|
|
@@ -26,9 +25,6 @@ const isMultiWalletEnabledInURL = () => {
|
|
|
26
25
|
};
|
|
27
26
|
const useMultiWalletFlag = () => {
|
|
28
27
|
const { multiWallet: isMultiWalletEnabled } = useInternalDynamicContext();
|
|
29
|
-
const isOnlyConnected = useOnlyConnectedMode();
|
|
30
|
-
if (isOnlyConnected)
|
|
31
|
-
return false;
|
|
32
28
|
return isMultiWalletEnabled && isMultiWalletEnabledInURL();
|
|
33
29
|
};
|
|
34
30
|
|
|
@@ -19,6 +19,7 @@ var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLo
|
|
|
19
19
|
require('../../../shared/consts/index.cjs');
|
|
20
20
|
var primaryWalletIdValidator = require('../useWalletConnectors/utils/primaryWalletIdValidator/primaryWalletIdValidator.cjs');
|
|
21
21
|
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
22
23
|
|
|
23
24
|
const usePrimaryWalletId = (internalEvents) => {
|
|
24
25
|
const [primaryWalletId, setPrimaryWalletIdState, clearPrimaryWalletIdStorage,] = useLocalStorage.useLocalStorage(localStorage.PRIMARY_WALLET_ID, undefined, primaryWalletIdValidator.primaryWalletIdValidator);
|
|
@@ -15,6 +15,7 @@ import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/use
|
|
|
15
15
|
import '../../../shared/consts/index.js';
|
|
16
16
|
import { primaryWalletIdValidator } from '../useWalletConnectors/utils/primaryWalletIdValidator/primaryWalletIdValidator.js';
|
|
17
17
|
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import '../../../config/ApiEndpoint.js';
|
|
18
19
|
|
|
19
20
|
const usePrimaryWalletId = (internalEvents) => {
|
|
20
21
|
const [primaryWalletId, setPrimaryWalletIdState, clearPrimaryWalletIdStorage,] = useLocalStorage(PRIMARY_WALLET_ID, undefined, primaryWalletIdValidator);
|
|
@@ -9,50 +9,36 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useInte
|
|
|
9
9
|
var api = require('../../../data/api.cjs');
|
|
10
10
|
var useUpdateUserProfileByJWTCallback = require('../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs');
|
|
11
11
|
require('@dynamic-labs/sdk-api');
|
|
12
|
-
|
|
12
|
+
require('../../../shared/logger.cjs');
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('react/jsx-runtime');
|
|
16
16
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-book');
|
|
18
18
|
require('@dynamic-labs/utils');
|
|
19
|
+
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
19
20
|
require('../../constants/colors.cjs');
|
|
20
|
-
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
|
+
var localStorage = require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
22
|
require('ethers');
|
|
22
23
|
require('../../../shared/consts/index.cjs');
|
|
23
24
|
require('@dynamic-labs/multi-wallet');
|
|
24
25
|
var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
|
|
25
26
|
var index = require('../../functions/getEnabledOAuthProviders/index.cjs');
|
|
26
27
|
var isSocialKycEnabled = require('../../functions/isSocialKycEnabled/isSocialKycEnabled.cjs');
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
var digestSHA256 = require('../../functions/digestSHA256/digestSHA256.cjs');
|
|
30
|
-
var encodeBase64URL = require('../../functions/encodeBase64URL/encodeBase64URL.cjs');
|
|
31
|
-
var getRedirectURIOrigin = require('../../functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs');
|
|
28
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
29
|
+
var useSocialAuth = require('../useSocialAuth/useSocialAuth.cjs');
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
'discord',
|
|
35
|
-
'facebook',
|
|
36
|
-
'github',
|
|
37
|
-
'google',
|
|
38
|
-
'instagram',
|
|
39
|
-
'twitch',
|
|
40
|
-
'twitter',
|
|
41
|
-
];
|
|
42
|
-
// pkce params are only required for twitter and break if added for other providers, like google
|
|
43
|
-
// so we should only add provider that support pkce to this list
|
|
44
|
-
const providersRequiringPkce = ['twitter', 'github'];
|
|
45
|
-
const providersWithoutWindowOpenerRefence = ['twitter'];
|
|
31
|
+
// Hook exposed to customers and used internally to handle social account linking
|
|
46
32
|
const useSocialAccounts = ({ sessionTimeout } = {
|
|
47
33
|
sessionTimeout: 10000,
|
|
48
34
|
}) => {
|
|
49
35
|
var _a;
|
|
50
36
|
const { environmentId, user, projectSettings, onboardingOnlyJwt } = useInternalDynamicContext.useInternalDynamicContext();
|
|
51
37
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
const { handleError, setError, setIsProcessing, checkValidProvider, error, isProcessing, connectSocialAccount, } = useSocialAuth.useSocialAuth({
|
|
39
|
+
authMode: 'link',
|
|
40
|
+
sessionTimeout,
|
|
41
|
+
});
|
|
56
42
|
const userJwt = (_a = getAuthToken.getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
57
43
|
const oauthProviders = index.getEnabledOAuthProviders(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers);
|
|
58
44
|
const verifiedOAuthCredentialsMap = React.useMemo(() => {
|
|
@@ -66,47 +52,11 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
66
52
|
];
|
|
67
53
|
})));
|
|
68
54
|
}, [user === null || user === void 0 ? void 0 : user.verifiedCredentials]);
|
|
69
|
-
const handleError = (code, message) => {
|
|
70
|
-
logger.logger.error(message);
|
|
71
|
-
setIsProcessing(false);
|
|
72
|
-
setError({ code, message });
|
|
73
|
-
};
|
|
74
|
-
const addOAuthIFrame = (url) => {
|
|
75
|
-
const container = document.getElementById('oauth-iframe-container');
|
|
76
|
-
let oauthIFrame = document.getElementById('oauth-iframe');
|
|
77
|
-
if (!container || oauthIFrame) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
oauthIFrame = document.createElement('iframe');
|
|
81
|
-
oauthIFrame.setAttribute('id', 'oauth-iframe');
|
|
82
|
-
oauthIFrame.setAttribute('src', url);
|
|
83
|
-
container.appendChild(oauthIFrame);
|
|
84
|
-
};
|
|
85
|
-
const removeOAuthIFrame = () => {
|
|
86
|
-
const oauthIFrame = document.getElementById('oauth-iframe');
|
|
87
|
-
if (oauthIFrame) {
|
|
88
|
-
oauthIFrame.remove();
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const checkValidProvider = (provider) => {
|
|
92
|
-
if (!provider) {
|
|
93
|
-
handleError(types.SocialOAuthErrorCode.NO_PROVIDER, 'Provider is required');
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
if (!socialProviders.includes(provider)) {
|
|
97
|
-
handleError(types.SocialOAuthErrorCode.INVALID_PROVIDER, `Invalid social provider. Valid providers are: ${socialProviders.join(', ')}`);
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
};
|
|
102
55
|
const checkValidOAuthLinking = (provider) => {
|
|
103
56
|
if (!isSocialKycEnabled.isSocialKycEnabled(projectSettings)) {
|
|
104
57
|
handleError(types.SocialOAuthErrorCode.SOCIAL_LINKING_NOT_ENABLED, 'Social linking is not enabled on the dashboard');
|
|
105
58
|
return false;
|
|
106
59
|
}
|
|
107
|
-
if (!checkValidProvider(provider)) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
60
|
const verifiedCredential = verifiedOAuthCredentialsMap[provider];
|
|
111
61
|
if (verifiedCredential) {
|
|
112
62
|
handleError(types.SocialOAuthErrorCode.ACCOUNT_ALREADY_LINKED, `Account already linked for provider: ${provider}`);
|
|
@@ -120,112 +70,10 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
120
70
|
return true;
|
|
121
71
|
};
|
|
122
72
|
const linkSocialAccount = (provider) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
|
|
124
|
-
clearInterval(authWindowInterval.current);
|
|
125
|
-
setError(undefined);
|
|
126
|
-
setIsProcessing(true);
|
|
127
|
-
// invalid linking request
|
|
128
|
-
if (!checkValidOAuthLinking(provider)) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const state = randomString.randomString(8);
|
|
132
|
-
const verifier = randomString.randomString(43);
|
|
133
|
-
const clearListeners = () => {
|
|
134
|
-
removeOAuthIFrame();
|
|
135
|
-
window.removeEventListener('message', handleAuthWindowMessage);
|
|
136
|
-
providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: false });
|
|
137
|
-
};
|
|
138
|
-
const handleAuthWindowMessage = (event) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
139
|
-
var _c;
|
|
140
|
-
const message = event.data;
|
|
141
|
-
const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
|
|
142
|
-
if (isAuthorizationMessage) {
|
|
143
|
-
logger.logger.debug('Message received', { data: message });
|
|
144
|
-
}
|
|
145
|
-
const isValidMessage = isAuthorizationMessage && (message === null || message === void 0 ? void 0 : message.provider) === provider;
|
|
146
|
-
// don't process imvalid messages for provider
|
|
147
|
-
if (!isValidMessage) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
setIsProcessing(true);
|
|
151
|
-
if (!((_c = providersWaitingOauthMessages.current) === null || _c === void 0 ? void 0 : _c[provider])) {
|
|
152
|
-
handleError(types.SocialOAuthErrorCode.SESSION_TIMEOUT, `Linking ${provider} account session timeout.`);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
clearListeners();
|
|
156
|
-
const { code, error } = message;
|
|
157
|
-
if (error && error !== 'undefined') {
|
|
158
|
-
handleError(types.SocialOAuthErrorCode.OAUTH_ERROR, `Failed to link ${provider} social account: ${error}`);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (!code) {
|
|
162
|
-
handleError(types.SocialOAuthErrorCode.NO_AUTH_CODE, `Failed to link ${provider} social account: no authorization code`);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const jwt = yield api.verifyOAuth(environmentId, provider, {
|
|
166
|
-
code,
|
|
167
|
-
codeVerifier: verifier,
|
|
168
|
-
state,
|
|
169
|
-
}, String(userJwt));
|
|
170
|
-
if (!jwt) {
|
|
171
|
-
handleError(types.SocialOAuthErrorCode.VERIFICATION_ERROR, `Failed to link social account: ${provider}`);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
yield updateUserProfileByJWT(jwt);
|
|
175
|
-
setIsProcessing(false);
|
|
176
|
-
});
|
|
177
|
-
const loginUrl = yield api.getOauthLoginUrl(environmentId, provider, String(userJwt));
|
|
178
|
-
if (!loginUrl) {
|
|
179
|
-
handleError(types.SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to link social account: ${provider}`);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
// we need to use an iframe to be the intermediary in communications between the popup and the sdk
|
|
183
|
-
// because of twitter limitations with accessing the window.opener and BroadcastChannel not working between
|
|
184
|
-
// different origins (our api redirect page and the app where the sdk is running)
|
|
185
|
-
const oauthIFrameUrl = `${getRedirectURIOrigin.getRedirectURIOrigin(loginUrl)}/sdkoauth`;
|
|
186
|
-
addOAuthIFrame(oauthIFrameUrl);
|
|
187
|
-
let oauthLoginUrl = loginUrl;
|
|
188
|
-
if (providersRequiringPkce.includes(provider)) {
|
|
189
|
-
const digest = yield digestSHA256.digestSHA256(verifier);
|
|
190
|
-
const pkceParams = stringifyURIQuery.stringifyURIQuery({
|
|
191
|
-
code_challenge: encodeBase64URL.encodeBase64URL(digest),
|
|
192
|
-
code_challenge_method: 'S256',
|
|
193
|
-
state: state,
|
|
194
|
-
});
|
|
195
|
-
oauthLoginUrl = `${loginUrl}&${pkceParams}`;
|
|
196
|
-
}
|
|
197
|
-
if (!((_b = providersWaitingOauthMessages.current) === null || _b === void 0 ? void 0 : _b[provider])) {
|
|
198
|
-
window.addEventListener('message', handleAuthWindowMessage);
|
|
199
|
-
providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: true });
|
|
200
|
-
}
|
|
201
|
-
const authWindow = window.open(oauthLoginUrl, '_blank', 'width=500,height=600');
|
|
202
|
-
if (!providersWithoutWindowOpenerRefence.includes(provider)) {
|
|
203
|
-
// For provider that support window.opener, we need to clear all states/listeners when the window is closed
|
|
204
|
-
authWindowInterval.current = setInterval(() => {
|
|
205
|
-
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed)) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
clearInterval(authWindowInterval.current);
|
|
209
|
-
setIsProcessing(false);
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
// For provider that don't support window.opener, we need to use a timeout to try to detect when the
|
|
214
|
-
// window is closed
|
|
215
|
-
authWindowInterval.current = setInterval(() => {
|
|
216
|
-
var _a;
|
|
217
|
-
// user didn't complete oauth
|
|
218
|
-
if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
|
|
219
|
-
clearListeners();
|
|
220
|
-
handleError(types.SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Linking ${provider} account window timeout.`);
|
|
221
|
-
}
|
|
222
|
-
setIsProcessing(false);
|
|
223
|
-
clearInterval(authWindowInterval.current);
|
|
224
|
-
}, sessionTimeout);
|
|
225
|
-
}
|
|
73
|
+
connectSocialAccount(provider, checkValidOAuthLinking);
|
|
226
74
|
});
|
|
227
75
|
const unlinkSocialAccount = (provider) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
228
|
-
var
|
|
76
|
+
var _b;
|
|
229
77
|
setError(undefined);
|
|
230
78
|
setIsProcessing(true);
|
|
231
79
|
if (!checkValidProvider(provider)) {
|
|
@@ -237,9 +85,11 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
237
85
|
return;
|
|
238
86
|
}
|
|
239
87
|
try {
|
|
88
|
+
const primaryWalletId = localStorage.LocalStorage.getFromLS(localStorage$1.PRIMARY_WALLET_ID);
|
|
240
89
|
const jwt = yield api.unlinkOAuth({
|
|
241
90
|
environmentId,
|
|
242
|
-
|
|
91
|
+
primaryWalletId,
|
|
92
|
+
verifiedCrentialId: (_b = verifiedCredential.id) !== null && _b !== void 0 ? _b : '',
|
|
243
93
|
}, String(userJwt));
|
|
244
94
|
if (!jwt) {
|
|
245
95
|
handleError(types.SocialOAuthErrorCode.UNLINK_ERROR, `Failed to unlink social account: ${provider} | ${verifiedCredential.id}`);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
2
|
-
import { SocialAccountInformation
|
|
2
|
+
import { SocialAccountInformation } from '@dynamic-labs/types';
|
|
3
3
|
type UseSocialAccountsProps = {
|
|
4
4
|
sessionTimeout: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const useSocialAccounts: ({ sessionTimeout }?: UseSocialAccountsProps) => {
|
|
7
|
-
readonly error: SocialOAuthError | undefined;
|
|
7
|
+
readonly error: import("@dynamic-labs/types").SocialOAuthError | undefined;
|
|
8
8
|
readonly getLinkedAccountInformation: (provider: ProviderEnum) => SocialAccountInformation | undefined;
|
|
9
9
|
readonly isLinked: (provider: ProviderEnum) => boolean;
|
|
10
10
|
readonly isProcessing: boolean;
|