wowok_agent
Version:
Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.
25 lines (24 loc) • 2.17 kB
JavaScript
import { z } from "zod";
import { CoinParamSchema, CallEnvSchema, SubmissionCallSchema, TypeNamedObjectSchema } from "./base.js";
import { AllocatorsSchema, PaymentInfoSchema } from "../query/index.js";
import { NameOrAddressSchema, ReceivedBalanceOrRecentlySchema } from "../common/index.js";
export const CallAllocation_CreateSchema = z.object({
object: TypeNamedObjectSchema.describe("REQUIRED for creating new object. Provide {name: 'yourName', type: 'Allocation'} to create and name the new Allocation object."),
allocators: AllocatorsSchema,
coin: CoinParamSchema,
payment_info: PaymentInfoSchema
}).strict().describe("Create a new Allocation object. Set 'object' field with {name: 'yourName', type: 'Allocation'} to name the new object. Notice:'name' goes INSIDE 'object', NOT at the data root level.");
export const CallAllocation_OperateSchema = z.object({
object: NameOrAddressSchema.describe("REQUIRED for operating existing object. Provide the Allocation object ID or existing name to reference the target object."),
received_coins: ReceivedBalanceOrRecentlySchema.optional().describe("Unwrap the CoinWrapper objects received by the Allocation object and deposit them into the pending allocation balance"),
alloc_by_guard: NameOrAddressSchema.optional().describe("Verify the specified Guard and execute the corresponding fund allocation")
}).strict().describe("Operate on an existing Allocation object. Set 'object' field with the object ID or existing name to specify the target.");
export const CallAllocation_DataSchema = z.union([
CallAllocation_CreateSchema,
CallAllocation_OperateSchema
]).describe("On-chain Allocation operations. USAGE: (1) CREATE NEW: Use CallAllocation_CreateSchema by setting 'object' with OBJECT format {name, type_parameter, ...}. (2) OPERATE EXISTING: Use CallAllocation_OperateSchema by setting 'object' with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. ");
export const CallAllocation_InputSchema = z.object({
data: CallAllocation_DataSchema,
env: CallEnvSchema.optional(),
submission: SubmissionCallSchema.optional(),
}).strict();