/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ledgersListApiV1LedgersGet } from "../../funcs/ledgersListApiV1LedgersGet.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.ListApiV1LedgersGetRequest$inboundSchema.optional(), }; export const tool$ledgersListApiV1LedgersGet: ToolDefinition = { name: "ledgers-list-api-v1-ledgers-get", description: `List ledgers ### How is the data for this endpoint gathered? Ledgers belonging to an SNS are automatically detected by looking at the SNS-WASM canister. Ledgers such as the ckBTC are currently added manually.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await ledgersListApiV1LedgersGet( 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); }, };