Hook - useWallet
-
required provider: ChainProvider from either
@cosmos-kit/react
or@cosmos-kit/react-lite
-
parameters:
- walletName?:
WalletName
( =string
); - activeOnly:
boolean
(default to betrue
);
- walletName?:
If
walletName
isundefined
, usingcurrentWallet
instead. See LocalStorage keycosmos-kit@2:core//current-wallet
. IfcurrentWallet
is also undefined, return default values.
If
activeOnly
istrue
, only look at chainWallets withisActive
true. WhenuseChain
is called, corresponding chainWallet will be activated.
- return type: WalletContext
Type - WalletContext
Properties
Name | Description | Type | Default |
---|---|---|---|
mainWallet | the mainWallet | `MainWalletBase | undefined` |
chainWallets | all the chainWallets (including chains that not be called by useChain) | ChainWalletBase[] | [] |
wallet | wallet registry information | Wallet | undefined | undefined |
status | global wallet status involves all active chainWallets if activeOnly is true | WalletStatus | WalletStatus.Disconnected |
message | - | string | undefined | undefined |