getTokensTool.tsā¢676 B
import { Tool } from "./../../shared/types/tool";
import { z } from "zod";
import { get_tokens } from "../hooks";
export const getTokensToolParams = {
chainId: z.string(),
};
export const getTokensToolZodParams = z.object({
...getTokensToolParams,
});
export type GetTokensToolParamType = z.infer<typeof getTokensToolZodParams>;
export const getTokensTool: Tool<
typeof getTokensToolParams,
{ chainId: string },
string
> = {
name: "OKX_DEX_GET_TOKENS",
description: "Fetches a list of tokens",
parameters: {
...getTokensToolParams,
},
callback: async ({ chainId }: { chainId: string }): Promise<string> => {
return get_tokens(chainId);
},
};