import { AptosClient } from "aptos"; import { AptosParserRepo, AptosLocalCache, AptosSyncedCache } from "@manahippo/move-to-ts"; import * as Beneficiary from './beneficiary'; import * as Controller from './controller'; import * as Event from './event'; import * as Implements from './implements'; import * as Init from './init'; import * as Interface from './interface'; import * as Math from './math'; export * as Beneficiary from './beneficiary'; export * as Controller from './controller'; export * as Event from './event'; export * as Implements from './implements'; export * as Init from './init'; export * as Interface from './interface'; export * as Math from './math'; export function loadParsers(repo: AptosParserRepo) { Beneficiary.loadParsers(repo); Controller.loadParsers(repo); Event.loadParsers(repo); Implements.loadParsers(repo); Init.loadParsers(repo); Interface.loadParsers(repo); Math.loadParsers(repo); } export function getPackageRepo(): AptosParserRepo { const repo = new AptosParserRepo(); loadParsers(repo); repo.addDefaultParsers(); return repo; } export type AppType = { client: AptosClient, repo: AptosParserRepo, cache: AptosLocalCache, }; export class App { beneficiary : Beneficiary.App controller : Controller.App event : Event.App implements : Implements.App init : Init.App interface : Interface.App math : Math.App constructor( public client: AptosClient, public repo: AptosParserRepo, public cache: AptosLocalCache, ) { this.beneficiary = new Beneficiary.App(client, repo, cache); this.controller = new Controller.App(client, repo, cache); this.event = new Event.App(client, repo, cache); this.implements = new Implements.App(client, repo, cache); this.init = new Init.App(client, repo, cache); this.interface = new Interface.App(client, repo, cache); this.math = new Math.App(client, repo, cache); } }