import { AptosClient } from 'aptos'; import { AptosParserRepo, AptosLocalCache, AptosSyncedCache, u8, u64, u128 } from '@manahippo/move-to-ts'; import * as lp from './lp'; import * as stdlib from './stdlib'; import * as swap from './swap'; import * as coin_list from './coin_list'; export * as lp from './lp'; export * as stdlib from './stdlib'; export * as swap from './swap'; export * as coin_list from './coin_list'; export { u8, u64, u128 }; export function getProjectRepo(): AptosParserRepo { const repo = new AptosParserRepo(); lp.loadParsers(repo); stdlib.loadParsers(repo); coin_list.loadParsers(repo); swap.loadParsers(repo); repo.addDefaultParsers(); return repo; } export class App { parserRepo: AptosParserRepo; cache: AptosLocalCache; lp: lp.App; stdlib: stdlib.App; coin_list: coin_list.App; swap: swap.App; constructor(public client: AptosClient) { this.parserRepo = getProjectRepo(); this.cache = new AptosLocalCache(); this.lp = new lp.App(client, this.parserRepo, this.cache); this.coin_list = new coin_list.App(client, this.parserRepo, this.cache); this.stdlib = new stdlib.App(client, this.parserRepo, this.cache); this.swap = new swap.App(client, this.parserRepo, this.cache); } }