@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
42 lines (41 loc) • 1.2 kB
TypeScript
import z from "zod";
import { claimActionSchema, depositActionSchema, redeemActionSchema } from "../schemas";
import { ApiError } from "./types";
import { Address, Hex } from "viem";
type FetchVaultActionsParams = ({
action: "deposit";
args: z.infer<typeof depositActionSchema>;
} | {
action: "redeem";
args: z.infer<typeof redeemActionSchema>;
} | {
action: "claim-rewards";
args: z.infer<typeof claimActionSchema>;
}) & {
sender: string;
apiKey: string;
};
export type Actions = {
actions: {
tx: {
to: Address;
data: Hex;
value: string;
chainId: number;
};
description: string;
}[];
currentActionIndex: number;
};
/**
* Fetches a list of actions for a vault from the vaultsfyi API.
*
* @param root0 - The fetch parameters
* @param root0.action - The action to fetch
* @param root0.args - The action parameters
* @param root0.sender - The sender address
* @param root0.apiKey - The vaultsfyi API key
* @returns The list of actions
*/
export declare function fetchVaultActions({ action, args, sender, apiKey, }: FetchVaultActionsParams): Promise<Actions | ApiError>;
export {};