export interface Attribute { trait_type?: string; value: string | number; display_type?: string; } export interface TokenMetadata { name: string; description: string; image?: string; external_url?: string; attributes?: Attribute[]; background_color?: string; animation_url?: string; youtube_url?: string; /** * Additional free-form fields (e.g. coingeckoId, documentation, etc.) */ extensions?: Record; /** * Tag IDs referencing top-level TokenListFile.tags. * Must match /^[a-z0-9-_]{1,32}$/ per JSON schema. */ tags?: string[]; /** * Optional absolute URI for the token logo. * Useful for UIs that want a direct URL separate from `image`. */ logoURI?: string; } export type TokenInfo = Partial & { address: string; chainId: number; symbol: string; decimals: number; totalSupply?: string; }; export interface TokenListVersion { major: number; minor: number; patch: number; } export interface TokenListTag { name: string; description?: string; } export type TokenListTagId = string; export interface TokenListLicense { name: string; url?: string; } export type TokenListSourceType = "coingecko" | "cmc" | "project" | "explorer" | "manual" | "other"; export interface TokenListSource { name: string; url?: string; type?: TokenListSourceType; [key: string]: unknown; } export interface TokenListVerification { policy?: string; lastAudit?: string; auditor?: string; [key: string]: unknown; } export type TokenListFile = { name?: string; timestamp?: string; version?: TokenListVersion; logoURI?: string; keywords?: string[]; license?: TokenListLicense; /** * Registry of tags: keys are tag IDs, values are definitions. * Keys must match /^[a-z0-9-_]{1,32}$/ per JSON schema. */ tags?: Record; sources?: TokenListSource[]; verification?: TokenListVerification; tokens: TokenInfo[]; };