@getpara/react-sdk-lite 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/modal.css +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/modal/ParaModal.js +57 -98
- package/dist/modal/components/Body/Body.d.ts +1 -2
- package/dist/modal/components/Body/Body.js +119 -231
- package/dist/modal/components/Controls/ChainSelect.js +3 -4
- package/dist/modal/components/Controls/Controls.js +2 -4
- package/dist/modal/components/Footer/Footer.js +3 -12
- package/dist/modal/components/Header/Header.js +13 -14
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
- package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
- package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
- package/dist/modal/components/ModalContent/ModalContent.js +6 -14
- package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
- package/dist/modal/components/WalletCard/WalletCard.js +9 -9
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +13 -18
- package/dist/modal/components/common.d.ts +5 -0
- package/dist/modal/components/common.js +17 -10
- package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
- package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
- package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +17 -22
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
- package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
- package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
- package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
- package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
- package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
- package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
- package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
- package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
- package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
- package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
- package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
- package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
- package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
- package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +16 -23
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
- package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
- package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
- package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
- package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +19 -6
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
- package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
- package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
- package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
- package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +12 -18
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
- package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
- package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
- package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
- package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
- package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
- package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
- package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
- package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
- package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
- package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
- package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
- package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
- package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
- package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
- package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
- package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +17 -37
- package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
- package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
- package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
- package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
- package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
- package/dist/modal/components/shared/IFrame.d.ts +1 -0
- package/dist/modal/components/shared/IFrame.js +87 -0
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
- package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
- package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
- package/dist/modal/hooks/index.d.ts +1 -2
- package/dist/modal/hooks/index.js +1 -2
- package/dist/modal/hooks/useAuthView.d.ts +4 -0
- package/dist/modal/hooks/useAuthView.js +115 -0
- package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
- package/dist/modal/hooks/useCanbGoBack.js +47 -0
- package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +1 -1
- package/dist/modal/hooks/useDropdownPosition.js +41 -0
- package/dist/modal/hooks/useGoBack.d.ts +4 -1
- package/dist/modal/hooks/useGoBack.js +60 -36
- package/dist/modal/hooks/useSendMutations.js +4 -5
- package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
- package/dist/modal/index.d.ts +1 -2
- package/dist/modal/index.js +1 -3
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -1
- package/dist/modal/types/modalProps.d.ts +18 -8
- package/dist/provider/ParaProviderMin.js +34 -38
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +43 -49
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/components/CosmosWalletWrapper.js +0 -3
- package/dist/provider/components/EvmWalletWrapper.js +0 -3
- package/dist/provider/components/ExternalWalletWrapper.js +8 -2
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
- package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
- package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
- package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
- package/dist/provider/hooks/mutations/utils.js +1 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
- package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
- package/dist/provider/hooks/queries/useParaStatus.js +0 -2
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +0 -7
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
- package/dist/provider/hooks/utils/useModal.d.ts +4 -3
- package/dist/provider/hooks/utils/useModal.js +17 -9
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
- package/dist/provider/hooks/utils/useWalletState.js +14 -6
- package/dist/provider/providers/AccountLinkProvider.js +21 -19
- package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
- package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
- package/dist/provider/providers/ExternalWalletProvider.js +285 -283
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/stores/getters.js +5 -5
- package/dist/provider/stores/setters.js +2 -2
- package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
- package/dist/provider/stores/slices/accountFlow.js +30 -0
- package/dist/provider/stores/slices/authFlow.d.ts +3 -0
- package/dist/provider/stores/slices/authFlow.js +63 -0
- package/dist/provider/stores/slices/externalWallets.js +10 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +4 -0
- package/dist/provider/stores/slices/modal.js +8 -2
- package/dist/provider/stores/slices/onRamp.d.ts +3 -0
- package/dist/provider/stores/slices/onRamp.js +20 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +9 -0
- package/dist/provider/stores/types.d.ts +117 -5
- package/dist/provider/stores/types.js +9 -0
- package/dist/provider/stores/useStore.d.ts +5 -3
- package/dist/provider/stores/useStore.js +15 -8
- package/package.json +8 -8
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
- package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -118
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
- package/dist/modal/hooks/useFarcasterLogin.js +0 -77
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -146
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -119
- package/dist/modal/stores/modal/useModalStore.js +0 -80
- package/dist/modal/utils/steps.d.ts +0 -162
- package/dist/modal/utils/steps.js +0 -335
- package/dist/provider/providers/AuthProvider.d.ts +0 -43
- package/dist/provider/providers/AuthProvider.js +0 -777
- /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
- /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
- /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
- /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
- /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
- /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
- /package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.d.ts +0 -0
|
@@ -1,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
|
};
|
package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js}
RENAMED
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { useInternalClient } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
6
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
7
|
+
import { validatePortalOrigin } from "../../../../utils/validatePortalOrigin.js";
|
|
8
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
9
|
+
const useTelegramLink = ({
|
|
10
10
|
isActive = false,
|
|
11
11
|
onSubmit,
|
|
12
|
-
status: propsStatus
|
|
13
|
-
isLinking
|
|
12
|
+
status: propsStatus
|
|
14
13
|
} = {}) => {
|
|
15
14
|
const para = useInternalClient();
|
|
16
|
-
const refs =
|
|
17
|
-
const
|
|
18
|
-
const
|
|
15
|
+
const refs = useStore((state) => state.refs);
|
|
16
|
+
const iFrameUrl = useStore((state) => state.iFrameUrl);
|
|
17
|
+
const setIFrameUrl = useStore((state) => state.setIFrameUrl);
|
|
19
18
|
const [msgStatus, setMsgStatus] = useState("idle");
|
|
20
19
|
const status = msgStatus === "success" ? propsStatus : msgStatus;
|
|
21
20
|
useEffect(() => {
|
|
22
21
|
const setup = () => __async(void 0, null, function* () {
|
|
23
|
-
if (!
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
yield para.touchSession(true);
|
|
27
|
-
}
|
|
28
|
-
para.constructPortalUrl(!isLinking ? "telegramLoginVerify" : "telegramLogin").then(setUrl);
|
|
22
|
+
if (!iFrameUrl) {
|
|
23
|
+
const url = yield para.constructPortalUrl("telegramLogin");
|
|
24
|
+
setIFrameUrl(url);
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
if (isActive) {
|
|
32
28
|
setup();
|
|
33
29
|
}
|
|
34
|
-
}, [isActive,
|
|
30
|
+
}, [isActive, iFrameUrl]);
|
|
35
31
|
useEffect(() => {
|
|
36
32
|
const updateState = (event) => __async(void 0, null, function* () {
|
|
37
33
|
var _a, _b;
|
|
@@ -50,9 +46,9 @@ const useTelegramLogin = ({
|
|
|
50
46
|
if (!!event.data.payload) {
|
|
51
47
|
const authObject = event.data.payload;
|
|
52
48
|
try {
|
|
53
|
-
|
|
49
|
+
onSubmit == null ? void 0 : onSubmit(authObject);
|
|
54
50
|
} catch (e) {
|
|
55
|
-
(_b = (_a = refs.
|
|
51
|
+
(_b = (_a = refs.iFrame.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage({ type: "TELEGRAM_RETRY" }, "*");
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
break;
|
|
@@ -66,12 +62,9 @@ const useTelegramLogin = ({
|
|
|
66
62
|
};
|
|
67
63
|
}, [isActive, onSubmit]);
|
|
68
64
|
return {
|
|
69
|
-
url,
|
|
70
|
-
isLoaded,
|
|
71
|
-
setIsLoaded,
|
|
72
65
|
status
|
|
73
66
|
};
|
|
74
67
|
};
|
|
75
68
|
export {
|
|
76
|
-
|
|
69
|
+
useTelegramLink
|
|
77
70
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendAsset: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo, useCallback, memo } from "react";
|
|
5
|
-
import { useWalletState } from "
|
|
6
|
-
import { useAssets } from "
|
|
7
|
-
import { SearchableButtonList } from "
|
|
5
|
+
import { useWalletState } from "../../../../../provider/index.js";
|
|
6
|
+
import { useAssets } from "../../../../../provider/providers/AssetsProvider.js";
|
|
7
|
+
import { SearchableButtonList } from "../../../SearchableButtonList.js";
|
|
8
8
|
import { useSend } from "./context.js";
|
|
9
9
|
import { CpslIcon } from "@getpara/react-components";
|
|
10
10
|
import { formatAssetQuantity, formatCurrency } from "@getpara/web-sdk";
|
|
11
|
-
import { ModalStep } from "../../../utils/steps.js";
|
|
12
|
-
import { useModalStore } from "../../../stores/index.js";
|
|
13
11
|
import { AssetNetwork } from "./AssetNetwork.js";
|
|
12
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
14
13
|
const NetworkIcons = memo(({ networks }) => {
|
|
15
14
|
return /* @__PURE__ */ jsx("div", { style: { position: "relative", height: "12px" }, children: networks.slice(0, 3).map((network, index) => {
|
|
16
15
|
var _a;
|
|
@@ -34,8 +33,8 @@ const NetworkIcons = memo(({ networks }) => {
|
|
|
34
33
|
}) });
|
|
35
34
|
});
|
|
36
35
|
NetworkIcons.displayName = "NetworkIcons";
|
|
37
|
-
|
|
38
|
-
const
|
|
36
|
+
const SendAsset = () => {
|
|
37
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
39
38
|
const { profileBalance } = useAssets();
|
|
40
39
|
const { selectedWallet } = useWalletState();
|
|
41
40
|
const { setSendMetadata, setTransferAmount } = useSend();
|
|
@@ -75,9 +74,9 @@ function AccountSendAsset() {
|
|
|
75
74
|
asset: item,
|
|
76
75
|
network: item.networks[0]
|
|
77
76
|
});
|
|
78
|
-
|
|
77
|
+
setAccountView(item.networks.length > 1 ? "ACCOUNT_SEND_NETWORK" : "ACCOUNT_SEND");
|
|
79
78
|
},
|
|
80
|
-
[setTransferAmount, setSendMetadata,
|
|
79
|
+
[setTransferAmount, setSendMetadata, setAccountView]
|
|
81
80
|
);
|
|
82
81
|
return /* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsx(
|
|
83
82
|
SearchableButtonList,
|
|
@@ -88,7 +87,7 @@ function AccountSendAsset() {
|
|
|
88
87
|
onSelect
|
|
89
88
|
}
|
|
90
89
|
) });
|
|
91
|
-
}
|
|
90
|
+
};
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
SendAsset
|
|
94
93
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendForm: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,26 @@
|
|
|
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, CpslInput, CpslText } from "@getpara/react-components";
|
|
5
|
-
import { QuantityInput } from "
|
|
5
|
+
import { QuantityInput } from "../../../QuantityInput.js";
|
|
6
6
|
import { formatAssetQuantity, formatCurrency } from "@getpara/shared";
|
|
7
7
|
import { WalletTypeIcon } from "@getpara/react-common";
|
|
8
8
|
import { useSend } from "./context.js";
|
|
9
|
-
import {
|
|
10
|
-
import { ModalStep } from "../../../utils/steps.js";
|
|
9
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
11
10
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
12
11
|
import { createPortal } from "react-dom";
|
|
13
|
-
import { useDebounce } from "
|
|
12
|
+
import { useDebounce } from "../../../../hooks/useDebounce.js";
|
|
14
13
|
import { AssetNetwork } from "./AssetNetwork.js";
|
|
15
|
-
import { useWalletState } from "
|
|
16
|
-
import { useInternalClient } from "
|
|
14
|
+
import { useWalletState } from "../../../../../provider/index.js";
|
|
15
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
17
16
|
import { Environment } from "@getpara/web-sdk";
|
|
18
17
|
import { safeStyled } from "@getpara/react-common";
|
|
19
|
-
|
|
18
|
+
const SendForm = () => {
|
|
20
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
21
20
|
const { selectedWallet } = useWalletState();
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
21
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
22
|
+
const accountView = useStore((state) => state.accountView);
|
|
23
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
25
24
|
const {
|
|
26
25
|
estimate,
|
|
27
26
|
broadcast,
|
|
@@ -46,7 +45,7 @@ function AccountSendForm() {
|
|
|
46
45
|
} = useSend();
|
|
47
46
|
const para = useInternalClient();
|
|
48
47
|
const isDevOrSandbox = ((_a = para.ctx) == null ? void 0 : _a.env) === Environment.DEV || ((_b = para.ctx) == null ? void 0 : _b.env) === Environment.SANDBOX;
|
|
49
|
-
const isSendFormStep =
|
|
48
|
+
const isSendFormStep = accountView === "ACCOUNT_SEND";
|
|
50
49
|
const [inputDestinationAddress, setInputDestinationAddress] = useState(destinationAddress);
|
|
51
50
|
const dbInputDestinationAddress = useDebounce(inputDestinationAddress, 500);
|
|
52
51
|
const isTestnet = (_d = (_c = sendMetadata == null ? void 0 : sendMetadata.network) == null ? void 0 : _c.metadata) == null ? void 0 : _d.isTestnet;
|
|
@@ -88,7 +87,7 @@ function AccountSendForm() {
|
|
|
88
87
|
gap: "4px",
|
|
89
88
|
paddingRight: 0
|
|
90
89
|
},
|
|
91
|
-
onClick: () =>
|
|
90
|
+
onClick: () => setAccountView("ACCOUNT_ADD_FUNDS_BUY"),
|
|
92
91
|
children: [
|
|
93
92
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
94
93
|
"Buy ",
|
|
@@ -218,7 +217,7 @@ function AccountSendForm() {
|
|
|
218
217
|
(sendMetadata == null ? void 0 : sendMetadata.asset) && (sendMetadata == null ? void 0 : sendMetadata.network) && /* @__PURE__ */ jsxs(
|
|
219
218
|
"button",
|
|
220
219
|
{
|
|
221
|
-
onClick: () => !["SINGLE_NETWORK", "NONE"].includes(optionsType) ?
|
|
220
|
+
onClick: () => !["SINGLE_NETWORK", "NONE"].includes(optionsType) ? setAccountView(optionsType === "SINGLE_ASSET" ? "ACCOUNT_SEND_NETWORK" : "ACCOUNT_SEND_ASSET") : void 0,
|
|
222
221
|
style: {
|
|
223
222
|
cursor: "pointer",
|
|
224
223
|
background: "transparent",
|
|
@@ -384,7 +383,7 @@ function AccountSendForm() {
|
|
|
384
383
|
document.body
|
|
385
384
|
)
|
|
386
385
|
] });
|
|
387
|
-
}
|
|
386
|
+
};
|
|
388
387
|
const RecipientInput = safeStyled(CpslInput)`
|
|
389
388
|
--cpsl-color-input-surface-hover: var(--cpsl-color-input-surface-default);
|
|
390
389
|
`;
|
|
@@ -406,5 +405,5 @@ const SimulateFailureContainer = safeStyled.div`
|
|
|
406
405
|
isolation: isolate;
|
|
407
406
|
`;
|
|
408
407
|
export {
|
|
409
|
-
|
|
408
|
+
SendForm
|
|
410
409
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendNetwork: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
-
import { useAssets } from "
|
|
9
|
-
import { SearchableButtonList } from "
|
|
8
|
+
import { useAssets } from "../../../../../provider/providers/AssetsProvider.js";
|
|
9
|
+
import { SearchableButtonList } from "../../../SearchableButtonList.js";
|
|
10
10
|
import { useSend } from "./context.js";
|
|
11
11
|
import { formatAssetQuantity, formatCurrency } from "@getpara/web-sdk";
|
|
12
|
-
import {
|
|
13
|
-
import { useModalStore } from "../../../stores/index.js";
|
|
12
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
14
13
|
import { AssetNetwork } from "./AssetNetwork.js";
|
|
15
|
-
|
|
16
|
-
const
|
|
14
|
+
const SendNetwork = () => {
|
|
15
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
17
16
|
const { profileBalance } = useAssets();
|
|
18
17
|
const { sendMetadata, setSendMetadata } = useSend();
|
|
19
18
|
const assetNetworks = useMemo(() => {
|
|
@@ -43,11 +42,11 @@ function AccountSendNetwork() {
|
|
|
43
42
|
setSendMetadata((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
44
43
|
network: item
|
|
45
44
|
}));
|
|
46
|
-
|
|
45
|
+
setAccountView("ACCOUNT_SEND");
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
) });
|
|
50
|
-
}
|
|
49
|
+
};
|
|
51
50
|
export {
|
|
52
|
-
|
|
51
|
+
SendNetwork
|
|
53
52
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendNoAssets: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
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
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
5
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
6
|
+
const SendNoAssets = () => {
|
|
7
|
+
const onRampConfig = useStore((state) => state.onRampConfig);
|
|
8
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
10
9
|
return /* @__PURE__ */ jsxs(
|
|
11
10
|
"div",
|
|
12
11
|
{
|
|
@@ -42,7 +41,7 @@ function AccountSendNoAssets() {
|
|
|
42
41
|
fullWidth: true,
|
|
43
42
|
variant: "primary",
|
|
44
43
|
onClick: () => {
|
|
45
|
-
|
|
44
|
+
setAccountView("ACCOUNT_ADD_FUNDS_BUY");
|
|
46
45
|
},
|
|
47
46
|
children: "Buy"
|
|
48
47
|
}
|
|
@@ -50,7 +49,7 @@ function AccountSendNoAssets() {
|
|
|
50
49
|
]
|
|
51
50
|
}
|
|
52
51
|
);
|
|
53
|
-
}
|
|
52
|
+
};
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
SendNoAssets
|
|
56
55
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import {
|
|
8
8
|
createContext,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
useRef,
|
|
14
14
|
useState
|
|
15
15
|
} from "react";
|
|
16
|
-
import { useInternalClient } from "
|
|
17
|
-
import { useProfileBalance, useWalletState } from "
|
|
18
|
-
import { useSendMutations } from "
|
|
19
|
-
import { useStore } from "
|
|
16
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
17
|
+
import { useProfileBalance, useWalletState } from "../../../../../provider/index.js";
|
|
18
|
+
import { useSendMutations } from "../../../../hooks/index.js";
|
|
19
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
20
20
|
const getDefaultSendMetadata = (balances, wallet) => {
|
|
21
21
|
if (!balances || !(wallet == null ? void 0 : wallet.type) || !(wallet == null ? void 0 : wallet.address) || (wallet == null ? void 0 : wallet.type) === "COSMOS") {
|
|
22
22
|
return { asset: null, network: null };
|
|
@@ -61,7 +61,8 @@ function AccountSendProvider({ children, step }) {
|
|
|
61
61
|
var _a2;
|
|
62
62
|
return (_a2 = state.modalConfig) == null ? void 0 : _a2.balances;
|
|
63
63
|
});
|
|
64
|
-
const
|
|
64
|
+
const [refetchTrigger, setRefetchTrigger] = useState(0);
|
|
65
|
+
const { data: balances } = useProfileBalance({ isComprehensive: true, refetchTrigger });
|
|
65
66
|
const { selectedWallet, setSelectedWallet } = useWalletState();
|
|
66
67
|
const [estimate, setEstimate] = useState(null);
|
|
67
68
|
const [broadcast, setBroadcast] = useState(null);
|
|
@@ -161,6 +162,7 @@ function AccountSendProvider({ children, step }) {
|
|
|
161
162
|
const prevWalletAddressRef = useRef(selectedWallet == null ? void 0 : selectedWallet.address);
|
|
162
163
|
const isSettingMaxRef = useRef(false);
|
|
163
164
|
const isResettingRef = useRef(false);
|
|
165
|
+
const recentTxCompletedRef = useRef(false);
|
|
164
166
|
const resetState = useCallback(() => {
|
|
165
167
|
if (isResettingRef.current) {
|
|
166
168
|
return;
|
|
@@ -291,6 +293,17 @@ function AccountSendProvider({ children, step }) {
|
|
|
291
293
|
assetAmountOnNetwork,
|
|
292
294
|
isMax
|
|
293
295
|
]);
|
|
296
|
+
useEffect(() => {
|
|
297
|
+
if (broadcast && !broadcast.error) {
|
|
298
|
+
recentTxCompletedRef.current = true;
|
|
299
|
+
}
|
|
300
|
+
}, [broadcast]);
|
|
301
|
+
useEffect(() => {
|
|
302
|
+
if (step === "SEND_FORM" && recentTxCompletedRef.current) {
|
|
303
|
+
setRefetchTrigger((prev) => prev + 1);
|
|
304
|
+
recentTxCompletedRef.current = false;
|
|
305
|
+
}
|
|
306
|
+
}, [step]);
|
|
294
307
|
const value = useMemo(() => {
|
|
295
308
|
return {
|
|
296
309
|
step,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { StepContainer } from "
|
|
4
|
+
import { StepContainer } from "../../../common.js";
|
|
5
5
|
import { useMemo, useRef, useEffect, useState } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { SendForm } from "./SendForm.js";
|
|
7
7
|
import { AccountSendProvider, useSend } from "./context.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { SendAsset } from "./SendAsset.js";
|
|
9
|
+
import { SendNetwork } from "./SendNetwork.js";
|
|
10
10
|
import { AnimatePresence, motion } from "framer-motion";
|
|
11
11
|
import { BODY_MOTION_VARIANTS, BODY_TRANSITION, safeStyled } from "@getpara/react-common";
|
|
12
|
-
import { WalletSelectOld } from "
|
|
13
|
-
import {
|
|
12
|
+
import { WalletSelectOld } from "../../../WalletSelectOld/WalletSelectOld.js";
|
|
13
|
+
import { SendNoAssets } from "./SendNoAssets.js";
|
|
14
14
|
const STEP_ORDER = ["SEND_FORM", "SEND_ASSET", "SEND_NETWORK"];
|
|
15
15
|
function AccountSendIndex() {
|
|
16
16
|
const { step, optionsType } = useSend();
|
|
@@ -24,15 +24,15 @@ function AccountSendIndex() {
|
|
|
24
24
|
}, [step]);
|
|
25
25
|
const Content = useMemo(() => {
|
|
26
26
|
if (optionsType === "NONE") {
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
+
return /* @__PURE__ */ jsx(SendNoAssets, {});
|
|
28
28
|
}
|
|
29
29
|
switch (step) {
|
|
30
30
|
case "SEND_FORM":
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
31
|
+
return /* @__PURE__ */ jsx(SendForm, {});
|
|
32
32
|
case "SEND_ASSET":
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
+
return /* @__PURE__ */ jsx(SendAsset, {});
|
|
34
34
|
case "SEND_NETWORK":
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
35
|
+
return /* @__PURE__ */ jsx(SendNetwork, {});
|
|
36
36
|
}
|
|
37
37
|
}, [step, optionsType]);
|
|
38
38
|
return /* @__PURE__ */ jsxs(StepContainer, { style: { gap: "16px" }, children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SwitchWallet: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Waiting } from "
|
|
5
|
-
const
|
|
4
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
5
|
+
const SwitchWallet = () => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Waiting, { heading: "Switching Wallets", subheading: "Please complete the wallet selection in the popup window." });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
SwitchWallet
|
|
10
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Wallet: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
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 { safeStyled, SpinnerContainer } from "@getpara/react-common";
|
|
7
7
|
import { CpslButton, CpslIcon, CpslSpinner } from "@getpara/react-components";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { useAccount, useExportPrivateKey } from "../../../../../provider/index.js";
|
|
10
|
+
import { useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
11
|
+
import { WalletEntry } from "../Profile/ProfileEntry.js";
|
|
12
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
14
13
|
const EXPLORERS = {
|
|
15
14
|
EVM: {
|
|
16
15
|
name: "Etherscan",
|
|
@@ -25,10 +24,10 @@ const EXPLORERS = {
|
|
|
25
24
|
url: (address) => `https://atomscan.com/accounts/${address}`
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
const
|
|
29
|
-
const profileWallet =
|
|
30
|
-
const setProfileWallet =
|
|
31
|
-
const
|
|
27
|
+
const Wallet = () => {
|
|
28
|
+
const profileWallet = useStore((state) => state.profileWallet);
|
|
29
|
+
const setProfileWallet = useStore((state) => state.setProfileWallet);
|
|
30
|
+
const setAccountView = useStore((state) => state.setAccountView);
|
|
32
31
|
const { connectionType } = useAccount();
|
|
33
32
|
const { mutate: exportPrivateKey } = useExportPrivateKey();
|
|
34
33
|
const { disconnectBase, evmDisconnectStatus, solanaDisconnectStatus, cosmosDisconnectStatus } = useExternalWallets();
|
|
@@ -102,7 +101,7 @@ const AccountWallet = () => {
|
|
|
102
101
|
disconnectType: "ACCOUNT_WIDGET"
|
|
103
102
|
});
|
|
104
103
|
setProfileWallet(void 0);
|
|
105
|
-
|
|
104
|
+
setAccountView("ACCOUNT_PROFILE");
|
|
106
105
|
}),
|
|
107
106
|
"data-testid": "para-disconnect-wallet",
|
|
108
107
|
children: [
|
|
@@ -113,11 +112,6 @@ const AccountWallet = () => {
|
|
|
113
112
|
)
|
|
114
113
|
] });
|
|
115
114
|
}, [profileWallet, connectionType, disconnectStatus]);
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
return () => {
|
|
118
|
-
setProfileWallet(void 0);
|
|
119
|
-
};
|
|
120
|
-
}, []);
|
|
121
115
|
return /* @__PURE__ */ jsx(Container, { children: Content });
|
|
122
116
|
};
|
|
123
117
|
const Container = safeStyled.div`
|
|
@@ -132,5 +126,5 @@ const DestructiveButton = safeStyled(CpslButton)`
|
|
|
132
126
|
--button-destructive-active-background-color: rgba(255, 0, 0, 0.1);
|
|
133
127
|
`;
|
|
134
128
|
export {
|
|
135
|
-
|
|
129
|
+
Wallet
|
|
136
130
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
+
interface AuthFlowProps {
|
|
3
|
+
oAuthMethods?: TOAuthMethod[];
|
|
4
|
+
disableEmailLogin: boolean;
|
|
5
|
+
disablePhoneLogin: boolean;
|
|
6
|
+
isGuestModeEnabled?: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AuthFlow: import("react").MemoExoticComponent<({ onClose, ...rest }: AuthFlowProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined>;
|
|
10
|
+
export {};
|