/**
 * Base adapter interface for external API integrations
 */
export interface ExternalApiAdapter {
  /**
   * Check if the chain is supported by this API provider
   */
  checkChainSupport(chainId: number): Promise<boolean>;

  /**
   * Get token metadata by contract address
   */
  getTokenByContract(chainId: number, address: string): Promise<TokenMetadata | null>;

  /**
   * Get market data for a token
   */
  getMarketData(chainId: number, address: string): Promise<MarketData | null>;

  /**
   * Get provider name
   */
  getProviderName(): string;
}

export interface TokenMetadata {
  id?: string; // Provider-specific ID (e.g., CoinGecko coin ID)
  name?: string;
  symbol?: string;
  description?: string;
  logoUrl?: string;
  websiteUrl?: string;
  socialLinks?: {
    twitter?: string;
    telegram?: string;
    discord?: string;
    github?: string;
  };
}

export interface MarketData {
  priceUsd?: number;
  priceChange24h?: number;
  volume24h?: number;
  marketCapUsd?: number;
  liquidityUsd?: number;
  lastUpdated?: Date;
}

export interface ApiCacheEntry {
  key: string;
  data: unknown;
  expiresAt: Date;
}
