import type { ChainId } from "../types/enums"; import { type Currency, type CurrencyBase } from "../types/model"; export interface Token { name: string; address?: string; ticker: string; decimals: number; chainId: ChainId; logoURI: string; } export interface ChainMetadata { chainId: ChainId; name: string; logoURI: string; } export interface ChainEntry { chainId: ChainId; name: string; logoURI: string; nativeCurrency?: { symbol: string; decimals: number; } | null; tokens: Token[]; } export interface TokenListResponse { chains: ChainEntry[]; } export declare function tokenToCurrency(token: Token): Currency; /** * Fetches the token list from the TOKEN_LIST_URL and returns it as a structured object. */ export declare function fetchTokenList(url?: string, init?: RequestInit): Promise; /** * Returns all chains from the token list. */ export declare function getChains(chains: ChainEntry[]): ChainMetadata[]; /** * Returns all tokens for the given chainId. */ export declare function tokensByChainId(chains: readonly ChainEntry[], chainId: ChainId): Token[]; /** * Returns the token for the given chainId and address (undefined for native asset). */ export declare function getToken(chains: readonly ChainEntry[], currency: CurrencyBase): Token | undefined;