import getJSON from 'get-json';

export const getLatestABI = async (abiName) => {
  switch (abiName) {
    case 'INDEX_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/OlympusIndex/latest.json');
      return json.abi;
    }
    case 'FUND_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/OlympusFund/latest.json');
      return json.abi;
    }
    case 'WHITELIST_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/WhitelistProvider/latest.json');
      return json.abi;
    }
    case 'LOCKER_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/Locker/latest.json');
      return json.abi;
    }
    case 'FUTURE_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/FutureContract/latest.json');
      return json.abi;
    }
    case 'REBALANCE_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/RebalanceProvider/latest.json');
      return json.abi;
    }
    case 'MARKETPLACE_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/Marketplace/latest.json');
      return json.abi;
    }
    case 'WITHDRAW_ABI': {
      const json = await getJSON('https://dev.aireach.io/contracts/AsyncWithdraw/latest.json');
      return json.abi;
    }
  }
};
