@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
67 lines (66 loc) • 1.73 kB
TypeScript
import z from "zod";
import { VaultDetailsActionSchema, VaultsActionSchema } from "../schemas";
import { ApiError } from "./types";
type ApyData = {
"1day": number;
"7day": number;
"30day": number;
};
export type ApiVault = {
name: string;
address: string;
network: string;
protocol: string;
isTransactional: boolean;
tvlDetails: {
tvlUsd: string;
};
token: {
name: string;
assetAddress: string;
symbol: string;
decimals: number;
};
apy: {
base: ApyData;
rewards: ApyData;
total: ApyData;
};
numberOfHolders: number;
rewards: {
apy: ApyData;
asset: {
name: string;
symbol: string;
assetAddress: string;
decimals: number;
};
}[];
description: string;
additionalIncentives: string;
score: {
vaultScore: number;
vaultTvlScore: number;
protocolTvlScore: number;
holderScore: number;
networkScore: number;
assetScore: number;
};
};
/**
* Fetches a list of vaults from the vaultsfyi API.
*
* @param args - The action parameters
* @param apiKey - The vaultsfyi API key
* @returns The list of vaults
*/
export declare function fetchVaults(args: z.infer<typeof VaultsActionSchema>, apiKey: string): Promise<ApiVault[] | ApiError>;
/**
* Fetches the details of a specific vault from the vaultsfyi API.
*
* @param args - The action parameters
* @param apiKey - The vaultsfyi API key
* @returns The vault details
*/
export declare function fetchVault(args: z.infer<typeof VaultDetailsActionSchema>, apiKey: string): Promise<ApiError | ApiVault>;
export {};