@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
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo, useState } from "react";
|
|
8
8
|
import { useAddFunds } from "./AddFundsContext.js";
|
|
9
|
-
import { isAmountWithinProviderLimits, PROVIDER_LIMITS } from "
|
|
9
|
+
import { isAmountWithinProviderLimits, PROVIDER_LIMITS } from "../../../../utils/onramps.js";
|
|
10
10
|
import { CpslButton, CpslIcon, CpslRow, CpslText } from "@getpara/react-components";
|
|
11
|
-
import { AssetIcon, contentMotionProps } from "
|
|
12
|
-
import { QuantityInput } from "
|
|
11
|
+
import { AssetIcon, contentMotionProps } from "../../../common.js";
|
|
12
|
+
import { QuantityInput } from "../../../QuantityInput.js";
|
|
13
13
|
import { formatAssetQuantity, OnRampPurchaseType, EnabledFlow } from "@getpara/web-sdk";
|
|
14
|
-
import { OnRampStep, useModalStore } from "../../stores/index.js";
|
|
15
14
|
import { safeStyled, getAssetCode, getNetworkName } from "@getpara/react-common";
|
|
16
15
|
import { AnimatePresence, motion, useIsPresent } from "framer-motion";
|
|
17
16
|
import { AddFundsAsset } from "./AddFundsAsset.js";
|
|
18
|
-
import { WalletSelectOld } from "
|
|
19
|
-
import { useAccount } from "
|
|
20
|
-
import { useAssetInfo } from "
|
|
17
|
+
import { WalletSelectOld } from "../../../WalletSelectOld/WalletSelectOld.js";
|
|
18
|
+
import { useAccount } from "../../../../../provider/index.js";
|
|
19
|
+
import { useAssetInfo } from "../../../../../provider/hooks/utils/useAssetInfo.js";
|
|
21
20
|
import { AddFundsNetwork } from "./AddFundsNetwork.js";
|
|
22
|
-
import { useStore } from "
|
|
21
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
22
|
+
import { OnRampStep } from "../../../../../provider/stores/types.js";
|
|
23
23
|
function AddFundsSettings() {
|
|
24
24
|
const hideWallets = useStore((state) => {
|
|
25
25
|
var _a;
|
|
@@ -27,7 +27,7 @@ function AddFundsSettings() {
|
|
|
27
27
|
});
|
|
28
28
|
const assetInfo = useAssetInfo();
|
|
29
29
|
const isPresent = useIsPresent();
|
|
30
|
-
const setOnRampStep =
|
|
30
|
+
const setOnRampStep = useStore((state) => state.setOnRampStep);
|
|
31
31
|
const { embedded } = useAccount();
|
|
32
32
|
const {
|
|
33
33
|
assets,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
|
+
function getAddFundsStep(currentTab) {
|
|
4
|
+
switch (currentTab) {
|
|
5
|
+
case "BUY":
|
|
6
|
+
return "ACCOUNT_ADD_FUNDS_BUY";
|
|
7
|
+
case "RECEIVE":
|
|
8
|
+
return "ACCOUNT_ADD_FUNDS_RECEIVE";
|
|
9
|
+
case "WITHDRAW":
|
|
10
|
+
default:
|
|
11
|
+
return "ACCOUNT_ADD_FUNDS_WITHDRAW";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
getAddFundsStep
|
|
16
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
|
-
import { HeroAccountTypeIcon, InnerStepContainer, QRContainer, StepContainer } from "
|
|
7
|
+
import { HeroAccountTypeIcon, InnerStepContainer, QRContainer, StepContainer } from "../../../common.js";
|
|
8
8
|
import { useEffect, useMemo } from "react";
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
10
9
|
import {
|
|
11
10
|
HeroSpinner,
|
|
12
11
|
safeStyled,
|
|
@@ -14,13 +13,12 @@ import {
|
|
|
14
13
|
useCopyToClipboard,
|
|
15
14
|
openMobileUrl
|
|
16
15
|
} from "@getpara/react-common";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
17
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
19
18
|
const ChainSwitch = () => {
|
|
20
19
|
const [isCopied, copy] = useCopyToClipboard();
|
|
21
|
-
const externalWalletError =
|
|
22
|
-
const
|
|
23
|
-
const setStepDirection = useModalStore((state) => state.setStepDirection);
|
|
20
|
+
const externalWalletError = useStore((state) => state.externalWalletError);
|
|
21
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
24
22
|
const { switchChain, wallet, qrUri, chainIdSwitchingTo, walletDisplayHelpers } = useExternalWallets();
|
|
25
23
|
useEffect(() => {
|
|
26
24
|
if ((wallet == null ? void 0 : wallet.type) === "COSMOS") {
|
|
@@ -29,8 +27,7 @@ const ChainSwitch = () => {
|
|
|
29
27
|
}, [qrUri, wallet]);
|
|
30
28
|
useEffect(() => {
|
|
31
29
|
if (!wallet) {
|
|
32
|
-
|
|
33
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
30
|
+
setAccountView("ACCOUNT_MAIN");
|
|
34
31
|
}
|
|
35
32
|
}, [wallet]);
|
|
36
33
|
const handleTryAgainClick = () => __async(void 0, null, function* () {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { useEffect, useMemo, useState } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { StepContainer, InnerStepContainer, Heading, HeroIcon, SpinnerContainer, ExplorerLink } from "../common.js";
|
|
7
|
+
import { useModalSessionStore } from "../../../../stores/index.js";
|
|
8
|
+
import { StepContainer, InnerStepContainer, Heading, HeroIcon, SpinnerContainer, ExplorerLink } from "../../../common.js";
|
|
10
9
|
import { CpslButton, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
11
|
-
import { useInternalClient } from "
|
|
12
|
-
import { useSendMutations } from "
|
|
13
|
-
import { useWalletState } from "
|
|
10
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
+
import { useSendMutations } from "../../../../hooks/index.js";
|
|
12
|
+
import { useWalletState } from "../../../../../provider/index.js";
|
|
14
13
|
import { formatAssetQuantity } from "@getpara/shared";
|
|
15
14
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
16
15
|
import { AnimatePresence, motion } from "framer-motion";
|
|
17
16
|
import { safeStyled } from "@getpara/react-common";
|
|
18
|
-
import { ErrorBoundary } from "
|
|
17
|
+
import { ErrorBoundary } from "../../../ErrorBoundary.js";
|
|
18
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
19
19
|
const ErrorFallback = () => {
|
|
20
20
|
var _a;
|
|
21
|
-
const
|
|
21
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
22
22
|
const sendTx = useModalSessionStore((state) => state.sendTx);
|
|
23
23
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
24
24
|
/* @__PURE__ */ jsx(HeroIcon, { icon: "alertTriangle" }),
|
|
@@ -32,7 +32,7 @@ const ErrorFallback = () => {
|
|
|
32
32
|
{
|
|
33
33
|
fullWidth: true,
|
|
34
34
|
onClick: () => {
|
|
35
|
-
|
|
35
|
+
setAccountView("ACCOUNT_MAIN");
|
|
36
36
|
},
|
|
37
37
|
children: "Go Back"
|
|
38
38
|
}
|
|
@@ -46,7 +46,7 @@ const AccountMonitorTxContent = () => {
|
|
|
46
46
|
var _a, _b, _c, _d, _e, _f;
|
|
47
47
|
const sendTx = useModalSessionStore((state) => state.sendTx);
|
|
48
48
|
const setSendTx = useModalSessionStore((state) => state.setSendTx);
|
|
49
|
-
const
|
|
49
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
50
50
|
const para = useInternalClient();
|
|
51
51
|
const { selectedWallet, setSelectedWallet } = useWalletState();
|
|
52
52
|
const [isRetrying, setIsRetrying] = useState(false);
|
|
@@ -61,9 +61,9 @@ const AccountMonitorTxContent = () => {
|
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
var _a2;
|
|
63
63
|
if (!((_a2 = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _a2.status)) {
|
|
64
|
-
|
|
64
|
+
setAccountView("ACCOUNT_MAIN");
|
|
65
65
|
}
|
|
66
|
-
}, [sendTx,
|
|
66
|
+
}, [sendTx, setAccountView]);
|
|
67
67
|
const { estimateMutateAsync, broadcastMutateAsync } = useSendMutations({
|
|
68
68
|
estimateOnSuccess: () => {
|
|
69
69
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
|
-
import { CenteredText, Heading, InnerStepContainer, QRContainer, StepContainer } from "
|
|
6
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
+
import { CenteredText, Heading, InnerStepContainer, QRContainer, StepContainer } from "../../../common.js";
|
|
7
6
|
import { isMobile } from "@getpara/web-sdk";
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
8
|
+
const FarcasterConnectQR = () => {
|
|
9
|
+
const farcasterConnectUri = useStore((state) => state.farcasterConnectUri);
|
|
10
10
|
return /* @__PURE__ */ jsx(Fragment, { children: isMobile() ? /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
11
11
|
/* @__PURE__ */ jsx(CpslText, { weight: "medium", color: "secondary", children: `Don\u2019t have Farcaster` }),
|
|
12
12
|
/* @__PURE__ */ jsxs(CpslButton, { as: "a", href: "https://link.warpcast.com/download-qr", target: "_blank", variant: "secondary", children: [
|
|
@@ -20,7 +20,7 @@ function FarcasterConnectQR() {
|
|
|
20
20
|
/* @__PURE__ */ jsx(QRContainer, { children: !farcasterConnectUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: farcasterConnectUri }) })
|
|
21
21
|
] })
|
|
22
22
|
] }) });
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
const FarcasterLink = () => {
|
|
25
25
|
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(FarcasterConnectQR, {}) });
|
|
26
26
|
};
|
package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js}
RENAMED
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { GradientScroll, StepContainer } from "
|
|
7
|
+
import { GradientScroll, StepContainer } from "../../../common.js";
|
|
8
8
|
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
9
|
-
import { useAccount } from "
|
|
10
|
-
import { useLinkedAccounts } from "
|
|
11
|
-
import { useAccountLinking } from "
|
|
9
|
+
import { useAccount } from "../../../../../provider/index.js";
|
|
10
|
+
import { useLinkedAccounts } from "../../../../../provider/hooks/index.js";
|
|
11
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
12
12
|
import { useEffect, useMemo } from "react";
|
|
13
13
|
import { safeStyled } from "@getpara/react-common";
|
|
14
|
-
import { useStore } from "
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
import { AccountLinkEntry, WalletEntry } from "./AccountProfileEntry.js";
|
|
21
|
-
const AccountProfile = ({
|
|
22
|
-
isDisconnecting,
|
|
23
|
-
onDisconnect
|
|
24
|
-
}) => {
|
|
14
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
15
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
16
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
17
|
+
import { AccountLinkEntry, WalletEntry } from "./ProfileEntry.js";
|
|
18
|
+
import { useAccountActions } from "../AccountProvider/AccountProvider.js";
|
|
19
|
+
const Profile = ({ isDisconnecting, onDisconnect }) => {
|
|
25
20
|
const para = useInternalClient();
|
|
26
21
|
const { embedded } = useAccount();
|
|
27
22
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
@@ -30,8 +25,9 @@ const AccountProfile = ({
|
|
|
30
25
|
var _a;
|
|
31
26
|
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
32
27
|
});
|
|
33
|
-
const { switchWallets, switchWalletsUrl, setSwitchWalletsUrl, isSwitchWalletsPending } =
|
|
34
|
-
const
|
|
28
|
+
const { switchWallets, switchWalletsUrl, setSwitchWalletsUrl, isSwitchWalletsPending } = useAccountActions();
|
|
29
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
30
|
+
const isGuestMode = embedded.isGuestMode;
|
|
35
31
|
const partnerGroups = useMemo(() => {
|
|
36
32
|
var _a;
|
|
37
33
|
return (_a = embedded == null ? void 0 : embedded.wallets) == null ? void 0 : _a.reduce((acc, wallet) => {
|
|
@@ -46,13 +42,13 @@ const AccountProfile = ({
|
|
|
46
42
|
}, []);
|
|
47
43
|
}, [embedded == null ? void 0 : embedded.wallets]);
|
|
48
44
|
useEffect(() => {
|
|
49
|
-
if (para) {
|
|
45
|
+
if (para && isGuestMode === false) {
|
|
50
46
|
para.getSwitchWalletsUrl().then((url) => {
|
|
51
47
|
setSwitchWalletsUrl(url);
|
|
52
48
|
});
|
|
53
49
|
}
|
|
54
|
-
}, []);
|
|
55
|
-
if (!para || !switchWalletsUrl) {
|
|
50
|
+
}, [isGuestMode]);
|
|
51
|
+
if (!para || !switchWalletsUrl && !isGuestMode) {
|
|
56
52
|
return /* @__PURE__ */ jsx(Waiting, {});
|
|
57
53
|
}
|
|
58
54
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
@@ -66,7 +62,7 @@ const AccountProfile = ({
|
|
|
66
62
|
/* @__PURE__ */ jsx(Content, { children: wallets.map((wallet) => /* @__PURE__ */ jsx(WalletEntry, { wallet, isSelectable: true }, `${wallet.address}-${wallet.type}`)) })
|
|
67
63
|
] }, partner.id);
|
|
68
64
|
}),
|
|
69
|
-
!
|
|
65
|
+
!isGuestMode && /* @__PURE__ */ jsx(
|
|
70
66
|
CpslButton,
|
|
71
67
|
{
|
|
72
68
|
fullWidth: true,
|
|
@@ -93,7 +89,7 @@ const AccountProfile = ({
|
|
|
93
89
|
fullWidth: true,
|
|
94
90
|
variant: "tertiary",
|
|
95
91
|
onClick: () => {
|
|
96
|
-
|
|
92
|
+
setAccountView("ACCOUNT_ADD_EX_WALLET_MORE");
|
|
97
93
|
},
|
|
98
94
|
"data-testid": "para-add-wallet",
|
|
99
95
|
children: [
|
|
@@ -161,5 +157,5 @@ const DisconnectButton = safeStyled(CpslButton)`
|
|
|
161
157
|
--button-destructive-active-background-color: rgba(255, 0, 0, 0.1);
|
|
162
158
|
`;
|
|
163
159
|
export {
|
|
164
|
-
|
|
160
|
+
Profile
|
|
165
161
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { ACCOUNT_TYPES, safeStyled, useCopyToClipboard, WalletTypeIcon } from "@getpara/react-common";
|
|
@@ -12,15 +12,13 @@ import {
|
|
|
12
12
|
formatCurrency,
|
|
13
13
|
truncateAddress
|
|
14
14
|
} from "@getpara/web-sdk";
|
|
15
|
-
import { useStore } from "
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
23
|
-
const AccountProfileEntry = ({
|
|
15
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
16
|
+
import { useAssets } from "../../../../../provider/providers/AssetsProvider.js";
|
|
17
|
+
import { AccountTypeIcon } from "../../../common.js";
|
|
18
|
+
import { useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
19
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
20
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
21
|
+
const ProfileEntry = ({
|
|
24
22
|
icon,
|
|
25
23
|
text,
|
|
26
24
|
textSecondary,
|
|
@@ -71,8 +69,8 @@ const WalletEntry = ({
|
|
|
71
69
|
var _a2;
|
|
72
70
|
return (_a2 = state.modalConfig) == null ? void 0 : _a2.balances;
|
|
73
71
|
});
|
|
74
|
-
const setProfileWallet =
|
|
75
|
-
const
|
|
72
|
+
const setProfileWallet = useStore((state) => state.setProfileWallet);
|
|
73
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
76
74
|
const walletBalance = useMemo(() => {
|
|
77
75
|
return profileBalance == null ? void 0 : profileBalance.wallets.find((w) => w.address === wallet.address);
|
|
78
76
|
}, [profileBalance, wallet.address]);
|
|
@@ -97,7 +95,7 @@ const WalletEntry = ({
|
|
|
97
95
|
}
|
|
98
96
|
}, [balancesConfig, walletBalance]);
|
|
99
97
|
return /* @__PURE__ */ jsx(
|
|
100
|
-
|
|
98
|
+
ProfileEntry,
|
|
101
99
|
{
|
|
102
100
|
icon: /* @__PURE__ */ jsx(
|
|
103
101
|
WalletTypeIcon,
|
|
@@ -116,7 +114,7 @@ const WalletEntry = ({
|
|
|
116
114
|
className,
|
|
117
115
|
onSelect: isSelectable ? () => {
|
|
118
116
|
setProfileWallet(wallet);
|
|
119
|
-
|
|
117
|
+
setAccountView("ACCOUNT_WALLET");
|
|
120
118
|
} : void 0,
|
|
121
119
|
dataTestId: `wallet-entry-${wallet.type}-${wallet.address}`
|
|
122
120
|
},
|
|
@@ -159,7 +157,7 @@ const AccountLinkEntry = ({
|
|
|
159
157
|
}
|
|
160
158
|
}
|
|
161
159
|
return /* @__PURE__ */ jsx(
|
|
162
|
-
|
|
160
|
+
ProfileEntry,
|
|
163
161
|
{
|
|
164
162
|
icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType, src, size: "24px" }),
|
|
165
163
|
text: externalWallet ? (_d = (_c = (_b = externalWallet.ensName) != null ? _b : externalWalletConnector == null ? void 0 : externalWalletConnector.name) != null ? _c : externalWallet.provider) != null ? _d : "" : displayName != null ? displayName : identifier,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProfileLink: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { HeroSpinner } from "@getpara/react-common";
|
|
7
7
|
import { CpslButton, CpslIcon } from "@getpara/react-components";
|
|
8
8
|
import { useEffect, useMemo } from "react";
|
|
9
|
-
import { HeroAccountTypeIcon, HeroSuccessIcon } from "
|
|
10
|
-
import { VerificationCode } from "../VerificationCodeStep/VerificationCodeStep.js";
|
|
9
|
+
import { HeroAccountTypeIcon, HeroSuccessIcon } from "../../../common.js";
|
|
11
10
|
import { extractAuthInfo } from "@getpara/user-management-client";
|
|
12
|
-
import { FarcasterLink } from "
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { useWalletDisplayHelpers, useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
18
|
-
import { ExternalWalletMobileConnect } from "../ExternalWalletStep/ExternalWalletStep.js";
|
|
19
|
-
import { useResendVerificationCode } from "../../../provider/index.js";
|
|
11
|
+
import { FarcasterLink } from "./FarcasterLink.js";
|
|
12
|
+
import { useTelegramLink } from "./useTelegramLink.js";
|
|
13
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
14
|
+
import { useWalletDisplayHelpers, useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
15
|
+
import { useResendVerificationCode } from "../../../../../provider/index.js";
|
|
20
16
|
import { AccountLinkError } from "@getpara/web-sdk";
|
|
21
|
-
|
|
17
|
+
import { VerificationCode } from "../../../shared/VerificationCode.js";
|
|
18
|
+
import { EmailOrPhoneInput } from "../../../shared/EmailOrPhone/EmailOrPhoneInput.js";
|
|
19
|
+
import { IFrame } from "../../../shared/IFrame.js";
|
|
20
|
+
import { ExternalWalletMobileConnect } from "../../../shared/ConnectExternalWallet/ConnectExternalWallet.js";
|
|
21
|
+
const ProfileLink = () => {
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
const {
|
|
24
24
|
accountLinkInProgress,
|
|
@@ -29,13 +29,8 @@ function AccountProfileLink() {
|
|
|
29
29
|
linkAccount,
|
|
30
30
|
isLinkAccountPending,
|
|
31
31
|
resetMutations
|
|
32
|
-
} = useAccountLinking(), { wallets } = useExternalWallets(), { resendVerificationCode } = useResendVerificationCode(), accountLinkType = accountLinkInProgress == null ? void 0 : accountLinkInProgress.type, externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId, externalWalletType = (_d = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletType) != null ? _d : (_c = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _c.type, externalWallet = wallets.find((w) => w.id === externalWalletProvider), isTelegram = accountLinkType === "TELEGRAM", {
|
|
33
|
-
|
|
34
|
-
status: telegramStatus,
|
|
35
|
-
isLoaded,
|
|
36
|
-
setIsLoaded
|
|
37
|
-
} = useTelegramLogin(
|
|
38
|
-
isTelegram ? { isActive: isTelegram, status: linkAccountStatus, onSubmit: verifyTelegramLink, isLinking: true } : { isActive: false, isLinking: true }
|
|
32
|
+
} = useAccountLinking(), { wallets } = useExternalWallets(), { resendVerificationCode } = useResendVerificationCode(), accountLinkType = accountLinkInProgress == null ? void 0 : accountLinkInProgress.type, externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId, externalWalletType = (_d = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletType) != null ? _d : (_c = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _c.type, externalWallet = wallets.find((w) => w.id === externalWalletProvider), isTelegram = accountLinkType === "TELEGRAM", { status: telegramStatus } = useTelegramLink(
|
|
33
|
+
isTelegram ? { isActive: isTelegram, status: linkAccountStatus, onSubmit: verifyTelegramLink } : { isActive: false }
|
|
39
34
|
), status = (accountLinkInProgress == null ? void 0 : accountLinkInProgress.isComplete) ? "success" : isTelegram ? telegramStatus : linkAccountStatus, commonWallet = useMemo(() => {
|
|
40
35
|
const wallet = wallets.find(
|
|
41
36
|
(w) => [w.name, w.internalId, w.id].includes(externalWalletProvider != null ? externalWalletProvider : "") && w.type === externalWalletType
|
|
@@ -92,7 +87,7 @@ function AccountProfileLink() {
|
|
|
92
87
|
case (!accountLinkInProgress.identifier && (accountLinkInProgress.type === "EMAIL" || accountLinkInProgress.type === "PHONE")):
|
|
93
88
|
upper2 = heroSpinner;
|
|
94
89
|
lower2 = /* @__PURE__ */ jsx(
|
|
95
|
-
|
|
90
|
+
EmailOrPhoneInput,
|
|
96
91
|
{
|
|
97
92
|
disableEmailLogin: accountLinkInProgress.type !== "EMAIL",
|
|
98
93
|
disablePhoneLogin: accountLinkInProgress.type !== "PHONE",
|
|
@@ -154,7 +149,7 @@ function AccountProfileLink() {
|
|
|
154
149
|
{
|
|
155
150
|
wallet: commonWallet,
|
|
156
151
|
isSelfFetching: true,
|
|
157
|
-
onConnectWc: (w) => __async(
|
|
152
|
+
onConnectWc: (w) => __async(void 0, null, function* () {
|
|
158
153
|
yield linkAccount({ externalWallet: { provider: w.id, type: w.type } });
|
|
159
154
|
})
|
|
160
155
|
}
|
|
@@ -164,15 +159,7 @@ function AccountProfileLink() {
|
|
|
164
159
|
}
|
|
165
160
|
break;
|
|
166
161
|
case accountLinkType === "TELEGRAM":
|
|
167
|
-
lower2 = /* @__PURE__ */ jsx(
|
|
168
|
-
TelegramIFrame,
|
|
169
|
-
{
|
|
170
|
-
url,
|
|
171
|
-
isLoaded,
|
|
172
|
-
setIsLoaded,
|
|
173
|
-
isVisible: status === "error" || status === "idle"
|
|
174
|
-
}
|
|
175
|
-
);
|
|
162
|
+
lower2 = /* @__PURE__ */ jsx(IFrame, {});
|
|
176
163
|
break;
|
|
177
164
|
case (status === "error" && !!accountLinkInProgress):
|
|
178
165
|
lower2 = tryAgain;
|
|
@@ -189,8 +176,6 @@ function AccountProfileLink() {
|
|
|
189
176
|
accountLinkType,
|
|
190
177
|
accountLinkInProgress,
|
|
191
178
|
telegramStatus,
|
|
192
|
-
url,
|
|
193
|
-
isLoaded,
|
|
194
179
|
linkAccount,
|
|
195
180
|
status,
|
|
196
181
|
isTelegram,
|
|
@@ -207,7 +192,7 @@ function AccountProfileLink() {
|
|
|
207
192
|
upper,
|
|
208
193
|
lower
|
|
209
194
|
] });
|
|
210
|
-
}
|
|
195
|
+
};
|
|
211
196
|
export {
|
|
212
|
-
|
|
197
|
+
ProfileLink
|
|
213
198
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProfileLinkOptions: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import { AccountTypeIcon, GradientScroll, StepContainer } from "../common.js";
|
|
4
|
+
import { AccountTypeIcon, GradientScroll, StepContainer } from "../../../common.js";
|
|
6
5
|
import { CpslButton, CpslDivider, CpslText } from "@getpara/react-components";
|
|
7
|
-
import { useExternalWallets } from "
|
|
8
|
-
import { useAccountLinking } from "
|
|
9
|
-
import { useLinkedAccounts } from "
|
|
6
|
+
import { useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
7
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
8
|
+
import { useLinkedAccounts } from "../../../../../provider/hooks/index.js";
|
|
10
9
|
import { useEffect, useMemo } from "react";
|
|
11
|
-
import { useInternalClient } from "
|
|
10
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
12
11
|
import { getAccountTypeName, safeStyled } from "@getpara/react-common";
|
|
13
|
-
|
|
12
|
+
import { EmailOrPhoneInput } from "../../../shared/EmailOrPhone/EmailOrPhoneInput.js";
|
|
13
|
+
const ProfileLinkOptions = () => {
|
|
14
14
|
const para = useInternalClient();
|
|
15
15
|
const { accountLinkOptions, linkAccount, isLinkAccountPending, linkAccountError, setLinkAccountError, resetMutations } = useAccountLinking();
|
|
16
16
|
const { wallets } = useExternalWallets();
|
|
@@ -63,7 +63,7 @@ function AccountProfileLinkOptions() {
|
|
|
63
63
|
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
64
64
|
(isEmail || isPhone) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
65
|
/* @__PURE__ */ jsx(
|
|
66
|
-
|
|
66
|
+
EmailOrPhoneInput,
|
|
67
67
|
{
|
|
68
68
|
disableEmailLogin: !isEmail,
|
|
69
69
|
disablePhoneLogin: !isPhone,
|
|
@@ -109,7 +109,7 @@ function AccountProfileLinkOptions() {
|
|
|
109
109
|
);
|
|
110
110
|
}) })
|
|
111
111
|
] }) });
|
|
112
|
-
}
|
|
112
|
+
};
|
|
113
113
|
const Content = safeStyled.div`
|
|
114
114
|
display: flex;
|
|
115
115
|
flex-direction: column;
|
|
@@ -125,5 +125,5 @@ const Option = safeStyled(CpslButton)`
|
|
|
125
125
|
align-items: flex-start;
|
|
126
126
|
`;
|
|
127
127
|
export {
|
|
128
|
-
|
|
128
|
+
ProfileLinkOptions
|
|
129
129
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProfileUnlink: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CpslButton, CpslText } from "@getpara/react-components";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { AccountTypeIcon } from "
|
|
7
|
-
import { useAccountLinking } from "
|
|
6
|
+
import { AccountTypeIcon } from "../../../common.js";
|
|
7
|
+
import { useAccountLinking } from "../../../../../provider/providers/AccountLinkProvider.js";
|
|
8
8
|
import { getAccountTypeName, safeStyled } from "@getpara/react-common";
|
|
9
|
-
|
|
9
|
+
const ProfileUnlink = () => {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
const { unlinkingAccount, unlinkAccountConfirm, isUnlinkAccountPending } = useAccountLinking(), [accountType, setAccountType] = useState((_b = (_a = unlinkingAccount == null ? void 0 : unlinkingAccount.externalWallet) == null ? void 0 : _a.providerId) != null ? _b : unlinkingAccount == null ? void 0 : unlinkingAccount.type), [isUnlinkingExternalWallet, setIsUnlinkingExternalWallet] = useState(false);
|
|
12
12
|
useEffect(() => {
|
|
@@ -28,7 +28,7 @@ function AccountProfileUnlink() {
|
|
|
28
28
|
] }),
|
|
29
29
|
/* @__PURE__ */ jsx(CpslButton, { variant: "destructive", fullWidth: true, onClick: unlinkAccountConfirm, disabled: isUnlinkAccountPending, children: "Confirm" })
|
|
30
30
|
] });
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
const Content = safeStyled.div`
|
|
33
33
|
display: flex;
|
|
34
34
|
flex-direction: column;
|
|
@@ -44,5 +44,5 @@ const Message = safeStyled(CpslText)`
|
|
|
44
44
|
max-width: 342px;
|
|
45
45
|
`;
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
ProfileUnlink
|
|
48
48
|
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { TelegramAuthResponse, VerifyThirdPartyAuth } from '@getpara/user-management-client';
|
|
2
2
|
import { MutationStatus } from '@tanstack/react-query';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const useTelegramLink: ({ isActive, onSubmit, status: propsStatus, }?: {
|
|
4
4
|
isActive?: boolean;
|
|
5
5
|
onSubmit?: (_: VerifyThirdPartyAuth | TelegramAuthResponse) => void;
|
|
6
6
|
status?: MutationStatus;
|
|
7
|
-
isLinking?: boolean;
|
|
8
7
|
}) => {
|
|
9
|
-
url: string | undefined;
|
|
10
|
-
isLoaded: boolean;
|
|
11
|
-
setIsLoaded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
12
8
|
status: MutationStatus | undefined;
|
|
13
9
|
};
|