import MethodAbi from "./methodAbi"; import { AbiEntry } from "./abi"; import ContractApi from "./contractApi"; import EventAbi from "./eventAbi"; export default class ContractAbi { /** * Name of the smart contract */ readonly name: string; /** * Abi */ readonly abi: AbiEntry[]; /** * Method ABI instances */ methods: { [key: string]: MethodAbi; }; /** * Method list */ methodList: MethodAbi[]; /** * Method ABI instances */ events: { [key: string]: EventAbi; }; /** * Events list */ eventList: EventAbi[]; constructor(abi: any, name?: string); private loadAbi; /** * Retrieve MethodAbi */ getMethods(): MethodAbi[]; /** * Retrieve method by name * * @param name */ getMethod(name: string): MethodAbi; /** * If the contract has a constructor defined */ hasConstructor(): boolean; /** * Returns the constructor method if any is defined */ getConstructorMethod(): AbiEntry; /** * Retrieve all entries which are marked as an event */ getEvents(): EventAbi[]; buildApi(address: string): ContractApi; /** * Decode the data string from a smart contract event */ decodeInput(data: string): { name: string; params: any; }; }