@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
44 lines (43 loc) • 1.79 kB
TypeScript
import { z } from "zod";
import { Network } from "../../network";
import { WalletProvider } from "../../wallet-providers";
import { ActionProvider } from "../actionProvider";
import { RequestFaucetFundsV2Schema, SwapSchema } from "./schemas";
/**
* CdpApiActionProvider is an action provider for CDP API.
*
* This provider is used for any action that uses the CDP API, but does not require a CDP Wallet.
*/
export declare class CdpApiActionProvider extends ActionProvider<WalletProvider> {
#private;
/**
* Constructor for the CdpApiActionProvider class.
*/
constructor();
/**
* Requests test tokens from the faucet for the default address in the wallet.
*
* @param walletProvider - The wallet provider to request funds from.
* @param args - The input arguments for the action.
* @returns A confirmation message with transaction details.
*/
faucet(walletProvider: WalletProvider, args: z.infer<typeof RequestFaucetFundsV2Schema>): Promise<string>;
/**
* Swaps tokens using the CDP client.
*
* @param walletProvider - The wallet provider to perform the swap with.
* @param args - The input arguments for the swap action.
* @returns A confirmation message with transaction details.
*/
swap(walletProvider: WalletProvider, args: z.infer<typeof SwapSchema>): Promise<string>;
/**
* Checks if the Cdp action provider supports the given network.
*
* NOTE: Network scoping is done at the action implementation level
*
* @param _ - The network to check.
* @returns True if the Cdp action provider supports the network, false otherwise.
*/
supportsNetwork: (_: Network) => boolean;
}
export declare const cdpApiActionProvider: () => CdpApiActionProvider;