@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
124 lines (123 loc) • 4.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SellCoinSchema = exports.BuyCoinWithCoinInputSchema = exports.BuyCoinWithETHInputSchema = exports.FlaunchSchema = void 0;
const zod_1 = require("zod");
/**
* Action schemas for the flaunch action provider.
*
* This file contains the Zod schemas that define the shape and validation
* rules for action parameters in the flaunch action provider.
*/
/**
* Schema for Flaunch token creation
*/
exports.FlaunchSchema = zod_1.z
.object({
name: zod_1.z.string().min(1).describe("The name of the token to flaunch"),
symbol: zod_1.z.string().min(1).describe("The symbol of the token to flaunch"),
image: zod_1.z.string().describe("Local image file path or URL to the token image"),
description: zod_1.z.string().describe("Description of the token"),
websiteUrl: zod_1.z.string().optional().describe("URL to the token website"),
discordUrl: zod_1.z.string().optional().describe("URL to the token Discord"),
twitterUrl: zod_1.z.string().optional().describe("URL to the token Twitter"),
telegramUrl: zod_1.z.string().optional().describe("URL to the token Telegram"),
fairLaunchPercent: zod_1.z
.number()
.min(0)
.max(100)
.default(60)
.describe("The percentage of tokens for fair launch (defaults to 60%)"),
fairLaunchDuration: zod_1.z
.number()
.min(0)
.default(30)
.describe("The duration of the fair launch in minutes (defaults to 30 minutes)"),
initialMarketCapUSD: zod_1.z
.number()
.min(100)
.max(100000)
.default(10000)
.describe("The initial market cap in USD (defaults to 10000 USD)"),
creatorFeeAllocationPercent: zod_1.z
.number()
.min(0)
.max(100)
.default(80)
.describe("The percentage of the fees allocated to the creator and optional additional receivers (defaults to 80%). Remainder goes to community via token buy backs"),
creatorSplitPercent: zod_1.z
.number()
.min(0)
.max(100)
.default(100)
.describe("The percentage of the fees allocated to the creator. Defaults to 100%, set to smaller value if fees are to be distributed to additional receivers"),
splitReceivers: zod_1.z
.array(zod_1.z.object({
address: zod_1.z
.string()
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
.describe("The recipient's address"),
percent: zod_1.z
.number()
.min(0)
.max(100)
.describe("The percentage share for the recipient. All split receiver percentages must add up to 100%"),
}))
.optional()
.describe("The recipients for the fee split (optional)"),
preminePercent: zod_1.z
.number()
.min(0)
.max(100)
.default(0)
.describe("The percentage of total supply to premine (defaults to 0%, max is equal to fairLaunchPercent)"),
})
.strip()
.describe("Instructions for creating a new memecoin using the flaunch protocol.");
exports.BuyCoinWithETHInputSchema = zod_1.z.object({
coinAddress: zod_1.z
.string()
.describe("The address of the flaunch coin to buy")
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format"),
amountIn: zod_1.z
.string()
.regex(/^\d+(\.\d+)?$/, "Must be a valid integer or decimal value")
.describe("The quantity of ETH to spend on the flaunch coin, in whole units"),
slippagePercent: zod_1.z
.number()
.min(0)
.max(100)
.default(5)
.describe("The slippage percentage. Default to 5%"),
});
exports.BuyCoinWithCoinInputSchema = zod_1.z.object({
coinAddress: zod_1.z
.string()
.describe("The address of the flaunch coin to buy")
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format"),
amountOut: zod_1.z
.string()
.regex(/^\d+(\.\d+)?$/, "Must be a valid integer or decimal value")
.describe("The quantity of the flaunch coin to buy, in whole units"),
slippagePercent: zod_1.z
.number()
.min(0)
.max(100)
.default(5)
.describe("The slippage percentage. Default to 5%"),
});
exports.SellCoinSchema = zod_1.z.object({
coinAddress: zod_1.z
.string()
.describe("The address of the flaunch coin to sell")
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format"),
amountIn: zod_1.z
.string()
.regex(/^\d+(\.\d+)?$/, "Must be a valid integer or decimal value")
.describe("The quantity of the flaunch coin to sell, in whole units"),
slippagePercent: zod_1.z
.number()
.min(0)
.max(100)
.default(5)
.describe("The slippage percentage. Default to 5%"),
});