@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
72 lines (71 loc) • 3.01 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"),
symbol: zod_1.z.string().min(1).describe("The symbol of the token"),
imageUrl: zod_1.z.string().url().describe("The URL to the token image"),
description: zod_1.z.string().describe("The description of the token"),
websiteUrl: zod_1.z.string().url().optional().describe("The (optional) URL to the token website"),
discordUrl: zod_1.z.string().url().optional().describe("The (optional) URL to the token Discord"),
twitterUrl: zod_1.z.string().url().optional().describe("The (optional) URL to the token Twitter"),
telegramUrl: zod_1.z.string().url().optional().describe("The (optional) URL to the token Telegram"),
});
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%"),
});