/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { constructionConstructionHash } from "../../funcs/constructionConstructionHash.js";
import * as models from "../../models/index.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: models.ConstructionHashRequest$inboundSchema,
};
export const tool$constructionConstructionHash: ToolDefinition<typeof args> = {
name: "construction-construction-hash",
description: `Get the Hash of a Signed Transaction
TransactionHash returns the network-specific transaction hash for a signed transaction.`,
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await constructionConstructionHash(
client,
args.request,
{ fetchOptions: { signal: ctx.signal } },
).$inspect();
if (!result.ok) {
return {
content: [{ type: "text", text: result.error.message }],
isError: true,
};
}
const value = result.value;
return formatResult(value, apiCall);
},
};