@getpara/react-sdk-lite 2.21.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/aa/hooks/alchemy.d.ts +5 -2
  2. package/dist/aa/hooks/biconomy.d.ts +5 -2
  3. package/dist/aa/hooks/cdp.d.ts +5 -2
  4. package/dist/aa/hooks/gelato.d.ts +5 -2
  5. package/dist/aa/hooks/pimlico.d.ts +5 -2
  6. package/dist/aa/hooks/porto.d.ts +5 -2
  7. package/dist/aa/hooks/rhinestone.d.ts +5 -2
  8. package/dist/aa/hooks/safe.d.ts +5 -2
  9. package/dist/aa/hooks/thirdweb.d.ts +6 -1
  10. package/dist/aa/hooks/zerodev.d.ts +5 -2
  11. package/dist/chains/cosmos.d.ts +62 -0
  12. package/dist/chains/cosmos.js +10 -0
  13. package/dist/chains/evm.d.ts +74 -0
  14. package/dist/chains/evm.js +14 -0
  15. package/dist/chains/solana.d.ts +33 -0
  16. package/dist/chains/solana.js +8 -0
  17. package/dist/chains/stellar.d.ts +2 -0
  18. package/dist/chains/stellar.js +14 -0
  19. package/dist/chains/useGrazEnhancer.d.ts +7 -0
  20. package/dist/chains/useGrazEnhancer.js +28 -0
  21. package/dist/chains/useSolanaWalletEnhancer.d.ts +7 -0
  22. package/dist/chains/useSolanaWalletEnhancer.js +53 -0
  23. package/dist/chains/useWagmiEthersEnhancer.d.ts +7 -0
  24. package/dist/chains/useWagmiEthersEnhancer.js +67 -0
  25. package/dist/chains/useWagmiViemEnhancer.d.ts +7 -0
  26. package/dist/chains/useWagmiViemEnhancer.js +56 -0
  27. package/dist/modal/ParaModal.js +1 -1
  28. package/dist/modal/components/shared/ConnectExternalWallet/ConnectExternalWallet.js +14 -4
  29. package/dist/provider/ParaProviderMin.js +119 -112
  30. package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +1 -1
  31. package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +1 -1
  32. package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +1 -1
  33. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +1 -1
  34. package/dist/provider/types/provider.d.ts +8 -53
  35. package/package.json +52 -20
@@ -1,4 +1,7 @@
1
1
  import { ALCHEMY_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseAlchemySmartAccountParams } from '@getpara/aa-alchemy';
2
5
  export { ALCHEMY_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage an Alchemy smart account.
@@ -10,6 +13,6 @@ export { ALCHEMY_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useAlchemySmartAccount: (params?: import("@getpara/aa-alchemy").AlchemySmartAccountConfig & {
16
+ export declare const useAlchemySmartAccount: (params?: UseAlchemySmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { BICONOMY_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseBiconomySmartAccountParams } from '@getpara/aa-biconomy';
2
5
  export { BICONOMY_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Biconomy smart account.
@@ -10,6 +13,6 @@ export { BICONOMY_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useBiconomySmartAccount: (params?: import("@getpara/aa-biconomy").BiconomySmartAccountConfig & {
16
+ export declare const useBiconomySmartAccount: (params?: UseBiconomySmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { CDP_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseCDPSmartAccountParams } from '@getpara/aa-cdp';
2
5
  export { CDP_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Coinbase Developer Platform smart account.
@@ -9,6 +12,6 @@ export { CDP_SMART_ACCOUNT_BASE_KEY };
9
12
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
10
13
  * and uses them as the signer when no Para embedded wallet is active.
11
14
  */
12
- export declare const useCDPSmartAccount: (params?: import("@getpara/aa-cdp").CDPSmartAccountConfig & {
15
+ export declare const useCDPSmartAccount: (params?: UseCDPSmartAccountParams & {
13
16
  enabled?: boolean;
14
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
17
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { GELATO_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseGelatoSmartAccountParams } from '@getpara/aa-gelato';
2
5
  export { GELATO_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Gelato smart account.
@@ -9,6 +12,6 @@ export { GELATO_SMART_ACCOUNT_BASE_KEY };
9
12
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
10
13
  * and uses them as the signer when no Para embedded wallet is active.
11
14
  */
12
- export declare const useGelatoSmartAccount: (params?: import("@getpara/aa-gelato").GelatoSmartAccountConfig & {
15
+ export declare const useGelatoSmartAccount: (params?: UseGelatoSmartAccountParams & {
13
16
  enabled?: boolean;
14
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
17
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { PIMLICO_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UsePimlicoSmartAccountParams } from '@getpara/aa-pimlico';
2
5
  export { PIMLICO_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Pimlico smart account.
@@ -10,6 +13,6 @@ export { PIMLICO_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const usePimlicoSmartAccount: (params?: import("@getpara/aa-pimlico").PimlicoSmartAccountConfig & {
16
+ export declare const usePimlicoSmartAccount: (params?: UsePimlicoSmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { PORTO_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UsePortoSmartAccountParams } from '@getpara/aa-porto';
2
5
  export { PORTO_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Porto smart account.
@@ -10,6 +13,6 @@ export { PORTO_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const usePortoSmartAccount: (params?: import("@getpara/aa-porto").PortoAccountConfig & {
16
+ export declare const usePortoSmartAccount: (params?: UsePortoSmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { RHINESTONE_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseRhinestoneSmartAccountParams } from '@getpara/aa-rhinestone';
2
5
  export { RHINESTONE_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Rhinestone smart account.
@@ -10,6 +13,6 @@ export { RHINESTONE_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useRhinestoneSmartAccount: (params?: import("@getpara/aa-rhinestone").RhinestoneSmartAccountConfig & {
16
+ export declare const useRhinestoneSmartAccount: (params?: UseRhinestoneSmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { SAFE_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseSafeSmartAccountParams } from '@getpara/aa-safe';
2
5
  export { SAFE_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Safe smart account.
@@ -10,6 +13,6 @@ export { SAFE_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useSafeSmartAccount: (params?: import("@getpara/aa-safe").SafeSmartAccountConfig & {
16
+ export declare const useSafeSmartAccount: (params?: UseSafeSmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { THIRDWEB_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseThirdwebSmartAccountParams } from '@getpara/aa-thirdweb';
2
5
  export { THIRDWEB_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a Thirdweb smart account.
@@ -10,4 +13,6 @@ export { THIRDWEB_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useThirdwebSmartAccount: (params?: any) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
16
+ export declare const useThirdwebSmartAccount: (params?: UseThirdwebSmartAccountParams & {
17
+ enabled?: boolean;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -1,4 +1,7 @@
1
1
  import { ZERODEV_SMART_ACCOUNT_BASE_KEY } from '@getpara/react-core/internal';
2
+ import type { UseSmartAccountResult } from '@getpara/react-core/internal';
3
+ import type { SmartAccount } from '@getpara/viem-v2-integration/aa';
4
+ import type { UseZeroDevSmartAccountParams } from '@getpara/aa-zerodev';
2
5
  export { ZERODEV_SMART_ACCOUNT_BASE_KEY };
3
6
  /**
4
7
  * React / React Native hook to create and manage a ZeroDev smart account.
@@ -10,6 +13,6 @@ export { ZERODEV_SMART_ACCOUNT_BASE_KEY };
10
13
  * On web, automatically detects connected external wallets (MetaMask, etc.) via wagmi
11
14
  * and uses them as the signer when no Para embedded wallet is active.
12
15
  */
13
- export declare const useZeroDevSmartAccount: (params?: import("@getpara/aa-zerodev").ZeroDevSmartAccountConfig & {
16
+ export declare const useZeroDevSmartAccount: (params?: UseZeroDevSmartAccountParams & {
14
17
  enabled?: boolean;
15
- }) => import("@getpara/react-core/internal").UseSmartAccountResult<import("@getpara/aa-alchemy").SmartAccount>;
18
+ }) => UseSmartAccountResult<SmartAccount>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Returns a CosmJS `OfflineDirectSigner` for the user's Cosmos wallet.
3
+ * Supports both embedded Para wallets and external wallets.
4
+ *
5
+ * If the user has multiple Cosmos wallets, pass `address` or `walletId` to select one.
6
+ * When omitted, the active wallet from `useWalletState` is used automatically.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { useParaCosmjsProtoSigner } from "@getpara/react-sdk";
11
+ * import { SigningStargateClient } from "@cosmjs/stargate";
12
+ *
13
+ * function SignDirect() {
14
+ * const { protoSigner, isLoading } = useParaCosmjsProtoSigner();
15
+ *
16
+ * const handleSign = async () => {
17
+ * if (!protoSigner) return;
18
+ * const client = await SigningStargateClient.connectWithSigner(rpcUrl, protoSigner);
19
+ * const result = await protoSigner.signDirect(protoSigner.address, signDoc);
20
+ * console.log(result);
21
+ * };
22
+ *
23
+ * if (isLoading) return <p>Loading...</p>;
24
+ * return <button onClick={handleSign}>Sign</button>;
25
+ * }
26
+ * ```
27
+ *
28
+ */
29
+ export declare const useParaCosmjsProtoSigner: ({ address, prefix, walletId, messageSigningTimeoutMs, }?: import("@getpara/react-core/dist/chains/types.js").WalletSelector & {
30
+ prefix?: string;
31
+ messageSigningTimeoutMs?: number;
32
+ }) => import("@getpara/react-core/dist/chains/cosmos/useParaCosmjsProtoSigner.js").UseParaCosmjsProtoSignerReturn;
33
+ /**
34
+ * Returns a CosmJS `OfflineAminoSigner` for the user's Cosmos wallet.
35
+ * Supports both embedded Para wallets and external wallets.
36
+ *
37
+ * If the user has multiple Cosmos wallets, pass `address` or `walletId` to select one.
38
+ * When omitted, the active wallet from `useWalletState` is used automatically.
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * import { useParaCosmjsAminoSigner } from "@getpara/react-sdk";
43
+ *
44
+ * function SignAmino() {
45
+ * const { aminoSigner, isLoading } = useParaCosmjsAminoSigner();
46
+ *
47
+ * const handleSign = async () => {
48
+ * if (!aminoSigner) return;
49
+ * const result = await aminoSigner.signAmino(aminoSigner.address, signDoc);
50
+ * console.log(result);
51
+ * };
52
+ *
53
+ * if (isLoading) return <p>Loading...</p>;
54
+ * return <button onClick={handleSign}>Sign</button>;
55
+ * }
56
+ * ```
57
+ *
58
+ */
59
+ export declare const useParaCosmjsAminoSigner: ({ address, prefix, walletId, messageSigningTimeoutMs, }?: import("@getpara/react-core/dist/chains/types.js").WalletSelector & {
60
+ prefix?: string;
61
+ messageSigningTimeoutMs?: number;
62
+ }) => import("@getpara/react-core/dist/chains/cosmos/useParaCosmjsAminoSigner.js").UseParaCosmjsAminoSignerReturn;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import "../chunk-MMUBH76A.js";
3
+ import { createParaCosmjsProtoSignerHook, createParaCosmjsAminoSignerHook } from "@getpara/react-core/cosmos";
4
+ import { useGrazEnhancer } from "./useGrazEnhancer.js";
5
+ const useParaCosmjsProtoSigner = createParaCosmjsProtoSignerHook(useGrazEnhancer);
6
+ const useParaCosmjsAminoSigner = createParaCosmjsAminoSignerHook(useGrazEnhancer);
7
+ export {
8
+ useParaCosmjsAminoSigner,
9
+ useParaCosmjsProtoSigner
10
+ };
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Returns a viem `WalletClient` for the user's EVM wallet.
3
+ * Supports both embedded Para wallets and external wallets.
4
+ *
5
+ * If the user has multiple EVM wallets, pass `address` or `walletId` to select one.
6
+ * When omitted, the active wallet from `useWalletState` is used automatically.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { useParaViemClient } from "@getpara/react-sdk";
11
+ * import { sepolia } from "viem/chains";
12
+ * import { http } from "viem";
13
+ *
14
+ * function SignMessage() {
15
+ * const { viemClient, isLoading } = useParaViemClient({
16
+ * walletClientConfig: { chain: sepolia, transport: http() },
17
+ * });
18
+ *
19
+ * const handleSign = async () => {
20
+ * if (!viemClient) return;
21
+ * const signature = await viemClient.signMessage({ message: "Hello" });
22
+ * console.log(signature);
23
+ * };
24
+ *
25
+ * if (isLoading) return <p>Loading...</p>;
26
+ * return <button onClick={handleSign}>Sign Message</button>;
27
+ * }
28
+ * ```
29
+ *
30
+ */
31
+ export declare const useParaViemClient: (params: import("@getpara/react-core/dist/chains/types.js").WalletSelector & {
32
+ walletClientConfig: Omit<import("viem").WalletClientConfig, "account">;
33
+ }) => import("@getpara/react-core/dist/chains/evm/viem/useParaViemClient.js").UseParaViemClientReturn;
34
+ /**
35
+ * Returns a viem `LocalAccount` for the user's EVM wallet.
36
+ * Supports both embedded Para wallets and external wallets.
37
+ *
38
+ * If the user has multiple EVM wallets, pass `address` or `walletId` to select one.
39
+ * When omitted, the active wallet from `useWalletState` is used automatically.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * import { useParaViemAccount } from "@getpara/react-sdk";
44
+ *
45
+ * function WalletAddress() {
46
+ * const { viemAccount, isLoading } = useParaViemAccount();
47
+ * if (isLoading) return <p>Loading...</p>;
48
+ * return <p>{viemAccount?.address ?? "No wallet"}</p>;
49
+ * }
50
+ * ```
51
+ *
52
+ */
53
+ export declare const useParaViemAccount: ({ address, walletId }?: import("@getpara/react-core/dist/chains/types.js").WalletSelector) => import("@getpara/react-core/dist/chains/evm/viem/useParaViemAccount.js").UseParaViemAccountReturn;
54
+ /**
55
+ * Returns an ethers.js `Signer` for the user's EVM wallet.
56
+ * Supports both embedded Para wallets and external wallets (via wagmi → BrowserProvider).
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * import { useParaEthersSigner } from "@getpara/react-sdk";
61
+ * import { JsonRpcProvider } from "ethers";
62
+ *
63
+ * const provider = new JsonRpcProvider("https://ethereum-sepolia-rpc.publicnode.com");
64
+ *
65
+ * function SignWithEthers() {
66
+ * const { ethersSigner, isLoading } = useParaEthersSigner({ provider });
67
+ * // ethersSigner works with both embedded and external wallets
68
+ * }
69
+ * ```
70
+ */
71
+ export declare const useParaEthersSigner: ({ address, walletId, provider, messageSigningTimeoutMs, }?: import("@getpara/react-core/dist/chains/types.js").WalletSelector & {
72
+ provider?: unknown;
73
+ messageSigningTimeoutMs?: number;
74
+ }) => import("@getpara/react-core/dist/chains/evm/ethers/useParaEthersSigner.js").UseParaEthersSignerReturn;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import "../chunk-MMUBH76A.js";
3
+ import { createParaViemClientHook, createParaViemAccountHook } from "@getpara/react-core/evm/viem";
4
+ import { createParaEthersSignerHook } from "@getpara/react-core/evm/ethers";
5
+ import { useWagmiViemEnhancer } from "./useWagmiViemEnhancer.js";
6
+ import { useWagmiEthersEnhancer } from "./useWagmiEthersEnhancer.js";
7
+ const useParaViemClient = createParaViemClientHook(useWagmiViemEnhancer);
8
+ const useParaViemAccount = createParaViemAccountHook(useWagmiViemEnhancer);
9
+ const useParaEthersSigner = createParaEthersSignerHook(useWagmiEthersEnhancer);
10
+ export {
11
+ useParaEthersSigner,
12
+ useParaViemAccount,
13
+ useParaViemClient
14
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Returns a Solana signer for the user's Solana wallet.
3
+ * Supports both embedded Para wallets and external wallets.
4
+ *
5
+ * If the user has multiple Solana wallets, pass `address` or `walletId` to select one.
6
+ * When omitted, the active wallet from `useWalletState` is used automatically.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { useParaSolanaSigner } from "@getpara/react-sdk";
11
+ * import { createSolanaRpc } from "@solana/kit";
12
+ *
13
+ * const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
14
+ *
15
+ * function SignMessage() {
16
+ * const { solanaSigner, isLoading } = useParaSolanaSigner({ rpc });
17
+ *
18
+ * const handleSign = async () => {
19
+ * if (!solanaSigner) return;
20
+ * const message = new TextEncoder().encode("Hello");
21
+ * const [signatures] = await solanaSigner.signMessages([{ content: message, signatures: {} }]);
22
+ * console.log(signatures);
23
+ * };
24
+ *
25
+ * if (isLoading) return <p>Loading...</p>;
26
+ * return <button onClick={handleSign}>Sign Message</button>;
27
+ * }
28
+ * ```
29
+ *
30
+ */
31
+ export declare const useParaSolanaSigner: ({ address, walletId, rpc }: import("@getpara/react-core/dist/chains/types.js").WalletSelector & {
32
+ rpc: import("@getpara/solana-signers-v2-integration").ParaSignerParams["rpc"];
33
+ }) => import("@getpara/react-core/dist/chains/solana/useParaSolanaSigner.js").UseParaSolanaSignerReturn;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import "../chunk-MMUBH76A.js";
3
+ import { createParaSolanaSignerHook } from "@getpara/react-core/solana";
4
+ import { useSolanaWalletEnhancer } from "./useSolanaWalletEnhancer.js";
5
+ const useParaSolanaSigner = createParaSolanaSignerHook(useSolanaWalletEnhancer);
6
+ export {
7
+ useParaSolanaSigner
8
+ };
@@ -0,0 +1,2 @@
1
+ export { useParaStellarSigner, STELLAR_SIGNER_BASE_KEY, useParaStellarSignTransaction, STELLAR_SIGN_TRANSACTION_KEY, } from '@getpara/react-core/stellar';
2
+ export type { StellarEnhancement } from '@getpara/react-core/stellar';
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import "../chunk-MMUBH76A.js";
3
+ import {
4
+ useParaStellarSigner,
5
+ STELLAR_SIGNER_BASE_KEY,
6
+ useParaStellarSignTransaction,
7
+ STELLAR_SIGN_TRANSACTION_KEY
8
+ } from "@getpara/react-core/stellar";
9
+ export {
10
+ STELLAR_SIGNER_BASE_KEY,
11
+ STELLAR_SIGN_TRANSACTION_KEY,
12
+ useParaStellarSignTransaction,
13
+ useParaStellarSigner
14
+ };
@@ -0,0 +1,7 @@
1
+ import type { CosmosEnhancement } from '@getpara/react-core/cosmos';
2
+ /**
3
+ * Graz-based enhancer for Cosmos chain hooks (useParaCosmjsProtoSigner, useParaCosmjsAminoSigner).
4
+ * When an external Cosmos wallet is connected via graz/Keplr, provides the external wallet's
5
+ * offline signers so the chain hooks return them instead of creating a Para signer.
6
+ */
7
+ export declare function useGrazEnhancer(): CosmosEnhancement;
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import "../chunk-MMUBH76A.js";
3
+ import { useContext } from "react";
4
+ import { useStore } from "../provider/stores/useStore.js";
5
+ function useGrazEnhancer() {
6
+ var _a, _b;
7
+ const cosmosContext = useStore((state) => state.cosmosContext);
8
+ const ctxValue = useContext(cosmosContext);
9
+ const noopUseAccount = () => void 0;
10
+ const useCosmosAccount = (_a = ctxValue == null ? void 0 : ctxValue.useAccount) != null ? _a : noopUseAccount;
11
+ const account = useCosmosAccount();
12
+ const acct = account;
13
+ const isExternalConnected = !!(acct == null ? void 0 : acct.bech32Address);
14
+ const noopUseOfflineSigners = () => ({
15
+ data: void 0
16
+ });
17
+ const useOfflineSigners = (_b = ctxValue == null ? void 0 : ctxValue.useOfflineSigners) != null ? _b : noopUseOfflineSigners;
18
+ const { data: signersRecord } = useOfflineSigners();
19
+ const signers = signersRecord ? Object.values(signersRecord)[0] : void 0;
20
+ return {
21
+ protoSigner: isExternalConnected && signers ? signers.offlineSigner : null,
22
+ aminoSigner: isExternalConnected && signers ? signers.offlineSignerAmino : null,
23
+ isLoading: isExternalConnected && !signers
24
+ };
25
+ }
26
+ export {
27
+ useGrazEnhancer
28
+ };
@@ -0,0 +1,7 @@
1
+ import type { SolanaEnhancement } from '@getpara/react-core/solana';
2
+ /**
3
+ * Solana wallet adapter enhancer for Solana chain hooks (useParaSolanaSigner).
4
+ * When an external Solana wallet is connected (e.g. Phantom via wallet-adapter),
5
+ * provides a wrapped signer that implements the same interface as ParaSolanaSigner.
6
+ */
7
+ export declare function useSolanaWalletEnhancer(): SolanaEnhancement;
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../chunk-MMUBH76A.js";
5
+ import { useContext, useMemo } from "react";
6
+ import { useStore } from "../provider/stores/useStore.js";
7
+ function wrapWalletAdapter(wallet) {
8
+ const address = wallet.publicKey.toBase58();
9
+ return {
10
+ address,
11
+ // MessagePartialSigner
12
+ signMessages(messages) {
13
+ return __async(this, null, function* () {
14
+ const results = [];
15
+ for (const msg of messages) {
16
+ const sig = yield wallet.signMessage(msg.content);
17
+ results.push({ [address]: sig });
18
+ }
19
+ return results;
20
+ });
21
+ },
22
+ // TransactionPartialSigner
23
+ signTransactions(transactions, _config) {
24
+ return __async(this, null, function* () {
25
+ if (wallet.signAllTransactions) {
26
+ return wallet.signAllTransactions(transactions);
27
+ }
28
+ return Promise.all(transactions.map((tx) => wallet.signTransaction(tx)));
29
+ });
30
+ }
31
+ };
32
+ }
33
+ function useSolanaWalletEnhancer() {
34
+ var _a, _b;
35
+ const solanaContext = useStore((state) => state.solanaContext);
36
+ const ctxValue = useContext(solanaContext);
37
+ const noopUseWallet = () => void 0;
38
+ const useSolanaWallet = (_a = ctxValue == null ? void 0 : ctxValue.useWallet) != null ? _a : noopUseWallet;
39
+ const wallet = useSolanaWallet();
40
+ const w = wallet;
41
+ const isExternalConnected = !!(w == null ? void 0 : w.connected) && !!(w == null ? void 0 : w.publicKey);
42
+ const wrappedSigner = useMemo(
43
+ () => isExternalConnected ? wrapWalletAdapter(wallet) : null,
44
+ [isExternalConnected, (_b = w == null ? void 0 : w.publicKey) == null ? void 0 : _b.toBase58()]
45
+ );
46
+ return {
47
+ signer: wrappedSigner,
48
+ isLoading: false
49
+ };
50
+ }
51
+ export {
52
+ useSolanaWalletEnhancer
53
+ };
@@ -0,0 +1,7 @@
1
+ import type { EthersEnhancement } from '@getpara/react-core/evm/ethers';
2
+ /**
3
+ * Wagmi-based enhancer for the ethers chain hooks (useParaEthersSigner).
4
+ * When an external EVM wallet is connected via wagmi, converts the wagmi
5
+ * walletClient into an ethers Signer via BrowserProvider.
6
+ */
7
+ export declare function useWagmiEthersEnhancer(): EthersEnhancement;
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../chunk-MMUBH76A.js";
5
+ import { useCallback, useContext, useEffect, useState } from "react";
6
+ import { useStore } from "../provider/stores/useStore.js";
7
+ import { getWagmiConfig } from "@getpara/evm-wallet-connectors";
8
+ function walletClientToSigner(walletClient) {
9
+ return __async(this, null, function* () {
10
+ const { BrowserProvider } = yield import("ethers");
11
+ const provider = new BrowserProvider(walletClient.transport);
12
+ return provider.getSigner();
13
+ });
14
+ }
15
+ function useWagmiEthersEnhancer() {
16
+ var _a, _b;
17
+ const evmContext = useStore((state) => state.evmContext);
18
+ const evmCtxValue = useContext(evmContext);
19
+ const noopUseAccount = () => void 0;
20
+ const noopUseWalletClient = () => ({
21
+ data: void 0,
22
+ isLoading: false
23
+ });
24
+ const useEvmAccount = (_a = evmCtxValue == null ? void 0 : evmCtxValue.useAccount) != null ? _a : noopUseAccount;
25
+ const useEvmWalletClient = (_b = evmCtxValue == null ? void 0 : evmCtxValue.useWalletClient) != null ? _b : noopUseWalletClient;
26
+ const evmAccount = useEvmAccount();
27
+ const { data: evmWalletClient, isLoading: isWalletClientLoading } = useEvmWalletClient();
28
+ const externalAddress = evmAccount == null ? void 0 : evmAccount.address;
29
+ const isExternalConnected = !!externalAddress;
30
+ const [signer, setSigner] = useState(null);
31
+ const [isConverting, setIsConverting] = useState(false);
32
+ useEffect(() => {
33
+ if (!isExternalConnected || !evmWalletClient) {
34
+ setSigner(null);
35
+ return;
36
+ }
37
+ setIsConverting(true);
38
+ walletClientToSigner(evmWalletClient).then(setSigner).catch(() => setSigner(null)).finally(() => setIsConverting(false));
39
+ }, [isExternalConnected, evmWalletClient]);
40
+ const getSignerForAddress = useCallback((address) => __async(this, null, function* () {
41
+ try {
42
+ const config = getWagmiConfig();
43
+ if (!config) return null;
44
+ const { getConnectorClient } = yield import("@wagmi/core");
45
+ for (const connection of config.state.connections.values()) {
46
+ if (connection.accounts.some((a) => a.toLowerCase() === address.toLowerCase())) {
47
+ const client = yield getConnectorClient(config, {
48
+ connector: connection.connector,
49
+ account: address
50
+ });
51
+ return walletClientToSigner(client);
52
+ }
53
+ }
54
+ return null;
55
+ } catch (e) {
56
+ return null;
57
+ }
58
+ }), []);
59
+ return {
60
+ signer: isExternalConnected ? signer : null,
61
+ isLoading: isExternalConnected && (isWalletClientLoading || isConverting),
62
+ getSignerForAddress
63
+ };
64
+ }
65
+ export {
66
+ useWagmiEthersEnhancer
67
+ };
@@ -0,0 +1,7 @@
1
+ import type { ViemEnhancement } from '@getpara/react-core/evm/viem';
2
+ /**
3
+ * Wagmi-based enhancer for the chain hooks (useParaViemClient, useParaViemAccount).
4
+ * When an external EVM wallet is connected via wagmi, provides the walletClient
5
+ * so the viem hooks use it directly instead of creating a Para-backed client.
6
+ */
7
+ export declare function useWagmiViemEnhancer(): ViemEnhancement;
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../chunk-MMUBH76A.js";
5
+ import { useCallback, useContext } from "react";
6
+ import { useStore } from "../provider/stores/useStore.js";
7
+ import { getWagmiConfig } from "@getpara/evm-wallet-connectors";
8
+ import { createWalletClient, custom } from "viem";
9
+ function useWagmiViemEnhancer() {
10
+ var _a, _b;
11
+ const evmContext = useStore((state) => state.evmContext);
12
+ const evmCtxValue = useContext(evmContext);
13
+ const noopUseAccount = () => void 0;
14
+ const noopUseWalletClient = () => ({
15
+ data: void 0,
16
+ isLoading: false
17
+ });
18
+ const useEvmAccount = (_a = evmCtxValue == null ? void 0 : evmCtxValue.useAccount) != null ? _a : noopUseAccount;
19
+ const useEvmWalletClient = (_b = evmCtxValue == null ? void 0 : evmCtxValue.useWalletClient) != null ? _b : noopUseWalletClient;
20
+ const evmAccount = useEvmAccount();
21
+ const { data: evmWalletClient, isLoading: isWalletClientLoading } = useEvmWalletClient();
22
+ const externalAddress = evmAccount == null ? void 0 : evmAccount.address;
23
+ const isExternalConnected = !!externalAddress;
24
+ const getWalletClientForAddress = useCallback((address) => __async(this, null, function* () {
25
+ try {
26
+ const config = getWagmiConfig();
27
+ if (!config) return null;
28
+ const { getConnectorClient } = yield import("@wagmi/core");
29
+ for (const connection of config.state.connections.values()) {
30
+ if (connection.accounts.some((a) => a.toLowerCase() === address.toLowerCase())) {
31
+ const connectorClient = yield getConnectorClient(config, {
32
+ connector: connection.connector,
33
+ account: address
34
+ });
35
+ return createWalletClient({
36
+ account: connectorClient.account,
37
+ chain: connectorClient.chain,
38
+ transport: custom(connectorClient.transport)
39
+ });
40
+ }
41
+ }
42
+ return null;
43
+ } catch (e) {
44
+ return null;
45
+ }
46
+ }), []);
47
+ return {
48
+ address: isExternalConnected ? externalAddress : void 0,
49
+ walletClient: isExternalConnected ? evmWalletClient : null,
50
+ isLoading: isExternalConnected && isWalletClientLoading,
51
+ getWalletClientForAddress
52
+ };
53
+ }
54
+ export {
55
+ useWagmiViemEnhancer
56
+ };
@@ -99,7 +99,7 @@ const ParaModal = forwardRef((props, ref) => {
99
99
  onClose,
100
100
  defaultAuthIdentifier
101
101
  }), rest),
102
- reactSdkVersion: "2.21.0"
102
+ reactSdkVersion: "2.22.0"
103
103
  });
104
104
  } catch (e) {
105
105
  }
@@ -11,6 +11,8 @@ import { useCopyToClipboard } from "@getpara/react-common";
11
11
  import { isMobile, isTablet } from "@getpara/web-sdk";
12
12
  import { isSolanaWalletInAppBrowser, useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
13
13
  import { useStore } from "../../../../provider/stores/useStore.js";
14
+ const IN_APP_BROWSER_POLL_INTERVAL = 200;
15
+ const IN_APP_BROWSER_POLL_MAX_WAIT = 3e3;
14
16
  const ExternalWalletMobileConnect = ({
15
17
  wallet,
16
18
  onConnectWc,
@@ -24,13 +26,21 @@ const ExternalWalletMobileConnect = ({
24
26
  const { qrUri } = useExternalWallets();
25
27
  const [isInAppBrowser, setIsInAppBrowser] = useState(() => !!isSolanaWalletInAppBrowser(wallet.internalId));
26
28
  useEffect(() => {
27
- setIsInAppBrowser(!!isSolanaWalletInAppBrowser(wallet.internalId));
28
- const timer = setTimeout(() => {
29
+ if (isSolanaWalletInAppBrowser(wallet.internalId)) {
30
+ setIsInAppBrowser(true);
31
+ return;
32
+ }
33
+ let elapsed = 0;
34
+ const timer = setInterval(() => {
35
+ elapsed += IN_APP_BROWSER_POLL_INTERVAL;
29
36
  if (isSolanaWalletInAppBrowser(wallet.internalId)) {
30
37
  setIsInAppBrowser(true);
38
+ clearInterval(timer);
39
+ } else if (elapsed >= IN_APP_BROWSER_POLL_MAX_WAIT) {
40
+ clearInterval(timer);
31
41
  }
32
- }, 500);
33
- return () => clearTimeout(timer);
42
+ }, IN_APP_BROWSER_POLL_INTERVAL);
43
+ return () => clearInterval(timer);
34
44
  }, [wallet.internalId]);
35
45
  const handleCopy = () => {
36
46
  if (qrUri) {
@@ -18,122 +18,129 @@ import { AccountLinkProvider } from "./providers/AccountLinkProvider.js";
18
18
  import { AssetsProvider } from "./providers/AssetsProvider.js";
19
19
  import { AuthProvider } from "./providers/AuthProvider/AuthProvider.js";
20
20
  const coreStoreRef = storeInstance;
21
- const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, config, externalWalletConfig, paraModalConfig }, ref) => {
22
- var _a;
23
- useEventListeners(callbacks);
24
- useAutoSessionKeepAlive({ disabled: config.disableAutoSessionKeepAlive });
25
- const setModalError = useStore((state) => state.setModalError);
26
- const paraClient = useMemo(() => {
27
- if (isParaWeb(paraClientConfig)) return paraClientConfig;
28
- if (isConfigType(paraClientConfig)) {
29
- return {
30
- apiKey: paraClientConfig.apiKey,
31
- env: paraClientConfig.env,
32
- opts: paraClientConfig.opts,
33
- createClient: (apiKey, env, opts) => env ? new ParaWeb(env, apiKey, opts) : new ParaWeb(apiKey, opts)
34
- };
35
- }
36
- throw new Error("Invalid Para config");
37
- }, [paraClientConfig]);
38
- const configureClient = useCallback(
39
- (client2) => {
40
- client2.setModalError = setModalError;
41
- if (typeof globalThis !== "undefined" && globalThis.__PARA_PORTAL_URL_OVERRIDE__) {
42
- client2.ctx.portalUrlOverride = globalThis.__PARA_PORTAL_URL_OVERRIDE__;
21
+ const ParaProviderMin = forwardRef(
22
+ ({ children, paraClientConfig, callbacks, config, externalWalletConfig, paraModalConfig, waitForReady, fallback }, ref) => {
23
+ var _a;
24
+ useEventListeners(callbacks);
25
+ useAutoSessionKeepAlive({ disabled: config.disableAutoSessionKeepAlive });
26
+ const setModalError = useStore((state) => state.setModalError);
27
+ const paraClient = useMemo(() => {
28
+ if (isParaWeb(paraClientConfig)) return paraClientConfig;
29
+ if (isConfigType(paraClientConfig)) {
30
+ return {
31
+ apiKey: paraClientConfig.apiKey,
32
+ env: paraClientConfig.env,
33
+ opts: paraClientConfig.opts,
34
+ createClient: (apiKey, env, opts) => env ? new ParaWeb(env, apiKey, opts) : new ParaWeb(apiKey, opts)
35
+ };
43
36
  }
44
- client2.portalTheme = paraModalConfig == null ? void 0 : paraModalConfig.theme;
45
- },
46
- [setModalError, paraModalConfig == null ? void 0 : paraModalConfig.theme]
47
- );
48
- const client = useStore((state) => state.client);
49
- useEffect(() => {
50
- if (client) {
51
- client.portalTheme = paraModalConfig == null ? void 0 : paraModalConfig.theme;
52
- }
53
- }, [paraModalConfig == null ? void 0 : paraModalConfig.theme, client]);
54
- const setExternalWallets = useStore((state) => state.setExternalWallets);
55
- const externalWallets = useStore((state) => state.externalWallets);
56
- const setExternalWalletsWithFullAuth = useStore((state) => state.setExternalWalletsWithFullAuth);
57
- const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
58
- const setIncludeWalletVerification = useStore((state) => state.setIncludeWalletVerification);
59
- const includeWalletVerification = useStore((state) => state.includeWalletVerification);
60
- const setConnectionOnly = useStore((state) => state.setConnectionOnly);
61
- const connectionOnly = useStore((state) => state.connectionOnly);
62
- const setModalConfig = useStore((state) => state.setModalConfig);
63
- const modalConfig = useStore((state) => state.modalConfig);
64
- const setProviderProps = useStore((state) => state.setProviderProps);
65
- const paraState = useStore((state) => state.paraState);
66
- useEffect(() => {
67
- setProviderProps(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, config), externalWalletConfig), paraModalConfig), {
68
- walletConnect: void 0
69
- }));
70
- }, [config, externalWalletConfig, paraModalConfig]);
71
- useEffect(() => {
72
- if (modalConfig !== paraModalConfig) setModalConfig(paraModalConfig);
73
- }, [paraModalConfig]);
74
- useEffect(() => {
75
- var _a2;
76
- if (connectionOnly !== (externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly)) {
77
- setConnectionOnly((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) != null ? _a2 : false);
78
- }
79
- }, [externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly]);
80
- useEffect(() => {
81
- var _a2, _b;
82
- if (includeWalletVerification !== (externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification)) {
83
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
84
- console.warn("includeWalletVerification has no effect when using connection only external wallets");
85
- setIncludeWalletVerification(false);
86
- } else {
87
- setIncludeWalletVerification((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification) != null ? _b : false);
37
+ throw new Error("Invalid Para config");
38
+ }, [paraClientConfig]);
39
+ const configureClient = useCallback(
40
+ (client2) => {
41
+ client2.setModalError = setModalError;
42
+ if (typeof globalThis !== "undefined" && globalThis.__PARA_PORTAL_URL_OVERRIDE__) {
43
+ client2.ctx.portalUrlOverride = globalThis.__PARA_PORTAL_URL_OVERRIDE__;
44
+ }
45
+ client2.portalTheme = paraModalConfig == null ? void 0 : paraModalConfig.theme;
46
+ },
47
+ [setModalError, paraModalConfig == null ? void 0 : paraModalConfig.theme]
48
+ );
49
+ const client = useStore((state) => state.client);
50
+ useEffect(() => {
51
+ if (client) {
52
+ client.portalTheme = paraModalConfig == null ? void 0 : paraModalConfig.theme;
53
+ }
54
+ }, [paraModalConfig == null ? void 0 : paraModalConfig.theme, client]);
55
+ const setExternalWallets = useStore((state) => state.setExternalWallets);
56
+ const externalWallets = useStore((state) => state.externalWallets);
57
+ const setExternalWalletsWithFullAuth = useStore((state) => state.setExternalWalletsWithFullAuth);
58
+ const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
59
+ const setIncludeWalletVerification = useStore((state) => state.setIncludeWalletVerification);
60
+ const includeWalletVerification = useStore((state) => state.includeWalletVerification);
61
+ const setConnectionOnly = useStore((state) => state.setConnectionOnly);
62
+ const connectionOnly = useStore((state) => state.connectionOnly);
63
+ const setModalConfig = useStore((state) => state.setModalConfig);
64
+ const modalConfig = useStore((state) => state.modalConfig);
65
+ const setProviderProps = useStore((state) => state.setProviderProps);
66
+ const paraState = useStore((state) => state.paraState);
67
+ useEffect(() => {
68
+ setProviderProps(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, config), externalWalletConfig), paraModalConfig), {
69
+ walletConnect: void 0
70
+ }));
71
+ }, [config, externalWalletConfig, paraModalConfig]);
72
+ useEffect(() => {
73
+ if (modalConfig !== paraModalConfig) setModalConfig(paraModalConfig);
74
+ }, [paraModalConfig]);
75
+ useEffect(() => {
76
+ var _a2;
77
+ if (connectionOnly !== (externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly)) {
78
+ setConnectionOnly((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) != null ? _a2 : false);
79
+ }
80
+ }, [externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly]);
81
+ useEffect(() => {
82
+ var _a2, _b;
83
+ if (includeWalletVerification !== (externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification)) {
84
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
85
+ console.warn("includeWalletVerification has no effect when using connection only external wallets");
86
+ setIncludeWalletVerification(false);
87
+ } else {
88
+ setIncludeWalletVerification((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification) != null ? _b : false);
89
+ }
88
90
  }
89
- }
90
- }, [externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification]);
91
- useEffect(() => {
92
- var _a2;
93
- if (externalWallets !== (externalWalletConfig == null ? void 0 : externalWalletConfig.wallets)) {
94
- setExternalWallets((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a2 : [...EXTERNAL_WALLET_TYPES]);
95
- }
96
- }, [externalWalletConfig == null ? void 0 : externalWalletConfig.wallets]);
97
- useEffect(() => {
98
- var _a2, _b;
99
- if (externalWalletsWithFullAuth !== (externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets)) {
100
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
101
- console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
102
- setExternalWalletsWithFullAuth([]);
103
- } else {
104
- setExternalWalletsWithFullAuth((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) != null ? _b : []);
91
+ }, [externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification]);
92
+ useEffect(() => {
93
+ var _a2;
94
+ if (externalWallets !== (externalWalletConfig == null ? void 0 : externalWalletConfig.wallets)) {
95
+ setExternalWallets((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a2 : [...EXTERNAL_WALLET_TYPES]);
105
96
  }
106
- }
107
- }, [externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets]);
108
- const isReady = (_a = paraState == null ? void 0 : paraState.isReady) != null ? _a : false;
109
- const ChildrenComponents = useMemo(() => {
110
- if (!isReady) {
111
- return null;
112
- }
113
- return /* @__PURE__ */ jsxs(Fragment, { children: [
114
- children,
115
- !config.disableEmbeddedModal && /* @__PURE__ */ jsx(ParaModal, { ref })
116
- ] });
117
- }, [isReady, children, config.disableEmbeddedModal, ref]);
118
- return /* @__PURE__ */ jsx(
119
- ParaProviderCore,
120
- {
121
- paraClientConfig: paraClient,
122
- config,
123
- configureClient,
124
- store: coreStoreRef,
125
- waitForReady: false,
126
- children: /* @__PURE__ */ jsx(
127
- AuthProvider,
128
- {
129
- isTwoFactorAuthEnabled: paraModalConfig == null ? void 0 : paraModalConfig.twoFactorAuthEnabled,
130
- defaultAuthIdentifier: paraModalConfig == null ? void 0 : paraModalConfig.defaultAuthIdentifier,
131
- children: /* @__PURE__ */ jsx(AssetsProvider, { children: /* @__PURE__ */ jsx(ExternalWalletWrapper, { config: externalWalletConfig, children: /* @__PURE__ */ jsx(AccountLinkProvider, { children: ChildrenComponents }) }) })
97
+ }, [externalWalletConfig == null ? void 0 : externalWalletConfig.wallets]);
98
+ useEffect(() => {
99
+ var _a2, _b;
100
+ if (externalWalletsWithFullAuth !== (externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets)) {
101
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
102
+ console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
103
+ setExternalWalletsWithFullAuth([]);
104
+ } else {
105
+ setExternalWalletsWithFullAuth((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) != null ? _b : []);
132
106
  }
133
- )
134
- }
135
- );
136
- });
107
+ }
108
+ }, [externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets]);
109
+ const isReady = (_a = paraState == null ? void 0 : paraState.isReady) != null ? _a : false;
110
+ const shouldWait = waitForReady !== false;
111
+ const ChildrenComponents = useMemo(() => {
112
+ if (shouldWait && !isReady) {
113
+ if (!!(paraState == null ? void 0 : paraState.error)) {
114
+ return children || null;
115
+ }
116
+ return fallback != null ? fallback : null;
117
+ }
118
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
119
+ children,
120
+ !config.disableEmbeddedModal && isReady && /* @__PURE__ */ jsx(ParaModal, { ref })
121
+ ] });
122
+ }, [shouldWait, isReady, paraState == null ? void 0 : paraState.error, fallback, children, config.disableEmbeddedModal, ref]);
123
+ return /* @__PURE__ */ jsx(
124
+ ParaProviderCore,
125
+ {
126
+ paraClientConfig: paraClient,
127
+ config,
128
+ configureClient,
129
+ store: coreStoreRef,
130
+ waitForReady: false,
131
+ fallback,
132
+ children: /* @__PURE__ */ jsx(
133
+ AuthProvider,
134
+ {
135
+ isTwoFactorAuthEnabled: paraModalConfig == null ? void 0 : paraModalConfig.twoFactorAuthEnabled,
136
+ defaultAuthIdentifier: paraModalConfig == null ? void 0 : paraModalConfig.defaultAuthIdentifier,
137
+ children: /* @__PURE__ */ jsx(AssetsProvider, { children: /* @__PURE__ */ jsx(ExternalWalletWrapper, { config: externalWalletConfig, children: /* @__PURE__ */ jsx(AccountLinkProvider, { children: ChildrenComponents }) }) })
138
+ }
139
+ )
140
+ }
141
+ );
142
+ }
143
+ );
137
144
  export {
138
145
  ParaProviderMin
139
146
  };
@@ -18,10 +18,10 @@ export declare const ADD_CREDENTIAL_KEY = "ADD_CREDENTIAL";
18
18
  export declare const useAddAuthMethod: ({ openPopup }?: {
19
19
  openPopup: boolean;
20
20
  }) => {
21
- error: Error | null;
22
21
  isSuccess: boolean;
23
22
  data: string | undefined;
24
23
  variables: void | AddCredentialParams | undefined;
24
+ error: Error | null;
25
25
  isError: boolean;
26
26
  isIdle: boolean;
27
27
  isPending: boolean;
@@ -11,10 +11,10 @@ export declare const EXPORT_PRIVATE_KEY_KEY = "EXPORT_PRIVATE_KEY";
11
11
  * await exportPrivateKeyAsync({ walletId: '...' });
12
12
  */
13
13
  export declare const useExportPrivateKey: () => {
14
- error: Error | null;
15
14
  isSuccess: boolean;
16
15
  data: ExportPrivateKeyResponse | undefined;
17
16
  variables: ExportPrivateKeyParams;
17
+ error: Error | null;
18
18
  isError: boolean;
19
19
  isIdle: boolean;
20
20
  isPending: boolean;
@@ -15,10 +15,10 @@ export declare const SWITCH_WALLETS_KEY = "SWITCH_WALLETS";
15
15
  * await switchWalletsAsync({ authMethod: 'PASSKEY' });
16
16
  */
17
17
  export declare const useSwitchWallets: () => {
18
- error: Error | null;
19
18
  isSuccess: boolean;
20
19
  data: WaitForLoginResponse | undefined;
21
20
  variables: void | WaitForLoginParams | undefined;
21
+ error: Error | null;
22
22
  isError: boolean;
23
23
  isIdle: boolean;
24
24
  isPending: boolean;
@@ -15,10 +15,10 @@ export declare const VERIFY_NEW_ACCOUNT_KEY = "VERIFY_NEW_ACCOUNT";
15
15
  * await verifyNewAccountAsync({ ...params });
16
16
  */
17
17
  export declare const useVerifyNewAccount: () => {
18
- error: Error | null;
19
18
  isSuccess: boolean;
20
19
  data: import("@getpara/web-sdk").AuthStateSignup | undefined;
21
20
  variables: VerifyNewAccountParams | undefined;
21
+ error: Error | null;
22
22
  isError: boolean;
23
23
  isIdle: boolean;
24
24
  isPending: boolean;
@@ -1,47 +1,26 @@
1
1
  import { ParaWagmiProviderProps } from '@getpara/evm-wallet-connectors';
2
- import ParaWeb, { AccountCreationEvent, AccountSetupEvent, ConstructorOpts, Environment, ExternalWalletChangeEvent, LoginEvent, LogoutEvent, PregenWalletClaimedEvent, SignMessageEvent, SignTransactionEvent, WalletCreatedEvent, WalletsChangeEvent, GuestWalletsCreatedEvent } from '@getpara/web-sdk';
3
- import { PropsWithChildren } from 'react';
2
+ import ParaWeb, { ExternalWalletChangeEvent, PregenWalletClaimedEvent, GuestWalletsCreatedEvent } from '@getpara/web-sdk';
4
3
  import { Chain, Transport } from 'viem';
5
4
  import { ParaModalProps } from '../../modal/index.js';
6
5
  import { ParaGrazProviderProps } from '@getpara/cosmos-wallet-connectors';
7
6
  import { ParaCosmosProviderConfigNoWallets, ParaEvmProviderConfigNoWallets, ParaSolanaProviderConfigNoWallets } from './externalWalletProviders.js';
8
7
  import { type TExternalWallet } from '@getpara/react-common';
9
- import { FarcasterMiniAppConfig } from '../stores/types.js';
10
- export type Callbacks = {
11
- onLogout?: (event: LogoutEvent) => void;
12
- onLogin?: (event: LoginEvent) => void;
13
- onAccountSetup?: (event: AccountSetupEvent) => void;
14
- onAccountCreation?: (event: AccountCreationEvent) => void;
15
- onSignMessage?: (event: SignMessageEvent) => void;
16
- onSignTransaction?: (event: SignTransactionEvent) => void;
8
+ import type { ParaProviderBaseProps, CoreProviderConfig, CoreCallbacks } from '@getpara/react-core/internal';
9
+ export interface Callbacks extends CoreCallbacks {
17
10
  onExternalWalletChange?: (event: ExternalWalletChangeEvent) => void;
18
- onWalletsChange?: (event: WalletsChangeEvent) => void;
19
- onWalletCreated?: (event: WalletCreatedEvent) => void;
20
11
  onPregenWalletClaimed?: (event: PregenWalletClaimedEvent) => void;
21
12
  onGuestWalletsCreated?: (event: GuestWalletsCreatedEvent) => void;
22
- };
23
- export type ParaProviderConfig = {
24
- /**
25
- * The name of your app, used throughout the modal and any configured external wallets.
26
- */
27
- appName: string;
13
+ }
14
+ export interface ParaProviderConfig extends CoreProviderConfig {
28
15
  /**
29
16
  * Disables the automatic session keep alive that's provided by ParaProvider.
30
17
  */
31
18
  disableAutoSessionKeepAlive?: boolean;
32
19
  /**
33
- * Disables the ParaModal that's provided by ParaProvider. Use this is you're providing a separate modal in another location in your app.
20
+ * Disables the ParaModal that's provided by ParaProvider. Use this if you're providing a separate modal in another location in your app.
34
21
  */
35
22
  disableEmbeddedModal?: boolean;
36
- /**
37
- * RPC url to use for retrieving the embedded wallet balance
38
- */
39
- rpcUrl?: string;
40
- /**
41
- * Configuration options for Farcaster mini-apps.
42
- */
43
- farcasterMiniAppConfig?: FarcasterMiniAppConfig;
44
- };
23
+ }
45
24
  export type ExternalWalletConfig<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> = {
46
25
  /**
47
26
  * A description of your app, displayed in some external wallets.
@@ -130,35 +109,11 @@ export type ExternalWalletConfig<chains extends readonly [Chain, ...Chain[]], tr
130
109
  */
131
110
  connectionOnly?: boolean;
132
111
  };
133
- export interface ParaProviderProps<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> extends PropsWithChildren {
134
- /**
135
- * Arguments to setup a new Para instance, or a Para instance you have already instantiated.
136
- */
137
- paraClientConfig: {
138
- /**
139
- * Environment for your Para instance.
140
- */
141
- env?: Environment;
142
- /**
143
- * API key for you Para instance.
144
- *
145
- * NOTE: Be sure this key matches the environment.
146
- */
147
- apiKey: string;
148
- opts?: ConstructorOpts;
149
- } | ParaWeb;
112
+ export interface ParaProviderProps<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> extends ParaProviderBaseProps<ParaWeb, ParaProviderConfig, Callbacks> {
150
113
  /**
151
114
  * Configuration used for the Para modal.
152
115
  */
153
116
  paraModalConfig?: ParaModalProps;
154
- /**
155
- * Callbacks fired for events from the Para instance.
156
- */
157
- callbacks?: Callbacks;
158
- /**
159
- * Config for the ParaProvider.
160
- */
161
- config: ParaProviderConfig;
162
117
  /**
163
118
  * Config for any external wallets.
164
119
  */
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.21.0",
9
- "@getpara/react-components": "2.21.0",
10
- "@getpara/react-core": "2.21.0",
11
- "@getpara/web-sdk": "2.21.0",
8
+ "@getpara/react-common": "2.22.0",
9
+ "@getpara/react-components": "2.22.0",
10
+ "@getpara/react-core": "2.22.0",
11
+ "@getpara/web-sdk": "2.22.0",
12
12
  "date-fns": "^3.6.0",
13
13
  "detect-browser": "^5.3.0",
14
14
  "framer-motion": "^11.3.31",
@@ -19,19 +19,19 @@
19
19
  "zustand-sync-tabs": "^0.2.2"
20
20
  },
21
21
  "devDependencies": {
22
- "@getpara/aa-alchemy": "2.21.0",
23
- "@getpara/aa-biconomy": "2.21.0",
24
- "@getpara/aa-cdp": "2.21.0",
25
- "@getpara/aa-gelato": "2.21.0",
26
- "@getpara/aa-pimlico": "2.21.0",
27
- "@getpara/aa-porto": "2.21.0",
28
- "@getpara/aa-rhinestone": "2.21.0",
29
- "@getpara/aa-safe": "2.21.0",
30
- "@getpara/aa-thirdweb": "2.21.0",
31
- "@getpara/aa-zerodev": "2.21.0",
32
- "@getpara/cosmos-wallet-connectors": "2.21.0",
33
- "@getpara/evm-wallet-connectors": "2.21.0",
34
- "@getpara/solana-wallet-connectors": "2.21.0",
22
+ "@getpara/aa-alchemy": "2.22.0",
23
+ "@getpara/aa-biconomy": "2.22.0",
24
+ "@getpara/aa-cdp": "2.22.0",
25
+ "@getpara/aa-gelato": "2.22.0",
26
+ "@getpara/aa-pimlico": "2.22.0",
27
+ "@getpara/aa-porto": "2.22.0",
28
+ "@getpara/aa-rhinestone": "2.22.0",
29
+ "@getpara/aa-safe": "2.22.0",
30
+ "@getpara/aa-thirdweb": "2.22.0",
31
+ "@getpara/aa-zerodev": "2.22.0",
32
+ "@getpara/cosmos-wallet-connectors": "2.22.0",
33
+ "@getpara/evm-wallet-connectors": "2.22.0",
34
+ "@getpara/solana-wallet-connectors": "2.22.0",
35
35
  "@tanstack/react-query": "^5.74.0",
36
36
  "@testing-library/dom": "^10.4.0",
37
37
  "@testing-library/react": "^16.3.0",
@@ -44,15 +44,47 @@
44
44
  },
45
45
  "exports": {
46
46
  ".": "./dist/index.js",
47
- "./styles.css": "./dist/css/modal.css"
47
+ "./styles.css": "./dist/css/modal.css",
48
+ "./chains/evm": {
49
+ "types": "./dist/chains/evm.d.ts",
50
+ "import": "./dist/chains/evm.js"
51
+ },
52
+ "./chains/cosmos": {
53
+ "types": "./dist/chains/cosmos.d.ts",
54
+ "import": "./dist/chains/cosmos.js"
55
+ },
56
+ "./chains/solana": {
57
+ "types": "./dist/chains/solana.d.ts",
58
+ "import": "./dist/chains/solana.js"
59
+ },
60
+ "./chains/stellar": {
61
+ "types": "./dist/chains/stellar.d.ts",
62
+ "import": "./dist/chains/stellar.js"
63
+ }
48
64
  },
49
65
  "files": [
50
66
  "dist",
51
67
  "package.json",
52
68
  "styles.css"
53
69
  ],
54
- "gitHead": "61f68bb1344dcec458f9016db39f631bb630b8f4",
70
+ "gitHead": "7191b8c823ec592eb1da16c9a085f8e69c6bf377",
55
71
  "main": "dist/index.js",
72
+ "typesVersions": {
73
+ "*": {
74
+ "chains/evm": [
75
+ "./dist/chains/evm.d.ts"
76
+ ],
77
+ "chains/cosmos": [
78
+ "./dist/chains/cosmos.d.ts"
79
+ ],
80
+ "chains/solana": [
81
+ "./dist/chains/solana.d.ts"
82
+ ],
83
+ "chains/stellar": [
84
+ "./dist/chains/stellar.d.ts"
85
+ ]
86
+ }
87
+ },
56
88
  "peerDependencies": {
57
89
  "@getpara/aa-alchemy": ">=2.15.0",
58
90
  "@getpara/aa-biconomy": ">=2.15.0",