@interchain-kit/react 0.0.1-beta.45 → 0.0.1-beta.46

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.
@@ -6,3 +6,4 @@ export * from './useConnect';
6
6
  export * from './useChainWallet';
7
7
  export * from './useConfig';
8
8
  export * from './useOfflineSigner';
9
+ export * from './useRpcEndpoint';
@@ -5,14 +5,22 @@ export const useAccount = (chainName, walletName) => {
5
5
  const walletManager = useWalletManager();
6
6
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
7
7
  useEffect(() => {
8
- if (chainAccount?.walletState === WalletState.Connected && !chainAccount?.account && chainName && walletName) {
8
+ if (chainAccount?.walletState === WalletState.Connected) {
9
9
  chainAccount.getAccount();
10
10
  }
11
- }, [chainAccount?.walletState, chainName, walletName]);
11
+ }, [chainName, walletName, chainAccount?.walletState]);
12
+ if (chainAccount?.walletState === WalletState.Connected) {
13
+ return {
14
+ account: chainAccount?.account,
15
+ isLoading: chainAccount.getAccountState().loading,
16
+ error: chainAccount.getAccountState().error,
17
+ getAccount: () => chainAccount?.getAccount()
18
+ };
19
+ }
12
20
  return {
13
- account: chainAccount?.account || undefined,
14
- isLoading: chainAccount?.getAccountState().loading || false,
15
- error: chainAccount?.getAccountState().error || undefined,
16
- getAccount: chainAccount?.getAccount
21
+ account: undefined,
22
+ isLoading: false,
23
+ error: null,
24
+ getAccount: () => chainAccount?.getAccount()
17
25
  };
18
26
  };
@@ -4,6 +4,7 @@ import { useCurrentWallet } from './useCurrentWallet';
4
4
  import { useInterchainClient } from './useInterchainClient';
5
5
  import { useWalletModal } from "../modal";
6
6
  import { useRpcEndpoint } from "./useRpcEndpoint";
7
+ import { WalletState } from "@interchain-kit/core";
7
8
  export const useChain = (chainName) => {
8
9
  const walletManager = useWalletManager();
9
10
  const currentWallet = useCurrentWallet();
@@ -23,6 +24,26 @@ export const useChain = (chainName) => {
23
24
  username: accountHook.account?.username,
24
25
  message: currentWallet?.errorMessage
25
26
  };
27
+ if (currentWallet && chainAccount?.walletState === WalletState.Connected) {
28
+ return {
29
+ logoUrl: walletManager.getChainLogoUrl(chainName),
30
+ chain: chainAccount?.chain,
31
+ assetList: chainAccount?.assetList,
32
+ address: accountHook.account?.address,
33
+ wallet: currentWallet,
34
+ rpcEndpoint: rpcEndpointHook.rpcEndpoint,
35
+ ...cosmosKitUserChainReturnType, //for migration cosmos kit
36
+ signingClient: signingClientHook.signingClient,
37
+ getSigningClient: () => signingClientHook.getSigningClient(),
38
+ isRpcEndpointLoading: rpcEndpointHook.isLoading,
39
+ isAccountLoading: accountHook.isLoading,
40
+ isSigningClientLoading: signingClientHook.isLoading,
41
+ isLoading: rpcEndpointHook.isLoading || accountHook.isLoading || signingClientHook.isLoading,
42
+ getRpcEndpointError: rpcEndpointHook.error,
43
+ getSigningClientError: signingClientHook.error,
44
+ getAccountError: accountHook.error
45
+ };
46
+ }
26
47
  return {
27
48
  logoUrl: walletManager.getChainLogoUrl(chainName),
28
49
  chain: chainAccount?.chain,
@@ -32,6 +53,7 @@ export const useChain = (chainName) => {
32
53
  rpcEndpoint: rpcEndpointHook.rpcEndpoint,
33
54
  ...cosmosKitUserChainReturnType, //for migration cosmos kit
34
55
  signingClient: signingClientHook.signingClient,
56
+ getSigningClient: () => signingClientHook.getSigningClient(),
35
57
  isRpcEndpointLoading: rpcEndpointHook.isLoading,
36
58
  isAccountLoading: accountHook.isLoading,
37
59
  isSigningClientLoading: signingClientHook.isLoading,
@@ -23,6 +23,7 @@ export const useChainWallet = (chainName, walletName) => {
23
23
  address: accountHook.account?.address,
24
24
  wallet: walletRepository,
25
25
  signingClient: signingClientHook.signingClient,
26
+ getSigningClient: () => signingClientHook.getSigningClient(),
26
27
  isRpcEndpointLoading: rpcEndpointHook.isLoading,
27
28
  isAccountLoading: accountHook.isLoading,
28
29
  isSigningClientLoading: signingClientHook.isLoading,
@@ -1,18 +1,20 @@
1
- import { useEffect } from "react";
2
1
  import { useWalletManager } from './useWalletManager';
3
2
  import { WalletState } from '@interchain-kit/core';
4
3
  export const useInterchainClient = (chainName, walletName) => {
5
4
  const walletManager = useWalletManager();
6
5
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
7
- useEffect(() => {
8
- if (chainAccount?.walletState === WalletState.Connected && !chainAccount.signingClient && chainName && walletName) {
9
- chainAccount.getSigningClient();
10
- }
11
- }, [chainAccount?.walletState, chainName, walletName]);
6
+ if (chainAccount && chainAccount.walletState === WalletState.Connected) {
7
+ return {
8
+ signingClient: chainAccount?.signingClient,
9
+ isLoading: chainAccount?.getSigningClientState().loading,
10
+ error: chainAccount?.getSigningClientState().error,
11
+ getSigningClient: () => chainAccount?.getSigningClient()
12
+ };
13
+ }
12
14
  return {
13
- signingClient: chainAccount?.signingClient,
14
- isLoading: chainAccount?.getSigningClientState().loading,
15
- error: chainAccount?.getSigningClientState().error,
16
- getSigningClient: chainAccount?.getSigningClient
15
+ signingClient: undefined,
16
+ isLoading: false,
17
+ error: undefined,
18
+ getSigningClient: () => chainAccount?.getSigningClient()
17
19
  };
18
20
  };
@@ -1,18 +1,20 @@
1
- import { useEffect } from "react";
2
1
  import { useWalletManager } from "./useWalletManager";
3
2
  import { WalletState } from "@interchain-kit/core";
4
3
  export const useOfflineSigner = (chainName, walletName) => {
5
4
  const walletManager = useWalletManager();
6
5
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
7
- useEffect(() => {
8
- if (chainAccount?.walletState === WalletState.Connected && !chainAccount.offlineSigner && chainName && walletName) {
9
- chainAccount.getOfflineSigner();
10
- }
11
- }, [chainAccount?.walletState, chainName, walletName]);
6
+ if (chainAccount && chainAccount.walletState === WalletState.Connected) {
7
+ return {
8
+ offlineSigner: chainAccount?.offlineSigner,
9
+ isLoading: chainAccount?.getOfflineSignerState().loading,
10
+ error: chainAccount?.getOfflineSignerState().error,
11
+ getOfflineSigner: () => chainAccount?.getOfflineSigner()
12
+ };
13
+ }
12
14
  return {
13
- offlineSigner: chainAccount?.offlineSigner,
14
- isLoading: chainAccount?.getOfflineSignerState().loading,
15
- error: chainAccount?.getOfflineSignerState().error,
16
- getOfflineSigner: chainAccount?.getOfflineSigner
15
+ offlineSigner: undefined,
16
+ isLoading: false,
17
+ error: undefined,
18
+ getOfflineSigner: () => chainAccount?.getOfflineSigner()
17
19
  };
18
20
  };
@@ -5,14 +5,22 @@ export const useRpcEndpoint = (chainName, walletName) => {
5
5
  const walletManager = useWalletManager();
6
6
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
7
7
  useEffect(() => {
8
- if (chainAccount?.walletState === WalletState.Connected && !chainAccount.rpcEndpoint && chainName && walletName) {
8
+ if (chainAccount?.walletState === WalletState.Connected) {
9
9
  chainAccount.getRpcEndpoint();
10
10
  }
11
- }, [chainAccount?.walletState, walletName, chainName]);
11
+ }, [chainName, walletName, chainAccount?.walletState]);
12
+ if (chainAccount && chainAccount.walletState === WalletState.Connected) {
13
+ return {
14
+ rpcEndpoint: chainAccount?.rpcEndpoint,
15
+ isLoading: chainAccount?.getRpcEndpointState().loading,
16
+ error: chainAccount?.getRpcEndpointState().error,
17
+ getRpcEndpoint: () => chainAccount?.getRpcEndpoint()
18
+ };
19
+ }
12
20
  return {
13
- rpcEndpoint: chainAccount?.rpcEndpoint,
14
- isLoading: chainAccount?.getRpcEndpointState().loading,
15
- error: chainAccount?.getRpcEndpointState().error,
16
- getRpcEndpoint: chainAccount?.getRpcEndpoint
21
+ rpcEndpoint: undefined,
22
+ isLoading: false,
23
+ error: undefined,
24
+ getRpcEndpoint: () => chainAccount?.getRpcEndpoint()
17
25
  };
18
26
  };
package/esm/provider.js CHANGED
@@ -8,9 +8,9 @@ export const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endp
8
8
  const [_, forceRender] = useState({});
9
9
  const walletManager = useMemo(() => {
10
10
  const wm = new WalletManager(chains, assetLists, wallets, signerOptions, endpointOptions);
11
- return wm.getObservableObj(() => {
12
- forceRender({});
13
- });
11
+ const observable = wm.getObservableObj();
12
+ observable.subscribe(() => forceRender({}));
13
+ return observable;
14
14
  }, []);
15
15
  useEffect(() => {
16
16
  walletManager.init();
package/hooks/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './useConnect';
6
6
  export * from './useChainWallet';
7
7
  export * from './useConfig';
8
8
  export * from './useOfflineSigner';
9
+ export * from './useRpcEndpoint';
package/hooks/index.js CHANGED
@@ -22,3 +22,4 @@ __exportStar(require("./useConnect"), exports);
22
22
  __exportStar(require("./useChainWallet"), exports);
23
23
  __exportStar(require("./useConfig"), exports);
24
24
  __exportStar(require("./useOfflineSigner"), exports);
25
+ __exportStar(require("./useRpcEndpoint"), exports);
@@ -1,6 +1,6 @@
1
1
  export declare const useAccount: (chainName: string, walletName: string) => {
2
- account: any;
3
- isLoading: any;
4
- error: any;
5
- getAccount: any;
2
+ account: import("@interchain-kit/core").WalletAccount;
3
+ isLoading: boolean;
4
+ error: Error;
5
+ getAccount: () => Promise<import("@interchain-kit/core").WalletAccount>;
6
6
  };
@@ -8,15 +8,23 @@ const useAccount = (chainName, walletName) => {
8
8
  const walletManager = (0, useWalletManager_1.useWalletManager)();
9
9
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
10
10
  (0, react_1.useEffect)(() => {
11
- if (chainAccount?.walletState === core_1.WalletState.Connected && !chainAccount?.account && chainName && walletName) {
11
+ if (chainAccount?.walletState === core_1.WalletState.Connected) {
12
12
  chainAccount.getAccount();
13
13
  }
14
- }, [chainAccount?.walletState, chainName, walletName]);
14
+ }, [chainName, walletName, chainAccount?.walletState]);
15
+ if (chainAccount?.walletState === core_1.WalletState.Connected) {
16
+ return {
17
+ account: chainAccount?.account,
18
+ isLoading: chainAccount.getAccountState().loading,
19
+ error: chainAccount.getAccountState().error,
20
+ getAccount: () => chainAccount?.getAccount()
21
+ };
22
+ }
15
23
  return {
16
- account: chainAccount?.account || undefined,
17
- isLoading: chainAccount?.getAccountState().loading || false,
18
- error: chainAccount?.getAccountState().error || undefined,
19
- getAccount: chainAccount?.getAccount
24
+ account: undefined,
25
+ isLoading: false,
26
+ error: null,
27
+ getAccount: () => chainAccount?.getAccount()
20
28
  };
21
29
  };
22
30
  exports.useAccount = useAccount;
package/hooks/useChain.js CHANGED
@@ -7,6 +7,7 @@ const useCurrentWallet_1 = require("./useCurrentWallet");
7
7
  const useInterchainClient_1 = require("./useInterchainClient");
8
8
  const modal_1 = require("../modal");
9
9
  const useRpcEndpoint_1 = require("./useRpcEndpoint");
10
+ const core_1 = require("@interchain-kit/core");
10
11
  const useChain = (chainName) => {
11
12
  const walletManager = (0, useWalletManager_1.useWalletManager)();
12
13
  const currentWallet = (0, useCurrentWallet_1.useCurrentWallet)();
@@ -26,6 +27,26 @@ const useChain = (chainName) => {
26
27
  username: accountHook.account?.username,
27
28
  message: currentWallet?.errorMessage
28
29
  };
30
+ if (currentWallet && chainAccount?.walletState === core_1.WalletState.Connected) {
31
+ return {
32
+ logoUrl: walletManager.getChainLogoUrl(chainName),
33
+ chain: chainAccount?.chain,
34
+ assetList: chainAccount?.assetList,
35
+ address: accountHook.account?.address,
36
+ wallet: currentWallet,
37
+ rpcEndpoint: rpcEndpointHook.rpcEndpoint,
38
+ ...cosmosKitUserChainReturnType, //for migration cosmos kit
39
+ signingClient: signingClientHook.signingClient,
40
+ getSigningClient: () => signingClientHook.getSigningClient(),
41
+ isRpcEndpointLoading: rpcEndpointHook.isLoading,
42
+ isAccountLoading: accountHook.isLoading,
43
+ isSigningClientLoading: signingClientHook.isLoading,
44
+ isLoading: rpcEndpointHook.isLoading || accountHook.isLoading || signingClientHook.isLoading,
45
+ getRpcEndpointError: rpcEndpointHook.error,
46
+ getSigningClientError: signingClientHook.error,
47
+ getAccountError: accountHook.error
48
+ };
49
+ }
29
50
  return {
30
51
  logoUrl: walletManager.getChainLogoUrl(chainName),
31
52
  chain: chainAccount?.chain,
@@ -35,6 +56,7 @@ const useChain = (chainName) => {
35
56
  rpcEndpoint: rpcEndpointHook.rpcEndpoint,
36
57
  ...cosmosKitUserChainReturnType, //for migration cosmos kit
37
58
  signingClient: signingClientHook.signingClient,
59
+ getSigningClient: () => signingClientHook.getSigningClient(),
38
60
  isRpcEndpointLoading: rpcEndpointHook.isLoading,
39
61
  isAccountLoading: accountHook.isLoading,
40
62
  isSigningClientLoading: signingClientHook.isLoading,
@@ -26,6 +26,7 @@ const useChainWallet = (chainName, walletName) => {
26
26
  address: accountHook.account?.address,
27
27
  wallet: walletRepository,
28
28
  signingClient: signingClientHook.signingClient,
29
+ getSigningClient: () => signingClientHook.getSigningClient(),
29
30
  isRpcEndpointLoading: rpcEndpointHook.isLoading,
30
31
  isAccountLoading: accountHook.isLoading,
31
32
  isSigningClientLoading: signingClientHook.isLoading,
@@ -1,4 +1,5 @@
1
1
  import { AssetList, Chain } from "@chain-registry/v2-types";
2
+ import { EndpointOptions, SignerOptions } from "@interchain-kit/core";
2
3
  export declare const useConfig: () => {
3
4
  updateChains: (chains: Chain[]) => Chain[];
4
5
  updateAssetLists: (assetLists: AssetList[]) => AssetList[];
@@ -1 +1,2 @@
1
+ import { WalletRepository } from '@interchain-kit/core/wallet-repository';
1
2
  export declare const useCurrentWallet: () => WalletRepository;
@@ -1,6 +1,6 @@
1
1
  export declare const useInterchainClient: (chainName: string, walletName: string) => {
2
- signingClient: any;
3
- isLoading: any;
4
- error: any;
5
- getSigningClient: any;
2
+ signingClient: import("@interchainjs/cosmos/signing-client").SigningClient;
3
+ isLoading: boolean;
4
+ error: Error;
5
+ getSigningClient: () => Promise<import("@interchainjs/cosmos/signing-client").SigningClient>;
6
6
  };
@@ -1,22 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useInterchainClient = void 0;
4
- const react_1 = require("react");
5
4
  const useWalletManager_1 = require("./useWalletManager");
6
5
  const core_1 = require("@interchain-kit/core");
7
6
  const useInterchainClient = (chainName, walletName) => {
8
7
  const walletManager = (0, useWalletManager_1.useWalletManager)();
9
8
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
10
- (0, react_1.useEffect)(() => {
11
- if (chainAccount?.walletState === core_1.WalletState.Connected && !chainAccount.signingClient && chainName && walletName) {
12
- chainAccount.getSigningClient();
13
- }
14
- }, [chainAccount?.walletState, chainName, walletName]);
9
+ if (chainAccount && chainAccount.walletState === core_1.WalletState.Connected) {
10
+ return {
11
+ signingClient: chainAccount?.signingClient,
12
+ isLoading: chainAccount?.getSigningClientState().loading,
13
+ error: chainAccount?.getSigningClientState().error,
14
+ getSigningClient: () => chainAccount?.getSigningClient()
15
+ };
16
+ }
15
17
  return {
16
- signingClient: chainAccount?.signingClient,
17
- isLoading: chainAccount?.getSigningClientState().loading,
18
- error: chainAccount?.getSigningClientState().error,
19
- getSigningClient: chainAccount?.getSigningClient
18
+ signingClient: undefined,
19
+ isLoading: false,
20
+ error: undefined,
21
+ getSigningClient: () => chainAccount?.getSigningClient()
20
22
  };
21
23
  };
22
24
  exports.useInterchainClient = useInterchainClient;
@@ -1,6 +1,6 @@
1
1
  export declare const useOfflineSigner: (chainName: string, walletName: string) => {
2
- offlineSigner: any;
3
- isLoading: any;
4
- error: any;
5
- getOfflineSigner: any;
2
+ offlineSigner: import("@interchainjs/cosmos/types/wallet").OfflineSigner;
3
+ isLoading: boolean;
4
+ error: Error;
5
+ getOfflineSigner: () => import("@interchainjs/cosmos/types/wallet").ICosmosGenericOfflineSigner;
6
6
  };
@@ -1,22 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useOfflineSigner = void 0;
4
- const react_1 = require("react");
5
4
  const useWalletManager_1 = require("./useWalletManager");
6
5
  const core_1 = require("@interchain-kit/core");
7
6
  const useOfflineSigner = (chainName, walletName) => {
8
7
  const walletManager = (0, useWalletManager_1.useWalletManager)();
9
8
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
10
- (0, react_1.useEffect)(() => {
11
- if (chainAccount?.walletState === core_1.WalletState.Connected && !chainAccount.offlineSigner && chainName && walletName) {
12
- chainAccount.getOfflineSigner();
13
- }
14
- }, [chainAccount?.walletState, chainName, walletName]);
9
+ if (chainAccount && chainAccount.walletState === core_1.WalletState.Connected) {
10
+ return {
11
+ offlineSigner: chainAccount?.offlineSigner,
12
+ isLoading: chainAccount?.getOfflineSignerState().loading,
13
+ error: chainAccount?.getOfflineSignerState().error,
14
+ getOfflineSigner: () => chainAccount?.getOfflineSigner()
15
+ };
16
+ }
15
17
  return {
16
- offlineSigner: chainAccount?.offlineSigner,
17
- isLoading: chainAccount?.getOfflineSignerState().loading,
18
- error: chainAccount?.getOfflineSignerState().error,
19
- getOfflineSigner: chainAccount?.getOfflineSigner
18
+ offlineSigner: undefined,
19
+ isLoading: false,
20
+ error: undefined,
21
+ getOfflineSigner: () => chainAccount?.getOfflineSigner()
20
22
  };
21
23
  };
22
24
  exports.useOfflineSigner = useOfflineSigner;
@@ -1,6 +1,6 @@
1
1
  export declare const useRpcEndpoint: (chainName: string, walletName: string) => {
2
- rpcEndpoint: any;
3
- isLoading: any;
4
- error: any;
5
- getRpcEndpoint: any;
2
+ rpcEndpoint: string | import("@interchainjs/types").HttpEndpoint;
3
+ isLoading: boolean;
4
+ error: Error;
5
+ getRpcEndpoint: () => Promise<string | import("@interchainjs/types").HttpEndpoint>;
6
6
  };
@@ -8,15 +8,23 @@ const useRpcEndpoint = (chainName, walletName) => {
8
8
  const walletManager = (0, useWalletManager_1.useWalletManager)();
9
9
  const chainAccount = walletManager.getWalletRepositoryByName(walletName)?.getChainAccountByName(chainName);
10
10
  (0, react_1.useEffect)(() => {
11
- if (chainAccount?.walletState === core_1.WalletState.Connected && !chainAccount.rpcEndpoint && chainName && walletName) {
11
+ if (chainAccount?.walletState === core_1.WalletState.Connected) {
12
12
  chainAccount.getRpcEndpoint();
13
13
  }
14
- }, [chainAccount?.walletState, walletName, chainName]);
14
+ }, [chainName, walletName, chainAccount?.walletState]);
15
+ if (chainAccount && chainAccount.walletState === core_1.WalletState.Connected) {
16
+ return {
17
+ rpcEndpoint: chainAccount?.rpcEndpoint,
18
+ isLoading: chainAccount?.getRpcEndpointState().loading,
19
+ error: chainAccount?.getRpcEndpointState().error,
20
+ getRpcEndpoint: () => chainAccount?.getRpcEndpoint()
21
+ };
22
+ }
15
23
  return {
16
- rpcEndpoint: chainAccount?.rpcEndpoint,
17
- isLoading: chainAccount?.getRpcEndpointState().loading,
18
- error: chainAccount?.getRpcEndpointState().error,
19
- getRpcEndpoint: chainAccount?.getRpcEndpoint
24
+ rpcEndpoint: undefined,
25
+ isLoading: false,
26
+ error: undefined,
27
+ getRpcEndpoint: () => chainAccount?.getRpcEndpoint()
20
28
  };
21
29
  };
22
30
  exports.useRpcEndpoint = useRpcEndpoint;
@@ -1 +1,2 @@
1
+ import { WalletManager } from '@interchain-kit/core';
1
2
  export declare const useWalletManager: () => WalletManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interchain-kit/react",
3
- "version": "0.0.1-beta.45",
3
+ "version": "0.0.1-beta.46",
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.40",
36
- "@interchain-kit/core": "0.0.1-beta.45",
36
+ "@interchain-kit/core": "0.0.1-beta.46",
37
37
  "@interchain-ui/react": "1.26.1",
38
38
  "@interchainjs/cosmos": "1.6.3",
39
39
  "@interchainjs/cosmos-types": "1.6.3",
@@ -48,5 +48,5 @@
48
48
  "react": "^18.3.1",
49
49
  "react-dom": "^18.3.1"
50
50
  },
51
- "gitHead": "1d52b0d7c0616c204434fb6a10e8d5a2fca62d92"
51
+ "gitHead": "c3d891660283751114a218e8abcbc278700442bd"
52
52
  }
package/provider.js CHANGED
@@ -11,9 +11,9 @@ const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOpt
11
11
  const [_, forceRender] = (0, react_1.useState)({});
12
12
  const walletManager = (0, react_1.useMemo)(() => {
13
13
  const wm = new core_1.WalletManager(chains, assetLists, wallets, signerOptions, endpointOptions);
14
- return wm.getObservableObj(() => {
15
- forceRender({});
16
- });
14
+ const observable = wm.getObservableObj();
15
+ observable.subscribe(() => forceRender({}));
16
+ return observable;
17
17
  }, []);
18
18
  (0, react_1.useEffect)(() => {
19
19
  walletManager.init();
package/types/chain.d.ts CHANGED
@@ -20,6 +20,7 @@ export type UseChainReturnType = {
20
20
  wallet: BaseWallet;
21
21
  rpcEndpoint: string | HttpEndpoint;
22
22
  signingClient: SigningClient;
23
+ getSigningClient: () => Promise<SigningClient>;
23
24
  isRpcEndpointLoading: boolean;
24
25
  isAccountLoading: boolean;
25
26
  isSigningClientLoading: boolean;
package/utils/wallet.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import { BaseWallet } from "@interchain-kit/core";
1
2
  export declare const getWalletInfo: (wallet: BaseWallet) => {
2
- name: any;
3
- prettyName: any;
3
+ name: string;
4
+ prettyName: string;
4
5
  logo: string;
5
6
  mobileDisabled: boolean;
6
7
  };