1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/src/keeper/ContractReflector.ts
Sebastian Gerske dfff8fc228 added event wireup
added lock payment
added fulfilmentOperators
added declarative way to describe dependencies
added service agreement termination
2018-11-20 09:13:03 +01:00

17 lines
624 B
TypeScript

import MethodReflection from "../models/MethodReflection"
import GenericContract from "./contracts/GenericContract"
export default class ContractReflector {
public static async reflectContractMethod(contractName: string, methodName: string): Promise<MethodReflection> {
const contract = await GenericContract.getInstance(contractName)
return {
contractName,
methodName,
address: contract.getAddress(),
signature: contract.getSignatureOfMethod(methodName),
inputs: contract.getInputsOfMethod(methodName),
} as MethodReflection
}
}