@cosmos-kit/react-lite
Version:
cosmos-kit wallet connector
24 lines (23 loc) • 728 B
JavaScript
import { useContext } from 'react';
import { walletContext } from '../provider';
export const useManager = () => {
const context = useContext(walletContext);
if (!context) {
throw new Error('You have forgot to use ChainProvider.');
}
const { walletManager: { mainWallets, chainRecords, walletRepos, defaultNameService, getChainRecord, getWalletRepo, addChains, addEndpoints, getChainLogo, getNameService, on, off, }, } = context;
return {
chainRecords,
walletRepos,
mainWallets,
defaultNameService,
getChainRecord,
getWalletRepo,
addChains,
addEndpoints,
getChainLogo,
getNameService,
on,
off,
};
};