@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
package/dist/css/modal.css
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/modal/ParaModal.js
CHANGED
|
@@ -9,8 +9,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
9
9
|
import { CpslAuthModal, defineCustomElements, generateTheme } from "@getpara/react-components";
|
|
10
10
|
import { ModalContent } from "./components/index.js";
|
|
11
11
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
12
|
-
import { useModalStore } from "./stores/index.js";
|
|
13
|
-
import { ModalStep, RESET_TO_ACCOUNT_STEPS, RESET_TO_AUTH_STEPS } from "./utils/steps.js";
|
|
14
12
|
import { AuthLayout } from "./types/modalProps.js";
|
|
15
13
|
import { DEFAULTS } from "./constants/defaults.js";
|
|
16
14
|
import { useGoBack } from "./hooks/useGoBack.js";
|
|
@@ -20,44 +18,37 @@ import { useAccount, useModal, useParaStatus, useWalletState } from "../provider
|
|
|
20
18
|
import { useInternalClient } from "../provider/hooks/utils/useInternalClient.js";
|
|
21
19
|
import { useExternalWallets } from "../provider/providers/ExternalWalletProvider.js";
|
|
22
20
|
import { useStore } from "../provider/stores/useStore.js";
|
|
23
|
-
import parsePhoneNumberFromString from "libphonenumber-js";
|
|
24
|
-
import { useAuthActions } from "../provider/providers/AuthProvider.js";
|
|
25
|
-
import { validateInput } from "./utils/authInputHelpers.js";
|
|
26
21
|
import { useTransactionMonitoring } from "./hooks/useTransactionMonitoring.js";
|
|
22
|
+
import { useAuthView } from "./hooks/useAuthView.js";
|
|
27
23
|
defineCustomElements();
|
|
28
24
|
const ParaModal = forwardRef((props, ref) => {
|
|
29
25
|
const storedModalConfig = useStore((state) => state.modalConfig);
|
|
30
|
-
const refs = useStore((state) => state.refs);
|
|
31
26
|
const modalContentRef = useRef(null);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
38
|
-
const hasPreviousStep = useModalStore((state) => state.hasPreviousStep());
|
|
39
|
-
const setFlow = useModalStore((state) => state.setFlow);
|
|
40
|
-
const goBack = useGoBack();
|
|
41
|
-
const setAuthLayout = useModalStore((state) => state.setAuthLayout);
|
|
42
|
-
const storedAuthLayout = useModalStore((state) => state.authLayout);
|
|
43
|
-
const resetModalState = useModalStore((state) => state.resetState);
|
|
44
|
-
const setRecoveryShare = useModalStore((state) => state.setRecoveryShare);
|
|
27
|
+
const modalRef = useRef(null);
|
|
28
|
+
const modalRefs = useStore((state) => state.refs);
|
|
29
|
+
const { goBack, canGoBack } = useGoBack();
|
|
30
|
+
const setAuthLayout = useStore((state) => state.setAuthLayout);
|
|
31
|
+
const storedAuthLayout = useStore((state) => state.authLayout);
|
|
45
32
|
const { disconnectExternalWallet } = useExternalWallets();
|
|
46
33
|
const { isOpen: storedIsOpen, closeModal } = useModal();
|
|
47
34
|
const para = useInternalClient();
|
|
48
35
|
const { setSelectedWallet, updateSelectedWallet } = useWalletState();
|
|
49
|
-
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
50
|
-
const { signUpOrLogIn, isCreateGuestWalletsPending } = useAuthActions();
|
|
51
36
|
const { isReady, isFarcasterMiniApp } = useParaStatus();
|
|
52
37
|
const { isLoading: isAccountLoading, isConnected, embedded } = useAccount();
|
|
53
|
-
const setIFrameUrl =
|
|
54
|
-
const setIsIFrameReady = useModalStore((state) => state.setIsIFrameReady);
|
|
38
|
+
const setIFrameUrl = useStore((state) => state.setIFrameUrl);
|
|
55
39
|
const [isModalMounted, setIsModalMounted] = useState(false);
|
|
56
40
|
const [isDisconnecting, setIsDisconnecting] = useState(false);
|
|
57
41
|
const externalWallets = useStore((state) => state.externalWallets);
|
|
58
42
|
const providerProps = useStore((state) => state.providerProps);
|
|
59
|
-
const setAccountLinkOptions =
|
|
60
|
-
const
|
|
43
|
+
const setAccountLinkOptions = useStore((state) => state.setAccountLinkOptions);
|
|
44
|
+
const setShowPostAuthFlow = useStore((state) => state.setShowPostAuthFlow);
|
|
45
|
+
const resetAuthFlow = useStore((state) => state.resetAuthFlow);
|
|
46
|
+
const resetAccountFlow = useStore((state) => state.resetAccountFlow);
|
|
47
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
48
|
+
const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
|
|
49
|
+
const selectedAuthView = useStore((state) => state.selectedAuthView);
|
|
50
|
+
const accountView = useStore((state) => state.accountView);
|
|
51
|
+
const { authView } = useAuthView();
|
|
61
52
|
const isInitialized = useRef(false);
|
|
62
53
|
const _a = __spreadValues(__spreadValues({}, storedModalConfig), props), {
|
|
63
54
|
isOpen: configIsOpen,
|
|
@@ -71,7 +62,6 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
71
62
|
currentStepOverride,
|
|
72
63
|
authLayout = [AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL],
|
|
73
64
|
embeddedModal,
|
|
74
|
-
onModalStepChange,
|
|
75
65
|
onClose,
|
|
76
66
|
defaultAuthIdentifier,
|
|
77
67
|
supportedAccountLinks: propsSupportedAccountLinks
|
|
@@ -87,7 +77,6 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
87
77
|
"currentStepOverride",
|
|
88
78
|
"authLayout",
|
|
89
79
|
"embeddedModal",
|
|
90
|
-
"onModalStepChange",
|
|
91
80
|
"onClose",
|
|
92
81
|
"defaultAuthIdentifier",
|
|
93
82
|
"supportedAccountLinks"
|
|
@@ -107,11 +96,10 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
107
96
|
currentStepOverride,
|
|
108
97
|
authLayout,
|
|
109
98
|
embeddedModal,
|
|
110
|
-
onModalStepChange,
|
|
111
99
|
onClose,
|
|
112
100
|
defaultAuthIdentifier
|
|
113
101
|
}), rest),
|
|
114
|
-
reactSdkVersion: "2.
|
|
102
|
+
reactSdkVersion: "2.13.0"
|
|
115
103
|
});
|
|
116
104
|
} catch (e) {
|
|
117
105
|
}
|
|
@@ -125,80 +113,49 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
125
113
|
goBack();
|
|
126
114
|
},
|
|
127
115
|
canGoBack() {
|
|
128
|
-
return
|
|
116
|
+
return canGoBack;
|
|
129
117
|
},
|
|
130
118
|
currentStep() {
|
|
131
|
-
return
|
|
119
|
+
return authView || accountView;
|
|
132
120
|
},
|
|
133
121
|
handleModalClose() {
|
|
134
122
|
var _a2;
|
|
135
123
|
(_a2 = modalContentRef == null ? void 0 : modalContentRef.current) == null ? void 0 : _a2.handleModalClose();
|
|
136
124
|
}
|
|
137
125
|
};
|
|
138
|
-
}, [
|
|
139
|
-
const initModal = (
|
|
140
|
-
var _a2;
|
|
126
|
+
}, [canGoBack, authView, accountView]);
|
|
127
|
+
const initModal = () => __async(void 0, null, function* () {
|
|
141
128
|
if (!isReady) {
|
|
142
129
|
return;
|
|
143
130
|
}
|
|
144
|
-
setIFrameUrl(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
159
|
-
}
|
|
160
|
-
break;
|
|
161
|
-
default:
|
|
162
|
-
if (currentStep !== ModalStep.AUTH_MAIN && currentStep !== ModalStep.SECRET) {
|
|
163
|
-
setFlow(void 0);
|
|
164
|
-
setStep(para.isTelegram ? ModalStep.TELEGRAM_OAUTH : ModalStep.AUTH_MAIN);
|
|
165
|
-
setAuthState();
|
|
166
|
-
setAuthStepRoute();
|
|
167
|
-
}
|
|
168
|
-
if (!isFarcasterMiniApp) {
|
|
169
|
-
yield disconnectExternalWallet();
|
|
170
|
-
setSelectedWallet({ id: void 0, type: void 0 });
|
|
171
|
-
}
|
|
172
|
-
if (shouldAutoLogin) {
|
|
173
|
-
if (defaultAuthIdentifier && ((_a2 = para.authInfo) == null ? void 0 : _a2.identifier) !== defaultAuthIdentifier) {
|
|
174
|
-
const number = parsePhoneNumberFromString(defaultAuthIdentifier);
|
|
175
|
-
try {
|
|
176
|
-
const auth = validateInput(
|
|
177
|
-
number ? number.nationalNumber : defaultAuthIdentifier,
|
|
178
|
-
(number == null ? void 0 : number.countryCallingCode) ? `+${number == null ? void 0 : number.countryCallingCode}` : void 0,
|
|
179
|
-
number ? "phone" : "email"
|
|
180
|
-
);
|
|
181
|
-
para.setAuth(number ? { phone: defaultAuthIdentifier } : { email: defaultAuthIdentifier });
|
|
182
|
-
signUpOrLogIn(auth);
|
|
183
|
-
} catch (err) {
|
|
184
|
-
console.error("invalid user identifier:", err.message);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
break;
|
|
131
|
+
setIFrameUrl(null);
|
|
132
|
+
if (!!currentStepOverride) {
|
|
133
|
+
if (currentStepOverride.startsWith("ACCOUNT_")) {
|
|
134
|
+
setAccountView(currentStepOverride);
|
|
135
|
+
} else if (currentStepOverride.startsWith("AUTH_")) {
|
|
136
|
+
setSelectedAuthView(currentStepOverride);
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (!isConnected) {
|
|
141
|
+
if (!isFarcasterMiniApp) {
|
|
142
|
+
yield disconnectExternalWallet();
|
|
143
|
+
yield setSelectedWallet({ id: void 0, type: void 0 });
|
|
144
|
+
}
|
|
189
145
|
}
|
|
190
146
|
});
|
|
191
147
|
useTransactionMonitoring();
|
|
192
148
|
useEffect(() => {
|
|
193
149
|
if (isReady && isOpen && !isAccountLoading && !isInitialized.current) {
|
|
194
|
-
initModal(
|
|
150
|
+
initModal();
|
|
195
151
|
isInitialized.current = true;
|
|
196
152
|
}
|
|
197
153
|
let timerId;
|
|
198
154
|
if (!bareModal && isReady && !isOpen && isInitialized.current) {
|
|
155
|
+
setIFrameUrl(null);
|
|
156
|
+
isInitialized.current = false;
|
|
199
157
|
timerId = setTimeout(() => {
|
|
200
158
|
initModal();
|
|
201
|
-
isInitialized.current = false;
|
|
202
159
|
}, 250);
|
|
203
160
|
}
|
|
204
161
|
return () => {
|
|
@@ -224,33 +181,30 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
224
181
|
generateTheme(theme);
|
|
225
182
|
}
|
|
226
183
|
}, [theme]);
|
|
227
|
-
useEffect(() => {
|
|
228
|
-
setOnModalStepChange(onModalStepChange);
|
|
229
|
-
}, [onModalStepChange]);
|
|
230
184
|
useEffect(() => {
|
|
231
185
|
updateSelectedWallet();
|
|
232
186
|
}, [para]);
|
|
233
187
|
useEffect(() => {
|
|
234
|
-
if (bareModal && !
|
|
235
|
-
|
|
188
|
+
if (bareModal && !isAccountLoading && !isConnected && selectedAuthView !== "AUTH_MAIN") {
|
|
189
|
+
setSelectedAuthView("AUTH_MAIN");
|
|
236
190
|
}
|
|
237
|
-
}, [bareModal,
|
|
191
|
+
}, [bareModal, isConnected, isAccountLoading, selectedAuthView]);
|
|
238
192
|
useEffect(() => {
|
|
239
193
|
setAccountLinkOptions(propsSupportedAccountLinks != null ? propsSupportedAccountLinks : para == null ? void 0 : para.supportedAccountLinks);
|
|
240
194
|
}, [propsSupportedAccountLinks, para == null ? void 0 : para.supportedAccountLinks]);
|
|
241
195
|
const handleClose = () => {
|
|
242
196
|
closeModal();
|
|
243
197
|
onClose == null ? void 0 : onClose();
|
|
198
|
+
setShowPostAuthFlow(false);
|
|
244
199
|
};
|
|
245
200
|
const handleDisconnect = () => __async(void 0, null, function* () {
|
|
246
201
|
setIsDisconnecting(true);
|
|
247
202
|
handleClose();
|
|
248
203
|
const reset = () => __async(void 0, null, function* () {
|
|
249
204
|
yield para.logout({ clearPregenWallets: embedded == null ? void 0 : embedded.isGuestMode });
|
|
250
|
-
yield disconnectExternalWallet();
|
|
251
|
-
setStep(ModalStep.AUTH_MAIN);
|
|
252
|
-
setFlow(void 0);
|
|
253
205
|
setIsDisconnecting(false);
|
|
206
|
+
resetAuthFlow();
|
|
207
|
+
resetAccountFlow();
|
|
254
208
|
});
|
|
255
209
|
if (bareModal) {
|
|
256
210
|
reset();
|
|
@@ -264,15 +218,18 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
264
218
|
setIsModalMounted(true);
|
|
265
219
|
};
|
|
266
220
|
const handleModalExited = () => __async(void 0, null, function* () {
|
|
267
|
-
refs.openedToStep.current = null;
|
|
268
221
|
setIsModalMounted(false);
|
|
269
|
-
|
|
270
|
-
resetModalState();
|
|
271
|
-
setRecoveryShare(null);
|
|
272
|
-
} else if (RESET_TO_ACCOUNT_STEPS.includes(currentStep)) {
|
|
273
|
-
setStep(ModalStep.LOGIN_DONE);
|
|
274
|
-
}
|
|
222
|
+
goBack();
|
|
275
223
|
});
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
var _a2;
|
|
226
|
+
if ((_a2 = modalRef.current) == null ? void 0 : _a2.shadowRoot) {
|
|
227
|
+
const container = modalRef.current.shadowRoot.getElementById("modal-container");
|
|
228
|
+
if (container && modalRefs.modalContainer) {
|
|
229
|
+
modalRefs.modalContainer.current = container;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, [isModalMounted]);
|
|
276
233
|
if (!para) {
|
|
277
234
|
console.error("A Para instance is required.");
|
|
278
235
|
return null;
|
|
@@ -297,6 +254,7 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
297
254
|
return /* @__PURE__ */ jsx(
|
|
298
255
|
StyledAuthModal,
|
|
299
256
|
{
|
|
257
|
+
ref: modalRef,
|
|
300
258
|
enterTransitionDuration: DEFAULTS.ANIMATION_DURATION,
|
|
301
259
|
exitTransitionDuration: DEFAULTS.ANIMATION_DURATION,
|
|
302
260
|
open: isOpen,
|
|
@@ -316,7 +274,8 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
316
274
|
isGuestModeEnabled,
|
|
317
275
|
onClose: handleClose,
|
|
318
276
|
onDisconnect: handleDisconnect,
|
|
319
|
-
isDisconnecting
|
|
277
|
+
isDisconnecting,
|
|
278
|
+
defaultAuthIdentifier
|
|
320
279
|
}, rest)
|
|
321
280
|
)
|
|
322
281
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
2
|
interface BodyProps {
|
|
3
3
|
oAuthMethods?: TOAuthMethod[];
|
|
4
|
-
twoFactorAuthEnabled?: boolean;
|
|
5
4
|
disableEmailLogin: boolean;
|
|
6
5
|
disablePhoneLogin: boolean;
|
|
7
6
|
isGuestModeEnabled?: boolean;
|
|
@@ -9,5 +8,5 @@ interface BodyProps {
|
|
|
9
8
|
isDisconnecting: boolean;
|
|
10
9
|
onClose: () => void;
|
|
11
10
|
}
|
|
12
|
-
export declare const Body: ({ oAuthMethods,
|
|
11
|
+
export declare const Body: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, onClose, onDisconnect, isDisconnecting, }: BodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|