import { useContext } from 'react' import { ConnectionContext } from '../providers/ConnectionProvider' import type { WalletMetadata } from '@meshconnect/uwc-types' /** * Hook for accessing the list of configured wallets * @returns Array of wallet metadata including names, IDs, and supported networks * @throws Error if used outside of ConnectionProvider * @example * ```tsx * const wallets = useWallets() * * wallets.forEach(wallet => { * console.log(`${wallet.name}: ${wallet.id}`) * }) * ``` */ export function useWallets(): WalletMetadata[] { const context = useContext(ConnectionContext) if (!context) { throw new Error('useWallets must be used within a ConnectionProvider') } return context.wallets }