@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
59 lines (58 loc) • 2.89 kB
TypeScript
import { z } from "zod";
import { WalletProvider } from "../../wallet-providers";
import { CdpEvmWalletProvider } from "../../wallet-providers/cdpEvmWalletProvider";
import { ActionProvider } from "../actionProvider";
import { UseSpendPermissionSchema, ListSpendPermissionsSchema, SwapSchema } from "./schemas";
import type { Network } from "../../network";
/**
* CdpEvmWalletActionProvider is an action provider for CDP EVM Wallet specific actions.
*
* This provider is scoped specifically to EVM wallets and provides actions
* that are optimized for EVM functionality, including spend permission usage.
*/
export declare class CdpEvmWalletActionProvider extends ActionProvider<CdpEvmWalletProvider> {
/**
* Constructor for the CdpEvmWalletActionProvider class.
*/
constructor();
/**
* Lists spend permissions for a smart account.
*
* @param walletProvider - The server wallet provider to use for listing permissions.
* @param args - The input arguments for listing spend permissions.
* @returns A list of spend permissions available to the current wallet.
*/
listSpendPermissions(walletProvider: WalletProvider, args: z.infer<typeof ListSpendPermissionsSchema>): Promise<string>;
/**
* Uses a spend permission to transfer tokens from a smart account to the current EVM wallet.
*
* @param walletProvider - The EVM wallet provider to use for the spend operation.
* @param args - The input arguments for using the spend permission.
* @returns A confirmation message with transaction details.
*/
useSpendPermission(walletProvider: CdpEvmWalletProvider, args: z.infer<typeof UseSpendPermissionSchema>): Promise<string>;
/**
* Gets a price quote for swapping tokens using the CDP Swap API.
*
* @param walletProvider - The EVM wallet provider to get the quote for.
* @param args - The input arguments for the swap price action.
* @returns A JSON string with detailed swap price quote information.
*/
getSwapPrice(walletProvider: CdpEvmWalletProvider, args: z.infer<typeof SwapSchema>): Promise<string>;
/**
* Swaps tokens using the CDP client.
*
* @param walletProvider - The EVM wallet provider to perform the swap with.
* @param args - The input arguments for the swap action.
* @returns A JSON string with detailed swap execution information.
*/
swap(walletProvider: CdpEvmWalletProvider, args: z.infer<typeof SwapSchema>): Promise<string>;
/**
* Checks if the EVM wallet action provider supports the given network.
*
* @param network - The network to check.
* @returns True if the EVM wallet action provider supports the network, false otherwise.
*/
supportsNetwork: (network: Network) => boolean;
}
export declare const cdpEvmWalletActionProvider: () => CdpEvmWalletActionProvider;