UNPKG

@coinbase/agentkit

Version:

Coinbase AgentKit core primitives

99 lines (98 loc) 2.76 kB
import { EvmWalletProvider } from "../../wallet-providers"; import { ApiVault } from "./api/vaults"; import { Actions } from "./api/actions"; /** * Get the link to the vaults.fyi page for a vault * * @param vault - The vault * @returns The link to the vaults.fyi page */ export declare function getVaultsLink(vault: ApiVault): string; /** * Execute a list of actions * * @param wallet - The wallet provider * @param actions - The list of actions to execute * @returns nothing */ export declare function executeActions(wallet: EvmWalletProvider, actions: Actions): Promise<void>; /** * Create a URLSearchParams object from an object * * @param obj - The object to convert * @returns The URLSearchParams object */ export declare function createSearchParams(obj: Record<string, string | number | boolean | undefined>): URLSearchParams; /** * Parse an asset amount with decimals * * @param wallet - The wallet provider * @param assetAddress - The address of the asset * @param amount - The amount to parse * @returns The parsed amount */ export declare function parseAssetAmount(wallet: EvmWalletProvider, assetAddress: string, amount: number): Promise<number>; /** * Transform a vault from the API to a format that can be used by the agent * * @param vault - The vault to transform * @param apyRange - The APY range to use * @returns The transformed vault */ export declare function transformVault(vault: ApiVault, apyRange: "1day" | "7day" | "30day"): { name: string; address: string; network: string; protocol: string; tvlInUsd: number; numberOfHolders: number; apy: { base: number; rewards: number | undefined; total: number; }; token: { address: string; name: string; symbol: string; }; vaultsFyiScore: number; link: string; }; /** * Transform a detailed vault from the API to a format that can be used by the agent * * @param vault - The vault to transform * @param apyRange - The APY range to use * @returns The transformed vault */ export declare function transformDetailedVault(vault: ApiVault, apyRange: "1day" | "7day" | "30day"): { rewards: { apy: number; asset: { address: string; name: string; symbol: string; }; }[]; description: string; additionalIncentives: string; name: string; address: string; network: string; protocol: string; tvlInUsd: number; numberOfHolders: number; apy: { base: number; rewards: number | undefined; total: number; }; token: { address: string; name: string; symbol: string; }; vaultsFyiScore: number; link: string; };