import axios from "axios";
export const fetchTokenInfo = async (denom, baseUrl) => {
  try {
    const url = `${baseUrl}/api/coincodex/get_coin/${denom}`;
    const response = await axios.get(url);
    if (response) return response.data;
    return undefined;
  } catch (error) {
    return undefined;
  }
};
export const fetchTokenHistory = async (denom, startDate, endDate, samples, baseUrl) => {
  try {
    const url = `${baseUrl}/api/coincodex/get_coin_history/${denom}/${startDate}/${endDate}/${samples}`;
    const response = await axios.get(url);
    if (response) return response.data;
    return undefined;
  } catch (error) {
    return undefined;
  }
};