@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,4 +1,4 @@
|
|
|
1
1
|
export declare const getClient: () => import("graz").ParaWeb | undefined;
|
|
2
2
|
export declare const getIsOpen: () => boolean;
|
|
3
3
|
export declare const getSelectedWalletId: () => string | undefined;
|
|
4
|
-
export declare const getSelectedWalletType: () => "
|
|
4
|
+
export declare const getSelectedWalletType: () => "EVM" | "SOLANA" | "COSMOS" | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../chunk-MMUBH76A.js";
|
|
3
|
-
import {
|
|
4
|
-
const getClient = () =>
|
|
5
|
-
const getIsOpen = () =>
|
|
6
|
-
const getSelectedWalletId = () =>
|
|
7
|
-
const getSelectedWalletType = () =>
|
|
3
|
+
import { store } from "./useStore.js";
|
|
4
|
+
const getClient = () => store.getState().client;
|
|
5
|
+
const getIsOpen = () => store.getState().isOpen;
|
|
6
|
+
const getSelectedWalletId = () => store.getState().selectedWalletId;
|
|
7
|
+
const getSelectedWalletType = () => store.getState().selectedWalletType;
|
|
8
8
|
export {
|
|
9
9
|
getClient,
|
|
10
10
|
getIsOpen,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../chunk-MMUBH76A.js";
|
|
3
|
-
import {
|
|
4
|
-
const setIsOpen = (isOpen) =>
|
|
3
|
+
import { store } from "./useStore.js";
|
|
4
|
+
const setIsOpen = (isOpen) => store.setState({ isOpen });
|
|
5
5
|
export {
|
|
6
6
|
setIsOpen
|
|
7
7
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
+
import { LINKED_ACCOUNT_TYPES } from "@getpara/web-sdk";
|
|
7
|
+
const DEFAULT_STATE = {
|
|
8
|
+
accountView: "ACCOUNT_MAIN",
|
|
9
|
+
farcasterConnectUri: null,
|
|
10
|
+
accountAddFundTab: void 0,
|
|
11
|
+
guestAddFundsTab: void 0,
|
|
12
|
+
accountLinkOptions: [...LINKED_ACCOUNT_TYPES],
|
|
13
|
+
profileWallet: void 0,
|
|
14
|
+
sendTx: void 0,
|
|
15
|
+
isTestModeAlertDismissed: false
|
|
16
|
+
};
|
|
17
|
+
const createAccountFlowSlice = (set) => __spreadProps(__spreadValues({}, DEFAULT_STATE), {
|
|
18
|
+
setAccountView: (accountView) => set({ accountView }),
|
|
19
|
+
setFarcasterConnectUri: (farcasterConnectUri) => set({ farcasterConnectUri }),
|
|
20
|
+
setAccountAddFundTab: (accountAddFundTab) => set({ accountAddFundTab }),
|
|
21
|
+
setGuestAddFundsTab: (guestAddFundsTab) => set({ guestAddFundsTab }),
|
|
22
|
+
setAccountLinkOptions: (accountLinkOptions) => set({ accountLinkOptions }),
|
|
23
|
+
setProfileWallet: (profileWallet) => set({ profileWallet }),
|
|
24
|
+
setSendTx: (sendTx) => set({ sendTx }),
|
|
25
|
+
setIsTestModeAlertDismissed: (isTestModeAlertDismissed) => set({ isTestModeAlertDismissed }),
|
|
26
|
+
resetAccountFlow: () => set(DEFAULT_STATE)
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
createAccountFlowSlice
|
|
30
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
+
import { AuthMethod } from "@getpara/web-sdk";
|
|
7
|
+
import { createRef } from "react";
|
|
8
|
+
import { AuthLayout } from "../../../modal/types/modalProps.js";
|
|
9
|
+
const DEFAULT_STATE = {
|
|
10
|
+
authFlowType: void 0,
|
|
11
|
+
passkeyUrl: null,
|
|
12
|
+
passkeyKnownDeviceUrl: null,
|
|
13
|
+
isPasskeySupported: false,
|
|
14
|
+
passwordUrl: null,
|
|
15
|
+
pinUrl: null,
|
|
16
|
+
iFrameUrl: null,
|
|
17
|
+
selectedAuthView: "AUTH_MAIN",
|
|
18
|
+
authMethod: AuthMethod.BASIC_LOGIN,
|
|
19
|
+
showPostAuthFlow: false,
|
|
20
|
+
recoverySecret: null,
|
|
21
|
+
twoFactorAuthUri: null,
|
|
22
|
+
hasCreatedWallets: false,
|
|
23
|
+
passkeyHints: null,
|
|
24
|
+
lastValidComponentRef: createRef(),
|
|
25
|
+
lastAuthViewRef: createRef(),
|
|
26
|
+
authLayout: [AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL],
|
|
27
|
+
isNavigatingBack: false
|
|
28
|
+
};
|
|
29
|
+
const createAuthFlowSlice = (set) => __spreadProps(__spreadValues({}, DEFAULT_STATE), {
|
|
30
|
+
setAuthFlowType: (authFlowType) => set({ authFlowType }),
|
|
31
|
+
setIFrameUrl: (iFrameUrl) => set({ iFrameUrl }),
|
|
32
|
+
setPasskeyUrl: (passkeyUrl) => set({ passkeyUrl }),
|
|
33
|
+
setPasskeyKnownDeviceUrl: (passkeyKnownDeviceUrl) => set({ passkeyKnownDeviceUrl }),
|
|
34
|
+
setIsPasskeySupported: (isPasskeySupported) => set({ isPasskeySupported }),
|
|
35
|
+
setPasswordUrl: (passwordUrl) => set({ passwordUrl }),
|
|
36
|
+
setPinUrl: (pinUrl) => set({ pinUrl }),
|
|
37
|
+
setSelectedAuthView: (selectedAuthView) => set({ selectedAuthView }),
|
|
38
|
+
setAuthMethod: (authMethod) => set({ authMethod }),
|
|
39
|
+
setShowPostAuthFlow: (showPostAuthFlow) => set({ showPostAuthFlow }),
|
|
40
|
+
setRecoverySecret: (recoverySecret) => set({ recoverySecret }),
|
|
41
|
+
setTwoFactorAuthUri: (twoFactorAuthUri) => set({ twoFactorAuthUri }),
|
|
42
|
+
setHasCreatedWallets: (hasCreatedWallets) => set({ hasCreatedWallets }),
|
|
43
|
+
setPasskeyHints: (passkeyHints) => set({ passkeyHints }),
|
|
44
|
+
setIsNavigatingBack: (isNavigatingBack) => set({ isNavigatingBack }),
|
|
45
|
+
setAuthLayout: (authLayout) => {
|
|
46
|
+
const types = [];
|
|
47
|
+
const uniqueLayouts = [];
|
|
48
|
+
authLayout.map((layout) => {
|
|
49
|
+
const type = layout.split(":")[0];
|
|
50
|
+
if (!types.includes(type)) {
|
|
51
|
+
uniqueLayouts.push(layout);
|
|
52
|
+
types.push(type);
|
|
53
|
+
} else {
|
|
54
|
+
console.warn(`${layout} is a duplicate ${type} layout type. Please remove the duplicate type from your config.`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
set({ authLayout: uniqueLayouts });
|
|
58
|
+
},
|
|
59
|
+
resetAuthFlow: () => set(DEFAULT_STATE)
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
createAuthFlowSlice
|
|
63
|
+
};
|
|
@@ -5,6 +5,16 @@ import { CosmosExternalWalletContext } from "../../external/stubs/CosmosExternal
|
|
|
5
5
|
import { SolanaExternalWalletContext } from "../../external/stubs/SolanaExternalWalletContextStub.js";
|
|
6
6
|
import { createRef } from "react";
|
|
7
7
|
const createExternalWalletsSlice = (set) => ({
|
|
8
|
+
selectedExternalWallet: void 0,
|
|
9
|
+
setSelectedExternalWallet: (selectedExternalWallet) => set({ selectedExternalWallet }),
|
|
10
|
+
isExternalWalletConnecting: false,
|
|
11
|
+
setIsExternalWalletConnecting: (isExternalWalletConnecting) => set({ isExternalWalletConnecting }),
|
|
12
|
+
isUsingMobileConnector: void 0,
|
|
13
|
+
setIsUsingMobileConnector: (isUsingMobileConnector) => set({ isUsingMobileConnector }),
|
|
14
|
+
externalWalletError: void 0,
|
|
15
|
+
setExternalWalletError: (externalWalletError) => set({ externalWalletError }),
|
|
16
|
+
showNetworkSelect: false,
|
|
17
|
+
setShowNetworkSelect: (showNetworkSelect) => set({ showNetworkSelect }),
|
|
8
18
|
externalWallets: [],
|
|
9
19
|
setExternalWallets: (externalWallets) => set({ externalWallets }),
|
|
10
20
|
externalWalletsWithFullAuth: [],
|
|
@@ -15,9 +15,15 @@ const createModalSlice = (set) => ({
|
|
|
15
15
|
oAuthLogoVariant: "default",
|
|
16
16
|
isOpen: false,
|
|
17
17
|
setIsOpen: (isOpen) => set({ isOpen }),
|
|
18
|
+
modalError: void 0,
|
|
19
|
+
setModalError: (modalError) => set({ modalError }),
|
|
18
20
|
refs: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
balancesInvalidationTime: createRef(),
|
|
22
|
+
popupWindow: createRef(),
|
|
23
|
+
poll: createRef(),
|
|
24
|
+
initialFarcasterConnected: createRef(),
|
|
25
|
+
iFrame: createRef(),
|
|
26
|
+
modalContainer: createRef()
|
|
21
27
|
},
|
|
22
28
|
balanceOverrides: null,
|
|
23
29
|
setBalanceOverrides: (balanceOverrides) => set((state) => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
+
import { OnRampStep } from "../types.js";
|
|
7
|
+
const DEFAULT_STATE = {
|
|
8
|
+
onRampConfig: void 0,
|
|
9
|
+
onRampPurchase: void 0,
|
|
10
|
+
onRampStep: OnRampStep.SETTINGS
|
|
11
|
+
};
|
|
12
|
+
const createOnRampSlice = (set) => __spreadProps(__spreadValues({}, DEFAULT_STATE), {
|
|
13
|
+
setOnRampConfig: (onRampConfig) => set({ onRampConfig }),
|
|
14
|
+
setOnRampPurchase: (onRampPurchase) => set((state) => ({ onRampPurchase: __spreadValues(__spreadValues({}, state.onRampPurchase || {}), onRampPurchase) })),
|
|
15
|
+
setOnRampStep: (onRampStep) => set({ onRampStep }),
|
|
16
|
+
resetOnRamp: () => set(DEFAULT_STATE)
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
createOnRampSlice
|
|
20
|
+
};
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { Context, MutableRefObject } from 'react';
|
|
2
|
-
import ParaWeb, { TWalletType } from '@getpara/web-sdk';
|
|
2
|
+
import ParaWeb, { AuthFlow, AuthMethod, AuthStateLogin, AuthStateSignup, AvailableWallet, BroadcastTransactionResult, OnRampConfig as OnRampConfigBase, OnRampPurchase, SupportedAccountLinks, StateSnapshot, TWalletType } from '@getpara/web-sdk';
|
|
3
3
|
import * as paraEvmLib from '@getpara/evm-wallet-connectors';
|
|
4
4
|
import { EvmExternalWalletContextType, ParaEvmProvider, WalletList as EvmWalletList } from '@getpara/evm-wallet-connectors';
|
|
5
5
|
import { CosmosExternalWalletContextType, ParaCosmosProvider, WalletList as CosmosWalletList } from '@getpara/cosmos-wallet-connectors';
|
|
6
6
|
import { ParaSolanaProvider, SolanaExternalWalletContextType, WalletList as SolanaWalletList } from '@getpara/solana-wallet-connectors';
|
|
7
|
-
import {
|
|
8
|
-
import { OAuthLogoVariantType } from '../../modal/types/modalProps.js';
|
|
7
|
+
import { ParaModalProps } from '../../modal/index.js';
|
|
8
|
+
import { OAuthLogoVariantType, TAuthLayout } from '../../modal/types/modalProps.js';
|
|
9
9
|
import { type TExternalWallet } from '@getpara/react-common';
|
|
10
10
|
import { BalanceOverrides } from '@getpara/shared';
|
|
11
|
+
import { AuthView } from '../providers/AuthProvider/AuthContext.js';
|
|
12
|
+
import { BiometricLocationHint } from '@getpara/user-management-client';
|
|
13
|
+
import { AccountView } from '../../modal/components/flows/account/AccountProvider/AccountContext.js';
|
|
14
|
+
import { Tab as AddFundsTabType } from '../../modal/components/flows/account/AddFunds/AddFundsContext.js';
|
|
11
15
|
/** Balance overrides with a version field for React Query cache invalidation (version must be serializable). */
|
|
12
16
|
export type BalanceOverridesWithVersion = {
|
|
13
17
|
version: number;
|
|
14
18
|
value: BalanceOverrides;
|
|
15
19
|
};
|
|
20
|
+
export type Flow = AuthStateSignup['stage'] | AuthStateLogin['stage'] | 'account' | 'guest';
|
|
21
|
+
export declare enum OnRampStep {
|
|
22
|
+
SETTINGS = 0,
|
|
23
|
+
PROVIDER = 1
|
|
24
|
+
}
|
|
25
|
+
export type OnRampConfig = OnRampConfigBase & {
|
|
26
|
+
testMode?: boolean;
|
|
27
|
+
};
|
|
16
28
|
export type FarcasterMiniAppConfig = {
|
|
17
29
|
/**
|
|
18
30
|
* Whether to disable automatic sign-in via the Farcaster user's existing miniapp wallet(s).
|
|
@@ -21,6 +33,70 @@ export type FarcasterMiniAppConfig = {
|
|
|
21
33
|
*/
|
|
22
34
|
disableAutoConnect?: boolean;
|
|
23
35
|
};
|
|
36
|
+
export interface AccountFlowSliceState {
|
|
37
|
+
accountView: AccountView;
|
|
38
|
+
farcasterConnectUri: string | null;
|
|
39
|
+
accountAddFundTab?: AddFundsTabType;
|
|
40
|
+
guestAddFundsTab?: AddFundsTabType;
|
|
41
|
+
accountLinkOptions: SupportedAccountLinks;
|
|
42
|
+
profileWallet?: AvailableWallet;
|
|
43
|
+
sendTx?: BroadcastTransactionResult;
|
|
44
|
+
isTestModeAlertDismissed: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface AccountFlowSlice extends AccountFlowSliceState {
|
|
47
|
+
setAccountView: (_: AccountView) => void;
|
|
48
|
+
setFarcasterConnectUri: (_: string | null) => void;
|
|
49
|
+
setAccountAddFundTab: (_?: AddFundsTabType) => void;
|
|
50
|
+
setGuestAddFundsTab: (_?: AddFundsTabType) => void;
|
|
51
|
+
setAccountLinkOptions: (_: SupportedAccountLinks) => void;
|
|
52
|
+
setProfileWallet: (_?: AvailableWallet) => void;
|
|
53
|
+
setSendTx: (_?: BroadcastTransactionResult) => void;
|
|
54
|
+
setIsTestModeAlertDismissed: (_: boolean) => void;
|
|
55
|
+
resetAccountFlow: () => void;
|
|
56
|
+
}
|
|
57
|
+
export interface AuthFlowSliceState {
|
|
58
|
+
authFlowType?: AuthFlow;
|
|
59
|
+
passkeyUrl: string | null;
|
|
60
|
+
passkeyKnownDeviceUrl: string | null;
|
|
61
|
+
isPasskeySupported: boolean;
|
|
62
|
+
passwordUrl: string | null;
|
|
63
|
+
pinUrl: string | null;
|
|
64
|
+
iFrameUrl: string | null;
|
|
65
|
+
selectedAuthView: AuthView;
|
|
66
|
+
authMethod: AuthMethod | null;
|
|
67
|
+
showPostAuthFlow: boolean;
|
|
68
|
+
recoverySecret: string | null;
|
|
69
|
+
twoFactorAuthUri: string | null;
|
|
70
|
+
hasCreatedWallets: boolean;
|
|
71
|
+
passkeyHints: BiometricLocationHint[] | null;
|
|
72
|
+
lastValidComponentRef: MutableRefObject<React.ReactNode | null>;
|
|
73
|
+
lastAuthViewRef: MutableRefObject<AuthView | null>;
|
|
74
|
+
authLayout: TAuthLayout[];
|
|
75
|
+
isNavigatingBack: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface AuthFlowSlice extends AuthFlowSliceState {
|
|
78
|
+
setAuthFlowType: (_: AuthFlow) => void;
|
|
79
|
+
setPasskeyUrl: (_: string | null) => void;
|
|
80
|
+
setPasskeyKnownDeviceUrl: (_: string | null) => void;
|
|
81
|
+
setIsPasskeySupported: (_: boolean) => void;
|
|
82
|
+
setPasswordUrl: (_: string | null) => void;
|
|
83
|
+
setPinUrl: (_: string | null) => void;
|
|
84
|
+
setIFrameUrl: (_: string | null) => void;
|
|
85
|
+
setSelectedAuthView: (_: AuthView) => void;
|
|
86
|
+
setAuthMethod: (_: AuthMethod | null) => void;
|
|
87
|
+
setShowPostAuthFlow: (_: boolean) => void;
|
|
88
|
+
setRecoverySecret: (_: string | null) => void;
|
|
89
|
+
setTwoFactorAuthUri: (_: string | null) => void;
|
|
90
|
+
setHasCreatedWallets: (_: boolean) => void;
|
|
91
|
+
setPasskeyHints: (_: BiometricLocationHint[] | null) => void;
|
|
92
|
+
setAuthLayout: (_: TAuthLayout[]) => void;
|
|
93
|
+
setIsNavigatingBack: (_: boolean) => void;
|
|
94
|
+
resetAuthFlow: () => void;
|
|
95
|
+
}
|
|
96
|
+
export interface ParaStateSlice {
|
|
97
|
+
paraState?: StateSnapshot;
|
|
98
|
+
setParaState: (_: StateSnapshot) => void;
|
|
99
|
+
}
|
|
24
100
|
export interface ClientSlice {
|
|
25
101
|
client?: ParaWeb;
|
|
26
102
|
setClient: (_: ParaWeb) => void;
|
|
@@ -42,9 +118,18 @@ export interface ModalSlice {
|
|
|
42
118
|
oAuthLogoVariant: OAuthLogoVariantType;
|
|
43
119
|
isOpen: boolean;
|
|
44
120
|
setIsOpen: (_: boolean) => void;
|
|
121
|
+
modalError?: string;
|
|
122
|
+
setModalError: (_?: string) => void;
|
|
45
123
|
refs: {
|
|
46
|
-
openedToStep: MutableRefObject<ModalStep | null>;
|
|
47
124
|
balancesInvalidationTime: MutableRefObject<number | null>;
|
|
125
|
+
popupWindow: MutableRefObject<Window | null>;
|
|
126
|
+
poll: MutableRefObject<{
|
|
127
|
+
action: 'login' | 'signup';
|
|
128
|
+
timeout: number;
|
|
129
|
+
} | null>;
|
|
130
|
+
initialFarcasterConnected: MutableRefObject<boolean | null>;
|
|
131
|
+
iFrame: MutableRefObject<HTMLIFrameElement | null>;
|
|
132
|
+
modalContainer: MutableRefObject<HTMLElement | null>;
|
|
48
133
|
};
|
|
49
134
|
balanceOverrides: BalanceOverridesWithVersion | null;
|
|
50
135
|
setBalanceOverrides: (_: BalanceOverrides | null) => void;
|
|
@@ -58,6 +143,22 @@ export interface WalletSlice {
|
|
|
58
143
|
clearSelectedWallet: () => void;
|
|
59
144
|
}
|
|
60
145
|
export interface ExternalWalletsSlice {
|
|
146
|
+
selectedExternalWallet?: {
|
|
147
|
+
id: string;
|
|
148
|
+
type: TWalletType;
|
|
149
|
+
};
|
|
150
|
+
setSelectedExternalWallet: (_?: {
|
|
151
|
+
id: string;
|
|
152
|
+
type: TWalletType;
|
|
153
|
+
}) => void;
|
|
154
|
+
isExternalWalletConnecting?: boolean;
|
|
155
|
+
setIsExternalWalletConnecting: (isExternalWalletConnecting: boolean) => void;
|
|
156
|
+
isUsingMobileConnector?: boolean;
|
|
157
|
+
setIsUsingMobileConnector: (_?: boolean) => void;
|
|
158
|
+
externalWalletError?: string[];
|
|
159
|
+
setExternalWalletError: (_?: string[]) => void;
|
|
160
|
+
showNetworkSelect?: boolean;
|
|
161
|
+
setShowNetworkSelect: (showNetworkSelect: boolean) => void;
|
|
61
162
|
externalWallets: TExternalWallet[];
|
|
62
163
|
setExternalWallets: (_: TExternalWallet[]) => void;
|
|
63
164
|
connectionOnly: boolean;
|
|
@@ -94,4 +195,15 @@ export interface ExternalWalletsSlice {
|
|
|
94
195
|
setIsLoadingSolanaLib: (_: boolean) => void;
|
|
95
196
|
onLoginRef: MutableRefObject<(() => Promise<void>) | null>;
|
|
96
197
|
}
|
|
97
|
-
export
|
|
198
|
+
export interface OnRampSliceState {
|
|
199
|
+
onRampConfig: OnRampConfig | undefined;
|
|
200
|
+
onRampPurchase: Partial<OnRampPurchase> | undefined;
|
|
201
|
+
onRampStep: OnRampStep;
|
|
202
|
+
}
|
|
203
|
+
export interface OnRampSlice extends OnRampSliceState {
|
|
204
|
+
setOnRampConfig: (_: OnRampConfig | undefined) => void;
|
|
205
|
+
setOnRampPurchase: (_: Partial<OnRampPurchase> | undefined) => void;
|
|
206
|
+
setOnRampStep: (_: OnRampStep) => void;
|
|
207
|
+
resetOnRamp: () => void;
|
|
208
|
+
}
|
|
209
|
+
export type Store = ClientSlice & ModalSlice & WalletSlice & ExternalWalletsSlice & ConfigSlice & AnalyticsSlice & ParaStateSlice & AuthFlowSlice & AccountFlowSlice & OnRampSlice;
|
|
@@ -1 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
var OnRampStep = /* @__PURE__ */ ((OnRampStep2) => {
|
|
4
|
+
OnRampStep2[OnRampStep2["SETTINGS"] = 0] = "SETTINGS";
|
|
5
|
+
OnRampStep2[OnRampStep2["PROVIDER"] = 1] = "PROVIDER";
|
|
6
|
+
return OnRampStep2;
|
|
7
|
+
})(OnRampStep || {});
|
|
8
|
+
export {
|
|
9
|
+
OnRampStep
|
|
10
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand';
|
|
2
2
|
import { Store } from './types.js';
|
|
3
|
-
|
|
3
|
+
type PersistedState = Pick<Store, 'selectedWalletId' | 'selectedWalletType' | 'onRampPurchase' | 'selectedExternalWallet' | 'isUsingMobileConnector'>;
|
|
4
|
+
export declare const store: Omit<StoreApi<Store>, "persist"> & {
|
|
4
5
|
persist: {
|
|
5
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<Store,
|
|
6
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<Store, PersistedState>>) => void;
|
|
6
7
|
clearStorage: () => void;
|
|
7
8
|
rehydrate: () => Promise<void> | void;
|
|
8
9
|
hasHydrated: () => boolean;
|
|
9
10
|
onHydrate: (fn: (state: Store) => void) => () => void;
|
|
10
11
|
onFinishHydration: (fn: (state: Store) => void) => () => void;
|
|
11
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<Store,
|
|
12
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<Store, PersistedState>>;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
export declare const useStore: {
|
|
15
16
|
(): Store;
|
|
16
17
|
<T>(selector: (state: Store) => T): T;
|
|
17
18
|
};
|
|
19
|
+
export {};
|
|
@@ -5,31 +5,38 @@ import {
|
|
|
5
5
|
import { createStore, useStore as useZustandStore } from "zustand";
|
|
6
6
|
import {
|
|
7
7
|
createAnalyticsSlice,
|
|
8
|
+
createAuthFlowSlice,
|
|
8
9
|
createClientSlice,
|
|
9
10
|
createExternalWalletsSlice,
|
|
10
11
|
createModalSlice,
|
|
12
|
+
createOnRampSlice,
|
|
13
|
+
createParaStateSlice,
|
|
11
14
|
createWalletSlice
|
|
12
15
|
} from "./slices/index.js";
|
|
13
16
|
import { createJSONStorage, persist } from "zustand/middleware";
|
|
14
17
|
import { createConfigSlice } from "./slices/config.js";
|
|
15
18
|
import { PARA_STORAGE_PREFIX } from "@getpara/core-sdk";
|
|
16
|
-
|
|
19
|
+
import { createAccountFlowSlice } from "./slices/accountFlow.js";
|
|
20
|
+
const store = createStore()(
|
|
17
21
|
persist(
|
|
18
|
-
(...a) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createClientSlice(...a)), createModalSlice(...a)), createWalletSlice(...a)), createExternalWalletsSlice(...a)), createConfigSlice(...a)), createAnalyticsSlice(...a)),
|
|
22
|
+
(...a) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createClientSlice(...a)), createModalSlice(...a)), createWalletSlice(...a)), createExternalWalletsSlice(...a)), createConfigSlice(...a)), createAnalyticsSlice(...a)), createParaStateSlice(...a)), createAuthFlowSlice(...a)), createAccountFlowSlice(...a)), createOnRampSlice(...a)),
|
|
19
23
|
{
|
|
20
|
-
version:
|
|
24
|
+
version: 2,
|
|
21
25
|
name: `${PARA_STORAGE_PREFIX}provider-state`,
|
|
22
26
|
storage: createJSONStorage(() => localStorage),
|
|
23
27
|
partialize: (state) => ({
|
|
24
28
|
selectedWalletId: state.selectedWalletId,
|
|
25
|
-
selectedWalletType: state.selectedWalletType
|
|
29
|
+
selectedWalletType: state.selectedWalletType,
|
|
30
|
+
onRampPurchase: state.onRampPurchase,
|
|
31
|
+
selectedExternalWallet: state.selectedExternalWallet,
|
|
32
|
+
isUsingMobileConnector: state.isUsingMobileConnector
|
|
26
33
|
})
|
|
27
34
|
}
|
|
28
35
|
)
|
|
29
36
|
);
|
|
30
|
-
const createBoundedUseStore = (
|
|
31
|
-
const useStore = createBoundedUseStore(
|
|
37
|
+
const createBoundedUseStore = (store2) => (selector) => useZustandStore(store2, selector);
|
|
38
|
+
const useStore = createBoundedUseStore(store);
|
|
32
39
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
store,
|
|
41
|
+
useStore
|
|
35
42
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk-lite",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/react-common": "2.
|
|
9
|
-
"@getpara/react-components": "2.
|
|
10
|
-
"@getpara/web-sdk": "2.
|
|
8
|
+
"@getpara/react-common": "2.13.0",
|
|
9
|
+
"@getpara/react-components": "2.13.0",
|
|
10
|
+
"@getpara/web-sdk": "2.13.0",
|
|
11
11
|
"date-fns": "^3.6.0",
|
|
12
12
|
"framer-motion": "^11.3.31",
|
|
13
13
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"zustand-sync-tabs": "^0.2.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@getpara/cosmos-wallet-connectors": "2.
|
|
21
|
-
"@getpara/evm-wallet-connectors": "2.
|
|
22
|
-
"@getpara/solana-wallet-connectors": "2.
|
|
20
|
+
"@getpara/cosmos-wallet-connectors": "2.13.0",
|
|
21
|
+
"@getpara/evm-wallet-connectors": "2.13.0",
|
|
22
|
+
"@getpara/solana-wallet-connectors": "2.13.0",
|
|
23
23
|
"@tanstack/react-query": "^5.74.0",
|
|
24
24
|
"@testing-library/dom": "^10.4.0",
|
|
25
25
|
"@testing-library/react": "^16.3.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"package.json",
|
|
40
40
|
"styles.css"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "75ac5d1ebe87366c23bb4e485481deb1b593e299",
|
|
43
43
|
"main": "dist/index.js",
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@tanstack/react-query": ">=5.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountProfileLink(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountProfileLinkOptions(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountProfileUnlink(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountSendAsset(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountSendForm(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountSendNetwork(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountSendNoAssets(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AccountWallet: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AddFundsProvider(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AddFundsReceive(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
const useDropdownPosition = (inputRef) => {
|
|
5
|
-
const [dropdownMaxHeight, setDropdownMaxHeight] = useState();
|
|
6
|
-
const [dropdownWidth, setDropdownWidth] = useState();
|
|
7
|
-
const [mobileAnchor, setMobileAnchor] = useState();
|
|
8
|
-
const resize = () => {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
10
|
-
if (typeof window !== "undefined") {
|
|
11
|
-
const newMaxHeight = Math.max(
|
|
12
|
-
window.innerHeight - ((_b = (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.getBoundingClientRect().bottom) != null ? _b : 0) - 20,
|
|
13
|
-
window.innerHeight * 0.25
|
|
14
|
-
);
|
|
15
|
-
setDropdownMaxHeight(newMaxHeight);
|
|
16
|
-
setDropdownWidth((_c = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _c.getBoundingClientRect().width);
|
|
17
|
-
setMobileAnchor((_d = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _d.getBoundingClientRect().height);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
if (inputRef.current && !dropdownMaxHeight) {
|
|
21
|
-
resize();
|
|
22
|
-
}
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
typeof window !== "undefined" && window.addEventListener("resize", resize);
|
|
25
|
-
return () => {
|
|
26
|
-
typeof window !== "undefined" && window.removeEventListener("resize", resize);
|
|
27
|
-
};
|
|
28
|
-
}, []);
|
|
29
|
-
return { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize };
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
useDropdownPosition
|
|
33
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
-
interface AuthMainStepProps {
|
|
3
|
-
oAuthMethods?: TOAuthMethod[];
|
|
4
|
-
disableEmailLogin: boolean;
|
|
5
|
-
disablePhoneLogin: boolean;
|
|
6
|
-
isGuestModeEnabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const AuthMainStep: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthMainStepProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
-
interface AuthMainStepContentProps {
|
|
3
|
-
oAuthMethods?: TOAuthMethod[];
|
|
4
|
-
disableEmailLogin: boolean;
|
|
5
|
-
disablePhoneLogin: boolean;
|
|
6
|
-
isGuestModeEnabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const AuthMainStepContent: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthMainStepContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AwaitingAccountStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
-
const AwaitingAccountStep = () => {
|
|
7
|
-
var _a;
|
|
8
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
9
|
-
const refs = useModalStore((state) => state.refs);
|
|
10
|
-
const isSLOPopup = ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) === false;
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
Waiting,
|
|
13
|
-
{
|
|
14
|
-
heading: isLogin ? "Logging you in..." : "Creating your account...",
|
|
15
|
-
subheading: isSLOPopup ? "Follow the prompts presented by your browser." : void 0
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
AwaitingAccountStep
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AwaitingBiometricsStep: () => import("react/jsx-runtime").JSX.Element;
|