export interface ContractConfig {
  name: string
  chain_id: number
  address: string
}

export async function fetchContracts(): Promise<ContractConfig[]> {
  try {
    const res = await fetch('/api/contracts')
    if (!res.ok) return []
    const data = await res.json()
    return data.contracts ?? []
  } catch {
    return []
  }
}
