@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
47 lines (46 loc) • 2.46 kB
TypeScript
import { z } from "zod";
import { ActionProvider } from "../actionProvider";
import { EvmWalletProvider } from "../../wallet-providers";
import { Network } from "../../network";
import { ListBaseAccountSpendPermissionsSchema, UseBaseAccountSpendPermissionSchema, RevokeBaseAccountSpendPermissionSchema } from "./schemas";
/**
* BaseAccountActionProvider provides actions to interact with Base Account spend permissions.
*/
export declare class BaseAccountActionProvider extends ActionProvider<EvmWalletProvider> {
/**
* Constructor for the BaseAccountActionProvider.
*/
constructor();
/**
* Lists spend permissions that have been granted to the current wallet by a Base Account.
*
* @param walletProvider - The wallet provider to use for listing permissions.
* @param args - The input arguments for listing spend permissions.
* @returns A JSON string with the list of spend permissions.
*/
listBaseAccountSpendPermissions(walletProvider: EvmWalletProvider, args: z.infer<typeof ListBaseAccountSpendPermissionsSchema>): Promise<string>;
/**
* Uses a spend permission to transfer tokens from a Base Account to the current wallet.
*
* @param walletProvider - The wallet provider to use for the spend operation.
* @param args - The input arguments for using the spend permission.
* @returns A JSON string with the spend operation results.
*/
spendFromBaseAccountPermission(walletProvider: EvmWalletProvider, args: z.infer<typeof UseBaseAccountSpendPermissionSchema>): Promise<string>;
/**
* Revokes a spend permission that was previously granted by a Base Account to the current wallet.
*
* @param walletProvider - The wallet provider to use for the revoke operation.
* @param args - The input arguments for revoking the spend permission.
* @returns A JSON string with the revoke operation results.
*/
revokeBaseAccountSpendPermission(walletProvider: EvmWalletProvider, args: z.infer<typeof RevokeBaseAccountSpendPermissionSchema>): Promise<string>;
/**
* Checks if the Base Account action provider supports the given network.
*
* @param network - The network to check.
* @returns True if the Base Account action provider supports the network, false otherwise.
*/
supportsNetwork: (network: Network) => boolean;
}
export declare const baseAccountActionProvider: () => BaseAccountActionProvider;