Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function generateFunction(fn: FunctionDeclaration): string {
return `
${fn.name}(${generateInputTypes(fn.inputs)}${
!isConstant(fn) && !isConstantFn(fn) ? "overrides?: TransactionOverrides" : ""
}): Promise<${
fn.stateMutability === "pure" || fn.stateMutability === "view"
? generateOutputTypes(fn.outputs)
: "ContractTransaction"
}>;
`;
}
function generateFunction(fn: FunctionDeclaration): string {
if (isConstant(fn) || isConstantFn(fn)) {
return generateConstantFunction(fn);
}
return `
${fn.name}: {
(${generateInputTypes(
fn.inputs,
)} txDetails?: Truffle.TransactionDetails): Promise;
call(${generateInputTypes(
fn.inputs,
)} txDetails?: Truffle.TransactionDetails): Promise<${generateOutputTypes(fn.outputs)}>;
sendTransaction(${generateInputTypes(
fn.inputs,
)} txDetails?: Truffle.TransactionDetails): Promise;
estimateGas(${generateInputTypes(
fn.inputs,