import { TokenInfo } from '@uniswap/token-lists'; /** * @public */ export interface TokenList { name: string; logoURI: string; tokens: TokenInfo[]; } /** * Fetches ERC20 token list under a given address and filters them by chain id. Optionally it can filter also by token tags. * @public * @param tokenListURI URI to fetch token list from * @param overrideChainId chain id to filter tokens by (if not specified then current network is used) * @param tags list of tags to filter tokens by (token is included if it contains any of given tags) * @returns * `name`: `string` - token list name. * `logoURI`: `string` - URI to get token list logo from. * `tokens`: `TokenInfo[]` - list of `TokenInfo` objects. * If an error occurs `undefined` is returned. * * @example * const { name, logoURI, tokens } = useTokenList(UNISWAP_DEFAULT_TOKEN_LIST_URI) || {} * const httpSource = logoURI && logoURI.startsWith('ipfs') ? logoURI.replace('ipfs://', 'https://ipfs.io/ipfs/') : logoURI * return ( *