import { Contract } from './contract' ; import { Account } from '../accounts' ; import { EOSManager } from '../eosManager' ; /**
 * Provides a set of methods to create contract references for already existing contracts
 */ export class ContractLoader { author Kevin Brown <github.com/thekevinbrown>
     *  param accountOrName returns public static async at < T extends Contract > ( accountOrName ) { const account = accountOrName instanceof Account ? accountOrName : new Account ( accountOrName ) ; const { abi } = await EOSManager . rpc . get_abi ( account . name ) ; if ( ! abi ) throw new Error ( `Could not load ABI for contract at '${ account . name }'.` ) ; const { actions , types } = await EOSManager . api . getContract ( account . name ) ; return new Contract ( { eos : EOSManager . api , account , abi , actions , types , } ) as T ; } }