Skip to content

Commit 42423c1

Browse files
Merge pull request #32 from 2wheeh/fix/optional-wallet-get-chain-wallet
fix: correct return type of useChain hook
2 parents 9a01142 + 80a1493 commit 42423c1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/react/src/types/chain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type UseChainReturnType = {
2121
chain: Chain,
2222
assetList: AssetList,
2323
address: string,
24-
wallet: ChainWalletStore,
24+
wallet: ChainWalletStore | undefined,
2525
rpcEndpoint: string | HttpEndpoint | unknown
2626
getSigningClient: () => Promise<SigningClient>
2727

packages/store/src/wallet-manager/wallet-manager-store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { createProxiedWallet } from '../proxied-wallets';
88
import { InterchainStore } from '../store';
99
import { ChainWalletState, InterchainStoreType } from '../types';
1010
import { LocalStorage } from '../utils/local-storage';
11+
import type { ChainWalletStore } from './chain-wallet-store';
1112
import { WalletStore } from './wallet-store';
1213
export class WalletManagerStore implements WalletManager {
1314

@@ -179,7 +180,7 @@ export class WalletManagerStore implements WalletManager {
179180
this.store.updateChainWalletState(walletName, chainName, data);
180181
}
181182

182-
getChainWalletByName(walletName: string, chainName: Chain['chainName']) {
183+
getChainWalletByName(walletName: string, chainName: Chain['chainName']): ChainWalletStore | undefined {
183184
const walletStore = this.wallets.find(w => w.info.name === walletName);
184185
return walletStore?.getChainWalletStore(chainName);
185186
}

0 commit comments

Comments
 (0)