@getpara/react-sdk 2.0.0-dev.2 → 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 -6
- package/dist/index.js +6 -7058
- package/dist/package.json +6 -0
- package/dist/provider/ParaProvider.d.ts +1 -2
- package/dist/provider/ParaProvider.js +24 -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 +37 -46
- package/styles.css/package.json +1 -1
- package/dist/MoonPayEmbed-Q2HP2BFI.js +0 -9
- package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
- package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
- package/dist/chunk-MMUBH76A.js.br +0 -0
- package/dist/chunk-MMUBH76A.js.gz +0 -0
- package/dist/cli/cli.mjs +0 -35
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/ParaModal.d.ts +0 -2
- package/dist/modal/components/Account/Account.d.ts +0 -5
- package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -3
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
- package/dist/modal/components/AddFunds/index.d.ts +0 -3
- package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -6
- package/dist/modal/components/AuthInput/countryCodes.d.ts +0 -8
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -8
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -8
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -8
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
- package/dist/modal/components/Body/Body.d.ts +0 -10
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
- package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
- package/dist/modal/components/Controls/Controls.d.ts +0 -5
- package/dist/modal/components/Controls/Selects.d.ts +0 -2
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
- package/dist/modal/components/Footer/Footer.d.ts +0 -1
- package/dist/modal/components/Header/Header.d.ts +0 -1
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -1
- package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -14
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -2
- package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -1
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/StripeComponents/StripeComponents.d.ts +0 -16
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -1
- package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
- package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/components/common.d.ts +0 -23
- package/dist/modal/components/index.d.ts +0 -1
- package/dist/modal/constants/constants.d.ts +0 -32
- package/dist/modal/constants/defaults.d.ts +0 -5
- package/dist/modal/constants/oAuthLogos.d.ts +0 -8
- package/dist/modal/hooks/useCreateAccount.d.ts +0 -4
- package/dist/modal/hooks/useGoBack.d.ts +0 -1
- package/dist/modal/index.d.ts +0 -8
- package/dist/modal/stores/index.d.ts +0 -2
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -102
- package/dist/modal/stores/userInfo/actions.d.ts +0 -3
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
- package/dist/modal/types/commonTypes.d.ts +0 -6
- package/dist/modal/types/modalProps.d.ts +0 -116
- package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
- package/dist/modal/utils/getMailtoLink.d.ts +0 -1
- package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
- package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
- package/dist/modal/utils/openPopup.d.ts +0 -6
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
- package/dist/modal/utils/steps.d.ts +0 -114
- package/dist/modal/utils/stringFormatters.d.ts +0 -4
- package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
- package/dist/provider/actions/checkIfUserExists.d.ts +0 -4
- package/dist/provider/actions/createUser.d.ts +0 -4
- package/dist/provider/actions/getAccount.d.ts +0 -10
- package/dist/provider/actions/getWallet.d.ts +0 -5
- package/dist/provider/actions/index.d.ts +0 -25
- package/dist/provider/actions/initiateLogin.d.ts +0 -4
- package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
- package/dist/provider/actions/logout.d.ts +0 -5
- package/dist/provider/actions/signMessage.d.ts +0 -8
- package/dist/provider/actions/signTransaction.d.ts +0 -8
- package/dist/provider/actions/utils.d.ts +0 -3
- package/dist/provider/actions/waitForAccountCreation.d.ts +0 -5
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
- package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
- package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
- package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
- package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
- package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
- package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
- package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -12
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -3
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -8
- package/dist/provider/hooks/index.d.ts +0 -3
- package/dist/provider/hooks/mutations/index.d.ts +0 -34
- package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
- package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
- package/dist/provider/hooks/mutations/useLogout.d.ts +0 -13
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -15
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -13
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
- package/dist/provider/hooks/mutations/utils.d.ts +0 -4
- package/dist/provider/hooks/queries/index.d.ts +0 -2
- package/dist/provider/hooks/queries/useAccount.d.ts +0 -11
- package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
- package/dist/provider/hooks/utils/index.d.ts +0 -3
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
- package/dist/provider/hooks/utils/useClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
- package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useModal.d.ts +0 -8
- package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
- package/dist/provider/index.d.ts +0 -4
- package/dist/provider/providers/AuthProvider.d.ts +0 -31
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -79
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
- package/dist/provider/stores/getters.d.ts +0 -4
- package/dist/provider/stores/setters.d.ts +0 -1
- package/dist/provider/stores/slices/client.d.ts +0 -3
- package/dist/provider/stores/slices/config.d.ts +0 -3
- package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
- package/dist/provider/stores/slices/index.d.ts +0 -4
- package/dist/provider/stores/slices/modal.d.ts +0 -3
- package/dist/provider/stores/slices/wallet.d.ts +0 -3
- package/dist/provider/stores/types.d.ts +0 -62
- package/dist/provider/stores/useStore.d.ts +0 -17
- package/dist/provider/types/externalWalletProviders.d.ts +0 -12
- package/dist/provider/types/provider.d.ts +0 -142
- package/dist/provider/types/query.d.ts +0 -3
- package/dist/provider/types/utils.d.ts +0 -22
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
- package/dist/provider/utils/renameMutations.d.ts +0 -5
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../../chunk-MMUBH76A.js";
|
|
7
|
+
import { useClient } from "@getpara/react-sdk-lite";
|
|
8
|
+
import { useViemAccount } from "./useViemAccount.js";
|
|
9
|
+
import { createParaViemClient } from "@getpara/viem-v2-integration";
|
|
10
|
+
import { useQuery } from "@tanstack/react-query";
|
|
11
|
+
const VIEM_CLIENT_BASE_KEY = "PARA_VIEM_CLIENT";
|
|
12
|
+
const useViemClient = ({ address, walletClientConfig }) => {
|
|
13
|
+
const para = useClient();
|
|
14
|
+
const { viemAccount } = useViemAccount({ address });
|
|
15
|
+
const { data, isLoading } = useQuery({
|
|
16
|
+
queryKey: [VIEM_CLIENT_BASE_KEY, viemAccount, address, walletClientConfig],
|
|
17
|
+
enabled: !!viemAccount && !!para,
|
|
18
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
19
|
+
if (!para || !viemAccount) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return yield createParaViemClient(para, __spreadProps(__spreadValues({}, walletClientConfig), { account: viemAccount }));
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
return { viemClient: data, isLoading };
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
VIEM_CLIENT_BASE_KEY,
|
|
29
|
+
useViemClient
|
|
30
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
|
|
3
|
-
export * from '@getpara/web-sdk';
|
|
4
|
-
export { ExternalWallet, EvmWallet, SolanaWallet, CosmosWallet } from '@getpara/react-common';
|
|
5
|
-
export type { Theme } from '@getpara/react-components';
|
|
6
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
1
|
+
export * from '@getpara/react-sdk-lite';
|
|
2
|
+
import ParaWeb from '@getpara/react-sdk-lite';
|
|
7
3
|
export default ParaWeb;
|
|
4
|
+
export { ParaProvider } from './provider/ParaProvider.js';
|