@getpara/react-sdk 2.0.0-alpha.33 → 2.0.0-alpha.35

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 (42) hide show
  1. package/dist/{chunk-3GWWZKX7.js → chunk-MMUBH76A.js} +22 -1
  2. package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
  3. package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
  4. package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
  5. package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
  6. package/dist/cosmos/actions/index.d.ts +2 -0
  7. package/dist/cosmos/actions/index.js +3 -0
  8. package/dist/cosmos/hooks/index.d.ts +2 -0
  9. package/dist/cosmos/hooks/index.js +3 -0
  10. package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
  11. package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
  12. package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
  13. package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
  14. package/dist/cosmos/index.d.ts +2 -0
  15. package/dist/cosmos/index.js +3 -0
  16. package/dist/evm/actions/getViemAccount.d.ts +22 -0
  17. package/dist/evm/actions/getViemAccount.js +20 -0
  18. package/dist/evm/actions/getViemClient.d.ts +7659 -0
  19. package/dist/evm/actions/getViemClient.js +25 -0
  20. package/dist/evm/actions/index.d.ts +2 -0
  21. package/dist/evm/actions/index.js +3 -0
  22. package/dist/evm/hooks/index.d.ts +2 -0
  23. package/dist/evm/hooks/index.js +3 -0
  24. package/dist/evm/hooks/useViemAccount.d.ts +26 -0
  25. package/dist/evm/hooks/useViemAccount.js +32 -0
  26. package/dist/evm/hooks/useViemClient.d.ts +7663 -0
  27. package/dist/evm/hooks/useViemClient.js +30 -0
  28. package/dist/evm/index.d.ts +2 -0
  29. package/dist/evm/index.js +3 -0
  30. package/dist/index.js +1 -1
  31. package/dist/provider/ParaProvider.js +1 -1
  32. package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
  33. package/dist/solana/actions/getSolanaSigner.js +15 -0
  34. package/dist/solana/actions/index.d.ts +1 -0
  35. package/dist/solana/actions/index.js +2 -0
  36. package/dist/solana/hooks/index.d.ts +1 -0
  37. package/dist/solana/hooks/index.js +2 -0
  38. package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
  39. package/dist/solana/hooks/useSolanaSigner.js +32 -0
  40. package/dist/solana/index.d.ts +2 -0
  41. package/dist/solana/index.js +3 -0
  42. package/package.json +19 -7
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ export * from './hooks/index.js';
2
+ export * from './actions/index.js';
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export * from "./hooks/index.js";
3
+ export * from "./actions/index.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-3GWWZKX7.js";
2
+ import "./chunk-MMUBH76A.js";
3
3
  export * from "@getpara/react-sdk-lite";
4
4
  import ParaWeb from "@getpara/react-sdk-lite";
5
5
  var src_default = ParaWeb;
@@ -3,7 +3,7 @@ import {
3
3
  __objRest,
4
4
  __spreadProps,
5
5
  __spreadValues
6
- } from "../chunk-3GWWZKX7.js";
6
+ } from "../chunk-MMUBH76A.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { ParaProvider as ParaProviderMin } from "@getpara/react-sdk-lite";
9
9
  import { forwardRef } from "react";
@@ -0,0 +1,8 @@
1
+ import ParaWeb from '@getpara/react-sdk-lite';
2
+ import { SolanaRpcApi } from '@solana/rpc-api';
3
+ import { Rpc } from '@solana/rpc-spec';
4
+ export declare const getSolanaSigner: ({ para, rpc, walletId, }: {
5
+ para: ParaWeb;
6
+ walletId?: string;
7
+ rpc: Rpc<SolanaRpcApi>;
8
+ }) => Promise<import("@getpara/solana-signers-v2-integration").ParaSolanaSigner>;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../../chunk-MMUBH76A.js";
5
+ import { createParaSolanaSigner } from "@getpara/solana-signers-v2-integration";
6
+ const getSolanaSigner = (_0) => __async(void 0, [_0], function* ({
7
+ para,
8
+ rpc,
9
+ walletId
10
+ }) {
11
+ return createParaSolanaSigner({ para, rpc, walletId });
12
+ });
13
+ export {
14
+ getSolanaSigner
15
+ };
@@ -0,0 +1 @@
1
+ export * from './getSolanaSigner.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export * from "./getSolanaSigner.js";
@@ -0,0 +1 @@
1
+ export * from './useSolanaSigner.js';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export * from "./useSolanaSigner.js";
@@ -0,0 +1,12 @@
1
+ import { SolanaRpcApi } from '@solana/rpc-api';
2
+ import { Rpc } from '@solana/rpc-spec';
3
+ export declare const SOLANA_SIGNER_BASE_KEY = "PARA_SOLANA_SIGNER";
4
+ type UseSolanaSignerParameters = {
5
+ walletId?: string;
6
+ rpc: Rpc<SolanaRpcApi>;
7
+ };
8
+ export declare const useSolanaSigner: ({ walletId, rpc }: UseSolanaSignerParameters) => {
9
+ solanaSigner: import("@getpara/solana-signers-v2-integration").ParaSolanaSigner | null | undefined;
10
+ isLoading: boolean;
11
+ };
12
+ 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 { getSolanaSigner } from "../actions/index.js";
8
+ const SOLANA_SIGNER_BASE_KEY = "PARA_SOLANA_SIGNER";
9
+ const useSolanaSigner = ({ walletId, rpc }) => {
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: [SOLANA_SIGNER_BASE_KEY, isConnected, userId, walletId != null ? walletId : (wallet == null ? void 0 : wallet.type) === "SOLANA" ? wallet == null ? void 0 : wallet.id : null],
18
+ enabled: isConnected && !!para,
19
+ queryFn: () => __async(void 0, null, function* () {
20
+ if (!isConnected || !para) {
21
+ return null;
22
+ }
23
+ const _id = walletId != null ? walletId : (wallet == null ? void 0 : wallet.type) === "SOLANA" ? wallet == null ? void 0 : wallet.id : void 0;
24
+ return yield getSolanaSigner({ para, rpc, walletId: _id });
25
+ })
26
+ });
27
+ return { solanaSigner: data, isLoading };
28
+ };
29
+ export {
30
+ SOLANA_SIGNER_BASE_KEY,
31
+ useSolanaSigner
32
+ };
@@ -0,0 +1,2 @@
1
+ export * from './hooks/index.js';
2
+ export * from './actions/index.js';
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export * from "./hooks/index.js";
3
+ export * from "./actions/index.js";
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "2.0.0-alpha.33",
3
+ "version": "2.0.0-alpha.35",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.33",
9
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.33",
10
- "@getpara/react-sdk-lite": "2.0.0-alpha.33",
11
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.33"
8
+ "@getpara/cosmjs-v0-integration": "2.0.0-alpha.35",
9
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.35",
10
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.35",
11
+ "@getpara/react-sdk-lite": "2.0.0-alpha.35",
12
+ "@getpara/solana-signers-v2-integration": "2.0.0-alpha.35",
13
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.35",
14
+ "@getpara/viem-v2-integration": "2.0.0-alpha.35"
12
15
  },
13
16
  "devDependencies": {
14
17
  "@types/react": "^18.0.31",
@@ -17,14 +20,23 @@
17
20
  },
18
21
  "exports": {
19
22
  ".": "./dist/index.js",
20
- "./styles.css": "./dist/css/modal.css"
23
+ "./styles.css": "./dist/css/modal.css",
24
+ "./evm": "./dist/evm/index.js",
25
+ "./evm/hooks": "./dist/evm/hooks/index.js",
26
+ "./evm/actions": "./dist/evm/actions/index.js",
27
+ "./cosmos": "./dist/cosmos/index.js",
28
+ "./cosmos/hooks": "./dist/cosmos/hooks/index.js",
29
+ "./cosmos/actions": "./dist/cosmos/actions/index.js",
30
+ "./solana": "./dist/solana/index.js",
31
+ "./solana/hooks": "./dist/solana/hooks/index.js",
32
+ "./solana/actions": "./dist/solana/actions/index.js"
21
33
  },
22
34
  "files": [
23
35
  "dist",
24
36
  "package.json",
25
37
  "styles.css"
26
38
  ],
27
- "gitHead": "f338306fa30497d2190f8da2ff72ddd8d9d9032f",
39
+ "gitHead": "abfec8cf9931f7a8469b09b67b5d48eee6f4cfd5",
28
40
  "main": "dist/index.js",
29
41
  "peerDependencies": {
30
42
  "@tanstack/react-query": ">=5.0.0",