@getpara/react-sdk 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.
- package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +1 -2
- package/dist/cosmos/actions/getCosmjsAminoSigner.js +2 -2
- package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +1 -2
- package/dist/cosmos/actions/getCosmjsProtoSigner.js +2 -2
- package/dist/cosmos/hooks/index.d.ts +3 -2
- package/dist/cosmos/hooks/index.js +7 -2
- package/dist/cosmos/hooks/useParaCosmjsAminoSigner.d.ts +3 -0
- package/dist/cosmos/hooks/useParaCosmjsAminoSigner.js +8 -0
- package/dist/cosmos/hooks/useParaCosmjsProtoSigner.d.ts +3 -0
- package/dist/cosmos/hooks/useParaCosmjsProtoSigner.js +8 -0
- package/dist/evm/actions/getViemAccount.js +2 -2
- package/dist/evm/actions/getViemClient.d.ts +2 -2
- package/dist/evm/hooks/index.d.ts +5 -2
- package/dist/evm/hooks/index.js +31 -2
- package/dist/evm/hooks/useParaViemAccount.d.ts +3 -0
- package/dist/evm/hooks/useParaViemAccount.js +8 -0
- package/dist/evm/hooks/useParaViemClient.d.ts +3 -0
- package/dist/evm/hooks/useParaViemClient.js +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/solana/hooks/index.d.ts +2 -1
- package/dist/solana/hooks/index.js +6 -1
- package/dist/solana/hooks/useParaSolanaSigner.d.ts +3 -0
- package/dist/solana/hooks/useParaSolanaSigner.js +8 -0
- package/dist/stellar/hooks/index.d.ts +2 -1
- package/dist/stellar/hooks/index.js +7 -1
- package/dist/stellar/hooks/useParaStellarSigner.d.ts +3 -0
- package/dist/stellar/hooks/useParaStellarSigner.js +8 -0
- package/dist/wagmi/index.d.ts +8 -0
- package/dist/wagmi/index.js +76 -0
- package/package.json +37 -23
- package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +0 -11
- package/dist/cosmos/hooks/useCosmjsAminoSigner.js +0 -37
- package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +0 -11
- package/dist/cosmos/hooks/useCosmjsProtoSigner.js +0 -37
- package/dist/evm/hooks/useViemAccount.d.ts +0 -26
- package/dist/evm/hooks/useViemAccount.js +0 -32
- package/dist/evm/hooks/useViemClient.d.ts +0 -18446
- package/dist/evm/hooks/useViemClient.js +0 -30
- package/dist/solana/hooks/useSolanaSigner.d.ts +0 -11
- package/dist/solana/hooks/useSolanaSigner.js +0 -32
|
@@ -1,30 +0,0 @@
|
|
|
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 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
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ParaSignerParams } from '@getpara/solana-signers-v2-integration';
|
|
2
|
-
export declare const SOLANA_SIGNER_BASE_KEY = "PARA_SOLANA_SIGNER";
|
|
3
|
-
type UseSolanaSignerParameters = {
|
|
4
|
-
walletId?: string;
|
|
5
|
-
rpc: ParaSignerParams['rpc'];
|
|
6
|
-
};
|
|
7
|
-
export declare const useSolanaSigner: ({ walletId, rpc }: UseSolanaSignerParameters) => {
|
|
8
|
-
solanaSigner: import("@getpara/solana-signers-v2-integration").ParaSolanaSigner | null | undefined;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
};
|