Hook - useManager
-
required provider: ChainProvider from either
@cosmos-kit/react
or@cosmos-kit/react-lite
-
return type: ManagerConext
Type - ManagerConext
properties
Name | Description | Type | Default |
---|---|---|---|
chainRecords | contains all chain registry and assets information | ChainRecord[] | [] |
walletRepos | contains all chain wallets information, each wallet repo identified with a chain | WalletRepo[] | [] |
mainWallets | all main wallets information | MainWalletBase[] | [] |
defaultNameService | - | NameServiceName | icns |
methods
Name | Description | Parameters | Return Type | Is Async |
---|---|---|---|---|
getChainRecord | get the basic info of a chain, which contains registry and assets information for this chain | chainName: ChainName | ChainRecord | N |
getChainLogo | get chain logo url | chainName: ChainName | string | undefined | N |
getWalletRepo | get the wallet repository of a chain, which stores all chain wallets for this chain | chainName: ChainName | WalletRepo | N |
getNameService | get name service object supported on provided chain, if chain not provided, using defaultNameService in ChainProvider | chainName?: ChainName | NameService | Y |
addChains | add new chains in provider | chains: Chain[] ,assetLists: AssetList[] ,signerOptions?: SignerOptions ,endpoints?: EndpointOptions["endpoints"] | void | N |
addEndpoints | add new endpoints | endpoints: EndpointOptions["endpoints"] | void | N |
on | attach event handler to events | event: EventName ,handler: (params: any) => void | void | N |
off | remove attached event handler | event: EventName ,handler: (params: any) => void | void | N |
Events
refresh_connection
Every time the registered events connectEventNamesOnWindow
and connectEventNamesOnClient
(see wallet registry) are triggered, and the dapp has been connected to the corresponding wallet, the refresh_connection
event will also be triggered.