UNPKG

@coinbase/agentkit

Version:

Coinbase AgentKit core primitives

154 lines (153 loc) 6.25 kB
/** * Vaultsfyi Action Provider * * This file contains the implementation of the VaultsfyiActionProvider, * which provides actions for vaultsfyi operations. * * @module vaultsfyi */ import { z } from "zod"; import { ActionProvider } from "../actionProvider"; import { Network } from "../../network"; import { EvmWalletProvider } from "../../wallet-providers"; import { executeStepActionSchema, transactionContextActionSchema, VaultDetailsActionSchema, VaultHistoricalDataActionSchema, VaultsActionSchema, claimRewardsActionSchema, benchmarkActionSchema, historicalBenchmarkActionSchema, totalVaultReturnsActionSchema, userEventsActionSchema } from "./schemas"; /** * Configuration options for the VaultsfyiActionProvider. */ export interface VaultsfyiActionProviderConfig { /** * vaults.fyi API Key. */ apiKey?: string; } /** * VaultsfyiActionProvider provides actions for vaultsfyi operations. * * @description * This provider is designed to work with EvmWalletProvider for blockchain interactions. * It supports all evm networks. */ export declare class VaultsfyiActionProvider extends ActionProvider<EvmWalletProvider> { private readonly apiKey; /** * Constructor for the VaultsfyiActionProvider. * * @param config - Configuration options for the provider */ constructor(config?: VaultsfyiActionProviderConfig); /** * vaults action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: token, network... * @returns A list of vaults. */ vaults(wallet: EvmWalletProvider, args: z.infer<typeof VaultsActionSchema>): Promise<string>; /** * vault details action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: address, network, apyRange * @returns A detailed view of a single vault. */ vaultDetails(wallet: EvmWalletProvider, args: z.infer<typeof VaultDetailsActionSchema>): Promise<string>; /** * vault historical data action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: address, network, date, apyRange * @returns A detailed view of a single vault. */ vaultHistoricalData(wallet: EvmWalletProvider, args: z.infer<typeof VaultHistoricalDataActionSchema>): Promise<string>; /** * Transaction context action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments * @returns A result message */ transactionContext(wallet: EvmWalletProvider, args: z.infer<typeof transactionContextActionSchema>): Promise<string>; /** * Deposit action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments * @returns A result message */ executeStep(wallet: EvmWalletProvider, args: z.infer<typeof executeStepActionSchema>): Promise<string>; /** * Returns the users wallet token balances. * * @param wallet - The wallet provider instance for blockchain interactions * @returns A record of the users balances */ idleAssets(wallet: EvmWalletProvider): Promise<string>; /** * Returns the users positions. * * @param wallet - The wallet provider instance for blockchain interactions * @returns A record of the users positions */ positions(wallet: EvmWalletProvider): Promise<string>; /** * Rewards context action * * @param wallet - The wallet provider instance for blockchain interactions * @returns A record of rewards that are available to the user each with a unique claim id */ rewardsContext(wallet: EvmWalletProvider): Promise<string>; /** * Claim rewards action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: claimIds * @returns A message indicating the success of the claim */ claimRewards(wallet: EvmWalletProvider, args: z.infer<typeof claimRewardsActionSchema>): Promise<string>; /** * Benchmark APY action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: network, benchmarkCode * @returns benchmark APY data */ benchmarkApy(wallet: EvmWalletProvider, args: z.infer<typeof benchmarkActionSchema>): Promise<string>; /** * Historical benchmark APY action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: network, benchmarkCode, fromDate, toDate, page, perPage * @returns A list of historical benchmark APY data */ historicalBenchmarkApy(wallet: EvmWalletProvider, args: z.infer<typeof historicalBenchmarkActionSchema>): Promise<string>; /** * Total vault returns action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: vaultAddress, network, userAddress * @returns An amount of the users total returns */ totalVaultReturns(wallet: EvmWalletProvider, args: z.infer<typeof totalVaultReturnsActionSchema>): Promise<string>; /** * User events action * * @param wallet - The wallet provider instance for blockchain interactions * @param args - Input arguments: vaultAddress, network, userAddress * @returns A list of the users actions on a vault */ userEvents(wallet: EvmWalletProvider, args: z.infer<typeof userEventsActionSchema>): Promise<string>; /** * Checks if this provider supports the given network. * * @param network - The network to check support for * @returns True if the network is supported */ supportsNetwork(network: Network): boolean; } /** * Factory function to create a new VaultsfyiActionProvider instance. * * @param config - Configuration options for the provider * @returns A new VaultsfyiActionProvider instance */ export declare const vaultsfyiActionProvider: (config?: VaultsfyiActionProviderConfig) => VaultsfyiActionProvider;