/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet } from "../../funcs/blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations .GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$inboundSchema, }; export const tool$blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet: ToolDefinition = { name: "api-v1-ledgers-ledger-canister-id-blocks-block-hash-get", description: `Get block ### How is data retrieved for this endpoint? Values from the endpoint are retrieved by scraping the blocks from the ledger canister (and associated archive canisters).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet( 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); }, };