/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { constructionConstructionDerive } from "../../funcs/constructionConstructionDerive.js";
import * as models from "../../models/index.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: models.ConstructionDeriveRequest$inboundSchema,
};
export const tool$constructionConstructionDerive: ToolDefinition<typeof args> =
{
name: "construction-construction-derive",
description: `Derive an AccountIdentifier from a PublicKey
Derive returns the AccountIdentifier associated with a public key. Blockchains that require an on-chain action to create an account should not implement this method.`,
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await constructionConstructionDerive(
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);
},
};