@getpara/react-sdk 2.0.0-dev.3 → 2.0.0-dev.5
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/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
- package/dist/cosmos/actions/index.d.ts +2 -0
- package/dist/cosmos/actions/index.js +3 -0
- package/dist/cosmos/hooks/index.d.ts +2 -0
- package/dist/cosmos/hooks/index.js +3 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
- package/dist/cosmos/index.d.ts +2 -0
- package/dist/cosmos/index.js +3 -0
- package/dist/css/modal.css +14 -1
- package/dist/evm/actions/getViemAccount.d.ts +22 -0
- package/dist/evm/actions/getViemAccount.js +20 -0
- package/dist/evm/actions/getViemClient.d.ts +7659 -0
- package/dist/evm/actions/getViemClient.js +25 -0
- package/dist/evm/actions/index.d.ts +2 -0
- package/dist/evm/actions/index.js +3 -0
- package/dist/evm/hooks/index.d.ts +2 -0
- package/dist/evm/hooks/index.js +3 -0
- package/dist/evm/hooks/useViemAccount.d.ts +26 -0
- package/dist/evm/hooks/useViemAccount.js +32 -0
- package/dist/evm/hooks/useViemClient.d.ts +7663 -0
- package/dist/evm/hooks/useViemClient.js +30 -0
- package/dist/evm/index.d.ts +2 -0
- package/dist/evm/index.js +3 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +4 -4
- package/dist/provider/ParaProvider.d.ts +1 -2
- package/dist/provider/ParaProvider.js +13 -106
- package/dist/public/PPMori-Regular.woff2 +0 -0
- package/dist/public/PPMori-SemiBold.woff2 +0 -0
- package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
- package/dist/solana/actions/getSolanaSigner.js +15 -0
- package/dist/solana/actions/index.d.ts +1 -0
- package/dist/solana/actions/index.js +2 -0
- package/dist/solana/hooks/index.d.ts +1 -0
- package/dist/solana/hooks/index.js +2 -0
- package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
- package/dist/solana/hooks/useSolanaSigner.js +32 -0
- package/dist/solana/index.d.ts +2 -0
- package/dist/solana/index.js +3 -0
- package/package.json +19 -29
- package/styles.css/package.json +1 -1
- package/dist/cli/cli.mjs +0 -50
- package/dist/modal/ParaModal.d.ts +0 -2
- package/dist/modal/ParaModal.js +0 -301
- package/dist/modal/components/Account/Account.d.ts +0 -5
- package/dist/modal/components/Account/Account.js +0 -148
- package/dist/modal/components/Account/AccountProfile.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfile.js +0 -168
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLink.js +0 -206
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +0 -111
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.js +0 -47
- package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFunds.js +0 -69
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
- package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
- package/dist/modal/components/AddFunds/common.d.ts +0 -19
- package/dist/modal/components/AddFunds/common.js +0 -24
- package/dist/modal/components/AddFunds/index.d.ts +0 -3
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -20
- package/dist/modal/components/AuthInput/AuthInput.js +0 -277
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -164
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -85
- 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/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -62
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -48
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.d.ts +0 -11
- package/dist/modal/components/Body/Body.js +0 -350
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
- package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.d.ts +0 -5
- package/dist/modal/components/Controls/Controls.js +0 -78
- package/dist/modal/components/Controls/Selects.d.ts +0 -2
- package/dist/modal/components/Controls/Selects.js +0 -173
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +0 -75
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -8
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -175
- package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -39
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -184
- package/dist/modal/components/Footer/Footer.d.ts +0 -1
- package/dist/modal/components/Footer/Footer.js +0 -95
- package/dist/modal/components/Header/Header.d.ts +0 -1
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -61
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -116
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -44
- package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
- package/dist/modal/components/ModalContent/ModalContent.js +0 -88
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -3
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -31
- package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
- package/dist/modal/components/OAuth/OAuth.js +0 -79
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -74
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -12
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -160
- package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
- package/dist/modal/components/WalletCard/WalletCard.js +0 -128
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -83
- package/dist/modal/components/common.d.ts +0 -59
- package/dist/modal/components/common.js +0 -261
- package/dist/modal/components/index.d.ts +0 -1
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.d.ts +0 -40
- package/dist/modal/constants/constants.js +0 -142
- package/dist/modal/constants/defaults.d.ts +0 -5
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.d.ts +0 -17
- package/dist/modal/constants/oAuthLogos.js +0 -158
- package/dist/modal/constants/walletTypeConfig.d.ts +0 -6
- package/dist/modal/constants/walletTypeConfig.js +0 -13
- package/dist/modal/hooks/useGoBack.d.ts +0 -1
- package/dist/modal/hooks/useGoBack.js +0 -43
- package/dist/modal/hooks/useTelegramLogin.d.ts +0 -12
- package/dist/modal/hooks/useTelegramLogin.js +0 -65
- package/dist/modal/index.d.ts +0 -8
- package/dist/modal/index.js +0 -29
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -2
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -135
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -103
- package/dist/modal/stores/modal/useModalStore.js +0 -73
- package/dist/modal/types/commonTypes.d.ts +0 -6
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/modalProps.d.ts +0 -129
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authInputHelpers.d.ts +0 -5
- package/dist/modal/utils/authInputHelpers.js +0 -41
- package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/countryCodes.d.ts +0 -8
- package/dist/modal/utils/countryCodes.js +0 -45
- package/dist/modal/utils/getMailtoLink.d.ts +0 -1
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/getWalletDisplayName.d.ts +0 -5
- package/dist/modal/utils/getWalletDisplayName.js +0 -22
- package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
- package/dist/modal/utils/isPasskeySupported.js +0 -15
- package/dist/modal/utils/openPopup.d.ts +0 -6
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.d.ts +0 -133
- package/dist/modal/utils/steps.js +0 -273
- package/dist/modal/utils/stringFormatters.d.ts +0 -5
- package/dist/modal/utils/stringFormatters.js +0 -19
- package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/provider/actions/getEmbeddedAccount.d.ts +0 -26
- package/dist/provider/actions/getEmbeddedAccount.js +0 -52
- package/dist/provider/actions/getWallet.d.ts +0 -5
- package/dist/provider/actions/getWallet.js +0 -18
- package/dist/provider/actions/index.d.ts +0 -47
- package/dist/provider/actions/index.js +0 -79
- package/dist/provider/actions/utils.d.ts +0 -4
- package/dist/provider/actions/utils.js +0 -34
- package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
- package/dist/provider/components/CosmosWalletWrapper.js +0 -43
- package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
- package/dist/provider/components/EvmWalletWrapper.js +0 -43
- package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
- package/dist/provider/components/ExternalWalletWrapper.js +0 -140
- package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
- package/dist/provider/components/SolanaWalletWrapper.js +0 -44
- package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
- package/dist/provider/external/getParaCosmosConnector.js +0 -19
- package/dist/provider/external/getParaCosmosLib.d.ts +0 -4
- package/dist/provider/external/getParaCosmosLib.js +0 -16
- package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
- package/dist/provider/external/getParaEvmConnector.js +0 -19
- package/dist/provider/external/getParaEvmLib.d.ts +0 -4
- package/dist/provider/external/getParaEvmLib.js +0 -16
- package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
- package/dist/provider/external/getParaSolanaConnector.js +0 -19
- package/dist/provider/external/getParaSolanaLib.d.ts +0 -4
- package/dist/provider/external/getParaSolanaLib.js +0 -16
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -8
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -8
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -2
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -8
- package/dist/provider/hooks/index.d.ts +0 -3
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/core.d.ts +0 -27
- package/dist/provider/hooks/mutations/core.js +0 -66
- package/dist/provider/hooks/mutations/index.d.ts +0 -3
- package/dist/provider/hooks/mutations/index.js +0 -9
- package/dist/provider/hooks/mutations/useLinkAccount.d.ts +0 -9
- package/dist/provider/hooks/mutations/useLinkAccount.js +0 -18
- package/dist/provider/hooks/mutations/utils.d.ts +0 -12
- package/dist/provider/hooks/mutations/utils.js +0 -90
- package/dist/provider/hooks/queries/core.d.ts +0 -4
- package/dist/provider/hooks/queries/core.js +0 -16
- package/dist/provider/hooks/queries/index.d.ts +0 -4
- package/dist/provider/hooks/queries/index.js +0 -11
- package/dist/provider/hooks/queries/useAccount.d.ts +0 -90
- package/dist/provider/hooks/queries/useAccount.js +0 -135
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +0 -5
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +0 -24
- package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
- package/dist/provider/hooks/queries/useWallet.js +0 -26
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
- package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
- package/dist/provider/hooks/queries/utils.d.ts +0 -7
- package/dist/provider/hooks/queries/utils.js +0 -25
- package/dist/provider/hooks/utils/index.d.ts +0 -3
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
- package/dist/provider/hooks/utils/useEventListeners.js +0 -157
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +0 -4
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +0 -27
- package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.d.ts +0 -11
- package/dist/provider/hooks/utils/useModal.js +0 -27
- package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
- package/dist/provider/hooks/utils/useWalletState.js +0 -48
- package/dist/provider/index.d.ts +0 -6
- package/dist/provider/index.js +0 -11
- package/dist/provider/providers/AccountLinkProvider.d.ts +0 -47
- package/dist/provider/providers/AccountLinkProvider.js +0 -452
- package/dist/provider/providers/AuthProvider.d.ts +0 -37
- package/dist/provider/providers/AuthProvider.js +0 -523
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
- package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -59
- package/dist/provider/providers/ExternalWalletProvider.js +0 -596
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
- package/dist/provider/stores/getters.d.ts +0 -4
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/setters.d.ts +0 -1
- package/dist/provider/stores/setters.js +0 -7
- package/dist/provider/stores/slices/analytics.d.ts +0 -3
- package/dist/provider/stores/slices/analytics.js +0 -9
- package/dist/provider/stores/slices/client.d.ts +0 -3
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/config.d.ts +0 -3
- package/dist/provider/stores/slices/config.js +0 -9
- package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
- package/dist/provider/stores/slices/externalWallets.js +0 -46
- package/dist/provider/stores/slices/index.d.ts +0 -5
- package/dist/provider/stores/slices/index.js +0 -6
- package/dist/provider/stores/slices/modal.d.ts +0 -3
- package/dist/provider/stores/slices/modal.js +0 -18
- package/dist/provider/stores/slices/wallet.d.ts +0 -3
- package/dist/provider/stores/slices/wallet.js +0 -13
- package/dist/provider/stores/types.d.ts +0 -76
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.d.ts +0 -17
- package/dist/provider/stores/useStore.js +0 -34
- package/dist/provider/types/externalWalletProviders.d.ts +0 -12
- package/dist/provider/types/externalWalletProviders.js +0 -1
- package/dist/provider/types/provider.d.ts +0 -161
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.d.ts +0 -3
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.d.ts +0 -45
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/constants.d.ts +0 -5
- package/dist/provider/utils/constants.js +0 -10
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
- package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
- package/dist/provider/utils/renameMutations.d.ts +0 -5
- package/dist/provider/utils/renameMutations.js +0 -18
|
@@ -1,523 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async,
|
|
4
|
-
__spreadProps,
|
|
5
|
-
__spreadValues
|
|
6
|
-
} from "../../chunk-MMUBH76A.js";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import { useUserAgent } from "@getpara/react-common";
|
|
9
|
-
import { createContext, useCallback, useContext, useEffect, useMemo } from "react";
|
|
10
|
-
import { useModalStore } from "../../modal/stores/index.js";
|
|
11
|
-
import { ModalStep } from "../../modal/utils/steps.js";
|
|
12
|
-
import {
|
|
13
|
-
useSignUpOrLogIn,
|
|
14
|
-
useVerifyNewAccount,
|
|
15
|
-
useWaitForSignup,
|
|
16
|
-
useWaitForLogin,
|
|
17
|
-
useWaitForWalletCreation,
|
|
18
|
-
useVerifyOAuth,
|
|
19
|
-
useVerifyFarcaster,
|
|
20
|
-
useVerifyTelegram,
|
|
21
|
-
useSetup2fa,
|
|
22
|
-
useLogout,
|
|
23
|
-
useCreateGuestWallets
|
|
24
|
-
} from "../index.js";
|
|
25
|
-
import { DEFAULTS } from "../../modal/constants/defaults.js";
|
|
26
|
-
import { openPopup } from "../../modal/utils/openPopup.js";
|
|
27
|
-
import {
|
|
28
|
-
AuthMethod,
|
|
29
|
-
entityToWallet
|
|
30
|
-
} from "@getpara/web-sdk";
|
|
31
|
-
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
32
|
-
import { useGoBack } from "../../modal/hooks/useGoBack.js";
|
|
33
|
-
import { isExternalWallet } from "@getpara/user-management-client";
|
|
34
|
-
import { routeMobileExternalWallet } from "../../modal/utils/routeMobileExternalWallet.js";
|
|
35
|
-
import { useStore } from "../stores/useStore.js";
|
|
36
|
-
import { useFormattedBiometricHints } from "../hooks/utils/useFormattedBiometricHints.js";
|
|
37
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
38
|
-
const AuthContext = createContext({
|
|
39
|
-
signUpOrLogIn: () => {
|
|
40
|
-
},
|
|
41
|
-
isSignUpOrLogInPending: false,
|
|
42
|
-
verifyNewAccount: () => {
|
|
43
|
-
},
|
|
44
|
-
verifyNewAccountStatus: "idle",
|
|
45
|
-
verifyNewAccountError: null,
|
|
46
|
-
verifyOAuth: () => {
|
|
47
|
-
},
|
|
48
|
-
verifyFarcaster: () => {
|
|
49
|
-
},
|
|
50
|
-
verifyTelegram: () => {
|
|
51
|
-
},
|
|
52
|
-
verifyTelegramStatus: "idle",
|
|
53
|
-
onNewAuthState: () => {
|
|
54
|
-
},
|
|
55
|
-
isSetup2faPending: false,
|
|
56
|
-
presentSignupUi: () => {
|
|
57
|
-
},
|
|
58
|
-
presentLoginUi: () => {
|
|
59
|
-
},
|
|
60
|
-
createGuestWallets: () => {
|
|
61
|
-
},
|
|
62
|
-
isCreateGuestWalletsPending: false,
|
|
63
|
-
logout: () => {
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
function AuthProvider({
|
|
67
|
-
children,
|
|
68
|
-
is2faEnabled = false,
|
|
69
|
-
isRecoverySecretStepEnabled = false,
|
|
70
|
-
overrides = {}
|
|
71
|
-
}) {
|
|
72
|
-
const queryClient = useQueryClient();
|
|
73
|
-
const para = useInternalClient();
|
|
74
|
-
const userAgent = useUserAgent();
|
|
75
|
-
const onLoginRef = useStore((state) => state.onLoginRef);
|
|
76
|
-
const setIsOpen = useStore((state) => state.setIsOpen);
|
|
77
|
-
const bareModal = useStore((state) => {
|
|
78
|
-
var _a;
|
|
79
|
-
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
80
|
-
});
|
|
81
|
-
const refs = useModalStore((state) => state.refs);
|
|
82
|
-
const setFlow = useModalStore((state) => state.setFlow);
|
|
83
|
-
const currentStep = useModalStore((state) => state.step);
|
|
84
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
85
|
-
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
86
|
-
const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
|
|
87
|
-
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
88
|
-
const loginState = useModalStore((state) => state.getLoginState());
|
|
89
|
-
const signupState = useModalStore((state) => state.getSignupState());
|
|
90
|
-
const setAuthState = useModalStore((state) => state.setAuthState);
|
|
91
|
-
const setFarcasterConnectUri = useModalStore((state) => state.setFarcasterConnectUri);
|
|
92
|
-
const setTwoFactorStatus = useModalStore((state) => state.setTwoFactorStatus);
|
|
93
|
-
const setRecoveryShare = useModalStore((state) => state.setRecoveryShare);
|
|
94
|
-
const authStepRoute = useModalStore((state) => state.authStepRoute);
|
|
95
|
-
const isIFrameReady = useModalStore((state) => state.isIFrameReady);
|
|
96
|
-
const goBack = useGoBack();
|
|
97
|
-
const { mutate: mutateSignUpOrLogIn, isPending: isSignUpOrLogInPending } = useSignUpOrLogIn();
|
|
98
|
-
const {
|
|
99
|
-
mutate: mutateVerifyNewAccount,
|
|
100
|
-
status: verifyNewAccountStatus,
|
|
101
|
-
error: verifyNewAccountError
|
|
102
|
-
} = useVerifyNewAccount();
|
|
103
|
-
const { mutate: mutateVerifyOAuth } = useVerifyOAuth();
|
|
104
|
-
const { mutate: mutateVerifyFarcaster } = useVerifyFarcaster();
|
|
105
|
-
const { mutate: mutateVerifyTelegram, status: verifyTelegramStatus } = useVerifyTelegram();
|
|
106
|
-
const { mutate: mutateWaitForLogin } = useWaitForLogin();
|
|
107
|
-
const { mutate: mutateWaitForSignup } = useWaitForSignup();
|
|
108
|
-
const { mutateAsync: mutateAsyncWaitForWalletCreation } = useWaitForWalletCreation();
|
|
109
|
-
const { mutate: mutateSetup2fa, isPending: isSetup2faPending } = useSetup2fa();
|
|
110
|
-
const { mutate: mutateCreateGuestWallets, isPending: isCreateGuestWalletsPending } = useCreateGuestWallets();
|
|
111
|
-
const { mutate: mutateLogout } = useLogout();
|
|
112
|
-
const { data: biometricHints } = useFormattedBiometricHints();
|
|
113
|
-
const goBackIfPopupClosedOnSteps = (steps) => {
|
|
114
|
-
var _a;
|
|
115
|
-
if (((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) && (!refs.currentStep.current || steps.includes(refs.currentStep.current))) {
|
|
116
|
-
refs.popupWindow.current = null;
|
|
117
|
-
goBack();
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const cancelIfExitedSteps = (steps) => {
|
|
121
|
-
const stepNow = refs.currentStep.current;
|
|
122
|
-
return !!stepNow && !steps.includes(stepNow);
|
|
123
|
-
};
|
|
124
|
-
const signup = () => {
|
|
125
|
-
if (typeof window !== "undefined") {
|
|
126
|
-
refs.poll.current = {
|
|
127
|
-
action: "signup",
|
|
128
|
-
timeout: window == null ? void 0 : window.setTimeout(() => __async(this, null, function* () {
|
|
129
|
-
mutateWaitForSignup(
|
|
130
|
-
{
|
|
131
|
-
isCanceled: () => cancelIfExitedSteps([
|
|
132
|
-
ModalStep.BIOMETRIC_CREATION,
|
|
133
|
-
ModalStep.AWAITING_BIOMETRIC_CREATION,
|
|
134
|
-
ModalStep.PASSWORD_CREATION
|
|
135
|
-
]),
|
|
136
|
-
onPoll: () => {
|
|
137
|
-
goBackIfPopupClosedOnSteps([ModalStep.AWAITING_BIOMETRIC_CREATION]);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
onSuccess: () => {
|
|
142
|
-
if (para.isNoWalletConfig) {
|
|
143
|
-
onLoginComplete({
|
|
144
|
-
on2faSetupOrError: () => setStep(ModalStep.LOGIN_DONE),
|
|
145
|
-
on2faNotSetup: () => setStep(ModalStep.SETUP_2FA)
|
|
146
|
-
});
|
|
147
|
-
} else {
|
|
148
|
-
createWallets();
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
onError: () => {
|
|
152
|
-
if (refs.currentStep.current && [ModalStep.AWAITING_BIOMETRIC_CREATION, ModalStep.PASSWORD_CREATION].includes(refs.currentStep.current)) {
|
|
153
|
-
setStep(ModalStep.BIOMETRIC_CREATION);
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
onSettled: () => {
|
|
157
|
-
var _a;
|
|
158
|
-
window == null ? void 0 : window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
|
|
159
|
-
refs.poll.current = null;
|
|
160
|
-
refs.popupWindow.current = null;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
}), DEFAULTS.POLLING_INTERVAL_MS)
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const presentSignupUi = useCallback(
|
|
169
|
-
(method, authState) => {
|
|
170
|
-
switch (method) {
|
|
171
|
-
case AuthMethod.PASSKEY:
|
|
172
|
-
if (refs.currentStep.current !== ModalStep.AWAITING_BIOMETRIC_CREATION) {
|
|
173
|
-
setStep(ModalStep.AWAITING_BIOMETRIC_CREATION);
|
|
174
|
-
}
|
|
175
|
-
refs.popupWindow.current = openPopup({
|
|
176
|
-
url: authState.passkeyUrl,
|
|
177
|
-
target: "ParaPasskey",
|
|
178
|
-
type: "CREATE_PASSKEY",
|
|
179
|
-
current: refs.popupWindow.current
|
|
180
|
-
});
|
|
181
|
-
break;
|
|
182
|
-
case AuthMethod.PASSWORD:
|
|
183
|
-
if (isIFrameReady) {
|
|
184
|
-
setStep(ModalStep.PASSWORD_CREATION);
|
|
185
|
-
} else {
|
|
186
|
-
setIFrameUrl(authState.passwordUrl);
|
|
187
|
-
setAuthStepRoute(ModalStep.PASSWORD_CREATION);
|
|
188
|
-
}
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
[isIFrameReady]
|
|
193
|
-
);
|
|
194
|
-
const login = (authState) => {
|
|
195
|
-
if (authState.isWalletSelectionNeeded || authState.passkeyUrl) {
|
|
196
|
-
setStep(ModalStep.BIOMETRIC_LOGIN);
|
|
197
|
-
} else {
|
|
198
|
-
setIFrameUrl(authState.passwordUrl);
|
|
199
|
-
setStep(ModalStep.EMBEDDED_PASSWORD_LOGIN);
|
|
200
|
-
}
|
|
201
|
-
refs.poll.current = {
|
|
202
|
-
action: "login",
|
|
203
|
-
timeout: window == null ? void 0 : window.setTimeout(() => __async(this, null, function* () {
|
|
204
|
-
mutateWaitForLogin(
|
|
205
|
-
{
|
|
206
|
-
isCanceled: () => cancelIfExitedSteps([
|
|
207
|
-
ModalStep.BIOMETRIC_LOGIN,
|
|
208
|
-
ModalStep.EMBEDDED_PASSWORD_LOGIN,
|
|
209
|
-
ModalStep.AWAITING_BIOMETRIC_LOGIN,
|
|
210
|
-
ModalStep.AWAITING_PASSWORD_LOGIN
|
|
211
|
-
]),
|
|
212
|
-
onPoll: () => {
|
|
213
|
-
goBackIfPopupClosedOnSteps([
|
|
214
|
-
ModalStep.AWAITING_BIOMETRIC_LOGIN,
|
|
215
|
-
ModalStep.AWAITING_PASSWORD_LOGIN,
|
|
216
|
-
ModalStep.EMBEDDED_PASSWORD_LOGIN
|
|
217
|
-
]);
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
onSuccess: ({ needsWallet }) => {
|
|
222
|
-
if (needsWallet && !para.isNoWalletConfig) {
|
|
223
|
-
createWallets();
|
|
224
|
-
} else {
|
|
225
|
-
onLoginComplete({
|
|
226
|
-
on2faSetupOrError: () => setStep(ModalStep.LOGIN_DONE),
|
|
227
|
-
on2faNotSetup: () => setStep(ModalStep.SETUP_2FA)
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
onSettled: () => {
|
|
232
|
-
var _a;
|
|
233
|
-
window == null ? void 0 : window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
|
|
234
|
-
refs.poll.current = null;
|
|
235
|
-
refs.popupWindow.current = null;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
}), DEFAULTS.LOGGIN_POLLING_DELAY_MS)
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
const presentLoginUi = useCallback(
|
|
243
|
-
(method, authState) => {
|
|
244
|
-
const isPasskey = method === AuthMethod.PASSKEY, isPassword = !isPasskey;
|
|
245
|
-
if (overrides.login) {
|
|
246
|
-
function loginOverride() {
|
|
247
|
-
return __async(this, null, function* () {
|
|
248
|
-
var _a, _b;
|
|
249
|
-
yield (_a = overrides == null ? void 0 : overrides.login) == null ? void 0 : _a.call(overrides, para);
|
|
250
|
-
yield (_b = onLoginRef.current) == null ? void 0 : _b.call(onLoginRef);
|
|
251
|
-
yield onLoginComplete();
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
loginOverride();
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
refs.popupWindow.current = openPopup({
|
|
258
|
-
url: isPassword ? authState.passwordUrl : authState.passkeyUrl,
|
|
259
|
-
target: isPassword ? "ParaPassword" : "ParaPasskey",
|
|
260
|
-
type: isPassword ? "LOGIN_PASSWORD" : "LOGIN_PASSKEY",
|
|
261
|
-
current: refs.popupWindow.current
|
|
262
|
-
});
|
|
263
|
-
setStep(isPassword ? ModalStep.AWAITING_PASSWORD_LOGIN : ModalStep.AWAITING_BIOMETRIC_LOGIN);
|
|
264
|
-
},
|
|
265
|
-
[loginState, biometricHints]
|
|
266
|
-
);
|
|
267
|
-
const onNewAuthState = (authState) => __async(this, null, function* () {
|
|
268
|
-
setAuthState(authState);
|
|
269
|
-
switch (authState.stage) {
|
|
270
|
-
case "verify":
|
|
271
|
-
if (isExternalWallet(authState.auth) && authState.signatureVerificationMessage) {
|
|
272
|
-
setStep(ModalStep.EXTERNAL_WALLET_VERIFICATION);
|
|
273
|
-
} else {
|
|
274
|
-
setStep(ModalStep.VERIFICATIONS);
|
|
275
|
-
}
|
|
276
|
-
break;
|
|
277
|
-
case "login":
|
|
278
|
-
login(authState);
|
|
279
|
-
break;
|
|
280
|
-
case "signup":
|
|
281
|
-
{
|
|
282
|
-
const isPassword = !!authState.passwordUrl, isPasswordOnly = isPassword && (!authState.passkeyUrl || (userAgent == null ? void 0 : userAgent.device.type) === "mobile" && !authState.isPasskeySupported);
|
|
283
|
-
if (isPassword) {
|
|
284
|
-
setIFrameUrl(authState.passwordUrl);
|
|
285
|
-
}
|
|
286
|
-
signup();
|
|
287
|
-
if (isPasswordOnly) {
|
|
288
|
-
presentSignupUi(AuthMethod.PASSWORD, authState);
|
|
289
|
-
} else {
|
|
290
|
-
setStep(ModalStep.BIOMETRIC_CREATION);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
const signUpOrLogIn = (auth) => __async(this, null, function* () {
|
|
297
|
-
mutateSignUpOrLogIn(
|
|
298
|
-
{ auth, useShortUrls: true },
|
|
299
|
-
{
|
|
300
|
-
onSuccess: onNewAuthState
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
});
|
|
304
|
-
const verifyNewAccount = (verificationCode) => __async(this, null, function* () {
|
|
305
|
-
mutateVerifyNewAccount(
|
|
306
|
-
{ verificationCode, useShortUrls: true },
|
|
307
|
-
{
|
|
308
|
-
onSuccess: onNewAuthState
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
});
|
|
312
|
-
const verifyOAuth = (method) => __async(this, null, function* () {
|
|
313
|
-
setStep(ModalStep.AWAITING_OAUTH);
|
|
314
|
-
mutateVerifyOAuth(
|
|
315
|
-
{
|
|
316
|
-
method,
|
|
317
|
-
isCanceled: () => {
|
|
318
|
-
var _a;
|
|
319
|
-
return ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) || cancelIfExitedSteps([ModalStep.AWAITING_OAUTH]);
|
|
320
|
-
},
|
|
321
|
-
onPoll: () => {
|
|
322
|
-
goBackIfPopupClosedOnSteps([ModalStep.AWAITING_OAUTH]);
|
|
323
|
-
},
|
|
324
|
-
onOAuthUrl: (oAuthUrl) => {
|
|
325
|
-
refs.popupWindow.current = openPopup({
|
|
326
|
-
url: oAuthUrl,
|
|
327
|
-
target: `${method}AuthPopup`,
|
|
328
|
-
type: "OAUTH",
|
|
329
|
-
current: refs.popupWindow.current
|
|
330
|
-
});
|
|
331
|
-
},
|
|
332
|
-
useShortUrls: true
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
onSuccess: onNewAuthState,
|
|
336
|
-
onError: () => {
|
|
337
|
-
goBackIfPopupClosedOnSteps([ModalStep.AWAITING_OAUTH]);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
});
|
|
342
|
-
const verifyFarcaster = () => __async(this, null, function* () {
|
|
343
|
-
setStep(ModalStep.FARCASTER_OAUTH);
|
|
344
|
-
mutateVerifyFarcaster(
|
|
345
|
-
{
|
|
346
|
-
isCanceled: () => refs.currentStep.current !== ModalStep.FARCASTER_OAUTH,
|
|
347
|
-
onConnectUri: (connectUri) => {
|
|
348
|
-
setFarcasterConnectUri(connectUri);
|
|
349
|
-
routeMobileExternalWallet(connectUri);
|
|
350
|
-
},
|
|
351
|
-
useShortUrls: true
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
onSuccess: onNewAuthState,
|
|
355
|
-
onError: () => {
|
|
356
|
-
if (refs.currentStep.current === ModalStep.FARCASTER_OAUTH) {
|
|
357
|
-
goBack();
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
);
|
|
362
|
-
});
|
|
363
|
-
const verifyTelegram = (telegramAuthResponse) => __async(this, null, function* () {
|
|
364
|
-
mutateVerifyTelegram(
|
|
365
|
-
{
|
|
366
|
-
telegramAuthResponse,
|
|
367
|
-
useShortUrls: true
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
onSuccess: onNewAuthState
|
|
371
|
-
}
|
|
372
|
-
);
|
|
373
|
-
});
|
|
374
|
-
const onLoginComplete = useCallback(
|
|
375
|
-
(..._0) => __async(this, [..._0], function* ({
|
|
376
|
-
on2faSetupOrError,
|
|
377
|
-
on2faNotSetup
|
|
378
|
-
} = {}) {
|
|
379
|
-
var _a;
|
|
380
|
-
yield queryClient.invalidateQueries({ queryKey: ["isFullyLoggedIn"] });
|
|
381
|
-
setAuthState();
|
|
382
|
-
yield (_a = onLoginRef.current) == null ? void 0 : _a.call(onLoginRef);
|
|
383
|
-
if (is2faEnabled) {
|
|
384
|
-
mutateSetup2fa(void 0, {
|
|
385
|
-
onSuccess: (status) => {
|
|
386
|
-
setTwoFactorStatus(status);
|
|
387
|
-
if (!status.isSetup && !!status.uri) {
|
|
388
|
-
on2faNotSetup == null ? void 0 : on2faNotSetup();
|
|
389
|
-
} else {
|
|
390
|
-
on2faSetupOrError == null ? void 0 : on2faSetupOrError();
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
onError: () => {
|
|
394
|
-
on2faSetupOrError == null ? void 0 : on2faSetupOrError();
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
} else {
|
|
398
|
-
on2faSetupOrError == null ? void 0 : on2faSetupOrError();
|
|
399
|
-
}
|
|
400
|
-
}),
|
|
401
|
-
[is2faEnabled]
|
|
402
|
-
);
|
|
403
|
-
const createWallets = useCallback(() => __async(this, null, function* () {
|
|
404
|
-
var _a;
|
|
405
|
-
if (refs.currentStep.current !== ModalStep.AWAITING_WALLET_CREATION) {
|
|
406
|
-
setStep(ModalStep.AWAITING_WALLET_CREATION);
|
|
407
|
-
}
|
|
408
|
-
let recoverySecret, walletIds;
|
|
409
|
-
try {
|
|
410
|
-
if (overrides.createWallets) {
|
|
411
|
-
({ recoverySecret, walletIds } = yield (_a = overrides == null ? void 0 : overrides.createWallets) == null ? void 0 : _a.call(overrides, para));
|
|
412
|
-
const fetchedWallets = (yield para.fetchWallets()).filter((wallet) => !!wallet.address);
|
|
413
|
-
const newWallets = {};
|
|
414
|
-
for (const wallet of fetchedWallets) {
|
|
415
|
-
newWallets[wallet.id] = __spreadProps(__spreadValues({}, entityToWallet(wallet)), {
|
|
416
|
-
signer: ""
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
para.setWallets(newWallets);
|
|
420
|
-
} else {
|
|
421
|
-
({ recoverySecret, walletIds } = yield mutateAsyncWaitForWalletCreation({
|
|
422
|
-
isCanceled: () => false
|
|
423
|
-
}));
|
|
424
|
-
}
|
|
425
|
-
if (walletIds) {
|
|
426
|
-
yield para.setCurrentWalletIds(walletIds);
|
|
427
|
-
}
|
|
428
|
-
if (recoverySecret && isRecoverySecretStepEnabled) {
|
|
429
|
-
setRecoveryShare(recoverySecret);
|
|
430
|
-
}
|
|
431
|
-
setStep(recoverySecret && isRecoverySecretStepEnabled ? ModalStep.SECRET : ModalStep.WALLET_CREATION_DONE);
|
|
432
|
-
onLoginComplete();
|
|
433
|
-
} catch (e) {
|
|
434
|
-
}
|
|
435
|
-
}), [para, isRecoverySecretStepEnabled, overrides == null ? void 0 : overrides.createWallets]);
|
|
436
|
-
const createGuestWallets = () => {
|
|
437
|
-
if (bareModal) {
|
|
438
|
-
setFlow("guest");
|
|
439
|
-
setStep(ModalStep.AWAITING_GUEST_WALLET_CREATION);
|
|
440
|
-
} else {
|
|
441
|
-
setIsOpen(false);
|
|
442
|
-
}
|
|
443
|
-
mutateCreateGuestWallets(void 0, {
|
|
444
|
-
onSuccess: () => {
|
|
445
|
-
},
|
|
446
|
-
onSettled: () => {
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
};
|
|
450
|
-
const logout = () => {
|
|
451
|
-
mutateLogout();
|
|
452
|
-
};
|
|
453
|
-
const isPasswordIFrameLoading = !!iFrameUrl && iFrameUrl === (signupState == null ? void 0 : signupState.passwordUrl) && !isIFrameReady;
|
|
454
|
-
const value = useMemo(
|
|
455
|
-
() => ({
|
|
456
|
-
presentSignupUi,
|
|
457
|
-
presentLoginUi,
|
|
458
|
-
signUpOrLogIn,
|
|
459
|
-
isSignUpOrLogInPending,
|
|
460
|
-
verifyNewAccount,
|
|
461
|
-
verifyNewAccountStatus: isPasswordIFrameLoading ? "pending" : verifyNewAccountStatus,
|
|
462
|
-
verifyNewAccountError,
|
|
463
|
-
verifyOAuth,
|
|
464
|
-
verifyFarcaster,
|
|
465
|
-
verifyTelegram,
|
|
466
|
-
verifyTelegramStatus,
|
|
467
|
-
onNewAuthState,
|
|
468
|
-
isSetup2faPending,
|
|
469
|
-
createGuestWallets,
|
|
470
|
-
isCreateGuestWalletsPending,
|
|
471
|
-
logout,
|
|
472
|
-
biometricHints: biometricHints || void 0
|
|
473
|
-
}),
|
|
474
|
-
[
|
|
475
|
-
presentSignupUi,
|
|
476
|
-
presentLoginUi,
|
|
477
|
-
signUpOrLogIn,
|
|
478
|
-
isSignUpOrLogInPending,
|
|
479
|
-
verifyNewAccount,
|
|
480
|
-
verifyNewAccountStatus,
|
|
481
|
-
isPasswordIFrameLoading,
|
|
482
|
-
verifyNewAccountError,
|
|
483
|
-
verifyOAuth,
|
|
484
|
-
verifyFarcaster,
|
|
485
|
-
verifyTelegram,
|
|
486
|
-
verifyTelegramStatus,
|
|
487
|
-
onNewAuthState,
|
|
488
|
-
isSetup2faPending,
|
|
489
|
-
createGuestWallets,
|
|
490
|
-
isCreateGuestWalletsPending,
|
|
491
|
-
logout,
|
|
492
|
-
biometricHints
|
|
493
|
-
]
|
|
494
|
-
);
|
|
495
|
-
useEffect(() => {
|
|
496
|
-
if (!!authStepRoute && isIFrameReady && refs.currentStep.current !== authStepRoute) {
|
|
497
|
-
setTimeout(() => {
|
|
498
|
-
setStep(authStepRoute);
|
|
499
|
-
}, 200);
|
|
500
|
-
}
|
|
501
|
-
}, [authStepRoute, isIFrameReady]);
|
|
502
|
-
useEffect(() => {
|
|
503
|
-
refs.currentStep.current = currentStep;
|
|
504
|
-
}, [currentStep]);
|
|
505
|
-
useEffect(() => {
|
|
506
|
-
if (refs.currentStep.current === ModalStep.AWAITING_GUEST_WALLET_CREATION && !isCreateGuestWalletsPending) {
|
|
507
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
508
|
-
}
|
|
509
|
-
}, [isCreateGuestWalletsPending]);
|
|
510
|
-
useEffect(() => {
|
|
511
|
-
return () => {
|
|
512
|
-
var _a;
|
|
513
|
-
window == null ? void 0 : window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
|
|
514
|
-
};
|
|
515
|
-
}, []);
|
|
516
|
-
return /* @__PURE__ */ jsx(AuthContext.Provider, { value, children });
|
|
517
|
-
}
|
|
518
|
-
const useAuthActions = () => useContext(AuthContext);
|
|
519
|
-
export {
|
|
520
|
-
AuthContext,
|
|
521
|
-
AuthProvider,
|
|
522
|
-
useAuthActions
|
|
523
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { ExternalWalletProviderCommon, ParaCosmosProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
3
|
-
import { ParaCosmosProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
4
|
-
export declare function CosmosExternalWalletProvider({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaCosmosProviderProps, 'config'> & {
|
|
5
|
-
config: ParaCosmosProviderConfigNoWallets;
|
|
6
|
-
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
-
export declare const MemoizedCosmosExternalWalletProvider: import("react").MemoExoticComponent<typeof CosmosExternalWalletProvider>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async,
|
|
4
|
-
__objRest,
|
|
5
|
-
__spreadProps,
|
|
6
|
-
__spreadValues
|
|
7
|
-
} from "../../chunk-MMUBH76A.js";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import { memo, useEffect, useMemo } from "react";
|
|
10
|
-
import { useStore } from "../stores/useStore.js";
|
|
11
|
-
import { getParaCosmosConnector } from "../external/getParaCosmosConnector.js";
|
|
12
|
-
function CosmosExternalWalletProvider(_a) {
|
|
13
|
-
var _b = _a, {
|
|
14
|
-
children,
|
|
15
|
-
isUsing,
|
|
16
|
-
wallets: walletsFromProps
|
|
17
|
-
} = _b, rest = __objRest(_b, [
|
|
18
|
-
"children",
|
|
19
|
-
"isUsing",
|
|
20
|
-
"wallets"
|
|
21
|
-
]);
|
|
22
|
-
const setCosmosContext = useStore((state) => state.setCosmosContext);
|
|
23
|
-
const setCosmosProvider = useStore((state) => state.setCosmosProvider);
|
|
24
|
-
const CosmosProvider = useStore((state) => state.CosmosProvider);
|
|
25
|
-
const setCosmosWallets = useStore((state) => state.setCosmosWallets);
|
|
26
|
-
const cosmosWallets = useStore((state) => state.cosmosWallets);
|
|
27
|
-
const isLoadingLib = useStore((state) => state.isLoadingCosmosLib);
|
|
28
|
-
const setIsLoadingLib = useStore((state) => state.setIsLoadingCosmosLib);
|
|
29
|
-
const filteredWallets = useMemo(
|
|
30
|
-
() => cosmosWallets.filter((w) => walletsFromProps.includes(w().id.toUpperCase())),
|
|
31
|
-
[cosmosWallets, walletsFromProps]
|
|
32
|
-
);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
const loadLib = () => __async(this, null, function* () {
|
|
35
|
-
if (CosmosProvider) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const { Provider, context, wallets } = yield getParaCosmosConnector();
|
|
39
|
-
if (Provider) {
|
|
40
|
-
setCosmosProvider(Provider);
|
|
41
|
-
}
|
|
42
|
-
if (wallets) {
|
|
43
|
-
setCosmosWallets(wallets);
|
|
44
|
-
}
|
|
45
|
-
if (context) {
|
|
46
|
-
setCosmosContext(context);
|
|
47
|
-
}
|
|
48
|
-
setIsLoadingLib(false);
|
|
49
|
-
});
|
|
50
|
-
loadLib();
|
|
51
|
-
}, []);
|
|
52
|
-
if (isLoadingLib) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
if (CosmosProvider) {
|
|
56
|
-
return /* @__PURE__ */ jsx(CosmosProvider, __spreadProps(__spreadValues({}, rest), { config: __spreadProps(__spreadValues({}, rest == null ? void 0 : rest.config), { wallets: filteredWallets }), children }));
|
|
57
|
-
} else if (isUsing) {
|
|
58
|
-
console.warn("@getpara/cosmos-wallet-connectors is required to use an external Cosmos wallet.");
|
|
59
|
-
}
|
|
60
|
-
return children;
|
|
61
|
-
}
|
|
62
|
-
const MemoizedCosmosExternalWalletProvider = memo(CosmosExternalWalletProvider);
|
|
63
|
-
export {
|
|
64
|
-
CosmosExternalWalletProvider,
|
|
65
|
-
MemoizedCosmosExternalWalletProvider
|
|
66
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { ParaEvmProviderProps } from '@getpara/evm-wallet-connectors';
|
|
3
|
-
import { Chain, Transport } from 'viem';
|
|
4
|
-
import { ExternalWalletProviderCommon, ParaEvmProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
5
|
-
export declare function EvmExternalWalletProvider<const chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>>({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaEvmProviderProps<chains, transports>, 'config'> & {
|
|
6
|
-
config: ParaEvmProviderConfigNoWallets<chains, transports>;
|
|
7
|
-
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async,
|
|
4
|
-
__objRest,
|
|
5
|
-
__spreadProps,
|
|
6
|
-
__spreadValues
|
|
7
|
-
} from "../../chunk-MMUBH76A.js";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import { useEffect, useMemo } from "react";
|
|
10
|
-
import { getParaEvmConnector } from "../external/getParaEvmConnector.js";
|
|
11
|
-
import { useStore } from "../stores/useStore.js";
|
|
12
|
-
function EvmExternalWalletProvider(_a) {
|
|
13
|
-
var _b = _a, {
|
|
14
|
-
children,
|
|
15
|
-
isUsing,
|
|
16
|
-
wallets: walletsFromProps
|
|
17
|
-
} = _b, rest = __objRest(_b, [
|
|
18
|
-
"children",
|
|
19
|
-
"isUsing",
|
|
20
|
-
"wallets"
|
|
21
|
-
]);
|
|
22
|
-
const setEvmContext = useStore((state) => state.setEvmContext);
|
|
23
|
-
const setEvmProvider = useStore((state) => state.setEvmProvider);
|
|
24
|
-
const EvmProvider = useStore((state) => state.EvmProvider);
|
|
25
|
-
const setEvmWallets = useStore((state) => state.setEvmWallets);
|
|
26
|
-
const evmWallets = useStore((state) => state.evmWallets);
|
|
27
|
-
const isLoadingLib = useStore((state) => state.isLoadingEvmLib);
|
|
28
|
-
const setIsLoadingLib = useStore((state) => state.setIsLoadingEvmLib);
|
|
29
|
-
const filteredWallets = useMemo(
|
|
30
|
-
() => evmWallets.filter(
|
|
31
|
-
(w) => {
|
|
32
|
-
var _a2, _b2, _c, _d;
|
|
33
|
-
return walletsFromProps.includes(
|
|
34
|
-
w({
|
|
35
|
-
appName: (_b2 = (_a2 = rest == null ? void 0 : rest.config) == null ? void 0 : _a2.appName) != null ? _b2 : "",
|
|
36
|
-
projectId: (_d = (_c = rest == null ? void 0 : rest.config) == null ? void 0 : _c.projectId) != null ? _d : ""
|
|
37
|
-
}).id.toUpperCase()
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
[evmWallets, walletsFromProps]
|
|
42
|
-
);
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
const loadLib = () => __async(this, null, function* () {
|
|
45
|
-
if (EvmProvider) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const { Provider, context, wallets } = yield getParaEvmConnector();
|
|
49
|
-
if (Provider) {
|
|
50
|
-
setEvmProvider(Provider);
|
|
51
|
-
}
|
|
52
|
-
if (wallets) {
|
|
53
|
-
setEvmWallets(wallets);
|
|
54
|
-
}
|
|
55
|
-
if (context) {
|
|
56
|
-
setEvmContext(context);
|
|
57
|
-
}
|
|
58
|
-
setIsLoadingLib(false);
|
|
59
|
-
});
|
|
60
|
-
loadLib();
|
|
61
|
-
}, []);
|
|
62
|
-
if (isLoadingLib) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
if (EvmProvider) {
|
|
66
|
-
return /* @__PURE__ */ jsx(EvmProvider, __spreadProps(__spreadValues({}, rest), { config: __spreadProps(__spreadValues({}, rest == null ? void 0 : rest.config), { wallets: filteredWallets }), children }));
|
|
67
|
-
} else if (isUsing) {
|
|
68
|
-
console.warn("@getpara/evm-wallet-connectors is required to use an external EVM wallet.");
|
|
69
|
-
}
|
|
70
|
-
return children;
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
EvmExternalWalletProvider
|
|
74
|
-
};
|