@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,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../../chunk-MMUBH76A.js";
|
|
7
|
+
import { createParaViemClient } from "@getpara/viem-v2-integration";
|
|
8
|
+
import { getViemAccount } from "./getViemAccount.js";
|
|
9
|
+
const getViemClient = (_0) => __async(void 0, [_0], function* ({
|
|
10
|
+
para,
|
|
11
|
+
address,
|
|
12
|
+
walletClientConfig
|
|
13
|
+
}) {
|
|
14
|
+
const viemAccount = yield getViemAccount({
|
|
15
|
+
para,
|
|
16
|
+
address
|
|
17
|
+
});
|
|
18
|
+
if (!viemAccount || !para) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return yield createParaViemClient(para, __spreadProps(__spreadValues({}, walletClientConfig), { account: viemAccount }));
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
getViemClient
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const VIEM_ACCOUNT_BASE_KEY = "PARA_VIEM_ACCOUNT";
|
|
2
|
+
type UseViemAccountParameters = {
|
|
3
|
+
address?: `0x${string}`;
|
|
4
|
+
};
|
|
5
|
+
export declare const useViemAccount: ({ address }?: UseViemAccountParameters) => {
|
|
6
|
+
viemAccount: {
|
|
7
|
+
address: import("abitype").Address;
|
|
8
|
+
nonceManager?: import("viem").NonceManager | undefined;
|
|
9
|
+
sign?: ((parameters: {
|
|
10
|
+
hash: import("viem").Hash;
|
|
11
|
+
}) => Promise<import("viem").Hex>) | undefined | undefined;
|
|
12
|
+
signAuthorization?: ((parameters: import("viem/_types/types/authorization.js").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>) | undefined | undefined;
|
|
13
|
+
signMessage: ({ message }: {
|
|
14
|
+
message: import("viem").SignableMessage;
|
|
15
|
+
}) => Promise<import("viem").Hex>;
|
|
16
|
+
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
17
|
+
serializer?: serializer | undefined;
|
|
18
|
+
} | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, import("viem").Hex> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : import("viem").Hex>;
|
|
19
|
+
signTypedData: <const typedData extends import("abitype").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
|
|
20
|
+
publicKey: import("viem").Hex;
|
|
21
|
+
source: string;
|
|
22
|
+
type: "local";
|
|
23
|
+
} | null | undefined;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useAccount, useClient, useWallet } from "@getpara/react-sdk-lite";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
|
+
import { getViemAccount } from "../actions/index.js";
|
|
8
|
+
const VIEM_ACCOUNT_BASE_KEY = "PARA_VIEM_ACCOUNT";
|
|
9
|
+
const useViemAccount = ({ address } = {}) => {
|
|
10
|
+
const para = useClient();
|
|
11
|
+
const {
|
|
12
|
+
isConnected,
|
|
13
|
+
embedded: { userId }
|
|
14
|
+
} = useAccount();
|
|
15
|
+
const { data: wallet } = useWallet();
|
|
16
|
+
const { data, isLoading } = useQuery({
|
|
17
|
+
queryKey: [VIEM_ACCOUNT_BASE_KEY, isConnected, userId, address != null ? address : (wallet == null ? void 0 : wallet.type) === "EVM" ? wallet == null ? void 0 : wallet.address : null],
|
|
18
|
+
enabled: isConnected && !!para,
|
|
19
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
20
|
+
if (!isConnected || !para) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const _address = address != null ? address : (wallet == null ? void 0 : wallet.type) === "EVM" ? wallet == null ? void 0 : wallet.address : void 0;
|
|
24
|
+
return yield getViemAccount({ para, address: _address });
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
return { viemAccount: data, isLoading };
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
VIEM_ACCOUNT_BASE_KEY,
|
|
31
|
+
useViemAccount
|
|
32
|
+
};
|