olympus-module
Version:
Module made by Olympus Labs for easier access to the Olympus protocol through Javascript/Typescript
10 lines (8 loc) • 456 B
text/typescript
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');
};