@getpara/react-sdk-lite 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/modal.css +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/modal/ParaModal.js +46 -98
- package/dist/modal/components/Body/Body.d.ts +1 -2
- package/dist/modal/components/Body/Body.js +119 -231
- package/dist/modal/components/Controls/ChainSelect.js +1 -1
- package/dist/modal/components/Controls/Controls.js +2 -4
- package/dist/modal/components/Footer/Footer.js +3 -12
- package/dist/modal/components/Header/Header.js +13 -14
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
- package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
- package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
- package/dist/modal/components/ModalContent/ModalContent.js +6 -14
- package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
- package/dist/modal/components/WalletCard/WalletCard.js +9 -9
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +7 -5
- package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
- package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
- package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +13 -11
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
- package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
- package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
- package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
- package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
- package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
- package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
- package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
- package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
- package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
- package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
- package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
- package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
- package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
- package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +15 -22
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
- package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
- package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
- package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
- package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +5 -5
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
- package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
- package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
- package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
- package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +11 -12
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
- package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
- package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
- package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
- package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
- package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
- package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
- package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
- package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
- package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
- package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
- package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
- package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
- package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
- package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
- package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
- package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +16 -36
- package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
- package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
- package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
- package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
- package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
- package/dist/modal/components/shared/IFrame.d.ts +1 -0
- package/dist/modal/components/shared/IFrame.js +87 -0
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
- package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
- package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
- package/dist/modal/hooks/index.d.ts +1 -2
- package/dist/modal/hooks/index.js +1 -2
- package/dist/modal/hooks/useAuthView.d.ts +4 -0
- package/dist/modal/hooks/useAuthView.js +115 -0
- package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
- package/dist/modal/hooks/useCanbGoBack.js +47 -0
- package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.js +3 -3
- package/dist/modal/hooks/useGoBack.d.ts +4 -1
- package/dist/modal/hooks/useGoBack.js +60 -36
- package/dist/modal/hooks/useSendMutations.js +4 -5
- package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
- package/dist/modal/index.d.ts +1 -2
- package/dist/modal/index.js +1 -3
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -1
- package/dist/modal/types/modalProps.d.ts +18 -8
- package/dist/provider/ParaProviderMin.js +34 -38
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +43 -49
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/components/CosmosWalletWrapper.js +0 -3
- package/dist/provider/components/EvmWalletWrapper.js +0 -3
- package/dist/provider/components/ExternalWalletWrapper.js +8 -2
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
- package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
- package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
- package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
- package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
- package/dist/provider/hooks/queries/useParaStatus.js +0 -2
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +0 -7
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
- package/dist/provider/hooks/utils/useModal.d.ts +2 -2
- package/dist/provider/hooks/utils/useModal.js +9 -8
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
- package/dist/provider/hooks/utils/useWalletState.js +14 -6
- package/dist/provider/providers/AccountLinkProvider.js +21 -19
- package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
- package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
- package/dist/provider/providers/ExternalWalletProvider.js +285 -283
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/stores/getters.js +5 -5
- package/dist/provider/stores/setters.js +2 -2
- package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
- package/dist/provider/stores/slices/accountFlow.js +30 -0
- package/dist/provider/stores/slices/authFlow.d.ts +3 -0
- package/dist/provider/stores/slices/authFlow.js +63 -0
- package/dist/provider/stores/slices/externalWallets.js +10 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +4 -0
- package/dist/provider/stores/slices/modal.js +8 -2
- package/dist/provider/stores/slices/onRamp.d.ts +3 -0
- package/dist/provider/stores/slices/onRamp.js +20 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +9 -0
- package/dist/provider/stores/types.d.ts +117 -5
- package/dist/provider/stores/types.js +9 -0
- package/dist/provider/stores/useStore.d.ts +5 -3
- package/dist/provider/stores/useStore.js +15 -8
- package/package.json +8 -8
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
- package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -118
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
- package/dist/modal/hooks/useFarcasterLogin.js +0 -77
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -146
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -120
- package/dist/modal/stores/modal/useModalStore.js +0 -81
- package/dist/modal/utils/steps.d.ts +0 -162
- package/dist/modal/utils/steps.js +0 -335
- package/dist/provider/providers/AuthProvider.d.ts +0 -43
- package/dist/provider/providers/AuthProvider.js +0 -777
- /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
- /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
- /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
- /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
- /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
- /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
- /package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.d.ts +0 -0
- /package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +0 -0
package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import {
|
|
7
7
|
CpslButton,
|
|
@@ -13,23 +13,31 @@ import {
|
|
|
13
13
|
CpslText
|
|
14
14
|
} from "@getpara/react-components";
|
|
15
15
|
import { useEffect, useRef, useState } from "react";
|
|
16
|
-
import {
|
|
17
|
-
import { Heading, QRContainer, FilledDisabledInput, StepContainer, InnerStepContainer } from "../common.js";
|
|
18
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
16
|
+
import { Heading, QRContainer, FilledDisabledInput, StepContainer, InnerStepContainer, HeroIcon } from "../../../common.js";
|
|
19
17
|
import { safeStyled } from "@getpara/react-common";
|
|
20
18
|
import { useCopyToClipboard } from "@getpara/react-common";
|
|
21
|
-
import { useEnable2fa } from "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
19
|
+
import { useEnable2fa } from "../../../../../provider/index.js";
|
|
20
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
21
|
+
const Setup2FA = ({ onClose }) => {
|
|
22
|
+
const hideWallets = useStore((state) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
25
|
+
});
|
|
26
26
|
const { enable2fa, isPending } = useEnable2fa();
|
|
27
|
-
const isVerifying = useModalStore((state) => state.step === ModalStep.VERIFY_2FA);
|
|
28
27
|
const [copied, copy] = useCopyToClipboard();
|
|
28
|
+
const bareModal = useStore((state) => {
|
|
29
|
+
var _a;
|
|
30
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
31
|
+
});
|
|
32
|
+
const setShowPostAuthFlow = useStore((state) => state.setShowPostAuthFlow);
|
|
33
|
+
const setTwoFactorAuthUri = useStore((state) => state.setTwoFactorAuthUri);
|
|
34
|
+
const twoFactorAuthUri = useStore((state) => state.twoFactorAuthUri);
|
|
29
35
|
const inputRef = useRef(null);
|
|
30
36
|
const [code, setCode] = useState("");
|
|
31
37
|
const [codeError, setCodeError] = useState("");
|
|
32
|
-
const
|
|
38
|
+
const [isVerifying, setIsVerifying] = useState(false);
|
|
39
|
+
const [isDone, setIsDone] = useState(false);
|
|
40
|
+
const params = twoFactorAuthUri ? new URL(twoFactorAuthUri).searchParams : void 0;
|
|
33
41
|
const secret = params == null ? void 0 : params.get("secret");
|
|
34
42
|
useEffect(() => {
|
|
35
43
|
const timerId = setTimeout(() => {
|
|
@@ -46,14 +54,15 @@ const Setup2FAStep = ({ onClose }) => {
|
|
|
46
54
|
}
|
|
47
55
|
}, [code]);
|
|
48
56
|
const handleNext = () => {
|
|
49
|
-
|
|
57
|
+
setIsVerifying(true);
|
|
50
58
|
};
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
59
|
+
const handleComplete = () => {
|
|
60
|
+
if (bareModal) {
|
|
61
|
+
setShowPostAuthFlow(false);
|
|
54
62
|
} else {
|
|
55
63
|
onClose();
|
|
56
64
|
}
|
|
65
|
+
setTwoFactorAuthUri(null);
|
|
57
66
|
};
|
|
58
67
|
const handleCodeInput = (e) => {
|
|
59
68
|
if (codeError) {
|
|
@@ -67,7 +76,7 @@ const Setup2FAStep = ({ onClose }) => {
|
|
|
67
76
|
{ verificationCode: code },
|
|
68
77
|
{
|
|
69
78
|
onSuccess: () => {
|
|
70
|
-
|
|
79
|
+
setIsDone(true);
|
|
71
80
|
},
|
|
72
81
|
onError: () => {
|
|
73
82
|
setCodeError("Incorrect Code");
|
|
@@ -83,6 +92,20 @@ const Setup2FAStep = ({ onClose }) => {
|
|
|
83
92
|
copy(secret);
|
|
84
93
|
}
|
|
85
94
|
};
|
|
95
|
+
if (isDone) {
|
|
96
|
+
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
98
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(Heading, { variant: "headingXS", children: "Success" }),
|
|
100
|
+
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
|
|
101
|
+
"Your ",
|
|
102
|
+
hideWallets ? "account" : "wallet",
|
|
103
|
+
" is now protected by 2FA"
|
|
104
|
+
] })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleComplete, children: "Done" })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
86
109
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
87
110
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
88
111
|
/* @__PURE__ */ jsx(Heading, { children: "Turn on two-factor authentication" }),
|
|
@@ -112,14 +135,14 @@ const Setup2FAStep = ({ onClose }) => {
|
|
|
112
135
|
}
|
|
113
136
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
137
|
/* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Scan with your preferred authenticator app" }),
|
|
115
|
-
/* @__PURE__ */ jsx(QRContainer, { children: !
|
|
138
|
+
/* @__PURE__ */ jsx(QRContainer, { children: !twoFactorAuthUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: twoFactorAuthUri, "data-testid": "para-2fa-qr" }) })
|
|
116
139
|
] }) }),
|
|
117
140
|
!isVerifying && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
141
|
/* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslDivider, { children: "or enter the code manually" }) }),
|
|
119
142
|
/* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(FilledDisabledInput, { disabled: true, value: secret != null ? secret : "", noAutoDisable: true, "data-testid": "para-2fa-secret", children: /* @__PURE__ */ jsx(CpslButton, { slot: "end", variant: "ghost", onClick: handleCopy, "data-testid": "para-2fa-copy", children: /* @__PURE__ */ jsx(CpslIcon, { icon: copied ? "check" : "copy" }) }) }) }),
|
|
120
143
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
121
144
|
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, "data-testid": "para-2fa-continue", children: "Continue" }),
|
|
122
|
-
/* @__PURE__ */ jsx(SkipButton, { variant: "ghost", onClick:
|
|
145
|
+
/* @__PURE__ */ jsx(SkipButton, { variant: "ghost", onClick: handleComplete, "data-testid": "para-2fa-skip", children: "Skip" })
|
|
123
146
|
] })
|
|
124
147
|
] })
|
|
125
148
|
] });
|
|
@@ -132,5 +155,5 @@ const SkipButton = safeStyled(CpslButton)`
|
|
|
132
155
|
text-decoration: underline;
|
|
133
156
|
`;
|
|
134
157
|
export {
|
|
135
|
-
|
|
158
|
+
Setup2FA
|
|
136
159
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Verification: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { StepContainer } from "../../../common.js";
|
|
7
|
+
import { useResendVerificationCode } from "../../../../../provider/index.js";
|
|
8
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
9
|
+
import { useVerifyNewAccount } from "../../../../../provider/index.js";
|
|
10
|
+
import { VerificationCode } from "../../../shared/VerificationCode.js";
|
|
11
|
+
const Verification = () => {
|
|
12
|
+
const { verifyNewAccount, status, error } = useVerifyNewAccount();
|
|
13
|
+
const { resendVerificationCodeAsync } = useResendVerificationCode();
|
|
14
|
+
const para = useInternalClient();
|
|
15
|
+
if (!para.authInfo) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const handleSubmitCode = (code) => {
|
|
19
|
+
verifyNewAccount({ verificationCode: code });
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(
|
|
22
|
+
VerificationCode,
|
|
23
|
+
{
|
|
24
|
+
authInfo: para.authInfo,
|
|
25
|
+
onSubmit: handleSubmitCode,
|
|
26
|
+
onResend: () => __async(void 0, null, function* () {
|
|
27
|
+
yield resendVerificationCodeAsync({ type: "SIGNUP" });
|
|
28
|
+
}),
|
|
29
|
+
status,
|
|
30
|
+
error
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
Verification
|
|
36
|
+
};
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CpslButton, CpslText } from "@getpara/react-components";
|
|
7
|
-
import { StepContainer, InnerStepContainer, HeroIcon } from "
|
|
8
|
-
import {
|
|
9
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
10
|
-
import { WalletCard, WalletCards } from "../WalletCard/WalletCard.js";
|
|
7
|
+
import { StepContainer, InnerStepContainer, HeroIcon } from "../../../common.js";
|
|
8
|
+
import { WalletCard, WalletCards } from "../../../WalletCard/WalletCard.js";
|
|
11
9
|
import { safeStyled } from "@getpara/react-common";
|
|
12
|
-
import { useInternalClient } from "
|
|
13
|
-
import { useStore } from "
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
|
|
17
|
-
const { isSetup2faPending } = useAuthActions();
|
|
10
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
const WalletCreationDone = ({ onClose }) => {
|
|
18
14
|
const hideWallets = useStore((state) => {
|
|
19
15
|
var _a;
|
|
20
16
|
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
@@ -23,47 +19,24 @@ const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
|
|
|
23
19
|
var _a;
|
|
24
20
|
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
25
21
|
});
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
22
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
23
|
+
const twoFactorAuthUri = useStore((state) => state.twoFactorAuthUri);
|
|
24
|
+
const setHasCreatedWallets = useStore((state) => state.setHasCreatedWallets);
|
|
25
|
+
const setShowPostAuthFlow = useStore((state) => state.setShowPostAuthFlow);
|
|
31
26
|
const para = useInternalClient();
|
|
32
|
-
const [isWaiting
|
|
27
|
+
const [isWaiting] = useState(false);
|
|
28
|
+
const isTwoFactorAuthEnabled = !!twoFactorAuthUri;
|
|
33
29
|
const isOnRampConfigured = (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isWithdrawEnabled);
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
setStep(ModalStep.LOGIN_DONE);
|
|
37
|
-
} else {
|
|
30
|
+
const handleNext = () => __async(void 0, null, function* () {
|
|
31
|
+
if (!isTwoFactorAuthEnabled) {
|
|
38
32
|
if (bareModal) {
|
|
39
|
-
|
|
40
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
33
|
+
setShowPostAuthFlow(false);
|
|
41
34
|
} else {
|
|
42
35
|
onClose();
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
|
|
46
|
-
const handleNext = () => __async(void 0, null, function* () {
|
|
47
|
-
if (!twoFactorAuthEnabled) {
|
|
48
|
-
onBypass2fa();
|
|
49
|
-
}
|
|
50
|
-
if (!twoFactorStatus) {
|
|
51
|
-
if (isSetup2faPending) {
|
|
52
|
-
setIsWaiting(true);
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
if (twoFactorStatus.isSetup) {
|
|
56
|
-
onBypass2fa();
|
|
57
|
-
} else {
|
|
58
|
-
setStep(ModalStep.SETUP_2FA);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
38
|
+
setHasCreatedWallets(false);
|
|
61
39
|
});
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (isWaiting && !!twoFactorStatus) {
|
|
64
|
-
setStep(ModalStep.SETUP_2FA);
|
|
65
|
-
}
|
|
66
|
-
}, [isWaiting, twoFactorStatus]);
|
|
67
40
|
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
68
41
|
/* @__PURE__ */ jsx(CardContainer, { children: hideWallets ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
42
|
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
@@ -71,7 +44,7 @@ const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
|
|
|
71
44
|
] }) : /* @__PURE__ */ jsx(WalletCards, { "data-testid": "para-wallet-card", children: para.currentWalletIdsArray.map(([id, type]) => {
|
|
72
45
|
return /* @__PURE__ */ jsx(WalletCard, { id, type, showAddFunds: isOnRampConfigured }, id);
|
|
73
46
|
}) }) }),
|
|
74
|
-
/* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, disabled: isWaiting, "data-testid": "para-done-button", children:
|
|
47
|
+
/* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, disabled: isWaiting, "data-testid": "para-done-button", children: isTwoFactorAuthEnabled ? "Continue" : "Done" }) })
|
|
75
48
|
] });
|
|
76
49
|
};
|
|
77
50
|
const CardContainer = safeStyled(InnerStepContainer)`
|
|
@@ -79,5 +52,5 @@ const CardContainer = safeStyled(InnerStepContainer)`
|
|
|
79
52
|
justify-content: center;
|
|
80
53
|
`;
|
|
81
54
|
export {
|
|
82
|
-
|
|
55
|
+
WalletCreationDone
|
|
83
56
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TOAuthMethod } from '@getpara/
|
|
1
|
+
import { TOAuthMethod } from '@getpara/user-management-client';
|
|
2
2
|
interface AuthOptionsProps {
|
|
3
3
|
oAuthMethods?: TOAuthMethod[];
|
|
4
4
|
disableEmailLogin: boolean;
|
|
5
5
|
disablePhoneLogin: boolean;
|
|
6
|
-
isGuestModeEnabled
|
|
6
|
+
isGuestModeEnabled?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuthOptions: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthOptionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -3,31 +3,34 @@ import "../../../chunk-MMUBH76A.js";
|
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { safeStyled } from "@getpara/react-common";
|
|
6
|
-
import { OAuth } from "../OAuth/OAuth.js";
|
|
7
|
-
import { AuthInput } from "../AuthInput/AuthInput.js";
|
|
8
6
|
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
10
7
|
import { CpslIcon, CpslText } from "@getpara/react-components";
|
|
11
|
-
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
12
8
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
13
9
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
14
10
|
import { isEmail, isPhone } from "@getpara/user-management-client";
|
|
11
|
+
import { OAuth } from "../flows/auth/OAuth/OAuth.js";
|
|
12
|
+
import { EmailOrPhoneInput } from "./EmailOrPhone/EmailOrPhoneInput.js";
|
|
13
|
+
import { useAuth } from "../../../provider/providers/AuthProvider/AuthProvider.js";
|
|
15
14
|
const AuthOptions = ({
|
|
16
15
|
oAuthMethods,
|
|
17
16
|
disableEmailLogin,
|
|
18
17
|
disablePhoneLogin,
|
|
19
|
-
isGuestModeEnabled
|
|
18
|
+
isGuestModeEnabled
|
|
20
19
|
}) => {
|
|
21
|
-
|
|
20
|
+
const {
|
|
21
|
+
authenticateWithEmailOrPhone: { authenticate, isAuthenticating }
|
|
22
|
+
} = useAuth();
|
|
22
23
|
const para = useInternalClient();
|
|
23
24
|
const defaultAuthIdentifier = useStore((state) => {
|
|
24
|
-
var
|
|
25
|
-
return (
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.defaultAuthIdentifier;
|
|
26
27
|
});
|
|
27
|
-
const { signUpOrLogIn, isSignUpOrLogInPending } = useAuthActions();
|
|
28
28
|
const { wallets } = useExternalWallets();
|
|
29
|
-
const guestAddFundsTab =
|
|
30
|
-
const defaultAuth =
|
|
29
|
+
const guestAddFundsTab = useStore((state) => state.guestAddFundsTab);
|
|
30
|
+
const defaultAuth = useMemo(() => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return defaultAuthIdentifier ? /^\+\d+$/.test(defaultAuthIdentifier) ? { phone: defaultAuthIdentifier } : { email: defaultAuthIdentifier } : para.authInfo && (isEmail((_a = para.authInfo) == null ? void 0 : _a.auth) || isPhone((_b = para.authInfo) == null ? void 0 : _b.auth)) ? para.authInfo.auth : void 0;
|
|
33
|
+
}, [defaultAuthIdentifier, para.authInfo]);
|
|
31
34
|
const Content = useMemo(() => {
|
|
32
35
|
const Methods = [];
|
|
33
36
|
if (!!(oAuthMethods == null ? void 0 : oAuthMethods.length)) {
|
|
@@ -36,21 +39,21 @@ const AuthOptions = ({
|
|
|
36
39
|
if (!disableEmailLogin || !disablePhoneLogin) {
|
|
37
40
|
Methods.push(
|
|
38
41
|
/* @__PURE__ */ jsx(
|
|
39
|
-
|
|
42
|
+
EmailOrPhoneInput,
|
|
40
43
|
{
|
|
41
44
|
sticky: true,
|
|
42
45
|
defaultAuth,
|
|
43
46
|
disableEmailLogin,
|
|
44
47
|
disablePhoneLogin,
|
|
45
|
-
onSubmit:
|
|
46
|
-
isSubmitting:
|
|
48
|
+
onSubmit: authenticate,
|
|
49
|
+
isSubmitting: isAuthenticating
|
|
47
50
|
},
|
|
48
51
|
"input"
|
|
49
52
|
)
|
|
50
53
|
);
|
|
51
54
|
}
|
|
52
55
|
return /* @__PURE__ */ jsx(Fragment, { children: Methods });
|
|
53
|
-
}, [oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets, defaultAuth]);
|
|
56
|
+
}, [oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets, isAuthenticating, defaultAuth]);
|
|
54
57
|
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
55
58
|
guestAddFundsTab && /* @__PURE__ */ jsxs(CompleteAccountSetup, { children: [
|
|
56
59
|
/* @__PURE__ */ jsx(CompleteAccountIcon, { icon: "stars02", size: "16px" }),
|
|
@@ -6,6 +6,6 @@ export declare const ExternalWalletMobileConnect: ({ wallet, onConnectWc, onRetr
|
|
|
6
6
|
onRetryClick?: () => Promise<void>;
|
|
7
7
|
isSelfFetching?: boolean;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const ConnectExternalWallet: ({ isAddingWallets }: {
|
|
10
10
|
isAddingWallets?: boolean;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
|
-
import { CenteredText, HeroAccountTypeIcon, InnerStepContainer, QRContainer, StepContainer } from "
|
|
8
|
-
import { useCallback,
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
7
|
+
import { CenteredText, HeroAccountTypeIcon, InnerStepContainer, QRContainer, StepContainer } from "../../common.js";
|
|
8
|
+
import { useCallback, useMemo } from "react";
|
|
10
9
|
import { HeroSpinner, openMobileUrl, safeStyled } from "@getpara/react-common";
|
|
11
10
|
import { useCopyToClipboard } from "@getpara/react-common";
|
|
12
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
13
11
|
import { isMobile, isTablet } from "@getpara/web-sdk";
|
|
14
|
-
import { useExternalWallets } from "
|
|
15
|
-
import { useStore } from "
|
|
12
|
+
import { useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
|
|
13
|
+
import { useStore } from "../../../../provider/stores/useStore.js";
|
|
16
14
|
const isSolanaWalletInAppBrowser = (wallet) => {
|
|
17
15
|
var _a;
|
|
18
16
|
switch (wallet) {
|
|
@@ -34,7 +32,7 @@ const ExternalWalletMobileConnect = ({
|
|
|
34
32
|
onRetryClick
|
|
35
33
|
}) => {
|
|
36
34
|
var _a, _b;
|
|
37
|
-
const externalWalletError =
|
|
35
|
+
const externalWalletError = useStore((state) => state.externalWalletError);
|
|
38
36
|
const [isCopied, copy] = useCopyToClipboard();
|
|
39
37
|
const appName = useStore((state) => state.appName);
|
|
40
38
|
const isWalletConnect = wallet.id === "WalletConnect";
|
|
@@ -113,10 +111,9 @@ const ExternalWalletMobileConnect = ({
|
|
|
113
111
|
/* @__PURE__ */ jsx(InnerStepContainer, { children: isWalletConnect ? /* @__PURE__ */ jsx(Fragment, { children: GetWalletButton }) : /* @__PURE__ */ jsx(Link, { href: (_b = wallet.downloadUrl) != null ? _b : "", target: "_blank", children: GetWalletButton }) })
|
|
114
112
|
] });
|
|
115
113
|
};
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
114
|
+
const ConnectExternalWallet = ({ isAddingWallets = false }) => {
|
|
115
|
+
var _a;
|
|
116
|
+
const { error } = (_a = useStore((state) => state.paraState)) != null ? _a : {};
|
|
120
117
|
const { connectExternalWallet, addAdditionalExternalWallet, wallet, qrUri, walletDisplayHelpers } = useExternalWallets();
|
|
121
118
|
const handleConnect = useCallback(
|
|
122
119
|
(wallet2, isWc = false, isRetryConnection = false) => __async(void 0, null, function* () {
|
|
@@ -134,7 +131,7 @@ const ExternalWalletStep = ({ isAddingWallets = false }) => {
|
|
|
134
131
|
}
|
|
135
132
|
});
|
|
136
133
|
const Content = useMemo(() => {
|
|
137
|
-
var
|
|
134
|
+
var _a2;
|
|
138
135
|
if (!wallet) {
|
|
139
136
|
return null;
|
|
140
137
|
}
|
|
@@ -151,21 +148,21 @@ Please choose another wallet or continue on desktop.` }) });
|
|
|
151
148
|
}
|
|
152
149
|
if (showExtension) {
|
|
153
150
|
const isInstalled = wallet.installed;
|
|
154
|
-
const isError = !isInstalled ||
|
|
151
|
+
const isError = !isInstalled || !!error;
|
|
155
152
|
return /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
156
153
|
/* @__PURE__ */ jsx(
|
|
157
154
|
HeroSpinner,
|
|
158
155
|
{
|
|
159
156
|
icon: /* @__PURE__ */ jsx(HeroAccountTypeIcon, { accountType: wallet.internalId, src: wallet ? wallet.iconUrl : void 0 }),
|
|
160
157
|
status: isError ? "error" : "pending",
|
|
161
|
-
text: isError ? isInstalled ?
|
|
158
|
+
text: isError ? isInstalled ? error == null ? void 0 : error.message : `${wallet.name} not detected` : `Confirm connection request in the ${wallet.name} browser extension.`
|
|
162
159
|
}
|
|
163
160
|
),
|
|
164
161
|
isError && /* @__PURE__ */ jsxs(
|
|
165
162
|
CpslButton,
|
|
166
163
|
{
|
|
167
164
|
as: isInstalled ? "button" : "a",
|
|
168
|
-
href: (
|
|
165
|
+
href: (_a2 = wallet.downloadUrl) != null ? _a2 : "",
|
|
169
166
|
target: "_blank",
|
|
170
167
|
variant: "secondary",
|
|
171
168
|
onClick: handleTryAgainClick,
|
|
@@ -193,24 +190,7 @@ Please choose another wallet or continue on desktop.` }) });
|
|
|
193
190
|
}
|
|
194
191
|
);
|
|
195
192
|
}
|
|
196
|
-
}, [
|
|
197
|
-
wallet,
|
|
198
|
-
walletDisplayHelpers,
|
|
199
|
-
externalWalletError,
|
|
200
|
-
qrUri,
|
|
201
|
-
isAddingWallets,
|
|
202
|
-
addAdditionalExternalWallet,
|
|
203
|
-
connectExternalWallet
|
|
204
|
-
]);
|
|
205
|
-
useEffect(() => {
|
|
206
|
-
if (!wallet) {
|
|
207
|
-
if (step === ModalStep.ADD_EX_WALLET_SELECTED) {
|
|
208
|
-
setStep(ModalStep.ADD_EX_WALLET_MORE);
|
|
209
|
-
} else {
|
|
210
|
-
setStep(ModalStep.AUTH_MAIN);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}, [wallet, step]);
|
|
193
|
+
}, [wallet, walletDisplayHelpers, error, qrUri, isAddingWallets, addAdditionalExternalWallet, connectExternalWallet]);
|
|
214
194
|
if (!wallet) {
|
|
215
195
|
return null;
|
|
216
196
|
}
|
|
@@ -241,6 +221,6 @@ const Link = safeStyled.a`
|
|
|
241
221
|
text-decoration: none;
|
|
242
222
|
`;
|
|
243
223
|
export {
|
|
244
|
-
|
|
245
|
-
|
|
224
|
+
ConnectExternalWallet,
|
|
225
|
+
ExternalWalletMobileConnect
|
|
246
226
|
};
|
|
@@ -5,16 +5,16 @@ type ChildProps = {
|
|
|
5
5
|
isSubmitting: boolean;
|
|
6
6
|
onSubmit: () => void;
|
|
7
7
|
};
|
|
8
|
-
type
|
|
8
|
+
type EmailOrPhoneInputProps = {
|
|
9
9
|
defaultAuth?: Auth<'email' | 'phone'>;
|
|
10
|
-
onSubmit: (_: Auth<'email' | 'phone'>) => void;
|
|
11
|
-
isSubmitting: boolean;
|
|
12
10
|
disableEmailLogin?: boolean;
|
|
13
11
|
disablePhoneLogin?: boolean;
|
|
14
12
|
disableSubmitButton?: boolean;
|
|
15
13
|
children?: (_: ChildProps) => ReactNode;
|
|
16
14
|
error?: string | null;
|
|
17
15
|
sticky?: boolean;
|
|
16
|
+
onSubmit: (auth: Auth<'email' | 'phone'>) => void;
|
|
17
|
+
isSubmitting: boolean;
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const EmailOrPhoneInput: ({ defaultAuth, disableEmailLogin, disablePhoneLogin, disableSubmitButton, children: Children, error: propsError, sticky, onSubmit: propsOnSubmit, isSubmitting, }: EmailOrPhoneInputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
export {};
|
package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import {
|
|
7
7
|
CpslButton,
|
|
@@ -14,23 +14,23 @@ import {
|
|
|
14
14
|
} from "@getpara/react-components";
|
|
15
15
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
16
16
|
import { safeStyled, MOBILE_SIZE } from "@getpara/react-common";
|
|
17
|
-
import countryCodes from "
|
|
18
|
-
import { useDropdownPosition } from "
|
|
17
|
+
import countryCodes from "../../../utils/countryCodes.js";
|
|
18
|
+
import { useDropdownPosition } from "../../../hooks/useDropdownPosition.js";
|
|
19
19
|
import { defaultPhoneMask, phoneMasks } from "./phoneMasks.js";
|
|
20
20
|
import { extractAuthInfo } from "@getpara/user-management-client";
|
|
21
21
|
import parsePhoneNumberFromString from "libphonenumber-js";
|
|
22
|
-
import { isCcMatch, validateInput } from "
|
|
22
|
+
import { isCcMatch, validateInput } from "../../../utils/authInputHelpers.js";
|
|
23
23
|
const DEFAULT_COUNTRY = { label: "United States", value: "+1", selectedLabel: "US", icon: "US" };
|
|
24
|
-
const
|
|
24
|
+
const EmailOrPhoneInput = ({
|
|
25
25
|
defaultAuth,
|
|
26
26
|
disableEmailLogin,
|
|
27
27
|
disablePhoneLogin,
|
|
28
|
-
onSubmit: _onSubmit,
|
|
29
|
-
isSubmitting,
|
|
30
28
|
disableSubmitButton,
|
|
31
29
|
children: Children,
|
|
32
30
|
error: propsError,
|
|
33
|
-
sticky = false
|
|
31
|
+
sticky = false,
|
|
32
|
+
onSubmit: propsOnSubmit,
|
|
33
|
+
isSubmitting
|
|
34
34
|
}) => {
|
|
35
35
|
var _a, _b, _c;
|
|
36
36
|
const inputRef = useRef(null);
|
|
@@ -113,7 +113,7 @@ const AuthInput = ({
|
|
|
113
113
|
setError(void 0);
|
|
114
114
|
try {
|
|
115
115
|
const auth = validateInput(identifier, countryCode, identifierType);
|
|
116
|
-
|
|
116
|
+
propsOnSubmit(auth);
|
|
117
117
|
} catch (err) {
|
|
118
118
|
setError(err.message);
|
|
119
119
|
}
|
|
@@ -135,6 +135,10 @@ const AuthInput = ({
|
|
|
135
135
|
setIsPending(isSubmitting);
|
|
136
136
|
}
|
|
137
137
|
}, [error]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
var _a2;
|
|
140
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.setFocus();
|
|
141
|
+
}, []);
|
|
138
142
|
if (disableEmailLogin && disablePhoneLogin) {
|
|
139
143
|
return null;
|
|
140
144
|
}
|
|
@@ -284,5 +288,5 @@ const ChildContainer = safeStyled.div`
|
|
|
284
288
|
width: 100%;
|
|
285
289
|
`;
|
|
286
290
|
export {
|
|
287
|
-
|
|
291
|
+
EmailOrPhoneInput
|
|
288
292
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type ExternalWalletNetworkSelectStepType = 'CONNECT' | 'ADD_EXTERNAL' | 'ACCOUNT_LINKING';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ExternalWalletNetworkSelect: ({ type }: {
|
|
3
3
|
type?: ExternalWalletNetworkSelectStepType;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
export {};
|