@interchain-kit/react 0.0.1-beta.31 → 0.0.1-beta.32
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/esm/hooks/useChain.js
CHANGED
|
@@ -35,9 +35,7 @@ export const useChain = (chainName) => {
|
|
|
35
35
|
getRpcEndpoint,
|
|
36
36
|
status: currentWallet?.walletState,
|
|
37
37
|
username: account?.username,
|
|
38
|
-
message: currentWallet?.errorMessage
|
|
39
|
-
getSigningCosmWasmClient: () => walletManager.getSigningCosmwasmClient(currentWallet.option.name, chainName),
|
|
40
|
-
getSigningCosmosClient: () => walletManager.getSigningCosmosClient(currentWallet.option.name, chainName),
|
|
38
|
+
message: currentWallet?.errorMessage
|
|
41
39
|
};
|
|
42
40
|
return {
|
|
43
41
|
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
@@ -4,13 +4,8 @@ import { useAccount } from './useAccount';
|
|
|
4
4
|
import { WalletState } from '@interchain-kit/core';
|
|
5
5
|
export const useInterchainClient = (chainName, walletName) => {
|
|
6
6
|
const [rpcEndpoint, setRpcEndpoint] = useState();
|
|
7
|
-
//query
|
|
8
|
-
const [queryClient, setQueryClient] = useState(null);
|
|
9
7
|
//signing
|
|
10
8
|
const [signingClient, setSigningClient] = useState(null);
|
|
11
|
-
const [signingCosmosClient, setSigningCosmosClient] = useState(null);
|
|
12
|
-
const [signingCosmWasmClient, setSigningCosmWasmClient] = useState(null);
|
|
13
|
-
const [signingInjectiveClient, setSigningInjectiveClient] = useState(null);
|
|
14
9
|
const [error, setError] = useState(null);
|
|
15
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
16
11
|
const walletManager = useWalletManager();
|
|
@@ -23,16 +18,8 @@ export const useInterchainClient = (chainName, walletName) => {
|
|
|
23
18
|
setIsLoading(true);
|
|
24
19
|
const rpcEndpoint = await walletManager.getRpcEndpoint(wallet, chainName);
|
|
25
20
|
setRpcEndpoint(rpcEndpoint);
|
|
26
|
-
const queryClient = await walletManager.getQueryClient(walletName, chainName);
|
|
27
|
-
setQueryClient(queryClient);
|
|
28
21
|
const signingClient = await walletManager.getSigningClient(walletName, chainName);
|
|
29
22
|
setSigningClient(signingClient);
|
|
30
|
-
const signingStargateClient = await walletManager.getSigningCosmosClient(walletName, chainName);
|
|
31
|
-
setSigningCosmosClient(signingStargateClient);
|
|
32
|
-
const signingCosmwasmClient = await walletManager.getSigningCosmwasmClient(walletName, chainName);
|
|
33
|
-
setSigningCosmWasmClient(signingCosmwasmClient);
|
|
34
|
-
const signingInjectiveClient = await walletManager.getSigningInjectiveClient(walletName, chainName);
|
|
35
|
-
setSigningInjectiveClient(signingInjectiveClient);
|
|
36
23
|
}
|
|
37
24
|
catch (error) {
|
|
38
25
|
setError(error);
|
|
@@ -48,11 +35,7 @@ export const useInterchainClient = (chainName, walletName) => {
|
|
|
48
35
|
}, [chainName, walletName, account, wallet?.walletState]);
|
|
49
36
|
return {
|
|
50
37
|
rpcEndpoint,
|
|
51
|
-
signingClient
|
|
52
|
-
queryClient,
|
|
53
|
-
signingCosmosClient,
|
|
54
|
-
signingCosmWasmClient,
|
|
55
|
-
signingInjectiveClient,
|
|
38
|
+
signingClient,
|
|
56
39
|
error,
|
|
57
40
|
isLoading
|
|
58
41
|
};
|
package/hooks/useChain.js
CHANGED
|
@@ -38,9 +38,7 @@ const useChain = (chainName) => {
|
|
|
38
38
|
getRpcEndpoint,
|
|
39
39
|
status: currentWallet?.walletState,
|
|
40
40
|
username: account?.username,
|
|
41
|
-
message: currentWallet?.errorMessage
|
|
42
|
-
getSigningCosmWasmClient: () => walletManager.getSigningCosmwasmClient(currentWallet.option.name, chainName),
|
|
43
|
-
getSigningCosmosClient: () => walletManager.getSigningCosmosClient(currentWallet.option.name, chainName),
|
|
41
|
+
message: currentWallet?.errorMessage
|
|
44
42
|
};
|
|
45
43
|
return {
|
|
46
44
|
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { HttpEndpoint } from '@interchainjs/types';
|
|
2
|
-
import {
|
|
3
|
-
import { CosmosSigningClient } from 'interchainjs/cosmos';
|
|
4
|
-
import { SigningClient } from 'interchainjs/signing-client';
|
|
5
|
-
import { RpcQuery } from 'interchainjs/query/rpc';
|
|
6
|
-
import { InjSigningClient } from '@interchainjs/injective/signing-client';
|
|
2
|
+
import { SigningClient } from '@interchainjs/cosmos/signing-client';
|
|
7
3
|
export declare const useInterchainClient: (chainName: string, walletName: string) => {
|
|
8
4
|
rpcEndpoint: string | HttpEndpoint;
|
|
9
5
|
signingClient: SigningClient;
|
|
10
|
-
queryClient: RpcQuery;
|
|
11
|
-
signingCosmosClient: CosmosSigningClient;
|
|
12
|
-
signingCosmWasmClient: CosmWasmSigningClient;
|
|
13
|
-
signingInjectiveClient: InjSigningClient;
|
|
14
6
|
error: unknown;
|
|
15
7
|
isLoading: boolean;
|
|
16
8
|
};
|
|
@@ -7,13 +7,8 @@ const useAccount_1 = require("./useAccount");
|
|
|
7
7
|
const core_1 = require("@interchain-kit/core");
|
|
8
8
|
const useInterchainClient = (chainName, walletName) => {
|
|
9
9
|
const [rpcEndpoint, setRpcEndpoint] = (0, react_1.useState)();
|
|
10
|
-
//query
|
|
11
|
-
const [queryClient, setQueryClient] = (0, react_1.useState)(null);
|
|
12
10
|
//signing
|
|
13
11
|
const [signingClient, setSigningClient] = (0, react_1.useState)(null);
|
|
14
|
-
const [signingCosmosClient, setSigningCosmosClient] = (0, react_1.useState)(null);
|
|
15
|
-
const [signingCosmWasmClient, setSigningCosmWasmClient] = (0, react_1.useState)(null);
|
|
16
|
-
const [signingInjectiveClient, setSigningInjectiveClient] = (0, react_1.useState)(null);
|
|
17
12
|
const [error, setError] = (0, react_1.useState)(null);
|
|
18
13
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
19
14
|
const walletManager = (0, useWalletManager_1.useWalletManager)();
|
|
@@ -26,16 +21,8 @@ const useInterchainClient = (chainName, walletName) => {
|
|
|
26
21
|
setIsLoading(true);
|
|
27
22
|
const rpcEndpoint = await walletManager.getRpcEndpoint(wallet, chainName);
|
|
28
23
|
setRpcEndpoint(rpcEndpoint);
|
|
29
|
-
const queryClient = await walletManager.getQueryClient(walletName, chainName);
|
|
30
|
-
setQueryClient(queryClient);
|
|
31
24
|
const signingClient = await walletManager.getSigningClient(walletName, chainName);
|
|
32
25
|
setSigningClient(signingClient);
|
|
33
|
-
const signingStargateClient = await walletManager.getSigningCosmosClient(walletName, chainName);
|
|
34
|
-
setSigningCosmosClient(signingStargateClient);
|
|
35
|
-
const signingCosmwasmClient = await walletManager.getSigningCosmwasmClient(walletName, chainName);
|
|
36
|
-
setSigningCosmWasmClient(signingCosmwasmClient);
|
|
37
|
-
const signingInjectiveClient = await walletManager.getSigningInjectiveClient(walletName, chainName);
|
|
38
|
-
setSigningInjectiveClient(signingInjectiveClient);
|
|
39
26
|
}
|
|
40
27
|
catch (error) {
|
|
41
28
|
setError(error);
|
|
@@ -51,11 +38,7 @@ const useInterchainClient = (chainName, walletName) => {
|
|
|
51
38
|
}, [chainName, walletName, account, wallet?.walletState]);
|
|
52
39
|
return {
|
|
53
40
|
rpcEndpoint,
|
|
54
|
-
signingClient
|
|
55
|
-
queryClient,
|
|
56
|
-
signingCosmosClient,
|
|
57
|
-
signingCosmWasmClient,
|
|
58
|
-
signingInjectiveClient,
|
|
41
|
+
signingClient,
|
|
59
42
|
error,
|
|
60
43
|
isLoading
|
|
61
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interchain-kit/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.32",
|
|
4
4
|
"author": "cosmology-tech <developers@cosmology.zone>",
|
|
5
5
|
"description": "interchain-kit wallet connector react package",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"keywords": [],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@chain-registry/v2-types": "^0.53.0",
|
|
36
|
-
"@interchain-kit/core": "0.0.1-beta.
|
|
36
|
+
"@interchain-kit/core": "0.0.1-beta.32",
|
|
37
37
|
"@interchain-ui/react": "1.24.0",
|
|
38
38
|
"@interchainjs/cosmos-types": "0.0.1-beta.13",
|
|
39
39
|
"@interchainjs/injective": "0.0.1-beta.18",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"react": "^18.3.1",
|
|
44
44
|
"react-dom": "^18.3.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ff4dc72f9f8274d3a00ab953b6962b5035a836dd"
|
|
47
47
|
}
|
package/types/chain.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { HttpEndpoint } from '@interchainjs/types';
|
|
2
|
-
import {
|
|
3
|
-
import { SigningClient } from 'interchainjs/signing-client';
|
|
4
|
-
import { RpcQuery } from 'interchainjs/query/rpc';
|
|
5
|
-
import { CosmosSigningClient } from 'interchainjs/cosmos';
|
|
2
|
+
import { SigningClient } from '@interchainjs/cosmos/signing-client';
|
|
6
3
|
import { Chain, AssetList } from '@chain-registry/v2-types';
|
|
7
4
|
import { BaseWallet, WalletState } from '@interchain-kit/core';
|
|
8
5
|
export type CosmosKitUseChainReturnType = {
|
|
@@ -14,8 +11,6 @@ export type CosmosKitUseChainReturnType = {
|
|
|
14
11
|
status: WalletState;
|
|
15
12
|
username: string;
|
|
16
13
|
message: string;
|
|
17
|
-
getSigningCosmWasmClient: () => Promise<CosmWasmSigningClient>;
|
|
18
|
-
getSigningCosmosClient: () => Promise<CosmosSigningClient>;
|
|
19
14
|
};
|
|
20
15
|
export type UseChainReturnType = {
|
|
21
16
|
logoUrl: string | undefined;
|
|
@@ -24,10 +19,7 @@ export type UseChainReturnType = {
|
|
|
24
19
|
address: string;
|
|
25
20
|
wallet: BaseWallet;
|
|
26
21
|
rpcEndpoint: string | HttpEndpoint;
|
|
27
|
-
queryClient: RpcQuery;
|
|
28
22
|
signingClient: SigningClient;
|
|
29
|
-
signingCosmosClient: CosmosSigningClient;
|
|
30
|
-
signingCosmWasmClient: CosmWasmSigningClient;
|
|
31
23
|
isLoading: boolean;
|
|
32
24
|
error: unknown;
|
|
33
25
|
};
|