|
|
|
export const config = { |
|
tokenContract: "", |
|
healthRegistry: "", |
|
donationRouter: "", |
|
chainId: "56", |
|
} |
|
|
|
|
|
export async function fetchContractConfig() { |
|
try { |
|
const response = await fetch("/api/contracts") |
|
if (!response.ok) { |
|
throw new Error("Failed to fetch contract configuration") |
|
} |
|
const data = await response.json() |
|
return { |
|
tokenContract: data.flbToken, |
|
healthRegistry: data.healthRegistry, |
|
donationRouter: data.donationRouter, |
|
chainId: data.chainId, |
|
} |
|
} catch (error) { |
|
console.error("Error fetching contract config:", error) |
|
return config |
|
} |
|
} |
|
|