@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
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { safeStyled } from "@getpara/react-common";
|
|
7
7
|
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
8
|
-
import { useModalStore } from "../../stores/index.js";
|
|
9
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
10
8
|
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
11
9
|
import { WALLET_TYPE_CONFIG } from "../../constants/walletTypeConfig.js";
|
|
12
10
|
import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
|
|
13
|
-
|
|
11
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
+
const ExternalWalletNetworkSelect = ({ type = "CONNECT" }) => {
|
|
14
13
|
var _a, _b, _c;
|
|
15
|
-
const
|
|
16
|
-
const selectedExternalWallet =
|
|
17
|
-
const setSelectedExternalWallet =
|
|
14
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
15
|
+
const selectedExternalWallet = useStore((state) => state.selectedExternalWallet);
|
|
16
|
+
const setSelectedExternalWallet = useStore((state) => state.setSelectedExternalWallet);
|
|
17
|
+
const setShowNetworkSelect = useStore((state) => state.setShowNetworkSelect);
|
|
18
18
|
const { wallets, connectExternalWallet, addAdditionalExternalWallet } = useExternalWallets();
|
|
19
19
|
const { accountLinkInProgress, linkAccount } = useAccountLinking();
|
|
20
20
|
const externalWalletProvider = (_c = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId) != null ? _c : selectedExternalWallet == null ? void 0 : selectedExternalWallet.id;
|
|
@@ -24,13 +24,14 @@ const ExternalWalletNetworkSelectStep = ({ type = "CONNECT" }) => {
|
|
|
24
24
|
const availableWallets = wallets.filter((w) => w.id === externalWalletProvider);
|
|
25
25
|
const firstWallet = availableWallets[0];
|
|
26
26
|
const handleWalletClick = (wallet) => () => __async(void 0, null, function* () {
|
|
27
|
+
setShowNetworkSelect(false);
|
|
27
28
|
switch (type) {
|
|
28
29
|
case "ACCOUNT_LINKING":
|
|
29
30
|
linkAccount({ externalWallet: { provider: wallet.id, type: wallet.type } });
|
|
30
31
|
break;
|
|
31
32
|
case "ADD_EXTERNAL":
|
|
32
33
|
setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
|
|
33
|
-
|
|
34
|
+
setAccountView("ACCOUNT_ADD_EX_WALLET_SELECTED");
|
|
34
35
|
try {
|
|
35
36
|
yield addAdditionalExternalWallet(wallet);
|
|
36
37
|
} catch (error) {
|
|
@@ -40,7 +41,6 @@ const ExternalWalletNetworkSelectStep = ({ type = "CONNECT" }) => {
|
|
|
40
41
|
case "CONNECT":
|
|
41
42
|
default:
|
|
42
43
|
setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
|
|
43
|
-
setStep(ModalStep.EX_WALLET_SELECTED);
|
|
44
44
|
if (wallet.installed || wallet.internalId === "FARCASTER") {
|
|
45
45
|
connectExternalWallet({ wallet });
|
|
46
46
|
} else if (wallet.isMobile) {
|
|
@@ -100,5 +100,5 @@ const ButtonInnerContainer = safeStyled.div`
|
|
|
100
100
|
gap: 8px;
|
|
101
101
|
`;
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
ExternalWalletNetworkSelect
|
|
104
104
|
};
|
|
@@ -6,21 +6,22 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { safeStyled } from "@getpara/react-common";
|
|
7
7
|
import { StyledCpslTileButton } from "../common.js";
|
|
8
8
|
import { CpslButton, CpslIcon, CpslInput, CpslText } from "@getpara/react-components";
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
10
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
11
9
|
import { useState } from "react";
|
|
12
10
|
import { hasEmbeddedAuth } from "../../utils/authLayoutHelpers.js";
|
|
13
11
|
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
12
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
14
13
|
const HAS_MORE_LENGTH = 3;
|
|
15
14
|
const ExternalWallets = ({ isAddingWallets = false }) => {
|
|
16
15
|
const { wallets: allWallets, connectExternalWallet, addAdditionalExternalWallet } = useExternalWallets();
|
|
17
|
-
const setSelectedExternalWallet =
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
const
|
|
16
|
+
const setSelectedExternalWallet = useStore((state) => state.setSelectedExternalWallet);
|
|
17
|
+
const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
|
|
18
|
+
const setShowNetworkSelect = useStore((state) => state.setShowNetworkSelect);
|
|
19
|
+
const selectedAuthView = useStore((state) => state.selectedAuthView);
|
|
20
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
21
|
+
const addShowAll = useStore((state) => state.accountView === "ACCOUNT_ADD_EX_WALLET_MORE");
|
|
22
|
+
const authLayout = useStore((state) => state.authLayout);
|
|
23
23
|
const [search, setSearch] = useState("");
|
|
24
|
+
const showAll = isAddingWallets ? addShowAll : selectedAuthView === "AUTH_ALL_EXTERNAL_WALLETS";
|
|
24
25
|
const dedupedWallets = Array.from(new Set(allWallets.map((wallet) => wallet.id))).map((id) => {
|
|
25
26
|
return allWallets.find((wallet) => wallet.id === id);
|
|
26
27
|
}).filter((wallet) => wallet.internalId !== "FARCASTER");
|
|
@@ -28,21 +29,25 @@ const ExternalWallets = ({ isAddingWallets = false }) => {
|
|
|
28
29
|
const walletsToShow = showAll || !hasMore ? search ? dedupedWallets.filter((w) => w.name.toLowerCase().includes(search.toLowerCase())) : dedupedWallets : dedupedWallets.slice(0, HAS_MORE_LENGTH);
|
|
29
30
|
const showMoreButton = !showAll && hasMore;
|
|
30
31
|
const handleShowAll = () => {
|
|
31
|
-
|
|
32
|
+
setSelectedAuthView("AUTH_ALL_EXTERNAL_WALLETS");
|
|
32
33
|
};
|
|
33
34
|
const handleParaClick = () => {
|
|
34
|
-
|
|
35
|
+
setSelectedAuthView("AUTH_ALL_OPTIONS");
|
|
35
36
|
};
|
|
36
37
|
const handleWalletClick = (wallet) => () => __async(void 0, null, function* () {
|
|
37
38
|
const shouldShowNetworkSelection = allWallets.filter((w) => w.id === wallet.id).length > 1;
|
|
38
39
|
if (shouldShowNetworkSelection) {
|
|
39
40
|
setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
|
|
40
|
-
|
|
41
|
+
setShowNetworkSelect(true);
|
|
42
|
+
if (isAddingWallets) {
|
|
43
|
+
setAccountView("ACCOUNT_ADD_EX_WALLET_NETWORK_SELECT");
|
|
44
|
+
}
|
|
41
45
|
return;
|
|
42
46
|
}
|
|
43
47
|
setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
|
|
44
|
-
|
|
48
|
+
setShowNetworkSelect(false);
|
|
45
49
|
if (isAddingWallets) {
|
|
50
|
+
setAccountView("ACCOUNT_ADD_EX_WALLET_SELECTED");
|
|
46
51
|
try {
|
|
47
52
|
yield addAdditionalExternalWallet(wallet);
|
|
48
53
|
} catch (error) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IFrame: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { safeStyled } from "@getpara/react-common";
|
|
7
|
+
import { CpslSpinner } from "@getpara/react-components";
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { validatePortalOrigin } from "../../utils/validatePortalOrigin.js";
|
|
10
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
+
const IFrame = () => {
|
|
13
|
+
const para = useInternalClient();
|
|
14
|
+
const paraCtxRef = useRef(para.ctx);
|
|
15
|
+
paraCtxRef.current = para.ctx;
|
|
16
|
+
const refs = useStore((state) => state.refs);
|
|
17
|
+
const iFrameUrl = useStore((state) => state.iFrameUrl);
|
|
18
|
+
const setIFrameUrl = useStore((state) => state.setIFrameUrl);
|
|
19
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
20
|
+
const [height, setHeight] = useState(0);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (iFrameUrl) {
|
|
23
|
+
setIsLoaded(false);
|
|
24
|
+
setHeight(0);
|
|
25
|
+
}
|
|
26
|
+
const handleMessage = (event) => {
|
|
27
|
+
if (!iFrameUrl) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!validatePortalOrigin(event, paraCtxRef.current)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (event.data) {
|
|
34
|
+
if (event.data.type === "LOADED") {
|
|
35
|
+
setIsLoaded(true);
|
|
36
|
+
}
|
|
37
|
+
if (event.data.type === "HEIGHT") {
|
|
38
|
+
setHeight(event.data.height);
|
|
39
|
+
}
|
|
40
|
+
if (event.data.type === "CLOSE_WINDOW") {
|
|
41
|
+
setIFrameUrl(null);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
typeof window !== "undefined" && window.addEventListener("message", handleMessage);
|
|
46
|
+
return () => {
|
|
47
|
+
typeof window !== "undefined" && window.removeEventListener("message", handleMessage);
|
|
48
|
+
};
|
|
49
|
+
}, [iFrameUrl]);
|
|
50
|
+
const handleIFrameLoad = useCallback(() => {
|
|
51
|
+
setIsLoaded(true);
|
|
52
|
+
}, []);
|
|
53
|
+
if (!iFrameUrl) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
IFrameComponent,
|
|
59
|
+
{
|
|
60
|
+
ref: refs.iFrame,
|
|
61
|
+
style: __spreadValues({
|
|
62
|
+
display: isLoaded ? "block" : "none",
|
|
63
|
+
overflow: height > 0 ? "auto" : "hidden"
|
|
64
|
+
}, height > 0 && { height }),
|
|
65
|
+
src: iFrameUrl,
|
|
66
|
+
onLoad: handleIFrameLoad,
|
|
67
|
+
"data-testid": "para-portal-iframe"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
!isLoaded && /* @__PURE__ */ jsx(CpslSpinner, {})
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
const Container = safeStyled.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 100%;
|
|
79
|
+
`;
|
|
80
|
+
const IFrameComponent = safeStyled.iframe`
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 52px;
|
|
83
|
+
border: none;
|
|
84
|
+
`;
|
|
85
|
+
export {
|
|
86
|
+
IFrame
|
|
87
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { AuthInfo } from '@getpara/
|
|
1
|
+
import { AuthInfo } from '@getpara/core-sdk';
|
|
2
2
|
import { MutationStatus } from '@tanstack/react-query';
|
|
3
|
-
type
|
|
3
|
+
type VerificationCodeProps = {
|
|
4
4
|
authInfo: AuthInfo<'email' | 'phone'>;
|
|
5
5
|
onSubmit: (_: string) => void;
|
|
6
6
|
onResend: () => void;
|
|
7
7
|
status: MutationStatus;
|
|
8
8
|
error?: Error | string | null;
|
|
9
9
|
};
|
|
10
|
-
export declare const VerificationCode: ({ authInfo, onResend, onSubmit, status, error }:
|
|
11
|
-
export declare const VerificationCodeStep: () => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare const VerificationCode: ({ authInfo, onResend, onSubmit, status, error }: VerificationCodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -5,12 +5,9 @@ import {
|
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CpslCodeInput, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
7
|
import { useEffect, useRef, useState } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import { Heading, InnerStepContainer, StepContainer } from "../common.js";
|
|
8
|
+
import { Heading, InnerStepContainer } from "../common.js";
|
|
10
9
|
import { displayPhoneNumber } from "@getpara/core-sdk";
|
|
11
|
-
import {
|
|
12
|
-
import { useResendVerificationCode } from "../../../provider/index.js";
|
|
13
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
10
|
+
import { safeStyled } from "@getpara/react-common";
|
|
14
11
|
const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
|
|
15
12
|
const inputRef = useRef(null);
|
|
16
13
|
const resendTimerRef = useRef();
|
|
@@ -120,7 +117,7 @@ const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
|
|
|
120
117
|
}
|
|
121
118
|
),
|
|
122
119
|
/* @__PURE__ */ jsxs(InlineText, { variant: "bodyS", color: "secondary", children: [
|
|
123
|
-
"Didn
|
|
120
|
+
"Didn\u2019t receive a code?",
|
|
124
121
|
" ",
|
|
125
122
|
/* @__PURE__ */ jsx(
|
|
126
123
|
ClickableText,
|
|
@@ -136,26 +133,6 @@ const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
|
|
|
136
133
|
] }) })
|
|
137
134
|
] });
|
|
138
135
|
};
|
|
139
|
-
const VerificationCodeStep = () => {
|
|
140
|
-
const { verifyNewAccount, verifyNewAccountStatus, verifyNewAccountError } = useAuthActions();
|
|
141
|
-
const { resendVerificationCodeAsync } = useResendVerificationCode();
|
|
142
|
-
const para = useInternalClient();
|
|
143
|
-
if (!para.authInfo) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(
|
|
147
|
-
VerificationCode,
|
|
148
|
-
{
|
|
149
|
-
authInfo: para.authInfo,
|
|
150
|
-
onSubmit: verifyNewAccount,
|
|
151
|
-
onResend: () => {
|
|
152
|
-
resendVerificationCodeAsync({ type: "SIGNUP" });
|
|
153
|
-
},
|
|
154
|
-
status: verifyNewAccountStatus,
|
|
155
|
-
error: verifyNewAccountError
|
|
156
|
-
}
|
|
157
|
-
) });
|
|
158
|
-
};
|
|
159
136
|
const StyledCodeInput = safeStyled(CpslCodeInput)`
|
|
160
137
|
align-self: center;
|
|
161
138
|
`;
|
|
@@ -168,6 +145,5 @@ const ClickableText = safeStyled(InlineText)`
|
|
|
168
145
|
display: inline-block;
|
|
169
146
|
`;
|
|
170
147
|
export {
|
|
171
|
-
VerificationCode
|
|
172
|
-
VerificationCodeStep
|
|
148
|
+
VerificationCode
|
|
173
149
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VerifyExternalWallet: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,34 +3,27 @@ import "../../../chunk-MMUBH76A.js";
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CpslButton, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
5
|
import { safeStyled } from "@getpara/react-common";
|
|
6
|
-
import { useModalStore } from "../../stores/index.js";
|
|
7
6
|
import { ErrorContainer, ErrorIcon, Heading, InnerStepContainer, StepContainer } from "../common.js";
|
|
8
7
|
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const hasRun = effectRan.current;
|
|
16
|
-
if (!hasRun) {
|
|
17
|
-
verifyWalletSignature();
|
|
18
|
-
effectRan.current = true;
|
|
19
|
-
}
|
|
20
|
-
}, []);
|
|
8
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
9
|
+
const VerifyExternalWallet = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { error } = (_a = useStore((state) => state.paraState)) != null ? _a : {};
|
|
12
|
+
const { verificationStage, retryVerification } = useExternalWallets();
|
|
21
13
|
const isVerifying = verificationStage === "verifying";
|
|
22
14
|
const header = isVerifying ? "Verifying Your Wallet" : "Switching Network";
|
|
23
15
|
const subheader = isVerifying ? "Sign the message with your wallet to complete sign up." : "Confirm the request to switch the network in your wallet.";
|
|
16
|
+
const canRetry = !error || error && error.message !== "External wallet verification failed after max retries";
|
|
24
17
|
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
25
18
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
26
19
|
/* @__PURE__ */ jsx(Heading, { children: header }),
|
|
27
20
|
/* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", children: subheader }),
|
|
28
|
-
!!
|
|
21
|
+
!!error && /* @__PURE__ */ jsxs(ErrorContainer, { children: [
|
|
29
22
|
/* @__PURE__ */ jsx(ErrorIcon, { icon: "alertCircle" }),
|
|
30
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "error", children:
|
|
23
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "error", children: error.message })
|
|
31
24
|
] })
|
|
32
25
|
] }),
|
|
33
|
-
/* @__PURE__ */ jsx(InnerStepContainer, { children: !
|
|
26
|
+
/* @__PURE__ */ jsx(InnerStepContainer, { children: !error ? /* @__PURE__ */ jsx(CpslSpinner, {}) : /* @__PURE__ */ jsx(CpslButton, { onClick: retryVerification, disabled: !canRetry, children: "Retry" }) })
|
|
34
27
|
] });
|
|
35
28
|
};
|
|
36
29
|
const InlineText = safeStyled(CpslText)`
|
|
@@ -38,5 +31,5 @@ const InlineText = safeStyled(CpslText)`
|
|
|
38
31
|
display: inline-block;
|
|
39
32
|
`;
|
|
40
33
|
export {
|
|
41
|
-
|
|
34
|
+
VerifyExternalWallet
|
|
42
35
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export * from "./useDebounce.js";
|
|
3
|
-
export * from "./useFarcasterLogin.js";
|
|
4
3
|
export * from "./useGoBack.js";
|
|
5
4
|
export * from "./useSendMutations.js";
|
|
6
|
-
export * from "
|
|
5
|
+
export * from "../components/flows/account/Profile/useTelegramLink.js";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useStore } from "../../provider/stores/useStore.js";
|
|
5
|
+
import { AuthMethod } from "@getpara/web-sdk";
|
|
6
|
+
import { useExternalWallets } from "../../provider/providers/ExternalWalletProvider.js";
|
|
7
|
+
const useAuthView = () => {
|
|
8
|
+
const paraState = useStore((state) => state.paraState);
|
|
9
|
+
const showPostAuthFlow = useStore((state) => state.showPostAuthFlow);
|
|
10
|
+
const recoverySecret = useStore((state) => state.recoverySecret);
|
|
11
|
+
const hasCreatedWallets = useStore((state) => state.hasCreatedWallets);
|
|
12
|
+
const twoFactorAuthUri = useStore((state) => state.twoFactorAuthUri);
|
|
13
|
+
const selectedAuthView = useStore((state) => state.selectedAuthView);
|
|
14
|
+
const authMethod = useStore((state) => state.authMethod);
|
|
15
|
+
const showNetworkSelect = useStore((state) => state.showNetworkSelect);
|
|
16
|
+
const { wallet: externalWallet } = useExternalWallets();
|
|
17
|
+
const lastAuthViewRef = useStore((state) => state.lastAuthViewRef);
|
|
18
|
+
const _authView = useMemo(() => {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
if (!paraState) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (paraState.corePhase === "error") {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (paraState.corePhase === "authenticated" && showPostAuthFlow) {
|
|
27
|
+
if (recoverySecret) {
|
|
28
|
+
return "AUTH_RECOVERY_SECRET";
|
|
29
|
+
}
|
|
30
|
+
if (hasCreatedWallets) {
|
|
31
|
+
return "AUTH_WALLETS_CREATED";
|
|
32
|
+
}
|
|
33
|
+
if (twoFactorAuthUri) {
|
|
34
|
+
return "AUTH_2FA_SETUP";
|
|
35
|
+
}
|
|
36
|
+
return "AUTH_CONNECTED";
|
|
37
|
+
}
|
|
38
|
+
if (paraState.corePhase === "wallet_flow") {
|
|
39
|
+
if (paraState.walletPhase === "error" || !!paraState.error) {
|
|
40
|
+
return "AUTH_ERROR";
|
|
41
|
+
}
|
|
42
|
+
if (paraState.walletPhase === "creating_guest_wallets") {
|
|
43
|
+
return "AUTH_GUEST_MODE_CONNECTING";
|
|
44
|
+
}
|
|
45
|
+
return "AUTH_CONNECTING";
|
|
46
|
+
}
|
|
47
|
+
if (paraState.corePhase === "auth_flow" || paraState.corePhase === "logging_out") {
|
|
48
|
+
if (paraState.authPhase === "error" || !!paraState.error) {
|
|
49
|
+
return "AUTH_ERROR";
|
|
50
|
+
}
|
|
51
|
+
if (paraState.authPhase === "guest_mode") {
|
|
52
|
+
return "AUTH_GUEST_MODE_CONNECTING";
|
|
53
|
+
}
|
|
54
|
+
if (paraState.authPhase === "processing_authentication" || paraState.authPhase === "awaiting_session_start") {
|
|
55
|
+
return "AUTH_PROCESSING";
|
|
56
|
+
}
|
|
57
|
+
if (paraState.authPhase === "authenticating_email_phone") {
|
|
58
|
+
return selectedAuthView || "AUTH_MAIN";
|
|
59
|
+
}
|
|
60
|
+
if (paraState.authPhase === "unauthenticated" || paraState.authPhase === "checking_state" || paraState.authPhase === "clearing_state" || paraState.authPhase === "uninitialized") {
|
|
61
|
+
if (!!externalWallet) {
|
|
62
|
+
if (showNetworkSelect) {
|
|
63
|
+
return "AUTH_EXTERNAL_WALLET_NETWORK_SELECT";
|
|
64
|
+
}
|
|
65
|
+
return "AUTH_EXTERNAL_WALLET_CONNECT";
|
|
66
|
+
}
|
|
67
|
+
return selectedAuthView || "AUTH_MAIN";
|
|
68
|
+
}
|
|
69
|
+
if (paraState.authPhase === "waiting_for_session") {
|
|
70
|
+
const hasPasskey = (_a = paraState.authStateInfo) == null ? void 0 : _a.hasPasskey;
|
|
71
|
+
const hasPassword = (_b = paraState.authStateInfo) == null ? void 0 : _b.hasPassword;
|
|
72
|
+
const hasPin = (_c = paraState.authStateInfo) == null ? void 0 : _c.hasPin;
|
|
73
|
+
const hasNone = !hasPasskey && !hasPassword && !hasPin;
|
|
74
|
+
if (hasNone) {
|
|
75
|
+
return "AUTH_BASIC_LOGIN";
|
|
76
|
+
}
|
|
77
|
+
if (authMethod === AuthMethod.PASSKEY) return "AUTH_BIOMETRIC_PASSKEY";
|
|
78
|
+
if (authMethod === AuthMethod.PIN) return "AUTH_BIOMETRIC_PIN";
|
|
79
|
+
if (authMethod === AuthMethod.PASSWORD) return "AUTH_BIOMETRIC_PASSWORD";
|
|
80
|
+
return "AUTH_BIOMETRIC_SELECT";
|
|
81
|
+
}
|
|
82
|
+
if (paraState.authPhase === "authenticating_external_wallet" || paraState.authPhase === "connecting_external_wallet") {
|
|
83
|
+
return "AUTH_EXTERNAL_WALLET_CONNECT";
|
|
84
|
+
}
|
|
85
|
+
if (paraState.authPhase === "verifying_external_wallet" || paraState.authPhase === "signing_external_wallet_verification" || paraState.authPhase === "awaiting_wallet_signature" || paraState.authPhase === "awaiting_wallet_verification") {
|
|
86
|
+
return "AUTH_EXTERNAL_WALLET_VERIFY";
|
|
87
|
+
}
|
|
88
|
+
if (paraState.authPhase === "awaiting_account_verification" || paraState.authPhase === "verifying_new_account") {
|
|
89
|
+
return "AUTH_VERIFY_ACCOUNT";
|
|
90
|
+
}
|
|
91
|
+
if (paraState.authPhase === "authenticating_oauth" || paraState.authPhase === "authenticating_farcaster" || paraState.authPhase === "authenticating_telegram") {
|
|
92
|
+
return "AUTH_OAUTH_CONNECT";
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}, [
|
|
98
|
+
paraState,
|
|
99
|
+
showPostAuthFlow,
|
|
100
|
+
recoverySecret,
|
|
101
|
+
hasCreatedWallets,
|
|
102
|
+
twoFactorAuthUri,
|
|
103
|
+
selectedAuthView,
|
|
104
|
+
authMethod,
|
|
105
|
+
externalWallet,
|
|
106
|
+
showNetworkSelect
|
|
107
|
+
]);
|
|
108
|
+
if (_authView !== "AUTH_PROCESSING") {
|
|
109
|
+
lastAuthViewRef.current = _authView;
|
|
110
|
+
}
|
|
111
|
+
return { authView: _authView === "AUTH_PROCESSING" ? lastAuthViewRef.current : _authView };
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
useAuthView
|
|
115
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
import { useStore } from "../../provider/stores/useStore.js";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { AccountPreviousView } from "../components/flows/account/AccountProvider/AccountContext.js";
|
|
6
|
+
import { useAuthView } from "./useAuthView.js";
|
|
7
|
+
const useCanGoBack = () => {
|
|
8
|
+
const accountView = useStore((state) => state.accountView);
|
|
9
|
+
const paraState = useStore((state) => state.paraState);
|
|
10
|
+
const { authView } = useAuthView();
|
|
11
|
+
const canGoBack = useMemo(() => {
|
|
12
|
+
if (authView) {
|
|
13
|
+
switch (authView) {
|
|
14
|
+
case "AUTH_ALL_EXTERNAL_WALLETS":
|
|
15
|
+
case "AUTH_ALL_OPTIONS":
|
|
16
|
+
case "AUTH_VERIFY_ACCOUNT":
|
|
17
|
+
case "AUTH_OAUTH_CONNECT":
|
|
18
|
+
case "AUTH_EXTERNAL_WALLET_CONNECT":
|
|
19
|
+
case "AUTH_EXTERNAL_WALLET_NETWORK_SELECT":
|
|
20
|
+
case "AUTH_EXTERNAL_WALLET_VERIFY":
|
|
21
|
+
case "AUTH_BIOMETRIC_SELECT":
|
|
22
|
+
case "AUTH_ERROR":
|
|
23
|
+
case "AUTH_BIOMETRIC_PASSWORD":
|
|
24
|
+
case "AUTH_BIOMETRIC_PIN":
|
|
25
|
+
case "AUTH_BIOMETRIC_PASSKEY":
|
|
26
|
+
case "AUTH_BASIC_LOGIN":
|
|
27
|
+
return true;
|
|
28
|
+
case "AUTH_MAIN":
|
|
29
|
+
case "AUTH_GUEST_MODE_CONNECTING":
|
|
30
|
+
case "AUTH_2FA_SETUP":
|
|
31
|
+
case "AUTH_RECOVERY_SECRET":
|
|
32
|
+
case "AUTH_WALLETS_CREATED":
|
|
33
|
+
case "AUTH_CONNECTED":
|
|
34
|
+
case "AUTH_CONNECTING":
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if ((paraState == null ? void 0 : paraState.corePhase) === "authenticated" || (paraState == null ? void 0 : paraState.corePhase) === "guest_mode") {
|
|
39
|
+
return !!AccountPreviousView[accountView];
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}, [authView, accountView, paraState]);
|
|
43
|
+
return { canGoBack };
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
useCanGoBack
|
|
47
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useStore } from "../../provider/stores/useStore.js";
|
|
5
5
|
const useDropdownPosition = (inputRef) => {
|
|
6
6
|
const [dropdownMaxHeight, setDropdownMaxHeight] = useState();
|
|
7
7
|
const [dropdownWidth, setDropdownWidth] = useState();
|
|
8
8
|
const [mobileAnchor, setMobileAnchor] = useState(null);
|
|
9
|
-
const modalContainerRef =
|
|
9
|
+
const modalContainerRef = useStore((state) => state.refs.modalContainer);
|
|
10
10
|
const resize = useCallback(() => {
|
|
11
11
|
if (typeof window !== "undefined" && inputRef.current) {
|
|
12
12
|
const rect = inputRef.current.getBoundingClientRect();
|