UNPKG

@coinbase/agentkit

Version:

Coinbase AgentKit core primitives

103 lines (102 loc) 4.24 kB
/** * Flaunch Action Provider * * This file contains the implementation of the FlaunchActionProvider, * which provides actions for flaunch operations. * * @module flaunch */ import { z } from "zod"; import { ActionProvider } from "../actionProvider"; import { Network } from "../../network"; import { EvmWalletProvider } from "../../wallet-providers"; import { FlaunchSchema, BuyCoinWithETHInputSchema, BuyCoinWithCoinInputSchema, SellCoinSchema } from "./schemas"; /** * Configuration options for the FarcasterActionProvider. */ export interface FlaunchActionProviderConfig { /** * Pinata JWT. */ pinataJwt?: string; } /** * FlaunchActionProvider provides actions for flaunch operations. * * @description * This provider is designed to work with EvmWalletProvider for blockchain interactions. * It supports all evm networks. */ export declare class FlaunchActionProvider extends ActionProvider<EvmWalletProvider> { private readonly pinataJwt; /** * Constructor for the FlaunchActionProvider. * * @param config - The configuration options for the FlaunchActionProvider. */ constructor(config?: FlaunchActionProviderConfig); /** * Example action implementation. * Replace or modify this with your actual action. * * @description * This is a template action that demonstrates the basic structure. * Replace it with your actual implementation. * * @param walletProvider - The wallet provider instance for blockchain interactions * @param args - Arguments defined by FlaunchSchema * @returns A promise that resolves to a string describing the action result */ flaunch(walletProvider: EvmWalletProvider, args: z.infer<typeof FlaunchSchema>): Promise<string>; /** * Buys a flaunch coin using ETH input. * * @param walletProvider - The wallet provider instance for blockchain interactions * @param args - Arguments defined by BuyCoinSchema * @returns A promise that resolves to a string describing the transaction result */ buyCoinWithETHInput(walletProvider: EvmWalletProvider, args: z.infer<typeof BuyCoinWithETHInputSchema>): Promise<string>; /** * Buys a flaunch coin using Coin input. * * @param walletProvider - The wallet provider instance for blockchain interactions * @param args - Arguments defined by BuyCoinSchema * @returns A promise that resolves to a string describing the transaction result */ buyCoinWithCoinInput(walletProvider: EvmWalletProvider, args: z.infer<typeof BuyCoinWithCoinInputSchema>): Promise<string>; /** * Sells a flaunch coin into ETH. * * @param walletProvider - The wallet provider instance for blockchain interactions * @param args - Arguments defined by SellCoinSchema * @returns A promise that resolves to a string describing the transaction result */ sellCoin(walletProvider: EvmWalletProvider, args: z.infer<typeof SellCoinSchema>): Promise<string>; /** * Checks if this provider supports the given network. * * @param network - The network to check support for * @returns True if the network is supported */ supportsNetwork(network: Network): boolean; /** * Handles the process of buying a flaunch coin with ETH. * * @param walletProvider - The wallet provider instance * @param coinAddress - The address of the flaunch coin * @param swapType - The type of swap (EXACT_IN or EXACT_OUT) * @param swapParams - Parameters specific to the swap type * @param swapParams.amountIn - The amount of ETH to spend (for EXACT_IN) * @param swapParams.amountOut - The amount of coins to buy (for EXACT_OUT) * @param slippagePercent - The slippage percentage * @returns A promise that resolves to a string describing the transaction result */ private _buyFlaunchCoin; } /** * Factory function to create a new FlaunchActionProvider instance. * * @param config - Configuration options for the FlaunchActionProvider * @returns A new FlaunchActionProvider instance */ export declare const flaunchActionProvider: (config?: FlaunchActionProviderConfig) => FlaunchActionProvider;