Skip to content

Commit

Permalink
Merge pull request #62 from dwhiffing/no-transaction-value-default
Browse files Browse the repository at this point in the history
No transaction value by default
  • Loading branch information
dwhiffing authored Sep 16, 2024
2 parents db6e8dc + 1aa9398 commit e52f8a2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions utils/generateToolFromABI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export const getContractABIDescriptions = (
{
name: func.name,
description: getToolDescription(contract, func),
valueDescription:
"An integer describing the amount to be included directly in a blockchain transaction. This should be represented as wei for ethereum based contracts, so if the user passes eth or gwei.etc, do the necessary conversion.",
valueDescription: "",
inputs: func.inputs.map((input) => ({
name: input.name ?? "",
description: getInputDescription(input),
Expand All @@ -48,9 +47,11 @@ const generateToolFromABI =
);

let schema: any = {};
schema.transactionValue = z
.string()
.describe(abiDescription?.valueDescription ?? "");
if (abiDescription?.valueDescription) {
schema.transactionValue = z
.string()
.describe(abiDescription?.valueDescription);
}

func.inputs.forEach((input) => {
const inputDescription =
Expand Down

0 comments on commit e52f8a2

Please sign in to comment.