@getpara/react-sdk-lite 2.11.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 +57 -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 +3 -4
- 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 +13 -18
- package/dist/modal/components/common.d.ts +5 -0
- package/dist/modal/components/common.js +17 -10
- 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} +17 -22
- 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} +16 -23
- 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 +19 -6
- 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} +12 -18
- 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} +17 -37
- 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.d.ts +1 -1
- package/dist/modal/hooks/useDropdownPosition.js +41 -0
- 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/mutations/utils.js +1 -1
- 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/useAutoSessionKeepAlive.js +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 +4 -3
- package/dist/provider/hooks/utils/useModal.js +17 -9
- 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/AuthInput/hooks/useDropdownPosition.js +0 -33
- 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 -119
- package/dist/modal/stores/modal/useModalStore.js +0 -80
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WaitForWalletCreationParams, WaitForWalletCreationResponse } from '@getpara/web-sdk';
|
|
1
2
|
export declare const WAIT_FOR_WALLET_CREATION_KEY = "WAIT_FOR_WALLET_CREATION";
|
|
2
3
|
/**
|
|
3
4
|
* React hook for the `waitForWalletCreation` mutation.
|
|
@@ -14,41 +15,20 @@ export declare const WAIT_FOR_WALLET_CREATION_KEY = "WAIT_FOR_WALLET_CREATION";
|
|
|
14
15
|
* await waitForWalletCreationAsync({ ...params });
|
|
15
16
|
*/
|
|
16
17
|
export declare const useWaitForWalletCreation: () => {
|
|
17
|
-
|
|
18
|
+
data: WaitForWalletCreationResponse | undefined;
|
|
19
|
+
variables: void | WaitForWalletCreationParams | undefined;
|
|
18
20
|
error: Error | null;
|
|
19
|
-
data: {
|
|
20
|
-
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
21
|
-
recoverySecret?: string | undefined;
|
|
22
|
-
} | undefined;
|
|
23
|
-
isSuccess: boolean;
|
|
24
|
-
variables: void | {
|
|
25
|
-
onPoll?: (() => void) | undefined;
|
|
26
|
-
onCancel?: (() => void) | undefined;
|
|
27
|
-
isCanceled?: (() => boolean) | undefined;
|
|
28
|
-
} | undefined;
|
|
29
21
|
isError: boolean;
|
|
30
22
|
isIdle: boolean;
|
|
31
23
|
isPending: boolean;
|
|
24
|
+
isSuccess: boolean;
|
|
25
|
+
status: "pending" | "error" | "idle" | "success";
|
|
32
26
|
reset: () => void;
|
|
33
27
|
context: unknown;
|
|
34
28
|
failureCount: number;
|
|
35
29
|
failureReason: Error | null;
|
|
36
30
|
isPaused: boolean;
|
|
37
31
|
submittedAt: number;
|
|
38
|
-
waitForWalletCreation: import("@tanstack/react-query").UseMutateFunction<
|
|
39
|
-
|
|
40
|
-
recoverySecret?: string | undefined;
|
|
41
|
-
}, Error, void | {
|
|
42
|
-
onPoll?: (() => void) | undefined;
|
|
43
|
-
onCancel?: (() => void) | undefined;
|
|
44
|
-
isCanceled?: (() => boolean) | undefined;
|
|
45
|
-
}, unknown>;
|
|
46
|
-
waitForWalletCreationAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
47
|
-
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
48
|
-
recoverySecret?: string | undefined;
|
|
49
|
-
}, Error, void | {
|
|
50
|
-
onPoll?: (() => void) | undefined;
|
|
51
|
-
onCancel?: (() => void) | undefined;
|
|
52
|
-
isCanceled?: (() => boolean) | undefined;
|
|
53
|
-
}, unknown>;
|
|
32
|
+
waitForWalletCreation: import("@tanstack/react-query").UseMutateFunction<WaitForWalletCreationResponse, Error, void | WaitForWalletCreationParams, unknown>;
|
|
33
|
+
waitForWalletCreationAsync: import("@tanstack/react-query").UseMutateAsyncFunction<WaitForWalletCreationResponse, Error, void | WaitForWalletCreationParams, unknown>;
|
|
54
34
|
};
|
|
@@ -17,7 +17,7 @@ function generateInternalMutation(method, action, {
|
|
|
17
17
|
mutationFn: (args) => __async(this, null, function* () {
|
|
18
18
|
if (typeof delay === "number") yield new Promise((resolve) => setTimeout(resolve, delay));
|
|
19
19
|
try {
|
|
20
|
-
const result =
|
|
20
|
+
const result = action(para, args != null ? args : defaultParams);
|
|
21
21
|
return result;
|
|
22
22
|
} catch (error) {
|
|
23
23
|
throw error;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare const IS_FULLY_LOGGED_IN_BASE_KEY = "PARA_FULLY_LOGGED_IN";
|
|
2
2
|
/**
|
|
3
|
-
* Hook for returning whether the user is fully logged in with Para
|
|
3
|
+
* Hook for returning whether the user is fully logged in with Para.
|
|
4
|
+
* Uses the core state machine phase as a reactive query key so the query
|
|
5
|
+
* automatically refetches on state transitions (login, logout, etc.)
|
|
6
|
+
* without relying on manual event-based invalidation.
|
|
4
7
|
*/
|
|
5
8
|
export declare const useIsFullyLoggedIn: () => import("@tanstack/react-query").UseQueryResult<boolean, Error>;
|
|
@@ -4,13 +4,18 @@ import {
|
|
|
4
4
|
} from "../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { useQuery } from "@tanstack/react-query";
|
|
6
6
|
import { useInternalClient } from "../utils/useInternalClient.js";
|
|
7
|
+
import { useStore } from "../../stores/useStore.js";
|
|
7
8
|
const IS_FULLY_LOGGED_IN_BASE_KEY = "PARA_FULLY_LOGGED_IN";
|
|
8
9
|
const useIsFullyLoggedIn = () => {
|
|
9
10
|
var _a;
|
|
10
11
|
const client = useInternalClient();
|
|
12
|
+
const corePhase = useStore((state) => {
|
|
13
|
+
var _a2;
|
|
14
|
+
return (_a2 = state.paraState) == null ? void 0 : _a2.corePhase;
|
|
15
|
+
});
|
|
11
16
|
return useQuery({
|
|
12
17
|
enabled: !!(client == null ? void 0 : client.isReady),
|
|
13
|
-
queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY, (_a = client == null ? void 0 : client.userId) != null ? _a : null],
|
|
18
|
+
queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY, corePhase != null ? corePhase : null, (_a = client == null ? void 0 : client.userId) != null ? _a : null],
|
|
14
19
|
queryFn: () => __async(void 0, null, function* () {
|
|
15
20
|
var _a2;
|
|
16
21
|
return (_a2 = yield client == null ? void 0 : client.isFullyLoggedIn()) != null ? _a2 : false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { GetLinkedAccountsParams } from '@getpara/web-sdk';
|
|
2
2
|
export declare const LINKED_ACCOUNTS_BASE_KEY = "PARA_LINKED_ACCOUNTS";
|
|
3
3
|
/**
|
|
4
4
|
* Hook for returning the linked accounts of the user.
|
|
@@ -6,6 +6,4 @@ export declare const LINKED_ACCOUNTS_BASE_KEY = "PARA_LINKED_ACCOUNTS";
|
|
|
6
6
|
* - withMetadata (boolean): Whether to include metadata for each linked account. Defaults to false.
|
|
7
7
|
* @returns A query object containing the linked accounts array and query status.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useLinkedAccounts: (params?:
|
|
10
|
-
userId: string;
|
|
11
|
-
}, Error>;
|
|
9
|
+
export declare const useLinkedAccounts: (params?: GetLinkedAccountsParams) => import("@tanstack/react-query").UseQueryResult<import("@getpara/web-sdk").GetLinkedAccountsResponse, Error>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
import { useInternalClient } from "../utils/useInternalClient.js";
|
|
5
|
-
const IS_FULLY_LOGGED_IN_BASE_KEY = "PARA_FULLY_LOGGED_IN";
|
|
6
5
|
const useParaStatus = () => {
|
|
7
6
|
var _a, _b;
|
|
8
7
|
const client = useInternalClient();
|
|
@@ -20,6 +19,5 @@ const useParaStatus = () => {
|
|
|
20
19
|
return data != null ? data : { isReady: false, isFarcasterMiniApp: false };
|
|
21
20
|
};
|
|
22
21
|
export {
|
|
23
|
-
IS_FULLY_LOGGED_IN_BASE_KEY,
|
|
24
22
|
useParaStatus
|
|
25
23
|
};
|
|
@@ -2,4 +2,4 @@ export declare const WALLET_BASE_KEY = "PARA_WALLET";
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook for retrieving the selected wallet
|
|
4
4
|
*/
|
|
5
|
-
export declare const useWallet: () => import("@tanstack/react-query").UseQueryResult<
|
|
5
|
+
export declare const useWallet: () => import("@tanstack/react-query").UseQueryResult<import("@getpara/core-sdk/dist/types/types/wallet.js").WalletNoSigner | null, Error>;
|
|
@@ -27,7 +27,7 @@ const useAutoSessionKeepAlive = ({ disabled }) => {
|
|
|
27
27
|
}, [client, embedded, disabled]);
|
|
28
28
|
const getSessionExpiry = () => __async(void 0, null, function* () {
|
|
29
29
|
try {
|
|
30
|
-
const sessionCookie =
|
|
30
|
+
const sessionCookie = client == null ? void 0 : client.retrieveSessionCookie();
|
|
31
31
|
if (!sessionCookie) return null;
|
|
32
32
|
const expiresMatch = sessionCookie.match(/Expires=([^;]+)/);
|
|
33
33
|
return expiresMatch ? new Date(expiresMatch[1]) : null;
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import { ACCOUNT_BASE_KEY } from "../queries/useAccount.js";
|
|
11
11
|
import { WALLET_BASE_KEY } from "../queries/useWallet.js";
|
|
12
12
|
import { WALLET_BALANCE_BASE_KEY } from "../queries/useWalletBalance.js";
|
|
13
|
-
import { IS_FULLY_LOGGED_IN_BASE_KEY } from "../queries/useIsFullyLoggedIn.js";
|
|
14
13
|
import { useModalSessionStore } from "../../../modal/stores/index.js";
|
|
15
14
|
const useEventListeners = ({
|
|
16
15
|
onLogin,
|
|
@@ -31,7 +30,6 @@ const useEventListeners = ({
|
|
|
31
30
|
const { updateSelectedWallet } = useWalletState();
|
|
32
31
|
const setSendTx = useModalSessionStore((state) => state.setSendTx);
|
|
33
32
|
const loginOrSetupListener = useCallback(() => {
|
|
34
|
-
queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
35
33
|
queryClient.refetchQueries({ queryKey: [ACCOUNT_BASE_KEY] });
|
|
36
34
|
queryClient.refetchQueries({ queryKey: [WALLET_BASE_KEY] });
|
|
37
35
|
queryClient.invalidateQueries({ queryKey: [WALLET_BALANCE_BASE_KEY], exact: false });
|
|
@@ -59,8 +57,6 @@ const useEventListeners = ({
|
|
|
59
57
|
);
|
|
60
58
|
const logoutListener = useCallback(
|
|
61
59
|
(event) => {
|
|
62
|
-
queryClient.setQueriesData({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] }, false);
|
|
63
|
-
queryClient.invalidateQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
64
60
|
queryClient.invalidateQueries({ queryKey: [ACCOUNT_BASE_KEY] });
|
|
65
61
|
clearSelectedWallet();
|
|
66
62
|
setSendTx(null);
|
|
@@ -82,7 +78,6 @@ const useEventListeners = ({
|
|
|
82
78
|
);
|
|
83
79
|
const walletChangeListener = useCallback(
|
|
84
80
|
(event) => {
|
|
85
|
-
queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
86
81
|
queryClient.refetchQueries({ queryKey: [ACCOUNT_BASE_KEY] });
|
|
87
82
|
updateSelectedWallet();
|
|
88
83
|
onWalletsChange == null ? void 0 : onWalletsChange(event);
|
|
@@ -91,7 +86,6 @@ const useEventListeners = ({
|
|
|
91
86
|
);
|
|
92
87
|
const externalWalletChangeListener = useCallback(
|
|
93
88
|
(event) => {
|
|
94
|
-
queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
95
89
|
queryClient.refetchQueries({ queryKey: [ACCOUNT_BASE_KEY] });
|
|
96
90
|
updateSelectedWallet();
|
|
97
91
|
onExternalWalletChange == null ? void 0 : onExternalWalletChange(event);
|
|
@@ -112,7 +106,6 @@ const useEventListeners = ({
|
|
|
112
106
|
);
|
|
113
107
|
const guestWalletsCreatedListener = useCallback(
|
|
114
108
|
(event) => {
|
|
115
|
-
queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
116
109
|
queryClient.refetchQueries({ queryKey: [ACCOUNT_BASE_KEY] });
|
|
117
110
|
updateSelectedWallet();
|
|
118
111
|
onGuestWalletsCreated == null ? void 0 : onGuestWalletsCreated(event);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hook for getting formatted biometric hints
|
|
3
|
+
* Reads passkey hints from paraState.authStateInfo (state-driven approach)
|
|
3
4
|
*/
|
|
4
5
|
export declare const useFormattedBiometricHints: () => import("@tanstack/react-query").UseQueryResult<import("@getpara/react-common").BiometricHints | null, Error>;
|
|
@@ -3,22 +3,26 @@ import {
|
|
|
3
3
|
__async
|
|
4
4
|
} from "../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { useQuery } from "@tanstack/react-query";
|
|
6
|
-
import { useModalStore } from "../../../modal/stores/index.js";
|
|
7
6
|
import { formatBiometricHints } from "@getpara/react-common";
|
|
8
7
|
import { useClient } from "./useClient.js";
|
|
8
|
+
import { useStore } from "../../stores/useStore.js";
|
|
9
9
|
const queryKey = ["FORMATTED_BIOMETRIC_HINTS"];
|
|
10
10
|
const useFormattedBiometricHints = () => {
|
|
11
11
|
var _a;
|
|
12
12
|
const client = useClient();
|
|
13
|
-
const
|
|
13
|
+
const authStateInfo = useStore((state) => {
|
|
14
|
+
var _a2;
|
|
15
|
+
return (_a2 = state.paraState) == null ? void 0 : _a2.authStateInfo;
|
|
16
|
+
});
|
|
17
|
+
const passkeyHints = (_a = authStateInfo == null ? void 0 : authStateInfo.passkeyHints) != null ? _a : null;
|
|
14
18
|
return useQuery({
|
|
15
|
-
queryKey: [...queryKey,
|
|
19
|
+
queryKey: [...queryKey, passkeyHints != null ? passkeyHints : "undefined"],
|
|
16
20
|
queryFn: () => __async(void 0, null, function* () {
|
|
17
|
-
if (!client || !
|
|
21
|
+
if (!client || !passkeyHints) {
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
24
|
const isPasskeySupported = yield client.isPasskeySupported();
|
|
21
|
-
return formatBiometricHints(
|
|
25
|
+
return formatBiometricHints(passkeyHints, isPasskeySupported);
|
|
22
26
|
})
|
|
23
27
|
});
|
|
24
28
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StepOverride } from '../../../modal/types/modalProps.js';
|
|
2
2
|
/**
|
|
3
3
|
* Hook for controlling the Para modal
|
|
4
4
|
*/
|
|
5
5
|
export declare const useModal: () => {
|
|
6
6
|
isOpen: boolean;
|
|
7
|
-
openModal: ({ step }?: {
|
|
8
|
-
step?:
|
|
7
|
+
openModal: ({ step, defaultAuthIdentifier }?: {
|
|
8
|
+
step?: StepOverride;
|
|
9
|
+
defaultAuthIdentifier?: string;
|
|
9
10
|
}) => void;
|
|
10
11
|
closeModal: () => void;
|
|
11
12
|
};
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
+
import { useStore, store } from "../../stores/useStore.js";
|
|
5
7
|
const useModal = () => {
|
|
6
8
|
const isOpen = useStore((state) => state.isOpen);
|
|
7
9
|
const setIsOpen = useStore((state) => state.setIsOpen);
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const openModal = ({ step } = {}) => {
|
|
10
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
11
|
+
const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
|
|
12
|
+
const openModal = ({ step, defaultAuthIdentifier } = {}) => {
|
|
13
|
+
if (defaultAuthIdentifier !== void 0) {
|
|
14
|
+
const { modalConfig, setModalConfig } = store.getState();
|
|
15
|
+
setModalConfig(__spreadProps(__spreadValues({}, modalConfig), { defaultAuthIdentifier }));
|
|
16
|
+
}
|
|
11
17
|
if (step) {
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
if (step.startsWith("ACCOUNT_")) {
|
|
19
|
+
setAccountView(step);
|
|
20
|
+
} else if (step.startsWith("AUTH_")) {
|
|
21
|
+
setSelectedAuthView(step);
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
if (!isOpen) {
|
|
16
25
|
setIsOpen(true);
|
|
17
26
|
}
|
|
18
27
|
};
|
|
19
28
|
const closeModal = () => {
|
|
20
|
-
refs.openedToStep.current = null;
|
|
21
29
|
setIsOpen(false);
|
|
22
30
|
};
|
|
23
31
|
return { isOpen, openModal, closeModal };
|
|
@@ -5,12 +5,12 @@ import { TWalletType } from '@getpara/web-sdk';
|
|
|
5
5
|
export declare const useWalletState: () => {
|
|
6
6
|
selectedWallet: {
|
|
7
7
|
id: string | undefined;
|
|
8
|
-
type: "
|
|
8
|
+
type: "EVM" | "SOLANA" | "COSMOS" | undefined;
|
|
9
9
|
address: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
setSelectedWallet: ({ id, type }: {
|
|
12
12
|
id?: string;
|
|
13
13
|
type?: TWalletType;
|
|
14
|
-
}) => void
|
|
15
|
-
updateSelectedWallet: () => void
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
updateSelectedWallet: () => Promise<void>;
|
|
16
16
|
};
|
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { useStore } from "../../stores/useStore.js";
|
|
4
6
|
import { useClient } from "./useClient.js";
|
|
5
7
|
import { useCallback } from "react";
|
|
8
|
+
import { useExternalWallets } from "../../providers/ExternalWalletProvider.js";
|
|
6
9
|
const useWalletState = () => {
|
|
7
10
|
const client = useClient();
|
|
11
|
+
const externalWallets = useExternalWallets();
|
|
8
12
|
const selectedWalletId = useStore((state) => state.selectedWalletId);
|
|
9
13
|
const selectedWalletType = useStore((state) => state.selectedWalletType);
|
|
10
14
|
const setStoredSelectedWallet = useStore((state) => state.setSelectedWallet);
|
|
11
15
|
const clearSelectedWallet = useStore((state) => state.clearSelectedWallet);
|
|
12
16
|
const setSelectedWallet = useCallback(
|
|
13
|
-
({ id, type })
|
|
17
|
+
(_0) => __async(void 0, [_0], function* ({ id, type }) {
|
|
14
18
|
try {
|
|
15
19
|
const validId = client == null ? void 0 : client.findWalletId(id, type ? { type: [type] } : void 0);
|
|
16
20
|
if (validId !== id) {
|
|
17
21
|
clearSelectedWallet();
|
|
18
22
|
} else {
|
|
23
|
+
const wallet = client == null ? void 0 : client.findWallet(validId, type);
|
|
24
|
+
if (wallet) {
|
|
25
|
+
yield externalWallets.switchConnection({ type: wallet.type, id: !!wallet.isExternal ? wallet.name : "Para" });
|
|
26
|
+
}
|
|
19
27
|
setStoredSelectedWallet(id, type);
|
|
20
28
|
}
|
|
21
29
|
} catch (e) {
|
|
22
30
|
clearSelectedWallet();
|
|
23
31
|
}
|
|
24
|
-
},
|
|
32
|
+
}),
|
|
25
33
|
[client, clearSelectedWallet, setStoredSelectedWallet]
|
|
26
34
|
);
|
|
27
|
-
const updateSelectedWallet = useCallback(() => {
|
|
35
|
+
const updateSelectedWallet = useCallback(() => __async(void 0, null, function* () {
|
|
28
36
|
if (!client) {
|
|
29
37
|
clearSelectedWallet();
|
|
30
38
|
return;
|
|
31
39
|
}
|
|
32
40
|
if (!selectedWalletId || !client.findWallet(selectedWalletId)) {
|
|
33
41
|
const defaultWallet = client.findWallet(void 0, void 0, { forbidPregen: true });
|
|
34
|
-
setSelectedWallet({ id: defaultWallet == null ? void 0 : defaultWallet.id, type: defaultWallet == null ? void 0 : defaultWallet.type });
|
|
42
|
+
yield setSelectedWallet({ id: defaultWallet == null ? void 0 : defaultWallet.id, type: defaultWallet == null ? void 0 : defaultWallet.type });
|
|
35
43
|
}
|
|
36
|
-
}, [clearSelectedWallet, setSelectedWallet, client, selectedWalletId]);
|
|
44
|
+
}), [clearSelectedWallet, setSelectedWallet, client, selectedWalletId]);
|
|
37
45
|
return {
|
|
38
46
|
selectedWallet: {
|
|
39
47
|
id: selectedWalletId,
|
|
@@ -11,15 +11,13 @@ import {
|
|
|
11
11
|
AccountLinkError,
|
|
12
12
|
LINKED_ACCOUNT_TYPES
|
|
13
13
|
} from "@getpara/web-sdk";
|
|
14
|
-
import { useModalStore } from "../../modal/stores/index.js";
|
|
15
|
-
import { ModalStep } from "../../modal/index.js";
|
|
16
14
|
import { useGoBack } from "../../modal/hooks/useGoBack.js";
|
|
17
15
|
import { useExternalWallets } from "./ExternalWalletProvider.js";
|
|
18
16
|
import { useInternalClient } from "../hooks/utils/useInternalClient.js";
|
|
19
17
|
import { generateInternalMutation } from "../hooks/mutations/utils.js";
|
|
20
18
|
import { validateAuth } from "../../modal/utils/authInputHelpers.js";
|
|
21
19
|
import { EXTERNAL_WALLET_TYPES, extractAuthInfo } from "@getpara/user-management-client";
|
|
22
|
-
import { useStore } from "../stores/useStore.js";
|
|
20
|
+
import { store, useStore } from "../stores/useStore.js";
|
|
23
21
|
import { LINKED_ACCOUNTS_BASE_KEY } from "../hooks/queries/useLinkedAccounts.js";
|
|
24
22
|
const AccountLinkContext = createContext({
|
|
25
23
|
isEnabled: false,
|
|
@@ -81,14 +79,14 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
81
79
|
} = useExternalWallets();
|
|
82
80
|
const { isOpen, openModal } = useModal();
|
|
83
81
|
const includeWalletVerification = useStore((state) => state.includeWalletVerification);
|
|
84
|
-
const
|
|
85
|
-
const setFarcasterConnectUri =
|
|
86
|
-
const refs =
|
|
87
|
-
const externalWalletError =
|
|
88
|
-
const accountLinkOptions =
|
|
89
|
-
const setAccountLinkOptions =
|
|
82
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
83
|
+
const setFarcasterConnectUri = useStore((state) => state.setFarcasterConnectUri);
|
|
84
|
+
const refs = useStore((state) => state.refs);
|
|
85
|
+
const externalWalletError = useStore((state) => state.externalWalletError);
|
|
86
|
+
const accountLinkOptions = useStore((state) => state.accountLinkOptions) || [...LINKED_ACCOUNT_TYPES];
|
|
87
|
+
const setAccountLinkOptions = useStore((state) => state.setAccountLinkOptions);
|
|
90
88
|
const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
|
|
91
|
-
const goBack = useGoBack();
|
|
89
|
+
const { goBack } = useGoBack();
|
|
92
90
|
const { mutateAsync: mutateLinkAccountAsync, isPending: isLinkAccountPending } = useLinkAccount();
|
|
93
91
|
const { mutate: mutateUnlinkAccount, isPending: isUnlinkAccountPending } = useUnlinkAccount();
|
|
94
92
|
const {
|
|
@@ -135,7 +133,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
135
133
|
throw new Error("Account linking options array must contain 2 or more items");
|
|
136
134
|
}
|
|
137
135
|
setAccountLinkOptions(options);
|
|
138
|
-
openModal({ step:
|
|
136
|
+
openModal({ step: "ACCOUNT_PROFILE_LIST" });
|
|
139
137
|
}
|
|
140
138
|
break;
|
|
141
139
|
case (args && "externalWallet" in args):
|
|
@@ -159,7 +157,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
159
157
|
if (!linkWallet) {
|
|
160
158
|
throw new Error(`wallet not installed: ${providerId}`);
|
|
161
159
|
}
|
|
162
|
-
openModal({ step: !type ?
|
|
160
|
+
openModal({ step: !type ? "ACCOUNT_LINK_EX_WALLET_NETWORK_SELECT" : "ACCOUNT_PROFILE_ADD" });
|
|
163
161
|
if (!type) {
|
|
164
162
|
return;
|
|
165
163
|
}
|
|
@@ -213,7 +211,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
if (!isOpen) {
|
|
216
|
-
openModal({ step:
|
|
214
|
+
openModal({ step: "ACCOUNT_PROFILE_ADD" });
|
|
217
215
|
}
|
|
218
216
|
try {
|
|
219
217
|
const accountLinkInProgress2 = yield mutateLinkAccountAsync(args);
|
|
@@ -226,7 +224,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
226
224
|
});
|
|
227
225
|
const onAccountLinked = (accountLinkInProgress2) => __async(void 0, null, function* () {
|
|
228
226
|
queryClient.setQueryData(["accountLinkInProgress"], accountLinkInProgress2 != null ? accountLinkInProgress2 : null);
|
|
229
|
-
|
|
227
|
+
setAccountView("ACCOUNT_PROFILE_ADD");
|
|
230
228
|
switch (accountLinkInProgress2.type) {
|
|
231
229
|
case "EMAIL":
|
|
232
230
|
case "PHONE":
|
|
@@ -270,7 +268,10 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
270
268
|
const verifyFarcasterLink = () => __async(void 0, null, function* () {
|
|
271
269
|
mutateVerifyFarcasterLink(
|
|
272
270
|
{
|
|
273
|
-
isCanceled: () =>
|
|
271
|
+
isCanceled: () => {
|
|
272
|
+
const currentView = store.getState().accountView;
|
|
273
|
+
return currentView !== "ACCOUNT_PROFILE_ADD";
|
|
274
|
+
},
|
|
274
275
|
onConnectUri: (connectUri) => {
|
|
275
276
|
setFarcasterConnectUri(connectUri);
|
|
276
277
|
}
|
|
@@ -278,7 +279,8 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
278
279
|
{
|
|
279
280
|
onSuccess: onAccountLinkVerified,
|
|
280
281
|
onError: () => {
|
|
281
|
-
|
|
282
|
+
const currentView = store.getState().accountView;
|
|
283
|
+
if (currentView === "ACCOUNT_PROFILE_ADD") {
|
|
282
284
|
goBack();
|
|
283
285
|
}
|
|
284
286
|
}
|
|
@@ -325,7 +327,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
325
327
|
}
|
|
326
328
|
}
|
|
327
329
|
setTimeout(() => {
|
|
328
|
-
|
|
330
|
+
setAccountView("ACCOUNT_PROFILE");
|
|
329
331
|
setAccountLinkInProgress(void 0);
|
|
330
332
|
}, 2e3);
|
|
331
333
|
});
|
|
@@ -335,7 +337,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
335
337
|
};
|
|
336
338
|
const unlinkAccount = (linkedAccount) => {
|
|
337
339
|
setUnlinkingAccount(linkedAccount);
|
|
338
|
-
|
|
340
|
+
setAccountView("ACCOUNT_PROFILE_REMOVE");
|
|
339
341
|
};
|
|
340
342
|
const unlinkAccountConfirm = () => {
|
|
341
343
|
mutateUnlinkAccount(
|
|
@@ -346,7 +348,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
346
348
|
onSuccess: (updatedAccounts) => {
|
|
347
349
|
queryClient.setQueryData(["getLinkedAccounts"], () => updatedAccounts);
|
|
348
350
|
setUnlinkingAccount(void 0);
|
|
349
|
-
|
|
351
|
+
setAccountView("ACCOUNT_PROFILE");
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
354
|
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Auth, AuthMethod, TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
+
export type AuthView = 'AUTH_MAIN' | 'AUTH_ALL_OPTIONS' | 'AUTH_ALL_EXTERNAL_WALLETS' | 'AUTH_VERIFY_ACCOUNT' | 'AUTH_OAUTH_CONNECT' | 'AUTH_EXTERNAL_WALLET_NETWORK_SELECT' | 'AUTH_EXTERNAL_WALLET_CONNECT' | 'AUTH_EXTERNAL_WALLET_VERIFY' | 'AUTH_BIOMETRIC_SELECT' | 'AUTH_BIOMETRIC_PIN' | 'AUTH_BIOMETRIC_PASSWORD' | 'AUTH_BIOMETRIC_PASSKEY' | 'AUTH_BASIC_LOGIN' | 'AUTH_PROCESSING' | 'AUTH_CONNECTING' | 'AUTH_GUEST_MODE_CONNECTING' | 'AUTH_RECOVERY_SECRET' | 'AUTH_WALLETS_CREATED' | 'AUTH_2FA_SETUP' | 'AUTH_CONNECTED' | 'AUTH_ERROR';
|
|
3
|
+
export interface AuthContextValue {
|
|
4
|
+
verifyEmailOrPhone: {
|
|
5
|
+
verify: (_: string) => Promise<void>;
|
|
6
|
+
isVerifying: boolean;
|
|
7
|
+
};
|
|
8
|
+
authenticateWithEmailOrPhone: {
|
|
9
|
+
authenticate: (_: Auth<'email'> | Auth<'phone'>) => Promise<void>;
|
|
10
|
+
isAuthenticating: boolean;
|
|
11
|
+
};
|
|
12
|
+
authenticateWithOAuth: {
|
|
13
|
+
authenticate: (_: TOAuthMethod) => Promise<void>;
|
|
14
|
+
isAuthenticating: boolean;
|
|
15
|
+
};
|
|
16
|
+
openBiometricUrl: (method: AuthMethod) => void;
|
|
17
|
+
createGuestWallets: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare const AuthContext: import("react").Context<AuthContextValue>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { createContext } from "react";
|
|
6
|
+
const defaultAuthContextValue = {
|
|
7
|
+
verifyEmailOrPhone: {
|
|
8
|
+
verify: () => __async(void 0, null, function* () {
|
|
9
|
+
throw new Error("verifyEmailOrPhone not implemented");
|
|
10
|
+
}),
|
|
11
|
+
isVerifying: false
|
|
12
|
+
},
|
|
13
|
+
authenticateWithEmailOrPhone: {
|
|
14
|
+
authenticate: () => __async(void 0, null, function* () {
|
|
15
|
+
throw new Error("handleAuthenticateWithEmailOrPhone not implemented");
|
|
16
|
+
}),
|
|
17
|
+
isAuthenticating: false
|
|
18
|
+
},
|
|
19
|
+
authenticateWithOAuth: {
|
|
20
|
+
authenticate: () => __async(void 0, null, function* () {
|
|
21
|
+
throw new Error("handleAuthenticateWithOAuth not implemented");
|
|
22
|
+
}),
|
|
23
|
+
isAuthenticating: false
|
|
24
|
+
},
|
|
25
|
+
openBiometricUrl: () => {
|
|
26
|
+
throw new Error("openBiometricUrl not implemented");
|
|
27
|
+
},
|
|
28
|
+
createGuestWallets: () => __async(void 0, null, function* () {
|
|
29
|
+
throw new Error("createGuestWallets not implemented");
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
const AuthContext = createContext(defaultAuthContextValue);
|
|
33
|
+
export {
|
|
34
|
+
AuthContext
|
|
35
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { AuthContextValue } from './AuthContext.js';
|
|
3
|
+
interface AuthProviderProps extends PropsWithChildren {
|
|
4
|
+
defaultAuthIdentifier?: string;
|
|
5
|
+
isTwoFactorAuthEnabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AuthProvider: React.FC<AuthProviderProps>;
|
|
8
|
+
export declare const useAuth: () => AuthContextValue;
|
|
9
|
+
export {};
|