import { getLatestABI } from '../services/AbiService';
import { FundType } from '../interfaces/Enums';

export const getProductABIByType = async (type: number): Promise<any> => {
  if (type === FundType.Index) { return await getLatestABI('INDEX_ABI'); }
  if (type === FundType.Fund) { return await getLatestABI('FUND_ABI'); }
  if (type === FundType.Future) { return await getLatestABI('FUTURE_ABI'); }
  throw new Error('Derivative type is unknown');
};
