@getpara/react-sdk-lite 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/modal.css +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/modal/ParaModal.js +46 -98
- package/dist/modal/components/Body/Body.d.ts +1 -2
- package/dist/modal/components/Body/Body.js +119 -231
- package/dist/modal/components/Controls/ChainSelect.js +1 -1
- package/dist/modal/components/Controls/Controls.js +2 -4
- package/dist/modal/components/Footer/Footer.js +3 -12
- package/dist/modal/components/Header/Header.js +13 -14
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
- package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
- package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
- package/dist/modal/components/ModalContent/ModalContent.js +6 -14
- package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
- package/dist/modal/components/WalletCard/WalletCard.js +9 -9
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +7 -5
- package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
- package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
- package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +13 -11
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
- package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
- package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
- package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
- package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
- package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
- package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
- package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
- package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
- package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
- package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
- package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
- package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
- package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
- package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +15 -22
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
- package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
- package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
- package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
- package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +5 -5
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
- package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
- package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
- package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
- package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +11 -12
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
- package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
- package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
- package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
- package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
- package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
- package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
- package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
- package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
- package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
- package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
- package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
- package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
- package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
- package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
- package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
- package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +16 -36
- package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
- package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
- package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
- package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
- package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
- package/dist/modal/components/shared/IFrame.d.ts +1 -0
- package/dist/modal/components/shared/IFrame.js +87 -0
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
- package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
- package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
- package/dist/modal/hooks/index.d.ts +1 -2
- package/dist/modal/hooks/index.js +1 -2
- package/dist/modal/hooks/useAuthView.d.ts +4 -0
- package/dist/modal/hooks/useAuthView.js +115 -0
- package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
- package/dist/modal/hooks/useCanbGoBack.js +47 -0
- package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.js +3 -3
- package/dist/modal/hooks/useGoBack.d.ts +4 -1
- package/dist/modal/hooks/useGoBack.js +60 -36
- package/dist/modal/hooks/useSendMutations.js +4 -5
- package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
- package/dist/modal/index.d.ts +1 -2
- package/dist/modal/index.js +1 -3
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -1
- package/dist/modal/types/modalProps.d.ts +18 -8
- package/dist/provider/ParaProviderMin.js +34 -38
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +43 -49
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/components/CosmosWalletWrapper.js +0 -3
- package/dist/provider/components/EvmWalletWrapper.js +0 -3
- package/dist/provider/components/ExternalWalletWrapper.js +8 -2
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
- package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
- package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
- package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
- package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
- package/dist/provider/hooks/queries/useParaStatus.js +0 -2
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +0 -7
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
- package/dist/provider/hooks/utils/useModal.d.ts +2 -2
- package/dist/provider/hooks/utils/useModal.js +9 -8
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
- package/dist/provider/hooks/utils/useWalletState.js +14 -6
- package/dist/provider/providers/AccountLinkProvider.js +21 -19
- package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
- package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
- package/dist/provider/providers/ExternalWalletProvider.js +285 -283
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/stores/getters.js +5 -5
- package/dist/provider/stores/setters.js +2 -2
- package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
- package/dist/provider/stores/slices/accountFlow.js +30 -0
- package/dist/provider/stores/slices/authFlow.d.ts +3 -0
- package/dist/provider/stores/slices/authFlow.js +63 -0
- package/dist/provider/stores/slices/externalWallets.js +10 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +4 -0
- package/dist/provider/stores/slices/modal.js +8 -2
- package/dist/provider/stores/slices/onRamp.d.ts +3 -0
- package/dist/provider/stores/slices/onRamp.js +20 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +9 -0
- package/dist/provider/stores/types.d.ts +117 -5
- package/dist/provider/stores/types.js +9 -0
- package/dist/provider/stores/useStore.d.ts +5 -3
- package/dist/provider/stores/useStore.js +15 -8
- package/package.json +8 -8
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
- package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -118
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
- package/dist/modal/hooks/useFarcasterLogin.js +0 -77
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -146
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -120
- package/dist/modal/stores/modal/useModalStore.js +0 -81
- package/dist/modal/utils/steps.d.ts +0 -162
- package/dist/modal/utils/steps.js +0 -335
- package/dist/provider/providers/AuthProvider.d.ts +0 -43
- package/dist/provider/providers/AuthProvider.js +0 -777
- /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
- /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
- /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
- /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
- /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
- /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
- /package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.d.ts +0 -0
- /package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { useModalStore } from "../../../stores/modal/useModalStore.js";
|
|
5
|
-
import { ModalStep } from "../../../utils/steps.js";
|
|
6
|
-
import { useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
|
|
3
|
+
import { useMemo, useRef } from "react";
|
|
7
4
|
import { useStore } from "../../../../provider/stores/useStore.js";
|
|
8
5
|
import { useAccountLinking } from "../../../../provider/providers/AccountLinkProvider.js";
|
|
9
6
|
import { useWallet } from "../../../../provider/index.js";
|
|
7
|
+
import { useAuthView } from "../../../hooks/useAuthView.js";
|
|
10
8
|
const signUpOrLogInTitle = "Sign Up or Login";
|
|
11
9
|
const connectWalletTitle = "Connect Wallet";
|
|
12
10
|
const useStepTitle = () => {
|
|
@@ -19,11 +17,16 @@ const useStepTitle = () => {
|
|
|
19
17
|
var _a2;
|
|
20
18
|
return (_a2 = state.modalConfig) == null ? void 0 : _a2.hideWallets;
|
|
21
19
|
});
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
20
|
+
const authLayout = useStore((state) => state.authLayout) || [];
|
|
21
|
+
const profileWallet = useStore((state) => state.profileWallet);
|
|
22
|
+
const accountView = useStore((state) => state.accountView);
|
|
23
|
+
const isLogin = useStore((state) => {
|
|
24
|
+
var _a2, _b2;
|
|
25
|
+
return ((_b2 = (_a2 = state.paraState) == null ? void 0 : _a2.authStateInfo) == null ? void 0 : _b2.isNewUser) === false;
|
|
26
|
+
});
|
|
26
27
|
const { data: activeWallet } = useWallet();
|
|
28
|
+
const { authView } = useAuthView();
|
|
29
|
+
const lastTitleRef = useRef(null);
|
|
27
30
|
const [isAuthFirst, isAuthCondensed, isExternalFirst, isExternalCondensed, isBothCondensed] = [
|
|
28
31
|
(_a = authLayout[0]) == null ? void 0 : _a.includes("AUTH"),
|
|
29
32
|
authLayout.includes("AUTH:CONDENSED"),
|
|
@@ -32,76 +35,90 @@ const useStepTitle = () => {
|
|
|
32
35
|
authLayout.includes("AUTH:CONDENSED") && authLayout.includes("EXTERNAL:CONDENSED")
|
|
33
36
|
];
|
|
34
37
|
const authStepTitle = isBothCondensed ? null : isAuthFirst && !isAuthCondensed ? signUpOrLogInTitle : isExternalFirst && !isExternalCondensed ? connectWalletTitle : "";
|
|
35
|
-
const { chainId } = useExternalWallets();
|
|
36
38
|
const { isEnabled: isAccountLinkingEnabled } = useAccountLinking();
|
|
37
|
-
const titles = useMemo(
|
|
38
|
-
() => {
|
|
39
|
-
var _a2;
|
|
40
|
-
return {
|
|
41
|
-
[ModalStep.AUTH_MAIN]: authStepTitle,
|
|
42
|
-
[ModalStep.AUTH_MORE]: signUpOrLogInTitle,
|
|
43
|
-
[ModalStep.AUTH_GUEST_SIGNUP]: "Complete Account Setup",
|
|
44
|
-
[ModalStep.EX_WALLET_MORE]: connectWalletTitle,
|
|
45
|
-
[ModalStep.ADD_EX_WALLET_MORE]: "Add Wallet",
|
|
46
|
-
[ModalStep.VERIFICATIONS]: "Sign Up",
|
|
47
|
-
[ModalStep.AWAITING_OAUTH]: signUpOrLogInTitle,
|
|
48
|
-
[ModalStep.FARCASTER_OAUTH]: signUpOrLogInTitle,
|
|
49
|
-
[ModalStep.TELEGRAM_OAUTH]: signUpOrLogInTitle,
|
|
50
|
-
[ModalStep.BIOMETRIC_CREATION]: "Sign Up",
|
|
51
|
-
[ModalStep.PASSWORD_CREATION]: "Sign Up",
|
|
52
|
-
[ModalStep.AWAITING_BIOMETRIC_CREATION]: "Sign Up",
|
|
53
|
-
[ModalStep.AWAITING_WALLET_CREATION]: isLogin ? "Login" : "Sign Up",
|
|
54
|
-
[ModalStep.AWAITING_PASSWORD_CREATION]: "Sign Up",
|
|
55
|
-
[ModalStep.WALLET_CREATION_DONE]: hideWallets ? "Account Created" : "Wallet Created",
|
|
56
|
-
[ModalStep.SECRET]: isLogin ? "Login" : "Sign Up",
|
|
57
|
-
[ModalStep.BIOMETRIC_LOGIN]: "Login",
|
|
58
|
-
[ModalStep.EMBEDDED_PASSWORD_LOGIN]: "Login",
|
|
59
|
-
[ModalStep.AWAITING_PASSWORD_LOGIN]: "Login",
|
|
60
|
-
[ModalStep.AWAITING_BIOMETRIC_LOGIN]: "Login",
|
|
61
|
-
[ModalStep.LOGIN_DONE]: "",
|
|
62
|
-
[ModalStep.SETUP_2FA]: "2FA",
|
|
63
|
-
[ModalStep.VERIFY_2FA]: "2FA",
|
|
64
|
-
[ModalStep.TWO_FACTOR_DONE]: "2FA",
|
|
65
|
-
[ModalStep.ADD_FUNDS_BUY]: "Add Funds",
|
|
66
|
-
[ModalStep.ADD_FUNDS_RECEIVE]: "Add Funds",
|
|
67
|
-
[ModalStep.ADD_FUNDS_WITHDRAW]: "Withdraw",
|
|
68
|
-
[ModalStep.ADD_FUNDS_AWAITING]: "Add Funds",
|
|
69
|
-
[ModalStep.ADD_FUNDS_SUCCESS]: "Add Funds",
|
|
70
|
-
[ModalStep.ADD_FUNDS_FAILURE]: "Add Funds",
|
|
71
|
-
[ModalStep.ACCOUNT_MAIN]: "",
|
|
72
|
-
[ModalStep.CHAIN_SWITCH]: "",
|
|
73
|
-
[ModalStep.ACCOUNT_PROFILE]: isAccountLinkingEnabled ? "Profile" : "Settings",
|
|
74
|
-
[ModalStep.ACCOUNT_PROFILE_LIST]: "Link Account",
|
|
75
|
-
[ModalStep.ACCOUNT_PROFILE_ADD]: "Link Account",
|
|
76
|
-
[ModalStep.ACCOUNT_PROFILE_REMOVE]: "Unlink Account",
|
|
77
|
-
[ModalStep.EX_WALLET_SELECTED]: "Connect Wallet",
|
|
78
|
-
[ModalStep.EX_WALLET_NETWORK_SELECT]: "Select Network",
|
|
79
|
-
[ModalStep.ADD_EX_WALLET_NETWORK_SELECT]: "Select Network",
|
|
80
|
-
[ModalStep.LINK_EX_WALLET_NETWORK_SELECT]: "Select Network",
|
|
81
|
-
[ModalStep.ADD_EX_WALLET_SELECTED]: "Add Wallet",
|
|
82
|
-
[ModalStep.EXTERNAL_WALLET_VERIFICATION]: "Verify Wallet",
|
|
83
|
-
[ModalStep.AWAITING_ACCOUNT]: isLogin ? "Login" : "Sign Up",
|
|
84
|
-
[ModalStep.ACCOUNT_WALLET]: (_a2 = profileWallet == null ? void 0 : profileWallet.displayName) != null ? _a2 : "Wallet Settings",
|
|
85
|
-
[ModalStep.ACCOUNT_SEND]: "Send",
|
|
86
|
-
[ModalStep.ACCOUNT_SEND_ASSET]: "Send",
|
|
87
|
-
[ModalStep.ACCOUNT_SEND_NETWORK]: "Send"
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
[isLogin, chainId, hideWallets, authStepTitle]
|
|
91
|
-
);
|
|
92
39
|
const title = useMemo(() => {
|
|
93
40
|
var _a2;
|
|
94
|
-
if (
|
|
95
|
-
|
|
41
|
+
if (authView) {
|
|
42
|
+
switch (authView) {
|
|
43
|
+
case "AUTH_MAIN":
|
|
44
|
+
return authStepTitle;
|
|
45
|
+
case "AUTH_ALL_EXTERNAL_WALLETS":
|
|
46
|
+
case "AUTH_ALL_OPTIONS":
|
|
47
|
+
case "AUTH_OAUTH_CONNECT":
|
|
48
|
+
return signUpOrLogInTitle;
|
|
49
|
+
case "AUTH_VERIFY_ACCOUNT":
|
|
50
|
+
return "Sign Up";
|
|
51
|
+
case "AUTH_EXTERNAL_WALLET_NETWORK_SELECT":
|
|
52
|
+
case "AUTH_EXTERNAL_WALLET_CONNECT":
|
|
53
|
+
return connectWalletTitle;
|
|
54
|
+
case "AUTH_EXTERNAL_WALLET_VERIFY":
|
|
55
|
+
return "Verify Wallet";
|
|
56
|
+
case "AUTH_BIOMETRIC_PASSKEY":
|
|
57
|
+
case "AUTH_BIOMETRIC_PASSWORD":
|
|
58
|
+
case "AUTH_BIOMETRIC_PIN":
|
|
59
|
+
case "AUTH_BIOMETRIC_SELECT":
|
|
60
|
+
case "AUTH_BASIC_LOGIN":
|
|
61
|
+
case "AUTH_CONNECTING":
|
|
62
|
+
case "AUTH_RECOVERY_SECRET":
|
|
63
|
+
case "AUTH_2FA_SETUP":
|
|
64
|
+
case "AUTH_CONNECTED":
|
|
65
|
+
return "";
|
|
66
|
+
case "AUTH_WALLETS_CREATED":
|
|
67
|
+
return hideWallets ? "Account Created" : "Wallet Created";
|
|
68
|
+
case "AUTH_GUEST_MODE_CONNECTING":
|
|
69
|
+
return "Creating Guest Account";
|
|
70
|
+
case "AUTH_ERROR":
|
|
71
|
+
return lastTitleRef.current;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
switch (accountView) {
|
|
75
|
+
case "ACCOUNT_MAIN":
|
|
76
|
+
case "ACCOUNT_CHAIN_SWITCH":
|
|
77
|
+
case "ACCOUNT_SWITCH_WALLETS":
|
|
78
|
+
case "ACCOUNT_SWITCH_WALLETS_IFRAME":
|
|
79
|
+
return null;
|
|
80
|
+
case "ACCOUNT_GUEST_SIGNUP":
|
|
81
|
+
return "Complete Account Setup";
|
|
82
|
+
case "ACCOUNT_ADD_FUNDS_BUY":
|
|
83
|
+
case "ACCOUNT_ADD_FUNDS_RECEIVE":
|
|
84
|
+
case "ACCOUNT_ADD_FUNDS_AWAITING":
|
|
85
|
+
case "ACCOUNT_ADD_FUNDS_SUCCESS":
|
|
86
|
+
case "ACCOUNT_ADD_FUNDS_FAILURE":
|
|
87
|
+
return "Add Funds";
|
|
88
|
+
case "ACCOUNT_ADD_FUNDS_WITHDRAW":
|
|
89
|
+
return "Withdraw";
|
|
90
|
+
case "ACCOUNT_PROFILE":
|
|
91
|
+
return isAccountLinkingEnabled ? "Profile" : "Settings";
|
|
92
|
+
case "ACCOUNT_PROFILE_ADD":
|
|
93
|
+
case "ACCOUNT_PROFILE_LIST":
|
|
94
|
+
return "Link Account";
|
|
95
|
+
case "ACCOUNT_PROFILE_REMOVE":
|
|
96
|
+
return "Unlink Account";
|
|
97
|
+
case "ACCOUNT_WALLET":
|
|
98
|
+
return (_a2 = profileWallet == null ? void 0 : profileWallet.displayName) != null ? _a2 : "Wallet Settings";
|
|
99
|
+
case "ACCOUNT_ADD_EX_WALLET_MORE":
|
|
100
|
+
return "Add Wallet";
|
|
101
|
+
case "ACCOUNT_ADD_EX_WALLET_SELECTED":
|
|
102
|
+
return "Connect Wallet";
|
|
103
|
+
case "ACCOUNT_ADD_EX_WALLET_NETWORK_SELECT":
|
|
104
|
+
case "ACCOUNT_LINK_EX_WALLET_NETWORK_SELECT":
|
|
105
|
+
return "Select Network";
|
|
106
|
+
case "ACCOUNT_SEND":
|
|
107
|
+
case "ACCOUNT_SEND_ASSET":
|
|
108
|
+
case "ACCOUNT_SEND_NETWORK":
|
|
109
|
+
return "Send";
|
|
96
110
|
}
|
|
97
111
|
return null;
|
|
98
|
-
}, [
|
|
112
|
+
}, [authView, isLogin, accountView, isAccountLinkingEnabled, profileWallet, authStepTitle, hideWallets]);
|
|
113
|
+
if (title && title !== lastTitleRef.current) {
|
|
114
|
+
lastTitleRef.current = title;
|
|
115
|
+
}
|
|
99
116
|
const isControls = useMemo(() => {
|
|
100
|
-
return (activeWallet == null ? void 0 : activeWallet.isExternal) && (activeWallet == null ? void 0 : activeWallet.type) === "EVM" && [
|
|
101
|
-
}, [activeWallet,
|
|
117
|
+
return !authView && (activeWallet == null ? void 0 : activeWallet.isExternal) && (activeWallet == null ? void 0 : activeWallet.type) === "EVM" && ["ACCOUNT_MAIN", "ACCOUNT_CHAIN_SWITCH"].includes(accountView);
|
|
118
|
+
}, [authView, activeWallet, accountView]);
|
|
102
119
|
const isTitleDisplayed = useMemo(() => {
|
|
103
|
-
return !isControls && (
|
|
104
|
-
}, [isControls,
|
|
120
|
+
return !isControls && (authView !== "AUTH_MAIN" || !logo);
|
|
121
|
+
}, [isControls, authView, logo]);
|
|
105
122
|
return { title, isTitleDisplayed, isControls };
|
|
106
123
|
};
|
|
107
124
|
export {
|
|
@@ -5,7 +5,7 @@ export type ModalContentHandle = {
|
|
|
5
5
|
*/
|
|
6
6
|
handleModalClose: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const ModalContent: import("react").ForwardRefExoticComponent<Omit<ParaModalProps, "
|
|
8
|
+
export declare const ModalContent: import("react").ForwardRefExoticComponent<Omit<ParaModalProps, "para" | "isOpen" | "theme" | "branding" | "onModalStepChange" | "onExpandModalChange"> & {
|
|
9
9
|
onDisconnect: () => void;
|
|
10
10
|
isDisconnecting: boolean;
|
|
11
11
|
} & import("react").RefAttributes<ModalContentHandle>>;
|
|
@@ -6,15 +6,12 @@ import {
|
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { forwardRef, useEffect, useImperativeHandle } from "react";
|
|
8
8
|
import { EnabledFlow } from "@getpara/web-sdk";
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
10
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
11
9
|
import { Body } from "../Body/Body.js";
|
|
12
10
|
import { Footer } from "../Footer/Footer.js";
|
|
13
11
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
14
|
-
import {
|
|
12
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
15
13
|
const ModalContent = forwardRef(
|
|
16
14
|
({
|
|
17
|
-
twoFactorAuthEnabled = false,
|
|
18
15
|
oAuthMethods,
|
|
19
16
|
disableEmailLogin,
|
|
20
17
|
disablePhoneLogin,
|
|
@@ -25,12 +22,11 @@ const ModalContent = forwardRef(
|
|
|
25
22
|
onRampTestMode
|
|
26
23
|
}, ref) => {
|
|
27
24
|
const para = useInternalClient();
|
|
28
|
-
const refs =
|
|
29
|
-
const onRampConfig =
|
|
30
|
-
const setOnRampConfig =
|
|
31
|
-
const accountAddFundTab =
|
|
32
|
-
const setAccountAddFundTab =
|
|
33
|
-
const { disconnectExternalWallet } = useExternalWallets();
|
|
25
|
+
const refs = useStore((state) => state.refs);
|
|
26
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
27
|
+
const setOnRampConfig = useStore((state) => state.setOnRampConfig);
|
|
28
|
+
const accountAddFundTab = useStore((state) => state.accountAddFundTab);
|
|
29
|
+
const setAccountAddFundTab = useStore((state) => state.setAccountAddFundTab);
|
|
34
30
|
useImperativeHandle(ref, () => {
|
|
35
31
|
return {
|
|
36
32
|
handleModalClose() {
|
|
@@ -40,9 +36,6 @@ const ModalContent = forwardRef(
|
|
|
40
36
|
}, []);
|
|
41
37
|
const handleClose = () => {
|
|
42
38
|
onClose == null ? void 0 : onClose();
|
|
43
|
-
if (refs.currentStep.current === ModalStep.EXTERNAL_WALLET_VERIFICATION && para.isExternalWalletAuth) {
|
|
44
|
-
disconnectExternalWallet();
|
|
45
|
-
}
|
|
46
39
|
};
|
|
47
40
|
useEffect(() => {
|
|
48
41
|
if (!onRampConfig) {
|
|
@@ -74,7 +67,6 @@ const ModalContent = forwardRef(
|
|
|
74
67
|
Body,
|
|
75
68
|
{
|
|
76
69
|
oAuthMethods,
|
|
77
|
-
twoFactorAuthEnabled,
|
|
78
70
|
disableEmailLogin: !!disableEmailLogin,
|
|
79
71
|
disablePhoneLogin: !!disablePhoneLogin,
|
|
80
72
|
isGuestModeEnabled,
|
|
@@ -4,10 +4,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { OnRampPurchaseStatus } from "@getpara/web-sdk";
|
|
5
5
|
import { SpinnerContainer } from "../common.js";
|
|
6
6
|
import { ON_RAMP_PROVIDERS } from "@getpara/react-common";
|
|
7
|
-
import {
|
|
7
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
8
8
|
import { CpslSpinner, CpslText } from "@getpara/react-components";
|
|
9
9
|
const AddingFunds = () => {
|
|
10
|
-
const onRampPurchase =
|
|
10
|
+
const onRampPurchase = useStore((state) => state.onRampPurchase);
|
|
11
11
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
12
|
/* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) }),
|
|
13
13
|
/* @__PURE__ */ jsxs(CpslText, { children: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { safeStyled, WalletTypeIcon } from "@getpara/react-common";
|
|
5
|
-
import { useModalStore } from "../../stores/index.js";
|
|
6
7
|
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
7
8
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
8
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
9
9
|
import { useWalletState } from "../../../provider/index.js";
|
|
10
10
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
11
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
@@ -72,16 +72,16 @@ const WalletCard = ({ id, type, showAddFunds }) => {
|
|
|
72
72
|
);
|
|
73
73
|
};
|
|
74
74
|
const SharedWalletCard = ({ address, name, showAddFunds, id, type, Icon }) => {
|
|
75
|
-
const onRampConfig =
|
|
75
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
76
76
|
const { setSelectedWallet } = useWalletState();
|
|
77
|
-
const
|
|
77
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
78
78
|
const isAddFundsEnabled = (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled);
|
|
79
|
-
const handleAddFundsClick = () => {
|
|
79
|
+
const handleAddFundsClick = () => __async(void 0, null, function* () {
|
|
80
80
|
if (id && type) {
|
|
81
|
-
setSelectedWallet({ id, type });
|
|
82
|
-
isAddFundsEnabled &&
|
|
81
|
+
yield setSelectedWallet({ id, type });
|
|
82
|
+
isAddFundsEnabled && setAccountView(onRampConfig.isBuyEnabled ? "ACCOUNT_ADD_FUNDS_BUY" : "ACCOUNT_ADD_FUNDS_RECEIVE");
|
|
83
83
|
}
|
|
84
|
-
};
|
|
84
|
+
});
|
|
85
85
|
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
86
86
|
/* @__PURE__ */ jsxs(InnerContainer, { children: [
|
|
87
87
|
Icon,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { useEffect, useMemo, useRef } from "react";
|
|
5
7
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
6
|
-
import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
|
|
7
8
|
import { safeStyled, useCopyToClipboard, WalletTypeIcon as WalletTypeIconBase } from "@getpara/react-common";
|
|
8
9
|
import { useAccount, useWallet, useWalletState } from "../../../provider/index.js";
|
|
9
10
|
import { CpslButton, CpslIcon, CpslSelect, CpslSelectItem, CpslText } from "@getpara/react-components";
|
|
11
|
+
import { useDropdownPosition } from "../../hooks/useDropdownPosition.js";
|
|
10
12
|
import { getMobilePopoverPositionCSS } from "../common.js";
|
|
11
13
|
const getValue = (id, type) => {
|
|
12
14
|
return id && type ? `${id}~${type}` : void 0;
|
|
@@ -74,10 +76,10 @@ const WalletSelectOld = ({
|
|
|
74
76
|
Select,
|
|
75
77
|
{
|
|
76
78
|
selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
|
|
77
|
-
onCpslSelectValueChange: (e) => {
|
|
79
|
+
onCpslSelectValueChange: (e) => __async(void 0, null, function* () {
|
|
78
80
|
const [id, type] = e.detail.split("~");
|
|
79
|
-
setSelectedWallet({ id, type });
|
|
80
|
-
},
|
|
81
|
+
yield setSelectedWallet({ id, type });
|
|
82
|
+
}),
|
|
81
83
|
showFormattedSelectedItem: true,
|
|
82
84
|
placeholder: "Choose wallet...",
|
|
83
85
|
dropdownMaxHeight,
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { safeStyled } from "@getpara/react-common";
|
|
5
|
-
import { ExplorerLink, InnerStepContainer, StepContainer } from "
|
|
7
|
+
import { ExplorerLink, InnerStepContainer, StepContainer } from "../../../common.js";
|
|
6
8
|
import { CpslButton, CpslIcon, CpslSpinner, CpslText, CpslTileButton } from "@getpara/react-components";
|
|
7
|
-
import {
|
|
9
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
8
10
|
import { useEffect, useMemo } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useAccount, useWalletState } from "../../../provider/index.js";
|
|
11
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
12
|
+
import { useAccount, useWalletState } from "../../../../../provider/index.js";
|
|
12
13
|
import { EnabledFlow } from "@getpara/web-sdk";
|
|
13
|
-
import { useAccountLinking } from "
|
|
14
|
-
import { useAssets } from "
|
|
15
|
-
import {
|
|
14
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
15
|
+
import { useAssets } from "../../../../../provider/providers/AssetsProvider.js";
|
|
16
|
+
import { Header } from "./Header.js";
|
|
17
|
+
import { useModalSessionStore } from "../../../../stores/index.js";
|
|
16
18
|
import { AnimatePresence, motion } from "framer-motion";
|
|
19
|
+
import { OnRampStep } from "../../../../../provider/stores/types.js";
|
|
17
20
|
const Account = () => {
|
|
18
|
-
const onRampConfig =
|
|
19
|
-
const
|
|
20
|
-
const setGuestAddFundsTab =
|
|
21
|
-
const setOnRampStep =
|
|
21
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
22
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
23
|
+
const setGuestAddFundsTab = useStore((state) => state.setGuestAddFundsTab);
|
|
24
|
+
const setOnRampStep = useStore((state) => state.setOnRampStep);
|
|
22
25
|
const sendTx = useModalSessionStore((state) => state.sendTx);
|
|
23
26
|
const sendTxStatus = useModalSessionStore((state) => {
|
|
24
27
|
var _a, _b, _c;
|
|
@@ -76,7 +79,7 @@ const Account = () => {
|
|
|
76
79
|
AnimatedMonitorButton,
|
|
77
80
|
{
|
|
78
81
|
onClick: () => {
|
|
79
|
-
|
|
82
|
+
setAccountView("ACCOUNT_MONITOR_TX");
|
|
80
83
|
},
|
|
81
84
|
children: [
|
|
82
85
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "4px", color }, children: [
|
|
@@ -106,52 +109,52 @@ const Account = () => {
|
|
|
106
109
|
);
|
|
107
110
|
}
|
|
108
111
|
return null;
|
|
109
|
-
}, [sendTx, sendTxStatus, sendTxResult,
|
|
112
|
+
}, [sendTx, sendTxStatus, sendTxResult, setAccountView]);
|
|
110
113
|
const transactionMonitor = /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: transactionMonitorContent });
|
|
111
114
|
const isGuestMode = embedded.isConnected && embedded.isGuestMode;
|
|
112
115
|
const cantBuyAndWithdraw = (para.externalWalletConnectionType === "CONNECTION_ONLY" || para.externalWalletConnectionType === "VERIFICATION") && !para.userId;
|
|
113
116
|
const isOnRampLoaded = !!onRampConfig;
|
|
114
|
-
const handleSendClick = () => {
|
|
117
|
+
const handleSendClick = () => __async(void 0, null, function* () {
|
|
115
118
|
var _a, _b;
|
|
116
119
|
if ((selectedWallet == null ? void 0 : selectedWallet.type) === "COSMOS" || ((_a = embedded.wallets) == null ? void 0 : _a.some((w) => w.id === (selectedWallet == null ? void 0 : selectedWallet.id) && w.isExternal))) {
|
|
117
120
|
const validWallet = (_b = embedded.wallets) == null ? void 0 : _b.find(({ type, isExternal }) => type !== "COSMOS" && !isExternal);
|
|
118
121
|
if (!validWallet) {
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
121
|
-
setSelectedWallet({ id: validWallet.id, type: validWallet.type });
|
|
124
|
+
yield setSelectedWallet({ id: validWallet.id, type: validWallet.type });
|
|
122
125
|
}
|
|
123
|
-
|
|
124
|
-
};
|
|
126
|
+
setAccountView("ACCOUNT_SEND");
|
|
127
|
+
});
|
|
125
128
|
const handleBuyClick = () => {
|
|
126
129
|
if (isGuestMode) {
|
|
127
130
|
if (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) {
|
|
128
|
-
|
|
131
|
+
setAccountView("ACCOUNT_ADD_FUNDS_RECEIVE");
|
|
129
132
|
} else {
|
|
130
133
|
setGuestAddFundsTab(EnabledFlow.BUY);
|
|
131
|
-
|
|
134
|
+
setAccountView("ACCOUNT_GUEST_SIGNUP");
|
|
132
135
|
}
|
|
133
136
|
} else if ((onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled)) {
|
|
134
137
|
setOnRampStep(OnRampStep.SETTINGS);
|
|
135
|
-
|
|
138
|
+
setAccountView((onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) ? "ACCOUNT_ADD_FUNDS_BUY" : "ACCOUNT_ADD_FUNDS_RECEIVE");
|
|
136
139
|
}
|
|
137
140
|
};
|
|
138
141
|
const handleSellClick = () => {
|
|
139
142
|
if (isGuestMode) {
|
|
140
143
|
setGuestAddFundsTab(EnabledFlow.WITHDRAW);
|
|
141
|
-
|
|
144
|
+
setAccountView("ACCOUNT_GUEST_SIGNUP");
|
|
142
145
|
} else {
|
|
143
146
|
setOnRampStep(OnRampStep.SETTINGS);
|
|
144
|
-
|
|
147
|
+
setAccountView("ACCOUNT_ADD_FUNDS_WITHDRAW");
|
|
145
148
|
}
|
|
146
149
|
};
|
|
147
150
|
const handleProfileClick = () => {
|
|
148
|
-
|
|
151
|
+
setAccountView("ACCOUNT_PROFILE");
|
|
149
152
|
};
|
|
150
153
|
useEffect(() => {
|
|
151
154
|
setGuestAddFundsTab();
|
|
152
155
|
}, []);
|
|
153
156
|
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, "data-testid": "para-account-main", children: /* @__PURE__ */ jsxs($InnerStepContainer, { children: [
|
|
154
|
-
/* @__PURE__ */ jsx(
|
|
157
|
+
/* @__PURE__ */ jsx(Header, { withBalance: true }),
|
|
155
158
|
/* @__PURE__ */ jsxs(LowerContainer, { children: [
|
|
156
159
|
isGuestMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
160
|
profileBalance && profileBalance.value && profileBalance.value.value > 0 && /* @__PURE__ */ jsxs(Alert, { "data-testid": "para-guest-warning", children: [
|
|
@@ -164,7 +167,7 @@ const Account = () => {
|
|
|
164
167
|
fullWidth: true,
|
|
165
168
|
variant: "primary",
|
|
166
169
|
onClick: () => {
|
|
167
|
-
|
|
170
|
+
setAccountView("ACCOUNT_GUEST_SIGNUP");
|
|
168
171
|
},
|
|
169
172
|
"data-testid": "para-complete-setup",
|
|
170
173
|
children: [
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { getExternalWalletIcon, safeStyled } from "@getpara/react-common";
|
|
5
5
|
import { CpslIcon, CpslText } from "@getpara/react-components";
|
|
6
6
|
import { useMemo } from "react";
|
|
7
7
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
8
|
-
import { useInternalClient } from "
|
|
9
|
-
import { useAssets } from "
|
|
10
|
-
import { useAccount, useWallet } from "
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
8
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
9
|
+
import { useAssets } from "../../../../../provider/providers/AssetsProvider.js";
|
|
10
|
+
import { useAccount, useWallet } from "../../../../../provider/index.js";
|
|
11
|
+
import { WalletSelect } from "./WalletSelect.js";
|
|
12
|
+
const Header = ({ withBalance = false } = {}) => {
|
|
13
13
|
const para = useInternalClient();
|
|
14
14
|
const { connectionType } = useAccount();
|
|
15
15
|
const { profileBalance, totalBalance } = useAssets();
|
|
@@ -44,7 +44,7 @@ const AccountHeader = ({ withBalance = false } = {}) => {
|
|
|
44
44
|
src
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
connectionType === "both" ? /* @__PURE__ */ jsx(
|
|
47
|
+
connectionType === "both" ? /* @__PURE__ */ jsx(WalletSelect, {}) : /* @__PURE__ */ jsx(StyledName, { variant: "headingXS", weight: "semiBold", color: "contrast", children: name }),
|
|
48
48
|
withBalance && typeof totalBalance === "string" && totalBalance !== "" && /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", weight: "medium", style: { visibility: profileBalance ? "visible" : "hidden" }, children: totalBalance })
|
|
49
49
|
] });
|
|
50
50
|
};
|
|
@@ -59,5 +59,5 @@ const StyledName = safeStyled(CpslText)`
|
|
|
59
59
|
text-align: center;
|
|
60
60
|
`;
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
Header
|
|
63
63
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const WalletSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export declare const Select: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
3
3
|
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
4
4
|
}, {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { useEffect, useMemo, useRef } from "react";
|
|
5
|
-
import { useInternalClient } from "
|
|
6
|
-
import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
|
|
7
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
7
8
|
import { getExternalWalletIcon, safeStyled, useCopyToClipboard } from "@getpara/react-common";
|
|
8
|
-
import { useAccount, useWallet, useWalletState } from "
|
|
9
|
+
import { useAccount, useWallet, useWalletState } from "../../../../../provider/index.js";
|
|
9
10
|
import { CpslButton, CpslIcon, CpslSelect, CpslSelectItem, CpslText } from "@getpara/react-components";
|
|
10
11
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
11
|
-
import {
|
|
12
|
+
import { useDropdownPosition } from "../../../../hooks/useDropdownPosition.js";
|
|
13
|
+
import { getMobilePopoverPositionCSS } from "../../../common.js";
|
|
12
14
|
const getValue = (id, type) => {
|
|
13
15
|
return id && type ? `${id}~${type}` : void 0;
|
|
14
16
|
};
|
|
@@ -63,7 +65,7 @@ const Wallet = ({
|
|
|
63
65
|
)
|
|
64
66
|
] });
|
|
65
67
|
};
|
|
66
|
-
const
|
|
68
|
+
const WalletSelect = () => {
|
|
67
69
|
var _a, _b, _c;
|
|
68
70
|
const containerRef = useRef(null);
|
|
69
71
|
const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
|
|
@@ -84,10 +86,10 @@ const AccountWalletSelect = () => {
|
|
|
84
86
|
Select,
|
|
85
87
|
{
|
|
86
88
|
selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
|
|
87
|
-
onCpslSelectValueChange: (e) => {
|
|
89
|
+
onCpslSelectValueChange: (e) => __async(void 0, null, function* () {
|
|
88
90
|
const [id, type] = e.detail.split("~");
|
|
89
|
-
setSelectedWallet({ id, type });
|
|
90
|
-
},
|
|
91
|
+
yield setSelectedWallet({ id, type });
|
|
92
|
+
}),
|
|
91
93
|
showFormattedSelectedItem: true,
|
|
92
94
|
placeholder: "Choose wallet...",
|
|
93
95
|
dropdownMaxHeight,
|
|
@@ -188,8 +190,8 @@ const CopyButton = safeStyled(CpslButton)`
|
|
|
188
190
|
}
|
|
189
191
|
`;
|
|
190
192
|
export {
|
|
191
|
-
AccountWalletSelect,
|
|
192
193
|
Select,
|
|
193
194
|
SelectContainer,
|
|
194
|
-
SelectItem
|
|
195
|
+
SelectItem,
|
|
196
|
+
WalletSelect
|
|
195
197
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
+
interface AccountFlowProps {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onDisconnect: () => void;
|
|
5
|
+
isDisconnecting: boolean;
|
|
6
|
+
oAuthMethods?: TOAuthMethod[];
|
|
7
|
+
disableEmailLogin: boolean;
|
|
8
|
+
disablePhoneLogin: boolean;
|
|
9
|
+
isGuestModeEnabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccountFlow: (props: AccountFlowProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|