/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { searchSearchTransactions } from "../../funcs/searchSearchTransactions.js";
import * as models from "../../models/index.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: models.SearchTransactionsRequest$inboundSchema,
};
export const tool$searchSearchTransactions: ToolDefinition<typeof args> = {
name: "search-search-transactions",
description: `[INDEXER] Search for Transactions
\`/search/transactions\` allows the caller to search for transactions that meet certain conditions. Some conditions include matching a transaction hash, containing an operation with a certain status, or containing an operation that affects a certain account. \`/search/transactions\` is considered an "indexer" endpoint and Rosetta implementations are not required to complete it to adhere to the Rosetta spec. However, any Rosetta "indexer" MUST support this endpoint.`,
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await searchSearchTransactions(
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);
},
};