Cosmos Kit
Hooks
- useManager

Hook - useManager

Type - ManagerConext

properties

NameDescriptionTypeDefault
chainRecordscontains all chain registry and assets informationChainRecord[][]
walletReposcontains all chain wallets information, each wallet repo identified with a chainWalletRepo[][]
mainWalletsall main wallets informationMainWalletBase[][]
defaultNameService-NameServiceNameicns

methods

NameDescriptionParametersReturn TypeIs Async
getChainRecordget the basic info of a chain, which contains registry and assets information for this chainchainName: ChainNameChainRecordN
getChainLogoget chain logo urlchainName: ChainNamestring | undefinedN
getWalletRepoget the wallet repository of a chain, which stores all chain wallets for this chainchainName: ChainNameWalletRepoN
getNameServiceget name service object supported on provided chain, if chain not provided, using defaultNameService in ChainProviderchainName?: ChainNameNameServiceY
addChainsadd new chains in providerchains: Chain[],
assetLists: AssetList[],
signerOptions?: SignerOptions,
endpoints?: EndpointOptions["endpoints"]
voidN
addEndpointsadd new endpointsendpoints: EndpointOptions["endpoints"]voidN
onattach event handler to eventsevent: EventName,
handler: (params: any) => void
voidN
offremove attached event handlerevent: EventName,
handler: (params: any) => void
voidN

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.

Examples

add chain (opens in a new tab)