@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
58 lines (57 loc) • 2.85 kB
TypeScript
import { z } from "zod";
import { CdpSmartWalletProvider } from "../../wallet-providers/cdpSmartWalletProvider";
import { ActionProvider } from "../actionProvider";
import { UseSpendPermissionSchema, ListSpendPermissionsSchema, SwapSchema } from "./schemas";
import type { Network } from "../../network";
/**
* CdpSmartWalletActionProvider is an action provider for CDP Smart Wallet specific actions.
*
* This provider is scoped specifically to CdpSmartWalletProvider and provides actions
* that are optimized for smart wallet functionality.
*/
export declare class CdpSmartWalletActionProvider extends ActionProvider<CdpSmartWalletProvider> {
/**
* Constructor for the CdpSmartWalletActionProvider class.
*/
constructor();
/**
* Lists spend permissions for a smart account.
*
* @param walletProvider - The smart 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: CdpSmartWalletProvider, args: z.infer<typeof ListSpendPermissionsSchema>): Promise<string>;
/**
* Uses a spend permission to transfer tokens from a smart account to the current smart wallet.
*
* @param walletProvider - The smart 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: CdpSmartWalletProvider, args: z.infer<typeof UseSpendPermissionSchema>): Promise<string>;
/**
* Gets a price quote for swapping tokens using the CDP Swap API.
*
* @param walletProvider - The smart 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: CdpSmartWalletProvider, args: z.infer<typeof SwapSchema>): Promise<string>;
/**
* Swaps tokens using the CDP client.
*
* @param walletProvider - The smart 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: CdpSmartWalletProvider, args: z.infer<typeof SwapSchema>): Promise<string>;
/**
* Checks if the smart wallet action provider supports the given network.
*
* @param _ - The network to check.
* @returns True if the smart wallet action provider supports the network, false otherwise.
*/
supportsNetwork: (_: Network) => boolean;
}
export declare const cdpSmartWalletActionProvider: () => CdpSmartWalletActionProvider;