@getpara/react-sdk 2.0.0-dev.3 → 2.0.0-dev.4
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/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/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
package/dist/modal/ParaModal.js
DELETED
|
@@ -1,301 +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 { CpslAuthModal, defineCustomElements, generateTheme } from "@getpara/react-components";
|
|
10
|
-
import { ModalContent } from "./components/index.js";
|
|
11
|
-
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
12
|
-
import { useModalStore } from "./stores/index.js";
|
|
13
|
-
import { ModalStep, RESET_TO_ACCOUNT_STEPS, RESET_TO_AUTH_STEPS } from "./utils/steps.js";
|
|
14
|
-
import { AuthLayout } from "./types/modalProps.js";
|
|
15
|
-
import { DEFAULTS } from "./constants/defaults.js";
|
|
16
|
-
import { useGoBack } from "./hooks/useGoBack.js";
|
|
17
|
-
import { safeStyled } from "@getpara/react-common";
|
|
18
|
-
import { hasEmbeddedAuth, hasExternalWallet } from "./utils/authLayoutHelpers.js";
|
|
19
|
-
import { useAccount, useModal, useWalletState } from "../provider/index.js";
|
|
20
|
-
import { useInternalClient } from "../provider/hooks/utils/useInternalClient.js";
|
|
21
|
-
import { useExternalWallets } from "../provider/providers/ExternalWalletProvider.js";
|
|
22
|
-
import { useStore } from "../provider/stores/useStore.js";
|
|
23
|
-
import parsePhoneNumberFromString from "libphonenumber-js";
|
|
24
|
-
import { useAuthActions } from "../provider/providers/AuthProvider.js";
|
|
25
|
-
import { validateInput } from "./utils/authInputHelpers.js";
|
|
26
|
-
import { SDK_VERSION } from "./constants/constants.js";
|
|
27
|
-
defineCustomElements();
|
|
28
|
-
const ParaModal = forwardRef((props, ref) => {
|
|
29
|
-
const storedModalConfig = useStore((state) => state.modalConfig);
|
|
30
|
-
const openedToStep = useStore((state) => state.openedToStep);
|
|
31
|
-
const modalContentRef = useRef(null);
|
|
32
|
-
const refs = useModalStore((state) => state.refs);
|
|
33
|
-
const flow = useModalStore((state) => state.flow);
|
|
34
|
-
const currentStep = useModalStore((state) => state.step);
|
|
35
|
-
const setAuthState = useModalStore((state) => state.setAuthState);
|
|
36
|
-
const setOnModalStepChange = useModalStore((state) => state.setOnModalStepChange);
|
|
37
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
38
|
-
const hasPreviousStep = useModalStore((state) => state.hasPreviousStep());
|
|
39
|
-
const setFlow = useModalStore((state) => state.setFlow);
|
|
40
|
-
const goBack = useGoBack();
|
|
41
|
-
const setAuthLayout = useModalStore((state) => state.setAuthLayout);
|
|
42
|
-
const storedAuthLayout = useModalStore((state) => state.authLayout);
|
|
43
|
-
const resetModalState = useModalStore((state) => state.resetState);
|
|
44
|
-
const setRecoveryShare = useModalStore((state) => state.setRecoveryShare);
|
|
45
|
-
const { disconnectExternalWallet } = useExternalWallets();
|
|
46
|
-
const { isOpen: storedIsOpen, closeModal } = useModal();
|
|
47
|
-
const para = useInternalClient();
|
|
48
|
-
const { setSelectedWallet, updateSelectedWallet } = useWalletState();
|
|
49
|
-
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
50
|
-
const { signUpOrLogIn, isCreateGuestWalletsPending } = useAuthActions();
|
|
51
|
-
const { isLoading: isAccountLoading, isConnected } = useAccount();
|
|
52
|
-
const [isModalMounted, setIsModalMounted] = useState(false);
|
|
53
|
-
const externalWallets = useStore((state) => state.externalWallets);
|
|
54
|
-
const providerProps = useStore((state) => state.providerProps);
|
|
55
|
-
const setAccountLinkOptions = useModalStore((state) => state.setAccountLinkOptions);
|
|
56
|
-
const isInitialized = useRef(false);
|
|
57
|
-
const _a = __spreadValues(__spreadValues({}, storedModalConfig), props), {
|
|
58
|
-
isOpen: configIsOpen,
|
|
59
|
-
theme,
|
|
60
|
-
disableEmailLogin = false,
|
|
61
|
-
disablePhoneLogin = false,
|
|
62
|
-
isGuestModeEnabled = false,
|
|
63
|
-
oAuthMethods = ["GOOGLE", "TWITTER"],
|
|
64
|
-
bareModal = false,
|
|
65
|
-
className,
|
|
66
|
-
currentStepOverride,
|
|
67
|
-
authLayout = [AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL],
|
|
68
|
-
embeddedModal,
|
|
69
|
-
onModalStepChange,
|
|
70
|
-
onClose,
|
|
71
|
-
defaultAuthIdentifier,
|
|
72
|
-
supportedAccountLinks: propsSupportedAccountLinks
|
|
73
|
-
} = _a, rest = __objRest(_a, [
|
|
74
|
-
"isOpen",
|
|
75
|
-
"theme",
|
|
76
|
-
"disableEmailLogin",
|
|
77
|
-
"disablePhoneLogin",
|
|
78
|
-
"isGuestModeEnabled",
|
|
79
|
-
"oAuthMethods",
|
|
80
|
-
"bareModal",
|
|
81
|
-
"className",
|
|
82
|
-
"currentStepOverride",
|
|
83
|
-
"authLayout",
|
|
84
|
-
"embeddedModal",
|
|
85
|
-
"onModalStepChange",
|
|
86
|
-
"onClose",
|
|
87
|
-
"defaultAuthIdentifier",
|
|
88
|
-
"supportedAccountLinks"
|
|
89
|
-
]);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
const trackAnalytics = () => __async(void 0, null, function* () {
|
|
92
|
-
try {
|
|
93
|
-
yield para.ctx.client.trackReactSdkAnalytics({
|
|
94
|
-
props: __spreadValues(__spreadProps(__spreadValues({}, providerProps), {
|
|
95
|
-
theme,
|
|
96
|
-
disableEmailLogin,
|
|
97
|
-
disablePhoneLogin,
|
|
98
|
-
isGuestModeEnabled,
|
|
99
|
-
oAuthMethods,
|
|
100
|
-
bareModal,
|
|
101
|
-
className,
|
|
102
|
-
currentStepOverride,
|
|
103
|
-
authLayout,
|
|
104
|
-
embeddedModal,
|
|
105
|
-
onModalStepChange,
|
|
106
|
-
onClose,
|
|
107
|
-
defaultAuthIdentifier
|
|
108
|
-
}), rest),
|
|
109
|
-
reactSdkVersion: SDK_VERSION
|
|
110
|
-
});
|
|
111
|
-
} catch (_) {
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
trackAnalytics();
|
|
115
|
-
}, []);
|
|
116
|
-
const isOpen = configIsOpen != null ? configIsOpen : storedIsOpen;
|
|
117
|
-
useImperativeHandle(ref, () => {
|
|
118
|
-
return {
|
|
119
|
-
goBack() {
|
|
120
|
-
goBack();
|
|
121
|
-
},
|
|
122
|
-
canGoBack() {
|
|
123
|
-
return hasPreviousStep;
|
|
124
|
-
},
|
|
125
|
-
currentStep() {
|
|
126
|
-
return currentStep;
|
|
127
|
-
},
|
|
128
|
-
handleModalClose() {
|
|
129
|
-
var _a2;
|
|
130
|
-
(_a2 = modalContentRef == null ? void 0 : modalContentRef.current) == null ? void 0 : _a2.handleModalClose();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}, [hasPreviousStep, currentStep]);
|
|
134
|
-
const initModal = (shouldAutoLogin) => __async(void 0, null, function* () {
|
|
135
|
-
var _a2;
|
|
136
|
-
if (!para.isReady) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
const isAccount = isConnected, isGuest = isAccount && para.isGuestMode || isCreateGuestWalletsPending;
|
|
140
|
-
switch (true) {
|
|
141
|
-
case !!currentStepOverride:
|
|
142
|
-
setStep(ModalStep[currentStepOverride.toUpperCase()]);
|
|
143
|
-
break;
|
|
144
|
-
case isGuest:
|
|
145
|
-
setFlow("guest");
|
|
146
|
-
setStep(isCreateGuestWalletsPending ? ModalStep.AWAITING_GUEST_WALLET_CREATION : ModalStep.ACCOUNT_MAIN);
|
|
147
|
-
break;
|
|
148
|
-
case isAccount:
|
|
149
|
-
setFlow("account");
|
|
150
|
-
if (!openedToStep.current) {
|
|
151
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
152
|
-
}
|
|
153
|
-
break;
|
|
154
|
-
default:
|
|
155
|
-
if (currentStep !== ModalStep.AUTH_MAIN && currentStep !== ModalStep.SECRET) {
|
|
156
|
-
setFlow(void 0);
|
|
157
|
-
setStep(para.isTelegram ? ModalStep.TELEGRAM_OAUTH : ModalStep.AUTH_MAIN);
|
|
158
|
-
setAuthState();
|
|
159
|
-
setAuthStepRoute();
|
|
160
|
-
}
|
|
161
|
-
yield disconnectExternalWallet();
|
|
162
|
-
setSelectedWallet({ id: void 0, type: void 0 });
|
|
163
|
-
if (shouldAutoLogin) {
|
|
164
|
-
if (defaultAuthIdentifier && ((_a2 = para.authInfo) == null ? void 0 : _a2.identifier) !== defaultAuthIdentifier) {
|
|
165
|
-
const number = parsePhoneNumberFromString(defaultAuthIdentifier);
|
|
166
|
-
try {
|
|
167
|
-
const auth = validateInput(
|
|
168
|
-
number ? number.nationalNumber : defaultAuthIdentifier,
|
|
169
|
-
(number == null ? void 0 : number.countryCallingCode) ? `+${number == null ? void 0 : number.countryCallingCode}` : void 0,
|
|
170
|
-
number ? "phone" : "email"
|
|
171
|
-
);
|
|
172
|
-
para.setAuth(number ? { phone: defaultAuthIdentifier } : { email: defaultAuthIdentifier });
|
|
173
|
-
signUpOrLogIn(auth);
|
|
174
|
-
} catch (err) {
|
|
175
|
-
console.error("invalid user identifier:", err.message);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
useEffect(() => {
|
|
183
|
-
if ((para == null ? void 0 : para.isReady) && isOpen && !isAccountLoading && !isInitialized.current) {
|
|
184
|
-
initModal(isOpen);
|
|
185
|
-
isInitialized.current = true;
|
|
186
|
-
}
|
|
187
|
-
if ((para == null ? void 0 : para.isReady) && !isOpen && isInitialized.current) {
|
|
188
|
-
initModal();
|
|
189
|
-
isInitialized.current = false;
|
|
190
|
-
}
|
|
191
|
-
}, [para == null ? void 0 : para.isReady, isOpen, isAccountLoading]);
|
|
192
|
-
useEffect(() => {
|
|
193
|
-
let _authLayout = authLayout;
|
|
194
|
-
if (!(externalWallets == null ? void 0 : externalWallets.length) && hasExternalWallet(authLayout)) {
|
|
195
|
-
_authLayout = _authLayout.filter((l) => !l.includes("EXTERNAL"));
|
|
196
|
-
}
|
|
197
|
-
if (disableEmailLogin && disablePhoneLogin && !(oAuthMethods == null ? void 0 : oAuthMethods.length) && hasEmbeddedAuth(authLayout)) {
|
|
198
|
-
_authLayout = _authLayout.filter((l) => !l.includes("AUTH"));
|
|
199
|
-
}
|
|
200
|
-
if (JSON.stringify(storedAuthLayout) !== JSON.stringify(_authLayout)) {
|
|
201
|
-
setAuthLayout(_authLayout);
|
|
202
|
-
}
|
|
203
|
-
}, [disableEmailLogin, disablePhoneLogin, oAuthMethods, externalWallets, authLayout, storedAuthLayout]);
|
|
204
|
-
useEffect(() => {
|
|
205
|
-
if (theme) {
|
|
206
|
-
generateTheme(theme);
|
|
207
|
-
}
|
|
208
|
-
}, [theme]);
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
setOnModalStepChange(onModalStepChange);
|
|
211
|
-
}, [onModalStepChange]);
|
|
212
|
-
useEffect(() => {
|
|
213
|
-
updateSelectedWallet();
|
|
214
|
-
}, [para]);
|
|
215
|
-
useEffect(() => {
|
|
216
|
-
if (bareModal && !isAccountLoading && !isConnected && !["signup", "login"].includes(flow != null ? flow : "") && refs.currentStep.current !== ModalStep.AUTH_MAIN) {
|
|
217
|
-
setStep(ModalStep.AUTH_MAIN);
|
|
218
|
-
}
|
|
219
|
-
}, [bareModal, flow, isConnected, isAccountLoading]);
|
|
220
|
-
useEffect(() => {
|
|
221
|
-
setAccountLinkOptions(propsSupportedAccountLinks != null ? propsSupportedAccountLinks : para == null ? void 0 : para.supportedAccountLinks);
|
|
222
|
-
}, [propsSupportedAccountLinks, para == null ? void 0 : para.supportedAccountLinks]);
|
|
223
|
-
const handleClose = () => {
|
|
224
|
-
closeModal();
|
|
225
|
-
onClose == null ? void 0 : onClose();
|
|
226
|
-
};
|
|
227
|
-
const handleModalEntering = () => {
|
|
228
|
-
setIsModalMounted(true);
|
|
229
|
-
};
|
|
230
|
-
const handleModalExited = () => __async(void 0, null, function* () {
|
|
231
|
-
openedToStep.current = null;
|
|
232
|
-
setIsModalMounted(false);
|
|
233
|
-
if (RESET_TO_AUTH_STEPS.includes(currentStep)) {
|
|
234
|
-
resetModalState();
|
|
235
|
-
setRecoveryShare(null);
|
|
236
|
-
} else if (RESET_TO_ACCOUNT_STEPS.includes(currentStep)) {
|
|
237
|
-
setStep(ModalStep.LOGIN_DONE);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
if (!para) {
|
|
241
|
-
console.error("A Para instance is required.");
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
if (!(storedAuthLayout == null ? void 0 : storedAuthLayout.length)) {
|
|
245
|
-
const hasExternalWalletError = !(externalWallets == null ? void 0 : externalWallets.length) && hasExternalWallet(authLayout);
|
|
246
|
-
const hasEmbeddedWalletError = disableEmailLogin && disablePhoneLogin && !(oAuthMethods == null ? void 0 : oAuthMethods.length) && hasEmbeddedAuth(authLayout);
|
|
247
|
-
if (hasExternalWalletError || hasEmbeddedWalletError) {
|
|
248
|
-
if (hasExternalWalletError) {
|
|
249
|
-
console.error("At least one external wallet must be provided if external wallet auth is enabled.");
|
|
250
|
-
}
|
|
251
|
-
if (hasEmbeddedWalletError) {
|
|
252
|
-
console.error(
|
|
253
|
-
"At least one login method (email, phone or OAuth) must be provided if embedded wallet auth is enabled."
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
} else {
|
|
257
|
-
console.error("At least one auth layout selection is required.");
|
|
258
|
-
}
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
261
|
-
return /* @__PURE__ */ jsx(
|
|
262
|
-
StyledAuthModal,
|
|
263
|
-
{
|
|
264
|
-
enterTransitionDuration: DEFAULTS.ANIMATION_DURATION,
|
|
265
|
-
exitTransitionDuration: DEFAULTS.ANIMATION_DURATION,
|
|
266
|
-
open: isOpen,
|
|
267
|
-
onCpslModalExited: handleModalExited,
|
|
268
|
-
onCpslModalEntering: handleModalEntering,
|
|
269
|
-
onCpslModalRequestClose: handleClose,
|
|
270
|
-
noOverlay: bareModal,
|
|
271
|
-
className,
|
|
272
|
-
"data-testid": "modal",
|
|
273
|
-
$embeddedModal: !!embeddedModal,
|
|
274
|
-
children: isModalMounted && ((embeddedModal || bareModal) && isInitialized.current || !embeddedModal && !bareModal) && /* @__PURE__ */ jsx(
|
|
275
|
-
ModalContent,
|
|
276
|
-
__spreadValues({
|
|
277
|
-
oAuthMethods,
|
|
278
|
-
disableEmailLogin,
|
|
279
|
-
disablePhoneLogin,
|
|
280
|
-
isGuestModeEnabled,
|
|
281
|
-
onClose: handleClose
|
|
282
|
-
}, rest)
|
|
283
|
-
)
|
|
284
|
-
}
|
|
285
|
-
);
|
|
286
|
-
});
|
|
287
|
-
const StyledAuthModal = safeStyled(CpslAuthModal)`
|
|
288
|
-
${({ $embeddedModal }) => $embeddedModal && `
|
|
289
|
-
&::part(modal-body-card) {
|
|
290
|
-
--card-box-shadow: none;
|
|
291
|
-
--card-border-width: 0px;
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
&::part(modal-footer) {
|
|
295
|
-
--card-box-shadow: none;
|
|
296
|
-
--card-border-width: 0px;
|
|
297
|
-
};`}
|
|
298
|
-
`;
|
|
299
|
-
export {
|
|
300
|
-
ParaModal
|
|
301
|
-
};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { safeStyled } from "@getpara/react-common";
|
|
7
|
-
import { InnerStepContainer, StepContainer, StyledCpslTileButton } from "../common.js";
|
|
8
|
-
import { CpslButton, CpslIcon, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
9
|
-
import { OnRampStep, useModalStore } from "../../stores/index.js";
|
|
10
|
-
import { useEffect, useState } from "react";
|
|
11
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
12
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
13
|
-
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
14
|
-
import { useStore } from "../../../provider/stores/useStore.js";
|
|
15
|
-
import { formatBalanceString } from "../../utils/stringFormatters.js";
|
|
16
|
-
import { useAccount, useWalletBalance } from "../../../provider/index.js";
|
|
17
|
-
import { EnabledFlow } from "@getpara/web-sdk";
|
|
18
|
-
import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
|
|
19
|
-
const Account = ({ onClose }) => {
|
|
20
|
-
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
21
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
22
|
-
const setFlow = useModalStore((state) => state.setFlow);
|
|
23
|
-
const setGuestAddFundsTab = useModalStore((state) => state.setGuestAddFundsTab);
|
|
24
|
-
const setOnRampStep = useModalStore((state) => state.setOnRampStep);
|
|
25
|
-
const hideWallets = useStore((state) => {
|
|
26
|
-
var _a;
|
|
27
|
-
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
28
|
-
});
|
|
29
|
-
const { disconnectExternalWallet } = useExternalWallets();
|
|
30
|
-
const para = useInternalClient();
|
|
31
|
-
const { embedded } = useAccount();
|
|
32
|
-
const { data: balance, isLoading: isBalanceLoading } = useWalletBalance();
|
|
33
|
-
const { isEnabled } = useAccountLinking();
|
|
34
|
-
const [isDisconnecting, setIsDisconnecting] = useState(false);
|
|
35
|
-
const isGuestMode = embedded.isConnected && embedded.isGuestMode;
|
|
36
|
-
const cantBuyAndWithdraw = (para.externalWalletConnectionType === "CONNECTION_ONLY" || para.externalWalletConnectionType === "VERIFICATION") && !para.userId;
|
|
37
|
-
const isOnRampLoaded = !!onRampConfig;
|
|
38
|
-
const handleBuyClick = () => {
|
|
39
|
-
if (isGuestMode) {
|
|
40
|
-
if (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) {
|
|
41
|
-
setStep(ModalStep.ADD_FUNDS_RECEIVE);
|
|
42
|
-
} else {
|
|
43
|
-
setGuestAddFundsTab(EnabledFlow.BUY);
|
|
44
|
-
setStep(ModalStep.AUTH_GUEST_SIGNUP);
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
setOnRampStep(OnRampStep.SETTINGS);
|
|
48
|
-
setStep(ModalStep.ADD_FUNDS_BUY);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const handleSellClick = () => {
|
|
52
|
-
if (isGuestMode) {
|
|
53
|
-
setGuestAddFundsTab(EnabledFlow.WITHDRAW);
|
|
54
|
-
setStep(ModalStep.AUTH_GUEST_SIGNUP);
|
|
55
|
-
} else {
|
|
56
|
-
setOnRampStep(OnRampStep.SETTINGS);
|
|
57
|
-
setStep(ModalStep.ADD_FUNDS_WITHDRAW);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const handleProfileClick = () => {
|
|
61
|
-
setStep(ModalStep.ACCOUNT_PROFILE);
|
|
62
|
-
};
|
|
63
|
-
const handleDisconnectClick = () => __async(void 0, null, function* () {
|
|
64
|
-
setIsDisconnecting(true);
|
|
65
|
-
yield para.logout();
|
|
66
|
-
yield disconnectExternalWallet();
|
|
67
|
-
onClose();
|
|
68
|
-
setStep(ModalStep.AUTH_MAIN);
|
|
69
|
-
setFlow(void 0);
|
|
70
|
-
setIsDisconnecting(false);
|
|
71
|
-
});
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
setGuestAddFundsTab();
|
|
74
|
-
}, []);
|
|
75
|
-
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
76
|
-
isBalanceLoading ? /* @__PURE__ */ jsx(BalanceContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, { size: 39 }) }) : balance !== void 0 && balance !== null && /* @__PURE__ */ jsx(BalanceContainer, { children: /* @__PURE__ */ jsx(CpslText, { variant: "headingS", weight: "medium", children: formatBalanceString(balance) }) }),
|
|
77
|
-
isGuestMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
-
balance && parseFloat(balance) > 0 && /* @__PURE__ */ jsxs(Alert, { children: [
|
|
79
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "alertTriangle", size: "24px", style: { color: "var(--cpsl-color-utility-yellow)" } }),
|
|
80
|
-
"You've funded this account - complete account setup to maintain access."
|
|
81
|
-
] }),
|
|
82
|
-
/* @__PURE__ */ jsxs(
|
|
83
|
-
CpslButton,
|
|
84
|
-
{
|
|
85
|
-
fullWidth: true,
|
|
86
|
-
variant: "primary",
|
|
87
|
-
onClick: () => {
|
|
88
|
-
setStep(ModalStep.AUTH_GUEST_SIGNUP);
|
|
89
|
-
},
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "stars02" }),
|
|
92
|
-
"Complete Account Setup"
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
] }),
|
|
97
|
-
/* @__PURE__ */ jsx(ButtonContainer, { children: isOnRampLoaded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
98
|
-
onRampConfig.isBuyEnabled && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "creditCard", onClick: handleBuyClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Receive" }) }),
|
|
99
|
-
onRampConfig.isWithdrawEnabled && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "arrowCircleBrokenDownLeft", onClick: handleSellClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Withdraw" }) }),
|
|
100
|
-
/* @__PURE__ */ jsx(OptionButton, { icon: "user", onClick: handleProfileClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: isEnabled ? "Profile" : "Settings" }) })
|
|
101
|
-
] }) : /* @__PURE__ */ jsx(CpslSpinner, {}) }),
|
|
102
|
-
!isGuestMode && /* @__PURE__ */ jsx(DisconnectButton, { variant: "destructive", fullWidth: true, onClick: handleDisconnectClick, disabled: isDisconnecting, children: isDisconnecting ? /* @__PURE__ */ jsx(CpslSpinner, { size: 16 }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
103
|
-
hideWallets ? "Logout" : "Disconnect Wallet",
|
|
104
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "logOut", slot: "end" })
|
|
105
|
-
] }) })
|
|
106
|
-
] }) });
|
|
107
|
-
};
|
|
108
|
-
const ButtonContainer = safeStyled.div`
|
|
109
|
-
display: flex;
|
|
110
|
-
align-items: center;
|
|
111
|
-
justify-content: center;
|
|
112
|
-
gap: 8px;
|
|
113
|
-
width: 100%;
|
|
114
|
-
height: 88px;
|
|
115
|
-
`;
|
|
116
|
-
const OptionButton = safeStyled(StyledCpslTileButton)`
|
|
117
|
-
flex: 1;
|
|
118
|
-
|
|
119
|
-
--button-icon-color: var(--cpsl-color-text-primary);
|
|
120
|
-
`;
|
|
121
|
-
const DisconnectButton = safeStyled(CpslButton)`
|
|
122
|
-
--button-border-width: 0px;
|
|
123
|
-
`;
|
|
124
|
-
const BalanceContainer = safeStyled.div`
|
|
125
|
-
display: flex;
|
|
126
|
-
justify-content: center;
|
|
127
|
-
align-items: center;
|
|
128
|
-
padding-top: 8px;
|
|
129
|
-
padding-bottom: 24px;
|
|
130
|
-
`;
|
|
131
|
-
const Alert = safeStyled.div`
|
|
132
|
-
--icon-color: var(--cpsl-color-utility-yellow);
|
|
133
|
-
--icon-stroke-color: var(--cpsl-color-utility-yellow);
|
|
134
|
-
--icon-fill-color: var(--cpsl-color-utility-yellow);
|
|
135
|
-
|
|
136
|
-
display: flex;
|
|
137
|
-
padding: 8px;
|
|
138
|
-
align-items: flex-start;
|
|
139
|
-
gap: 8px;
|
|
140
|
-
align-self: stretch;
|
|
141
|
-
border-radius: var(--cpsl-border-radius-alert);
|
|
142
|
-
border: 1px solid var(--cpsl-color-utility-yellow);
|
|
143
|
-
background: var(--cpsl-color-utility-yellow-light);
|
|
144
|
-
font-size: 14px;
|
|
145
|
-
`;
|
|
146
|
-
export {
|
|
147
|
-
Account
|
|
148
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AccountProfile: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { AccountTypeIcon, GradientScroll, StepContainer } from "../common.js";
|
|
8
|
-
import { CpslButton, CpslIcon, CpslIdenticon, CpslText } from "@getpara/react-components";
|
|
9
|
-
import { useClient } from "../../../provider/index.js";
|
|
10
|
-
import { useLinkedAccounts } from "../../../provider/hooks/index.js";
|
|
11
|
-
import { getWalletDisplayName } from "../../utils/getWalletDisplayName.js";
|
|
12
|
-
import { truncateAddress } from "@getpara/web-sdk";
|
|
13
|
-
import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
|
|
14
|
-
import { safeStyled, useCopyToClipboard } from "@getpara/react-common";
|
|
15
|
-
import { getAccountTypeName } from "../../constants/oAuthLogos.js";
|
|
16
|
-
const Entry = ({
|
|
17
|
-
identifier,
|
|
18
|
-
icon,
|
|
19
|
-
name,
|
|
20
|
-
address,
|
|
21
|
-
addressShort,
|
|
22
|
-
onUnlink
|
|
23
|
-
}) => {
|
|
24
|
-
const [isCopied, copy] = useCopyToClipboard();
|
|
25
|
-
return /* @__PURE__ */ jsxs(EntryContainer, { children: [
|
|
26
|
-
icon,
|
|
27
|
-
/* @__PURE__ */ jsx(EntryDisplayName, { variant: "bodyM", color: "contrast", children: name }),
|
|
28
|
-
/* @__PURE__ */ jsx(EntryFlex, { children: address ? /* @__PURE__ */ jsxs(EntryAddress, { children: [
|
|
29
|
-
/* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", children: addressShort != null ? addressShort : address }),
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
CpslButton,
|
|
32
|
-
{
|
|
33
|
-
size: "small",
|
|
34
|
-
variant: "ghost",
|
|
35
|
-
onClick: (e) => {
|
|
36
|
-
e.stopPropagation();
|
|
37
|
-
e.preventDefault();
|
|
38
|
-
copy(address);
|
|
39
|
-
},
|
|
40
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { id: "ignore-click", slot: "start", isCopied, icon: isCopied ? "check" : "copy" })
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
] }) : null }),
|
|
44
|
-
onUnlink && /* @__PURE__ */ jsx(EntryUnlink, { href: "#", onClick: onUnlink, children: "Unlink" })
|
|
45
|
-
] }, address != null ? address : identifier);
|
|
46
|
-
};
|
|
47
|
-
const AccountProfile = () => {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f;
|
|
49
|
-
const para = useClient();
|
|
50
|
-
const { data: linkedAccounts } = useLinkedAccounts();
|
|
51
|
-
const { isEnabled, linkAccount, unlinkAccount } = useAccountLinking();
|
|
52
|
-
if (!para) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const externalWallet = (_a = para.authInfo) == null ? void 0 : _a.externalWallet;
|
|
56
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
57
|
-
/* @__PURE__ */ jsxs(Section, { children: [
|
|
58
|
-
/* @__PURE__ */ jsx(Title, { variant: "bodyS", color: "secondary", children: "Connected Wallets" }),
|
|
59
|
-
/* @__PURE__ */ jsx(Content, { children: externalWallet ? /* @__PURE__ */ jsx(
|
|
60
|
-
Entry,
|
|
61
|
-
{
|
|
62
|
-
icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: externalWallet.providerId, size: "24px" }),
|
|
63
|
-
name: (_c = (_b = externalWallet.ensName) != null ? _b : getAccountTypeName(externalWallet.providerId)) != null ? _c : "",
|
|
64
|
-
address: (_d = externalWallet.addressBech32) != null ? _d : externalWallet.address,
|
|
65
|
-
addressShort: truncateAddress((_e = externalWallet.addressBech32) != null ? _e : externalWallet.address, externalWallet.type, {
|
|
66
|
-
prefix: para.cosmosPrefix
|
|
67
|
-
})
|
|
68
|
-
},
|
|
69
|
-
externalWallet.address
|
|
70
|
-
) : (_f = para == null ? void 0 : para.availableWallets) == null ? void 0 : _f.map((wallet) => {
|
|
71
|
-
var _a2;
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
Entry,
|
|
74
|
-
{
|
|
75
|
-
icon: wallet.isExternal ? /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: (_a2 = wallet.externalProviderId) != null ? _a2 : "EXTERNAL_WALLET", size: "24px" }) : /* @__PURE__ */ jsx(CpslIdenticon, { hash: para.getIdenticonHash(wallet.id, wallet.type), size: "24px", arcWidth: "40%" }),
|
|
76
|
-
name: getWalletDisplayName(para, wallet),
|
|
77
|
-
address: wallet.address,
|
|
78
|
-
addressShort: truncateAddress(wallet.address, wallet.type)
|
|
79
|
-
},
|
|
80
|
-
wallet.address
|
|
81
|
-
);
|
|
82
|
-
}) })
|
|
83
|
-
] }),
|
|
84
|
-
isEnabled && /* @__PURE__ */ jsxs(Section, { children: [
|
|
85
|
-
/* @__PURE__ */ jsx(Title, { variant: "bodyS", color: "secondary", children: "Linked Accounts" }),
|
|
86
|
-
/* @__PURE__ */ jsxs(Content, { children: [
|
|
87
|
-
/* @__PURE__ */ jsx(GradientScroll, { gap: "12px", height: "360px", children: [
|
|
88
|
-
...((linkedAccounts == null ? void 0 : linkedAccounts.primary) || []).map((p) => __spreadProps(__spreadValues({}, p), { isPrimary: true })),
|
|
89
|
-
...(linkedAccounts == null ? void 0 : linkedAccounts.linked) || []
|
|
90
|
-
].map((linkedAccount) => {
|
|
91
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
92
|
-
const { identifier, displayName, type, isPrimary = false, externalWallet: externalWallet2 } = linkedAccount;
|
|
93
|
-
return /* @__PURE__ */ jsx(
|
|
94
|
-
Entry,
|
|
95
|
-
{
|
|
96
|
-
icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: (_a2 = externalWallet2 == null ? void 0 : externalWallet2.providerId) != null ? _a2 : type, size: "24px" }),
|
|
97
|
-
name: externalWallet2 ? (_c2 = (_b2 = externalWallet2.ensName) != null ? _b2 : getAccountTypeName(externalWallet2.providerId)) != null ? _c2 : "" : displayName != null ? displayName : identifier,
|
|
98
|
-
address: (_d2 = externalWallet2 == null ? void 0 : externalWallet2.addressBech32) != null ? _d2 : externalWallet2 == null ? void 0 : externalWallet2.address,
|
|
99
|
-
addressShort: externalWallet2 ? truncateAddress((_e2 = externalWallet2.addressBech32) != null ? _e2 : externalWallet2.address, externalWallet2.type, {
|
|
100
|
-
prefix: para.cosmosPrefix
|
|
101
|
-
}) : void 0,
|
|
102
|
-
onUnlink: isPrimary ? void 0 : (e) => {
|
|
103
|
-
e.preventDefault();
|
|
104
|
-
unlinkAccount(linkedAccount);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
identifier
|
|
108
|
-
);
|
|
109
|
-
}) }),
|
|
110
|
-
/* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, variant: "tertiary", onClick: () => linkAccount(void 0), children: [
|
|
111
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "userPlus", slot: "start" }),
|
|
112
|
-
"Link an account"
|
|
113
|
-
] })
|
|
114
|
-
] })
|
|
115
|
-
] })
|
|
116
|
-
] });
|
|
117
|
-
};
|
|
118
|
-
const Section = safeStyled.div`
|
|
119
|
-
display: flex;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
align-items: flex-start;
|
|
122
|
-
justify-content: center;
|
|
123
|
-
gap: 16px;
|
|
124
|
-
width: 100%;
|
|
125
|
-
`;
|
|
126
|
-
const Content = safeStyled(Section)``;
|
|
127
|
-
const Title = safeStyled(CpslText)``;
|
|
128
|
-
const EntryContainer = safeStyled.div`
|
|
129
|
-
position: relative;
|
|
130
|
-
width: 100%;
|
|
131
|
-
display: flex;
|
|
132
|
-
gap: 8px;
|
|
133
|
-
align-items: center;
|
|
134
|
-
`;
|
|
135
|
-
const EntryDisplayName = safeStyled(CpslText)``;
|
|
136
|
-
const EntryFlex = safeStyled.div`
|
|
137
|
-
flex: 1;
|
|
138
|
-
`;
|
|
139
|
-
const EntryAddress = safeStyled.div`
|
|
140
|
-
display: flex;
|
|
141
|
-
gap: 8px;
|
|
142
|
-
align-items: center;
|
|
143
|
-
`;
|
|
144
|
-
const CopyIcon = safeStyled(CpslIcon)`
|
|
145
|
-
--width: 16px;
|
|
146
|
-
--height: 16px;
|
|
147
|
-
--icon-color: ${({ isCopied }) => isCopied ? "var(--cpsl-color-utility-green) !important" : "var(--cpsl-color-text-secondary)"};
|
|
148
|
-
|
|
149
|
-
&:hover {
|
|
150
|
-
--icon-color: var(--cpsl-color-text-contrast);
|
|
151
|
-
}
|
|
152
|
-
`;
|
|
153
|
-
const EntryUnlink = safeStyled.a`
|
|
154
|
-
color: var(--cpsl-color-utility-red);
|
|
155
|
-
position: absolute;
|
|
156
|
-
right: 0;
|
|
157
|
-
text-decoration: none;
|
|
158
|
-
font-size: 14px;
|
|
159
|
-
font-weight: 500;
|
|
160
|
-
font-family: var(--cpsl-font-family);
|
|
161
|
-
|
|
162
|
-
&:hover {
|
|
163
|
-
text-decoration: underline;
|
|
164
|
-
}
|
|
165
|
-
`;
|
|
166
|
-
export {
|
|
167
|
-
AccountProfile
|
|
168
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountProfileLink(): import("react/jsx-runtime").JSX.Element;
|