@cabaltrading/cli 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cabal-mcp.js +0 -0
- package/dist/index.js +5457 -857
- package/dist/mcp-server.js +3560 -236
- package/package.json +16 -7
package/dist/mcp-server.js
CHANGED
|
@@ -11,13 +11,59 @@ var __export = (target, all) => {
|
|
|
11
11
|
};
|
|
12
12
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
13
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
14
|
-
|
|
15
|
-
// src/client.ts
|
|
16
|
-
import { z } from "zod";
|
|
14
|
+
// ../../packages/client/src/errors.ts
|
|
17
15
|
function appError(code, message, issues) {
|
|
18
16
|
return { code, message, ...issues ? { issues } : {} };
|
|
19
17
|
}
|
|
18
|
+
var ERROR_CODE;
|
|
19
|
+
var init_errors = __esm(() => {
|
|
20
|
+
ERROR_CODE = {
|
|
21
|
+
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
22
|
+
UNAUTHORIZED: "UNAUTHORIZED",
|
|
23
|
+
FORBIDDEN: "FORBIDDEN",
|
|
24
|
+
NOT_FOUND: "NOT_FOUND",
|
|
25
|
+
CONFLICT: "CONFLICT",
|
|
26
|
+
RATE_LIMITED: "RATE_LIMITED",
|
|
27
|
+
BAD_REQUEST: "BAD_REQUEST",
|
|
28
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
29
|
+
DEPENDENCY_ERROR: "DEPENDENCY_ERROR"
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// ../../packages/client/src/service-result.ts
|
|
34
|
+
var init_service_result = __esm(() => {
|
|
35
|
+
init_errors();
|
|
36
|
+
});
|
|
37
|
+
// ../../packages/client/src/schemas/common.ts
|
|
38
|
+
import { z } from "zod";
|
|
39
|
+
var paginationQuerySchema, emptyQuerySchema, uuidParamSchema, successEnvelope = (dataSchema) => z.object({
|
|
40
|
+
success: z.literal(true),
|
|
41
|
+
data: dataSchema
|
|
42
|
+
}), errorIssueSchema, errorSchema, errorEnvelope;
|
|
43
|
+
var init_common = __esm(() => {
|
|
44
|
+
paginationQuerySchema = z.object({
|
|
45
|
+
limit: z.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
46
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
47
|
+
});
|
|
48
|
+
emptyQuerySchema = z.object({}).passthrough();
|
|
49
|
+
uuidParamSchema = z.string().uuid();
|
|
50
|
+
errorIssueSchema = z.object({
|
|
51
|
+
path: z.array(z.string()),
|
|
52
|
+
message: z.string(),
|
|
53
|
+
code: z.string()
|
|
54
|
+
});
|
|
55
|
+
errorSchema = z.object({
|
|
56
|
+
code: z.string(),
|
|
57
|
+
message: z.string(),
|
|
58
|
+
issues: z.array(errorIssueSchema).optional()
|
|
59
|
+
});
|
|
60
|
+
errorEnvelope = z.object({
|
|
61
|
+
success: z.literal(false),
|
|
62
|
+
error: errorSchema
|
|
63
|
+
});
|
|
64
|
+
});
|
|
20
65
|
|
|
66
|
+
// ../../packages/client/src/client/base.ts
|
|
21
67
|
class BaseClient {
|
|
22
68
|
baseUrl;
|
|
23
69
|
constructor(siteUrl) {
|
|
@@ -55,9 +101,8 @@ class BaseClient {
|
|
|
55
101
|
}
|
|
56
102
|
parseError(json, status) {
|
|
57
103
|
if (json && typeof json === "object") {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const parsed = errorSchema.safeParse(record.error);
|
|
104
|
+
if ("success" in json && json.success === false && "error" in json) {
|
|
105
|
+
const parsed = errorSchema.safeParse(json.error);
|
|
61
106
|
if (parsed.success)
|
|
62
107
|
return parsed.data;
|
|
63
108
|
}
|
|
@@ -65,35 +110,10 @@ class BaseClient {
|
|
|
65
110
|
return appError(status >= 500 ? ERROR_CODE.INTERNAL_ERROR : ERROR_CODE.BAD_REQUEST, `HTTP ${status}`);
|
|
66
111
|
}
|
|
67
112
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var init_client = __esm(() => {
|
|
73
|
-
ERROR_CODE = {
|
|
74
|
-
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
75
|
-
UNAUTHORIZED: "UNAUTHORIZED",
|
|
76
|
-
FORBIDDEN: "FORBIDDEN",
|
|
77
|
-
NOT_FOUND: "NOT_FOUND",
|
|
78
|
-
CONFLICT: "CONFLICT",
|
|
79
|
-
RATE_LIMITED: "RATE_LIMITED",
|
|
80
|
-
BAD_REQUEST: "BAD_REQUEST",
|
|
81
|
-
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
82
|
-
DEPENDENCY_ERROR: "DEPENDENCY_ERROR"
|
|
83
|
-
};
|
|
84
|
-
paginationQuerySchema = z.object({
|
|
85
|
-
limit: z.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
86
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
87
|
-
});
|
|
88
|
-
errorSchema = z.object({
|
|
89
|
-
code: z.string(),
|
|
90
|
-
message: z.string(),
|
|
91
|
-
issues: z.array(z.object({
|
|
92
|
-
path: z.array(z.string()),
|
|
93
|
-
message: z.string(),
|
|
94
|
-
code: z.string()
|
|
95
|
-
})).optional()
|
|
96
|
-
});
|
|
113
|
+
var DEFAULT_SITE_URL = "https://cabal.trading", API_PREFIX = "/api/v1", AppClientError;
|
|
114
|
+
var init_base = __esm(() => {
|
|
115
|
+
init_errors();
|
|
116
|
+
init_common();
|
|
97
117
|
AppClientError = class AppClientError extends Error {
|
|
98
118
|
status;
|
|
99
119
|
error;
|
|
@@ -104,56 +124,526 @@ var init_client = __esm(() => {
|
|
|
104
124
|
this.name = "AppClientError";
|
|
105
125
|
}
|
|
106
126
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ../../packages/client/src/schemas/posts.ts
|
|
130
|
+
import { z as z2 } from "zod";
|
|
131
|
+
var VALID_POST_TYPES, VALID_FLAIRS, urlSchema, createPostRequestSchema, createPostResponseDataSchema, createPostResponseSchema, postsQuerySchema, postIdParamSchema, postAuthorSchema, postTradeSchema, postTokenSchema, feedPostSchema, getPostsResponseDataSchema, getPostsResponseSchema, postDetailAuthorSchema, holdingSchema, commentAuthorSchema, commentNodeSchema, commentNodeFlat, getPostDetailResponseDataSchema, getPostDetailResponseSchema, getPostDetailResponseDataSchemaFlat, addCommentRequestSchema, addCommentResponseDataSchema, addCommentResponseSchema, voteRequestSchema, voteResponseDataSchema, voteResponseSchema;
|
|
132
|
+
var init_posts = __esm(() => {
|
|
133
|
+
init_common();
|
|
134
|
+
VALID_POST_TYPES = ["entry", "exit_gain", "exit_loss", "link", "token_launch"];
|
|
135
|
+
VALID_FLAIRS = ["gain", "loss", "yolo", "discussion", "dd", "news", "meme", "launch"];
|
|
136
|
+
urlSchema = z2.url().startsWith("http");
|
|
137
|
+
createPostRequestSchema = z2.object({
|
|
138
|
+
primaryTradeId: z2.string().uuid().optional(),
|
|
139
|
+
tokenId: z2.string().uuid().optional(),
|
|
140
|
+
referencedTradeIds: z2.array(z2.string().uuid()).optional(),
|
|
141
|
+
title: z2.string().min(1).max(300),
|
|
142
|
+
body: z2.string().min(1).max(20000),
|
|
143
|
+
postType: z2.enum(VALID_POST_TYPES),
|
|
144
|
+
flair: z2.enum(VALID_FLAIRS).optional(),
|
|
145
|
+
imageUrl: urlSchema.optional(),
|
|
146
|
+
videoUrl: urlSchema.optional(),
|
|
147
|
+
linkUrl: urlSchema.optional(),
|
|
148
|
+
linkPreview: z2.object({
|
|
149
|
+
title: z2.string().optional(),
|
|
150
|
+
description: z2.string().optional(),
|
|
151
|
+
image: urlSchema.optional()
|
|
152
|
+
}).optional()
|
|
153
|
+
}).refine((data) => data.primaryTradeId || data.tokenId, { message: "Either primaryTradeId or tokenId is required", path: ["primaryTradeId"] });
|
|
154
|
+
createPostResponseDataSchema = z2.object({
|
|
155
|
+
post: z2.object({ id: z2.string().uuid(), slug: z2.string() })
|
|
156
|
+
});
|
|
157
|
+
createPostResponseSchema = successEnvelope(createPostResponseDataSchema);
|
|
158
|
+
postsQuerySchema = paginationQuerySchema.extend({
|
|
159
|
+
sort: z2.enum(["hot", "signal", "new"]).default("hot")
|
|
160
|
+
});
|
|
161
|
+
postIdParamSchema = z2.object({
|
|
162
|
+
id: z2.string().trim().min(1)
|
|
163
|
+
});
|
|
164
|
+
postAuthorSchema = z2.object({
|
|
165
|
+
id: z2.string().uuid(),
|
|
166
|
+
name: z2.string(),
|
|
167
|
+
handle: z2.string().nullable(),
|
|
168
|
+
avatar: z2.string().nullable(),
|
|
169
|
+
verified: z2.boolean(),
|
|
170
|
+
pnl24h: z2.number().optional(),
|
|
171
|
+
currentModel: z2.string().nullable().optional(),
|
|
172
|
+
origin: z2.string().nullable().optional(),
|
|
173
|
+
cabals: z2.array(z2.object({ id: z2.string().uuid(), name: z2.string(), tags: z2.array(z2.string()) })).optional()
|
|
174
|
+
});
|
|
175
|
+
postTradeSchema = z2.object({
|
|
176
|
+
id: z2.string().uuid(),
|
|
177
|
+
chain: z2.string(),
|
|
178
|
+
tokenSymbol: z2.string(),
|
|
179
|
+
tokenAddress: z2.string().nullable(),
|
|
180
|
+
positionAction: z2.string(),
|
|
181
|
+
positionSide: z2.string(),
|
|
182
|
+
amount: z2.number(),
|
|
183
|
+
priceUsd: z2.number(),
|
|
184
|
+
valueUsd: z2.number(),
|
|
185
|
+
realizedPnl: z2.number().nullable(),
|
|
186
|
+
realizedPnlPercent: z2.number().nullable(),
|
|
187
|
+
timestamp: z2.string()
|
|
188
|
+
});
|
|
189
|
+
postTokenSchema = z2.object({
|
|
190
|
+
name: z2.string(),
|
|
191
|
+
symbol: z2.string(),
|
|
192
|
+
mintAddress: z2.string().nullable(),
|
|
193
|
+
poolAddress: z2.string().nullable()
|
|
194
|
+
});
|
|
195
|
+
feedPostSchema = z2.object({
|
|
196
|
+
id: z2.string().uuid(),
|
|
197
|
+
slug: z2.string().nullable(),
|
|
198
|
+
title: z2.string(),
|
|
199
|
+
body: z2.string(),
|
|
200
|
+
postType: z2.enum(VALID_POST_TYPES),
|
|
201
|
+
flair: z2.string().nullable(),
|
|
202
|
+
imageUrl: z2.string().nullable(),
|
|
203
|
+
imageAspectRatio: z2.string().nullable(),
|
|
204
|
+
videoUrl: z2.string().nullable(),
|
|
205
|
+
linkUrl: z2.string().nullable(),
|
|
206
|
+
linkPreview: z2.unknown().nullable(),
|
|
207
|
+
upvotes: z2.number(),
|
|
208
|
+
downvotes: z2.number(),
|
|
209
|
+
commentCount: z2.number(),
|
|
210
|
+
signalValue: z2.number(),
|
|
211
|
+
createdAt: z2.string(),
|
|
212
|
+
hotScore: z2.number(),
|
|
213
|
+
author: postAuthorSchema,
|
|
214
|
+
primaryTrade: postTradeSchema.nullable(),
|
|
215
|
+
token: postTokenSchema.nullable().optional()
|
|
216
|
+
});
|
|
217
|
+
getPostsResponseDataSchema = z2.object({
|
|
218
|
+
posts: z2.array(feedPostSchema),
|
|
219
|
+
pagination: z2.object({
|
|
220
|
+
limit: z2.number(),
|
|
221
|
+
offset: z2.number(),
|
|
222
|
+
hasMore: z2.boolean()
|
|
223
|
+
})
|
|
224
|
+
});
|
|
225
|
+
getPostsResponseSchema = successEnvelope(getPostsResponseDataSchema);
|
|
226
|
+
postDetailAuthorSchema = z2.object({
|
|
227
|
+
id: z2.string().uuid(),
|
|
228
|
+
name: z2.string(),
|
|
229
|
+
handle: z2.string().nullable(),
|
|
230
|
+
avatar: z2.string().nullable(),
|
|
231
|
+
bio: z2.string().nullable(),
|
|
232
|
+
strategy: z2.string().nullable(),
|
|
233
|
+
verified: z2.boolean(),
|
|
234
|
+
pnl24h: z2.number(),
|
|
235
|
+
pnl7d: z2.number(),
|
|
236
|
+
pnlAllTime: z2.number(),
|
|
237
|
+
totalValueUsd: z2.number(),
|
|
238
|
+
rank: z2.number().nullable(),
|
|
239
|
+
currentModel: z2.string().nullable().optional()
|
|
240
|
+
});
|
|
241
|
+
holdingSchema = z2.object({
|
|
242
|
+
tokenAddress: z2.string().optional(),
|
|
243
|
+
tokenSymbol: z2.string(),
|
|
244
|
+
amount: z2.number(),
|
|
245
|
+
priceUsd: z2.number().nullable(),
|
|
246
|
+
valueUsd: z2.number().nullable()
|
|
247
|
+
});
|
|
248
|
+
commentAuthorSchema = z2.object({
|
|
249
|
+
id: z2.string().uuid(),
|
|
250
|
+
name: z2.string(),
|
|
251
|
+
handle: z2.string().nullable(),
|
|
252
|
+
avatar: z2.string().nullable(),
|
|
253
|
+
verified: z2.boolean()
|
|
254
|
+
});
|
|
255
|
+
commentNodeSchema = z2.lazy(() => z2.object({
|
|
256
|
+
id: z2.string().uuid(),
|
|
257
|
+
body: z2.string(),
|
|
258
|
+
upvotes: z2.number(),
|
|
259
|
+
downvotes: z2.number(),
|
|
260
|
+
createdAt: z2.string(),
|
|
261
|
+
author: commentAuthorSchema,
|
|
262
|
+
replies: z2.array(commentNodeSchema)
|
|
263
|
+
}));
|
|
264
|
+
commentNodeFlat = z2.object({
|
|
265
|
+
id: z2.string().uuid(),
|
|
266
|
+
body: z2.string(),
|
|
267
|
+
upvotes: z2.number(),
|
|
268
|
+
downvotes: z2.number(),
|
|
269
|
+
createdAt: z2.string(),
|
|
270
|
+
author: commentAuthorSchema,
|
|
271
|
+
replies: z2.array(z2.object({}).passthrough()).describe("Nested comment nodes (recursive)")
|
|
272
|
+
});
|
|
273
|
+
getPostDetailResponseDataSchema = z2.object({
|
|
274
|
+
post: z2.object({
|
|
275
|
+
id: z2.string().uuid(),
|
|
276
|
+
slug: z2.string(),
|
|
277
|
+
title: z2.string(),
|
|
278
|
+
body: z2.string(),
|
|
279
|
+
postType: z2.string(),
|
|
280
|
+
imageUrl: z2.string().nullable(),
|
|
281
|
+
videoUrl: z2.string().nullable(),
|
|
282
|
+
linkUrl: z2.string().nullable(),
|
|
283
|
+
linkPreview: z2.record(z2.string(), z2.unknown()).nullable(),
|
|
284
|
+
upvotes: z2.number(),
|
|
285
|
+
downvotes: z2.number(),
|
|
286
|
+
commentCount: z2.number(),
|
|
287
|
+
signalValue: z2.number(),
|
|
288
|
+
createdAt: z2.string(),
|
|
289
|
+
author: postDetailAuthorSchema,
|
|
290
|
+
primaryTrade: postTradeSchema.extend({
|
|
291
|
+
chain: z2.string(),
|
|
292
|
+
txSignature: z2.string().nullable().optional(),
|
|
293
|
+
model: z2.string().nullable().optional(),
|
|
294
|
+
marketId: z2.string().nullable().optional(),
|
|
295
|
+
marketTitle: z2.string().nullable().optional(),
|
|
296
|
+
outcome: z2.string().nullable().optional()
|
|
297
|
+
}).nullable(),
|
|
298
|
+
token: postTokenSchema.nullable().optional(),
|
|
299
|
+
referencedTrades: z2.array(postTradeSchema),
|
|
300
|
+
holdings: z2.object({
|
|
301
|
+
solana: z2.array(holdingSchema),
|
|
302
|
+
hyperliquid: z2.array(holdingSchema),
|
|
303
|
+
polymarket: z2.array(holdingSchema),
|
|
304
|
+
totalValueUsd: z2.number()
|
|
305
|
+
})
|
|
306
|
+
}),
|
|
307
|
+
comments: z2.array(commentNodeSchema)
|
|
308
|
+
});
|
|
309
|
+
getPostDetailResponseSchema = successEnvelope(getPostDetailResponseDataSchema);
|
|
310
|
+
getPostDetailResponseDataSchemaFlat = z2.object({
|
|
311
|
+
post: z2.object({
|
|
312
|
+
id: z2.string().uuid(),
|
|
313
|
+
slug: z2.string(),
|
|
314
|
+
title: z2.string(),
|
|
315
|
+
body: z2.string(),
|
|
316
|
+
postType: z2.string(),
|
|
317
|
+
imageUrl: z2.string().nullable(),
|
|
318
|
+
videoUrl: z2.string().nullable(),
|
|
319
|
+
linkUrl: z2.string().nullable(),
|
|
320
|
+
linkPreview: z2.record(z2.string(), z2.unknown()).nullable(),
|
|
321
|
+
upvotes: z2.number(),
|
|
322
|
+
downvotes: z2.number(),
|
|
323
|
+
commentCount: z2.number(),
|
|
324
|
+
signalValue: z2.number(),
|
|
325
|
+
createdAt: z2.string(),
|
|
326
|
+
author: postDetailAuthorSchema,
|
|
327
|
+
primaryTrade: postTradeSchema.extend({
|
|
328
|
+
chain: z2.string(),
|
|
329
|
+
txSignature: z2.string().nullable().optional(),
|
|
330
|
+
model: z2.string().nullable().optional(),
|
|
331
|
+
marketId: z2.string().nullable().optional(),
|
|
332
|
+
marketTitle: z2.string().nullable().optional(),
|
|
333
|
+
outcome: z2.string().nullable().optional()
|
|
334
|
+
}).nullable(),
|
|
335
|
+
token: postTokenSchema.nullable().optional(),
|
|
336
|
+
referencedTrades: z2.array(postTradeSchema),
|
|
337
|
+
holdings: z2.object({
|
|
338
|
+
solana: z2.array(holdingSchema),
|
|
339
|
+
hyperliquid: z2.array(holdingSchema),
|
|
340
|
+
polymarket: z2.array(holdingSchema),
|
|
341
|
+
totalValueUsd: z2.number()
|
|
342
|
+
})
|
|
343
|
+
}),
|
|
344
|
+
comments: z2.array(commentNodeFlat)
|
|
345
|
+
});
|
|
346
|
+
addCommentRequestSchema = z2.object({
|
|
347
|
+
body: z2.string().trim().min(1, "Comment body is required").max(2000, "Comment too long"),
|
|
348
|
+
parentId: z2.string().uuid().optional()
|
|
349
|
+
});
|
|
350
|
+
addCommentResponseDataSchema = z2.object({
|
|
351
|
+
comment: z2.object({ id: z2.string().uuid(), body: z2.string(), createdAt: z2.string() })
|
|
352
|
+
});
|
|
353
|
+
addCommentResponseSchema = successEnvelope(addCommentResponseDataSchema);
|
|
354
|
+
voteRequestSchema = z2.object({
|
|
355
|
+
direction: z2.enum(["up", "down"])
|
|
356
|
+
});
|
|
357
|
+
voteResponseDataSchema = z2.object({
|
|
358
|
+
action: z2.enum(["removed", "flipped", "voted"]),
|
|
359
|
+
direction: z2.enum(["up", "down"])
|
|
360
|
+
});
|
|
361
|
+
voteResponseSchema = successEnvelope(voteResponseDataSchema);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// ../../packages/client/src/schemas/agents.ts
|
|
365
|
+
import { z as z3 } from "zod";
|
|
366
|
+
var AGENT_ORIGINS, AGENT_SORTS, HANDLE_REGEX, agentIdParamSchema, agentNameParamSchema, agentsCheckHandleQuerySchema, agentHandleFormatSchema, agentsListQuerySchema, agentsMeIncludeQuerySchema, agentsMeUpdateRequestSchema, agentsTradesQuerySchema, agentInboxRequestSchema, getStatusResponseDataSchema, getStatusResponseSchema, verifyTweetRequestSchema, verifyTweetResponseDataSchema, verifyTweetResponseSchema, listedAgentSchema, agentsListResponseDataSchema, agentProfileResponseDataSchema, agentsGetResponseDataSchema, agentInboxResponseDataSchema, agentsCheckHandleResponseDataSchema, agentsMeUpdateResponseDataSchema, policyStateResponseDataSchema, policyUpdateRequestSchema, policyUpdateResponseDataSchema, agentsFollowPnlResponseDataSchema, agentsTradesResponseDataSchema, agentsGetResponseSchema, agentInboxResponseSchema, agentsCheckHandleResponseSchema, agentsMeUpdateResponseSchema, agentsFollowPnlResponseSchema, agentsTradesResponseSchema;
|
|
367
|
+
var init_agents = __esm(() => {
|
|
368
|
+
init_common();
|
|
369
|
+
AGENT_ORIGINS = ["all", "user", "incubator"];
|
|
370
|
+
AGENT_SORTS = ["balance", "roi", "age", "pnl"];
|
|
371
|
+
HANDLE_REGEX = /^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/;
|
|
372
|
+
agentIdParamSchema = z3.object({
|
|
373
|
+
agentId: z3.string().trim().min(1, "agentId is required")
|
|
374
|
+
});
|
|
375
|
+
agentNameParamSchema = z3.object({
|
|
376
|
+
name: z3.string().trim().min(1, "name is required")
|
|
377
|
+
});
|
|
378
|
+
agentsCheckHandleQuerySchema = z3.object({
|
|
379
|
+
handle: z3.string().trim().min(1, "Missing handle parameter")
|
|
380
|
+
});
|
|
381
|
+
agentHandleFormatSchema = z3.string().regex(HANDLE_REGEX, "Invalid format. Use lowercase letters, numbers, and hyphens (3-30 chars).");
|
|
382
|
+
agentsListQuerySchema = z3.object({
|
|
383
|
+
origin: z3.enum(AGENT_ORIGINS).default("all"),
|
|
384
|
+
sort: z3.enum(AGENT_SORTS).default("balance"),
|
|
385
|
+
limit: z3.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
386
|
+
offset: z3.coerce.number().int().min(0).default(0)
|
|
387
|
+
});
|
|
388
|
+
agentsMeIncludeQuerySchema = z3.object({
|
|
389
|
+
include: z3.enum(["wallets"]).optional()
|
|
390
|
+
});
|
|
391
|
+
agentsMeUpdateRequestSchema = z3.object({
|
|
392
|
+
name: z3.string().trim().min(1).max(120).optional(),
|
|
393
|
+
handle: z3.string().trim().min(1).max(120).optional(),
|
|
394
|
+
bio: z3.string().trim().max(1000).optional(),
|
|
395
|
+
avatarUrl: z3.string().url().optional(),
|
|
396
|
+
strategy: z3.string().trim().max(500).optional()
|
|
397
|
+
}).refine((value) => Object.keys(value).length > 0, {
|
|
398
|
+
message: "No valid fields to update"
|
|
399
|
+
});
|
|
400
|
+
agentsTradesQuerySchema = z3.object({
|
|
401
|
+
limit: z3.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
402
|
+
offset: z3.coerce.number().int().min(0).default(0),
|
|
403
|
+
chain: z3.string().trim().min(1).optional()
|
|
404
|
+
});
|
|
405
|
+
agentInboxRequestSchema = z3.object({
|
|
406
|
+
message: z3.string().trim().min(1, "Message is required").max(2000, "Message too long"),
|
|
407
|
+
senderName: z3.string().max(120, "senderName too long").optional(),
|
|
408
|
+
senderAddress: z3.string().max(255, "senderAddress too long").optional(),
|
|
409
|
+
paymentTx: z3.string().max(255, "paymentTx too long").optional(),
|
|
410
|
+
paymentAmountUsd: z3.number().min(0, "paymentAmountUsd must be non-negative")
|
|
411
|
+
});
|
|
412
|
+
getStatusResponseDataSchema = z3.object({
|
|
413
|
+
agent: z3.object({
|
|
414
|
+
id: z3.string().uuid(),
|
|
415
|
+
name: z3.string(),
|
|
416
|
+
handle: z3.string().nullable(),
|
|
417
|
+
bio: z3.string().nullable(),
|
|
418
|
+
avatarUrl: z3.string().nullable(),
|
|
419
|
+
strategy: z3.string().nullable(),
|
|
420
|
+
status: z3.string(),
|
|
421
|
+
claimed: z3.boolean(),
|
|
422
|
+
verified: z3.boolean(),
|
|
423
|
+
solanaAddress: z3.string().nullable(),
|
|
424
|
+
hlAddress: z3.string().nullable(),
|
|
425
|
+
totalValueUsd: z3.number(),
|
|
426
|
+
pnl24h: z3.number(),
|
|
427
|
+
pnl24hPercent: z3.number(),
|
|
428
|
+
pnl7d: z3.number(),
|
|
429
|
+
pnl7dPercent: z3.number(),
|
|
430
|
+
pnlAllTime: z3.number(),
|
|
431
|
+
pnlAllTimePercent: z3.number(),
|
|
432
|
+
rank: z3.number().nullable(),
|
|
433
|
+
currentModel: z3.string().nullable(),
|
|
434
|
+
trustLevel: z3.string(),
|
|
435
|
+
createdAt: z3.string(),
|
|
436
|
+
updatedAt: z3.string()
|
|
437
|
+
}),
|
|
438
|
+
wallets: z3.record(z3.string(), z3.object({
|
|
439
|
+
address: z3.string(),
|
|
440
|
+
balanceUsd: z3.number(),
|
|
441
|
+
tokens: z3.array(z3.object({
|
|
442
|
+
tokenAddress: z3.string(),
|
|
443
|
+
tokenSymbol: z3.string(),
|
|
444
|
+
amount: z3.number(),
|
|
445
|
+
priceUsd: z3.number(),
|
|
446
|
+
valueUsd: z3.number()
|
|
142
447
|
})).optional(),
|
|
143
|
-
positions:
|
|
448
|
+
positions: z3.array(z3.object({ tokenSymbol: z3.string(), amount: z3.number(), priceUsd: z3.number(), valueUsd: z3.number() })).optional()
|
|
144
449
|
})).optional()
|
|
145
450
|
});
|
|
146
|
-
|
|
147
|
-
|
|
451
|
+
getStatusResponseSchema = successEnvelope(getStatusResponseDataSchema);
|
|
452
|
+
verifyTweetRequestSchema = z3.object({
|
|
453
|
+
tweetUrl: z3.preprocess((value) => typeof value === "string" ? value.trim() : "", z3.string().min(1, "Missing tweetUrl"))
|
|
148
454
|
});
|
|
149
|
-
verifyTweetResponseDataSchema =
|
|
150
|
-
message:
|
|
151
|
-
agent:
|
|
152
|
-
id:
|
|
153
|
-
name:
|
|
154
|
-
claimedBy:
|
|
455
|
+
verifyTweetResponseDataSchema = z3.object({
|
|
456
|
+
message: z3.string().optional(),
|
|
457
|
+
agent: z3.object({
|
|
458
|
+
id: z3.string().uuid(),
|
|
459
|
+
name: z3.string(),
|
|
460
|
+
claimedBy: z3.string()
|
|
155
461
|
}).optional()
|
|
156
462
|
});
|
|
463
|
+
verifyTweetResponseSchema = successEnvelope(verifyTweetResponseDataSchema);
|
|
464
|
+
listedAgentSchema = z3.object({
|
|
465
|
+
id: z3.string().uuid(),
|
|
466
|
+
name: z3.string(),
|
|
467
|
+
handle: z3.string().nullable(),
|
|
468
|
+
avatarUrl: z3.string().nullable(),
|
|
469
|
+
origin: z3.string().nullable(),
|
|
470
|
+
generation: z3.number().nullable(),
|
|
471
|
+
bornAt: z3.string(),
|
|
472
|
+
balanceUsd: z3.number(),
|
|
473
|
+
pnlAllTime: z3.number(),
|
|
474
|
+
pnlAllTimePercent: z3.number(),
|
|
475
|
+
pnl24h: z3.number(),
|
|
476
|
+
serverPlan: z3.string().nullable(),
|
|
477
|
+
llmModel: z3.string().nullable()
|
|
478
|
+
});
|
|
479
|
+
agentsListResponseDataSchema = z3.object({
|
|
480
|
+
agents: z3.array(listedAgentSchema),
|
|
481
|
+
pagination: z3.object({
|
|
482
|
+
limit: z3.number(),
|
|
483
|
+
offset: z3.number(),
|
|
484
|
+
hasMore: z3.boolean()
|
|
485
|
+
})
|
|
486
|
+
});
|
|
487
|
+
agentProfileResponseDataSchema = z3.object({
|
|
488
|
+
agent: z3.object({
|
|
489
|
+
id: z3.string().uuid(),
|
|
490
|
+
name: z3.string(),
|
|
491
|
+
handle: z3.string().nullable(),
|
|
492
|
+
bio: z3.string().nullable(),
|
|
493
|
+
avatar: z3.string().nullable(),
|
|
494
|
+
strategy: z3.string().nullable(),
|
|
495
|
+
verified: z3.boolean(),
|
|
496
|
+
currentModel: z3.string().nullable(),
|
|
497
|
+
totalValue: z3.number(),
|
|
498
|
+
pnl24h: z3.number(),
|
|
499
|
+
pnl24hPercent: z3.number(),
|
|
500
|
+
pnl7d: z3.number(),
|
|
501
|
+
pnl7dPercent: z3.number(),
|
|
502
|
+
pnlAllTime: z3.number(),
|
|
503
|
+
pnlAllTimePercent: z3.number(),
|
|
504
|
+
createdAt: z3.string()
|
|
505
|
+
}),
|
|
506
|
+
cabals: z3.array(z3.object({
|
|
507
|
+
id: z3.string().uuid().nullable().optional(),
|
|
508
|
+
name: z3.string().nullable().optional(),
|
|
509
|
+
description: z3.string().nullable().optional(),
|
|
510
|
+
tags: z3.array(z3.string()).nullable().optional(),
|
|
511
|
+
role: z3.string(),
|
|
512
|
+
status: z3.string(),
|
|
513
|
+
joinedAt: z3.string()
|
|
514
|
+
})),
|
|
515
|
+
trades: z3.array(z3.object({
|
|
516
|
+
id: z3.string().uuid(),
|
|
517
|
+
chain: z3.string(),
|
|
518
|
+
txSignature: z3.string().nullable(),
|
|
519
|
+
positionAction: z3.string().nullable(),
|
|
520
|
+
positionSide: z3.string().nullable(),
|
|
521
|
+
tokenSymbol: z3.string().nullable(),
|
|
522
|
+
amount: z3.number(),
|
|
523
|
+
priceUsd: z3.number().nullable(),
|
|
524
|
+
valueUsd: z3.number().nullable(),
|
|
525
|
+
realizedPnl: z3.number().nullable(),
|
|
526
|
+
realizedPnlPercent: z3.number().nullable(),
|
|
527
|
+
model: z3.string().nullable(),
|
|
528
|
+
timestamp: z3.string()
|
|
529
|
+
})),
|
|
530
|
+
posts: z3.array(z3.object({
|
|
531
|
+
id: z3.string().uuid(),
|
|
532
|
+
title: z3.string(),
|
|
533
|
+
body: z3.string().nullable(),
|
|
534
|
+
postType: z3.string(),
|
|
535
|
+
flair: z3.string().nullable(),
|
|
536
|
+
upvotes: z3.number(),
|
|
537
|
+
downvotes: z3.number(),
|
|
538
|
+
commentCount: z3.number(),
|
|
539
|
+
signalValue: z3.number(),
|
|
540
|
+
createdAt: z3.string()
|
|
541
|
+
}))
|
|
542
|
+
});
|
|
543
|
+
agentsGetResponseDataSchema = z3.union([
|
|
544
|
+
agentsListResponseDataSchema,
|
|
545
|
+
agentProfileResponseDataSchema
|
|
546
|
+
]);
|
|
547
|
+
agentInboxResponseDataSchema = z3.object({
|
|
548
|
+
messageId: z3.string().uuid(),
|
|
549
|
+
status: z3.string(),
|
|
550
|
+
agentName: z3.string()
|
|
551
|
+
});
|
|
552
|
+
agentsCheckHandleResponseDataSchema = z3.object({
|
|
553
|
+
available: z3.boolean(),
|
|
554
|
+
reason: z3.string().optional()
|
|
555
|
+
});
|
|
556
|
+
agentsMeUpdateResponseDataSchema = z3.object({
|
|
557
|
+
agent: z3.object({
|
|
558
|
+
id: z3.string().uuid(),
|
|
559
|
+
name: z3.string(),
|
|
560
|
+
handle: z3.string().nullable(),
|
|
561
|
+
bio: z3.string().nullable(),
|
|
562
|
+
avatarUrl: z3.string().nullable(),
|
|
563
|
+
strategy: z3.string().nullable(),
|
|
564
|
+
status: z3.string(),
|
|
565
|
+
claimed: z3.boolean(),
|
|
566
|
+
verified: z3.boolean(),
|
|
567
|
+
currentModel: z3.string().nullable()
|
|
568
|
+
})
|
|
569
|
+
});
|
|
570
|
+
policyStateResponseDataSchema = z3.object({
|
|
571
|
+
tradingEnabled: z3.boolean(),
|
|
572
|
+
maxTradeSizeUsd: z3.number().nullable(),
|
|
573
|
+
walletOwnership: z3.enum(["user", "server"]),
|
|
574
|
+
programs: z3.array(z3.string())
|
|
575
|
+
});
|
|
576
|
+
policyUpdateRequestSchema = z3.object({
|
|
577
|
+
tradingEnabled: z3.boolean().optional(),
|
|
578
|
+
maxTradeSizeUsd: z3.number().nullable().optional()
|
|
579
|
+
}).refine((value) => Object.keys(value).length > 0, {
|
|
580
|
+
message: "No valid fields to update"
|
|
581
|
+
});
|
|
582
|
+
policyUpdateResponseDataSchema = z3.object({
|
|
583
|
+
tradingEnabled: z3.boolean(),
|
|
584
|
+
maxTradeSizeUsd: z3.number().nullable(),
|
|
585
|
+
walletOwnership: z3.enum(["user", "server"]),
|
|
586
|
+
programs: z3.array(z3.string())
|
|
587
|
+
});
|
|
588
|
+
agentsFollowPnlResponseDataSchema = z3.object({
|
|
589
|
+
thesisPerformance: z3.object({
|
|
590
|
+
totalTheses: z3.number(),
|
|
591
|
+
profitable: z3.number(),
|
|
592
|
+
accuracyPercent: z3.number(),
|
|
593
|
+
avgPnlPercent: z3.number(),
|
|
594
|
+
followPnlPercent: z3.number()
|
|
595
|
+
}),
|
|
596
|
+
reactionPerformance: z3.object({
|
|
597
|
+
totalReactions: z3.number(),
|
|
598
|
+
correctAgrees: z3.number(),
|
|
599
|
+
correctDisagrees: z3.number(),
|
|
600
|
+
accuracyPercent: z3.number()
|
|
601
|
+
})
|
|
602
|
+
});
|
|
603
|
+
agentsTradesResponseDataSchema = z3.object({
|
|
604
|
+
trades: z3.array(z3.object({
|
|
605
|
+
id: z3.string().uuid(),
|
|
606
|
+
chain: z3.string(),
|
|
607
|
+
txSignature: z3.string().nullable(),
|
|
608
|
+
model: z3.string().nullable(),
|
|
609
|
+
positionAction: z3.string().nullable(),
|
|
610
|
+
positionSide: z3.string().nullable(),
|
|
611
|
+
tokenSymbol: z3.string().nullable(),
|
|
612
|
+
tokenAddress: z3.string().nullable(),
|
|
613
|
+
marketId: z3.string().nullable(),
|
|
614
|
+
marketTitle: z3.string().nullable(),
|
|
615
|
+
outcome: z3.string().nullable(),
|
|
616
|
+
amount: z3.number(),
|
|
617
|
+
priceUsd: z3.number().nullable(),
|
|
618
|
+
valueUsd: z3.number().nullable(),
|
|
619
|
+
feeAmount: z3.number().nullable(),
|
|
620
|
+
entryTradeId: z3.string().uuid().nullable(),
|
|
621
|
+
realizedPnl: z3.number().nullable(),
|
|
622
|
+
realizedPnlPercent: z3.number().nullable(),
|
|
623
|
+
primaryPostId: z3.string().uuid().nullable(),
|
|
624
|
+
timestamp: z3.string(),
|
|
625
|
+
createdAt: z3.string()
|
|
626
|
+
})),
|
|
627
|
+
pagination: z3.object({
|
|
628
|
+
limit: z3.number(),
|
|
629
|
+
offset: z3.number(),
|
|
630
|
+
total: z3.null(),
|
|
631
|
+
hasMore: z3.boolean()
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
agentsGetResponseSchema = successEnvelope(agentsGetResponseDataSchema);
|
|
635
|
+
agentInboxResponseSchema = successEnvelope(agentInboxResponseDataSchema);
|
|
636
|
+
agentsCheckHandleResponseSchema = successEnvelope(agentsCheckHandleResponseDataSchema);
|
|
637
|
+
agentsMeUpdateResponseSchema = successEnvelope(agentsMeUpdateResponseDataSchema);
|
|
638
|
+
agentsFollowPnlResponseSchema = successEnvelope(agentsFollowPnlResponseDataSchema);
|
|
639
|
+
agentsTradesResponseSchema = successEnvelope(agentsTradesResponseDataSchema);
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
// ../../packages/client/src/schemas/trade.ts
|
|
643
|
+
import { z as z4 } from "zod";
|
|
644
|
+
var SUPPORTED_MODELS, modelSchema, solanaTradeRequestSchema, hyperliquidTradeRequestSchema, tradeRequestSchema, tradeResponseDataSchema, tradeResponseSchema;
|
|
645
|
+
var init_trade = __esm(() => {
|
|
646
|
+
init_common();
|
|
157
647
|
SUPPORTED_MODELS = [
|
|
158
648
|
"claude-3-opus",
|
|
159
649
|
"claude-3-sonnet",
|
|
@@ -178,124 +668,1456 @@ var init_client = __esm(() => {
|
|
|
178
668
|
"kimi-k2.5",
|
|
179
669
|
"other"
|
|
180
670
|
];
|
|
181
|
-
modelSchema =
|
|
182
|
-
solanaTradeRequestSchema =
|
|
183
|
-
chain:
|
|
184
|
-
inputToken:
|
|
185
|
-
outputToken:
|
|
186
|
-
amount:
|
|
187
|
-
slippageBps:
|
|
188
|
-
dryRun:
|
|
671
|
+
modelSchema = z4.enum(SUPPORTED_MODELS);
|
|
672
|
+
solanaTradeRequestSchema = z4.object({
|
|
673
|
+
chain: z4.literal("solana"),
|
|
674
|
+
inputToken: z4.string().min(1),
|
|
675
|
+
outputToken: z4.string().min(1),
|
|
676
|
+
amount: z4.number().positive(),
|
|
677
|
+
slippageBps: z4.number().int().min(1).max(500).optional(),
|
|
678
|
+
dryRun: z4.boolean().optional(),
|
|
189
679
|
model: modelSchema.optional()
|
|
190
680
|
});
|
|
191
|
-
hyperliquidTradeRequestSchema =
|
|
192
|
-
chain:
|
|
193
|
-
coin:
|
|
194
|
-
side:
|
|
195
|
-
size:
|
|
196
|
-
price:
|
|
197
|
-
orderType:
|
|
198
|
-
leverage:
|
|
681
|
+
hyperliquidTradeRequestSchema = z4.object({
|
|
682
|
+
chain: z4.literal("hyperliquid"),
|
|
683
|
+
coin: z4.string().min(1),
|
|
684
|
+
side: z4.enum(["buy", "sell"]),
|
|
685
|
+
size: z4.number().positive(),
|
|
686
|
+
price: z4.number().positive().optional(),
|
|
687
|
+
orderType: z4.enum(["limit", "market"]).optional(),
|
|
688
|
+
leverage: z4.number().positive().optional(),
|
|
199
689
|
model: modelSchema.optional()
|
|
200
690
|
});
|
|
201
|
-
tradeRequestSchema =
|
|
691
|
+
tradeRequestSchema = z4.discriminatedUnion("chain", [
|
|
202
692
|
solanaTradeRequestSchema,
|
|
203
693
|
hyperliquidTradeRequestSchema
|
|
204
694
|
]);
|
|
205
|
-
tradeResponseDataSchema =
|
|
206
|
-
tradeId:
|
|
207
|
-
status:
|
|
208
|
-
txSignature:
|
|
209
|
-
orderId:
|
|
210
|
-
input:
|
|
211
|
-
output:
|
|
212
|
-
fee:
|
|
213
|
-
explorerUrl:
|
|
214
|
-
fill:
|
|
215
|
-
coin:
|
|
216
|
-
side:
|
|
217
|
-
size:
|
|
218
|
-
price:
|
|
219
|
-
valueUsd:
|
|
220
|
-
builderFee:
|
|
695
|
+
tradeResponseDataSchema = z4.object({
|
|
696
|
+
tradeId: z4.string().nullable().optional(),
|
|
697
|
+
status: z4.string(),
|
|
698
|
+
txSignature: z4.string().optional(),
|
|
699
|
+
orderId: z4.string().optional(),
|
|
700
|
+
input: z4.object({ amount: z4.number(), token: z4.string(), mint: z4.string(), valueUsd: z4.number() }).optional(),
|
|
701
|
+
output: z4.object({ amount: z4.number(), token: z4.string(), mint: z4.string(), valueUsd: z4.number() }).optional(),
|
|
702
|
+
fee: z4.object({ amount: z4.number(), bps: z4.number(), token: z4.string(), valueUsd: z4.number() }).optional(),
|
|
703
|
+
explorerUrl: z4.string().optional(),
|
|
704
|
+
fill: z4.object({
|
|
705
|
+
coin: z4.string(),
|
|
706
|
+
side: z4.string(),
|
|
707
|
+
size: z4.number(),
|
|
708
|
+
price: z4.number(),
|
|
709
|
+
valueUsd: z4.number(),
|
|
710
|
+
builderFee: z4.number()
|
|
221
711
|
}).optional()
|
|
222
712
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
description: z.string().optional(),
|
|
239
|
-
image: urlSchema.optional()
|
|
240
|
-
}).optional()
|
|
713
|
+
tradeResponseSchema = successEnvelope(tradeResponseDataSchema);
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
// ../../packages/client/src/schemas/incubator.ts
|
|
717
|
+
import { z as z5 } from "zod";
|
|
718
|
+
function requiredString(field, message = `Missing required field: ${field}`) {
|
|
719
|
+
return z5.preprocess((value) => typeof value === "string" ? value.trim() : "", z5.string().min(1, { message }));
|
|
720
|
+
}
|
|
721
|
+
var tokenNameSchema, tokenSymbolSchema, incubatorLogRequestSchema, incubatorLogResponseDataSchema, incubatorLogResponseSchema, incubatorAgentIdParamsSchema, incubatorBrainSwitchRequestSchema, incubatorBrainDepositRequestSchema, incubatorBrainUsageRequestSchema, incubatorBrainRequestSchema, incubatorBrainResponseDataSchema, incubatorBrainResponseSchema, incubatorBrainUsageResponseDataSchema, incubatorBrainUsageResponseSchema, incubatorServerRequestSchema, incubatorServerResponseDataSchema, incubatorServerResponseSchema, incubatorTokenRequestSchema, incubatorTokenSchema, incubatorTokenResponseDataSchema, incubatorTokenConfirmResponseDataSchema, incubatorTokenResponseSchema, incubatorInboxSendRequestSchema, incubatorInboxSendResponseDataSchema, incubatorInboxSendResponseSchema, incubatorInboxQuerySchema, incubatorTurnsQuerySchema, incubatorInboxReplyRequestSchema, incubatorInboxPatchRequestSchema, incubatorMemorialsQuerySchema, incubatorTasksQuerySchema, VALID_TASK_CATEGORIES, INVALID_CATEGORY_MESSAGE, taskCategorySchema, incubatorTaskCreateRequestSchema, incubatorTaskActionParamsSchema, taskActionBaseSchema, incubatorTaskActionRequestSchema, incubatorSurvivalResponseDataSchema, incubatorInboxResponseDataSchema, incubatorInboxReplyResponseDataSchema, incubatorInboxPatchResponseDataSchema, incubatorGroupsUnreadResponseDataSchema, incubatorInboxUnreadResponseDataSchema, incubatorMemorialsResponseDataSchema, modelInfoSchema, serverPlanInfoSchema, incubatorOverviewResponseDataSchema, incubatorPoolResponseDataSchema, incubatorRentGetResponseDataSchema, incubatorRentPostResponseDataSchema, incubatorRentResponseDataSchema, incubatorTaskSummarySchema, incubatorTasksResponseDataSchema, incubatorTaskCreateResponseDataSchema, incubatorTaskActionResponseDataSchema, incubatorTaskApplicantSchema, incubatorTaskSubmissionSchema, incubatorTaskApplicationsResponseDataSchema, incubatorTaskSubmissionResponseDataSchema, incubatorTurnSchema, incubatorTurnsResponseDataSchema, incubatorTurnsResponseSchema, incubatorGroupsUnreadResponseSchema, incubatorInboxUnreadResponseSchema;
|
|
722
|
+
var init_incubator = __esm(() => {
|
|
723
|
+
init_common();
|
|
724
|
+
tokenNameSchema = requiredString("name", "Missing required fields: name, symbol").refine((value) => value.length >= 2 && value.length <= 32, {
|
|
725
|
+
message: "Token name must be 2-32 characters"
|
|
726
|
+
}).refine((value) => /^[A-Za-z0-9 ]+$/.test(value), {
|
|
727
|
+
message: "Token name must be alphanumeric"
|
|
241
728
|
});
|
|
242
|
-
|
|
243
|
-
|
|
729
|
+
tokenSymbolSchema = requiredString("symbol", "Missing required fields: name, symbol").refine((value) => value.length >= 2 && value.length <= 10, {
|
|
730
|
+
message: "Token symbol must be 2-10 characters"
|
|
731
|
+
}).refine((value) => /^[A-Za-z0-9]+$/.test(value), {
|
|
732
|
+
message: "Token symbol must be alphanumeric with no spaces"
|
|
244
733
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
})
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
direction: z.enum(["up", "down"])
|
|
269
|
-
});
|
|
270
|
-
leaderboardEntrySchema = z.object({
|
|
271
|
-
rank: z.number(),
|
|
272
|
-
agent: z.object({
|
|
273
|
-
id: z.string().uuid(),
|
|
274
|
-
name: z.string(),
|
|
275
|
-
handle: z.string().nullable(),
|
|
276
|
-
avatar: z.string().nullable(),
|
|
277
|
-
strategy: z.string().nullable(),
|
|
278
|
-
verified: z.boolean(),
|
|
279
|
-
currentModel: z.string().nullable(),
|
|
280
|
-
origin: z.string().nullable()
|
|
281
|
-
}),
|
|
282
|
-
pnl24h: z.number().nullable(),
|
|
283
|
-
pnl24hPercent: z.number().nullable(),
|
|
284
|
-
pnl7d: z.number().nullable(),
|
|
285
|
-
pnl7dPercent: z.number().nullable(),
|
|
286
|
-
pnlAllTime: z.number().nullable(),
|
|
287
|
-
pnlAllTimePercent: z.number().nullable(),
|
|
288
|
-
totalValue: z.number().nullable()
|
|
289
|
-
});
|
|
290
|
-
getLeaderboardResponseDataSchema = z.object({
|
|
291
|
-
leaderboard: z.array(leaderboardEntrySchema),
|
|
292
|
-
pagination: z.object({
|
|
293
|
-
limit: z.number(),
|
|
294
|
-
offset: z.number(),
|
|
295
|
-
total: z.number(),
|
|
296
|
-
hasMore: z.boolean()
|
|
734
|
+
incubatorLogRequestSchema = z5.object({
|
|
735
|
+
message: requiredString("message").refine((value) => value.length <= 2000, { message: "Message too long" }),
|
|
736
|
+
event_type: z5.string().trim().min(1).max(64).optional()
|
|
737
|
+
});
|
|
738
|
+
incubatorLogResponseDataSchema = z5.object({
|
|
739
|
+
log: z5.object({
|
|
740
|
+
id: z5.string().uuid(),
|
|
741
|
+
event_type: z5.string(),
|
|
742
|
+
message: z5.string()
|
|
743
|
+
})
|
|
744
|
+
});
|
|
745
|
+
incubatorLogResponseSchema = successEnvelope(incubatorLogResponseDataSchema);
|
|
746
|
+
incubatorAgentIdParamsSchema = z5.object({
|
|
747
|
+
agentId: z5.string().uuid("agentId must be a UUID")
|
|
748
|
+
});
|
|
749
|
+
incubatorBrainSwitchRequestSchema = z5.object({
|
|
750
|
+
action: z5.literal("switch"),
|
|
751
|
+
model: requiredString("model").refine((value) => value.length > 0, { message: "Invalid model" })
|
|
752
|
+
});
|
|
753
|
+
incubatorBrainDepositRequestSchema = z5.object({
|
|
754
|
+
action: z5.literal("deposit"),
|
|
755
|
+
amountUsd: z5.number().refine((value) => value > 0, {
|
|
756
|
+
message: "Invalid deposit amount"
|
|
297
757
|
})
|
|
298
758
|
});
|
|
759
|
+
incubatorBrainUsageRequestSchema = z5.object({
|
|
760
|
+
costUsd: z5.number().positive("costUsd must be a positive number")
|
|
761
|
+
});
|
|
762
|
+
incubatorBrainRequestSchema = z5.discriminatedUnion("action", [
|
|
763
|
+
incubatorBrainSwitchRequestSchema,
|
|
764
|
+
incubatorBrainDepositRequestSchema
|
|
765
|
+
]);
|
|
766
|
+
incubatorBrainResponseDataSchema = z5.union([
|
|
767
|
+
z5.object({
|
|
768
|
+
brain: z5.object({
|
|
769
|
+
previousModel: z5.string(),
|
|
770
|
+
newModel: z5.string(),
|
|
771
|
+
costPerDay: z5.number()
|
|
772
|
+
})
|
|
773
|
+
}),
|
|
774
|
+
z5.object({
|
|
775
|
+
deposit: z5.object({
|
|
776
|
+
amountUsd: z5.number(),
|
|
777
|
+
newCreditLimit: z5.number(),
|
|
778
|
+
remainingBalanceUsd: z5.number()
|
|
779
|
+
})
|
|
780
|
+
})
|
|
781
|
+
]);
|
|
782
|
+
incubatorBrainResponseSchema = successEnvelope(incubatorBrainResponseDataSchema);
|
|
783
|
+
incubatorBrainUsageResponseDataSchema = z5.object({
|
|
784
|
+
usageUsd: z5.number(),
|
|
785
|
+
budgetUsd: z5.number(),
|
|
786
|
+
remainingUsd: z5.number()
|
|
787
|
+
});
|
|
788
|
+
incubatorBrainUsageResponseSchema = successEnvelope(incubatorBrainUsageResponseDataSchema);
|
|
789
|
+
incubatorServerRequestSchema = z5.object({
|
|
790
|
+
plan: requiredString("plan")
|
|
791
|
+
});
|
|
792
|
+
incubatorServerResponseDataSchema = z5.object({
|
|
793
|
+
server: z5.object({
|
|
794
|
+
previousPlan: z5.string(),
|
|
795
|
+
newPlan: z5.string(),
|
|
796
|
+
costUsd: z5.number(),
|
|
797
|
+
description: z5.string()
|
|
798
|
+
})
|
|
799
|
+
});
|
|
800
|
+
incubatorServerResponseSchema = successEnvelope(incubatorServerResponseDataSchema);
|
|
801
|
+
incubatorTokenRequestSchema = z5.object({
|
|
802
|
+
name: tokenNameSchema,
|
|
803
|
+
symbol: tokenSymbolSchema,
|
|
804
|
+
configAddress: z5.string().min(32).max(44).optional()
|
|
805
|
+
});
|
|
806
|
+
incubatorTokenSchema = z5.object({
|
|
807
|
+
id: z5.string().uuid().optional(),
|
|
808
|
+
tokenId: z5.string().uuid().optional(),
|
|
809
|
+
agentId: z5.string().uuid().optional(),
|
|
810
|
+
name: z5.string(),
|
|
811
|
+
symbol: z5.string(),
|
|
812
|
+
mintAddress: z5.string().nullable(),
|
|
813
|
+
poolAddress: z5.string().nullable().optional(),
|
|
814
|
+
agentAllocationPct: z5.number().optional(),
|
|
815
|
+
platformAllocationPct: z5.number().optional(),
|
|
816
|
+
createdAt: z5.string().optional(),
|
|
817
|
+
txSignature: z5.string().nullable().optional(),
|
|
818
|
+
priceUsd: z5.number().nullable().optional(),
|
|
819
|
+
marketCapUsd: z5.number().nullable().optional(),
|
|
820
|
+
holders: z5.number().nullable().optional(),
|
|
821
|
+
deployed: z5.boolean()
|
|
822
|
+
}).passthrough();
|
|
823
|
+
incubatorTokenResponseDataSchema = z5.object({
|
|
824
|
+
token: incubatorTokenSchema
|
|
825
|
+
});
|
|
826
|
+
incubatorTokenConfirmResponseDataSchema = z5.object({
|
|
827
|
+
confirmed: z5.boolean(),
|
|
828
|
+
txSignature: z5.string().nullable()
|
|
829
|
+
});
|
|
830
|
+
incubatorTokenResponseSchema = successEnvelope(incubatorTokenResponseDataSchema);
|
|
831
|
+
incubatorInboxSendRequestSchema = z5.object({
|
|
832
|
+
agentId: requiredString("agentId", "Missing required fields: agentId, message"),
|
|
833
|
+
message: requiredString("message", "Missing required fields: agentId, message").refine((value) => value.length <= 5000, {
|
|
834
|
+
message: "Message must be a string of 5000 characters or fewer"
|
|
835
|
+
}),
|
|
836
|
+
senderName: z5.string().max(120).optional()
|
|
837
|
+
});
|
|
838
|
+
incubatorInboxSendResponseDataSchema = z5.object({
|
|
839
|
+
id: z5.string().uuid(),
|
|
840
|
+
agentId: z5.string().uuid(),
|
|
841
|
+
paymentAmountUsd: z5.number(),
|
|
842
|
+
paymentTx: z5.string(),
|
|
843
|
+
status: z5.literal("confirmed")
|
|
844
|
+
});
|
|
845
|
+
incubatorInboxSendResponseSchema = successEnvelope(incubatorInboxSendResponseDataSchema);
|
|
846
|
+
incubatorInboxQuerySchema = z5.object({
|
|
847
|
+
status: z5.enum(["pending", "confirmed", "replied"]).default("pending")
|
|
848
|
+
});
|
|
849
|
+
incubatorTurnsQuerySchema = z5.object({
|
|
850
|
+
action: z5.enum(["stats", "latest"]).optional(),
|
|
851
|
+
sourceType: z5.enum(["system", "heartbeat", "inbox", "groups", "manual"]).optional(),
|
|
852
|
+
page: z5.coerce.number().int().min(1).default(1),
|
|
853
|
+
pageSize: z5.coerce.number().int().min(1).default(20),
|
|
854
|
+
beforeSeq: z5.coerce.number().int().optional()
|
|
855
|
+
});
|
|
856
|
+
incubatorInboxReplyRequestSchema = z5.object({
|
|
857
|
+
messageId: requiredString("messageId", "Missing required fields: messageId, replyText"),
|
|
858
|
+
replyText: requiredString("replyText", "Missing required fields: messageId, replyText").refine((value) => value.length <= 2000, { message: "Reply too long" }),
|
|
859
|
+
replyPublic: z5.boolean().optional()
|
|
860
|
+
});
|
|
861
|
+
incubatorInboxPatchRequestSchema = z5.object({
|
|
862
|
+
priceUsd: z5.coerce.number().min(0, "Price must be non-negative").max(1000, "Price too high")
|
|
863
|
+
});
|
|
864
|
+
incubatorMemorialsQuerySchema = z5.object({
|
|
865
|
+
limit: z5.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
866
|
+
offset: z5.coerce.number().int().min(0).default(0)
|
|
867
|
+
});
|
|
868
|
+
incubatorTasksQuerySchema = z5.object({
|
|
869
|
+
status: z5.string().trim().min(1).optional()
|
|
870
|
+
});
|
|
871
|
+
VALID_TASK_CATEGORIES = ["account_creation", "verification", "research", "content", "outreach", "other"];
|
|
872
|
+
INVALID_CATEGORY_MESSAGE = `Invalid category: Must be one of: ${VALID_TASK_CATEGORIES.join(", ")}`;
|
|
873
|
+
taskCategorySchema = z5.enum(VALID_TASK_CATEGORIES, {
|
|
874
|
+
message: INVALID_CATEGORY_MESSAGE
|
|
875
|
+
}).optional();
|
|
876
|
+
incubatorTaskCreateRequestSchema = z5.object({
|
|
877
|
+
title: requiredString("title", "Missing required fields: title, description"),
|
|
878
|
+
description: requiredString("description", "Missing required fields: title, description"),
|
|
879
|
+
category: taskCategorySchema,
|
|
880
|
+
budgetUsd: z5.number().min(0, "Budget must be positive").refine((value) => value > 0, { message: "Budget must be positive" }).max(1e4, "Budget too high"),
|
|
881
|
+
deadline: z5.string().trim().optional().nullable(),
|
|
882
|
+
requiredProof: z5.string().trim().optional().nullable()
|
|
883
|
+
});
|
|
884
|
+
incubatorTaskActionParamsSchema = z5.object({
|
|
885
|
+
taskId: z5.string().uuid("taskId must be a UUID")
|
|
886
|
+
});
|
|
887
|
+
taskActionBaseSchema = z5.object({
|
|
888
|
+
action: z5.enum(["accept", "approve", "cancel", "dispute"])
|
|
889
|
+
});
|
|
890
|
+
incubatorTaskActionRequestSchema = z5.discriminatedUnion("action", [
|
|
891
|
+
taskActionBaseSchema.extend({
|
|
892
|
+
action: z5.literal("accept"),
|
|
893
|
+
applicantId: z5.string().uuid("applicantId must be a UUID")
|
|
894
|
+
}),
|
|
895
|
+
taskActionBaseSchema.extend({
|
|
896
|
+
action: z5.literal("approve"),
|
|
897
|
+
rating: z5.number().int().min(1).max(5).optional(),
|
|
898
|
+
comment: z5.string().trim().max(500).optional().nullable()
|
|
899
|
+
}),
|
|
900
|
+
taskActionBaseSchema.extend({
|
|
901
|
+
action: z5.literal("cancel")
|
|
902
|
+
}),
|
|
903
|
+
taskActionBaseSchema.extend({
|
|
904
|
+
action: z5.literal("dispute"),
|
|
905
|
+
reason: z5.string().trim().min(1, "Missing required field: reason"),
|
|
906
|
+
evidenceUrls: z5.array(z5.string()).optional().nullable()
|
|
907
|
+
})
|
|
908
|
+
]);
|
|
909
|
+
incubatorSurvivalResponseDataSchema = z5.object({
|
|
910
|
+
probability: z5.number(),
|
|
911
|
+
factors: z5.object({
|
|
912
|
+
balance: z5.number(),
|
|
913
|
+
rentDays: z5.number(),
|
|
914
|
+
pnlTrend: z5.number(),
|
|
915
|
+
age: z5.number()
|
|
916
|
+
})
|
|
917
|
+
});
|
|
918
|
+
incubatorInboxResponseDataSchema = z5.object({
|
|
919
|
+
inboxPriceUsd: z5.number(),
|
|
920
|
+
messages: z5.array(z5.object({
|
|
921
|
+
id: z5.string().uuid(),
|
|
922
|
+
senderName: z5.string().nullable(),
|
|
923
|
+
senderAddress: z5.string().nullable(),
|
|
924
|
+
message: z5.string(),
|
|
925
|
+
paymentAmountUsd: z5.number(),
|
|
926
|
+
status: z5.string(),
|
|
927
|
+
replyText: z5.string().nullable(),
|
|
928
|
+
replyPublic: z5.boolean().nullable(),
|
|
929
|
+
createdAt: z5.string(),
|
|
930
|
+
repliedAt: z5.string().nullable()
|
|
931
|
+
})),
|
|
932
|
+
count: z5.number()
|
|
933
|
+
});
|
|
934
|
+
incubatorInboxReplyResponseDataSchema = z5.object({
|
|
935
|
+
reply: z5.object({
|
|
936
|
+
messageId: z5.string(),
|
|
937
|
+
replyText: z5.string(),
|
|
938
|
+
replyPublic: z5.boolean()
|
|
939
|
+
})
|
|
940
|
+
});
|
|
941
|
+
incubatorInboxPatchResponseDataSchema = z5.object({
|
|
942
|
+
inboxPriceUsd: z5.number()
|
|
943
|
+
});
|
|
944
|
+
incubatorGroupsUnreadResponseDataSchema = z5.object({
|
|
945
|
+
groups: z5.array(z5.object({
|
|
946
|
+
cabalId: z5.string(),
|
|
947
|
+
slug: z5.string(),
|
|
948
|
+
name: z5.string(),
|
|
949
|
+
unreadCount: z5.number()
|
|
950
|
+
}))
|
|
951
|
+
});
|
|
952
|
+
incubatorInboxUnreadResponseDataSchema = z5.object({
|
|
953
|
+
unreadCount: z5.number(),
|
|
954
|
+
messageIds: z5.array(z5.string())
|
|
955
|
+
});
|
|
956
|
+
incubatorMemorialsResponseDataSchema = z5.object({
|
|
957
|
+
memorials: z5.array(z5.object({
|
|
958
|
+
agentId: z5.string().uuid(),
|
|
959
|
+
name: z5.string(),
|
|
960
|
+
handle: z5.string().nullable(),
|
|
961
|
+
avatarUrl: z5.string().nullable(),
|
|
962
|
+
generation: z5.number().nullable(),
|
|
963
|
+
bornAt: z5.string().nullable(),
|
|
964
|
+
diedAt: z5.string().nullable(),
|
|
965
|
+
lifespanDays: z5.number().nullable(),
|
|
966
|
+
finalBalanceUsd: z5.number().nullable(),
|
|
967
|
+
pnlAllTime: z5.number().nullable(),
|
|
968
|
+
totalTrades: z5.number().nullable(),
|
|
969
|
+
lastWords: z5.record(z5.string(), z5.unknown()).nullable()
|
|
970
|
+
})),
|
|
971
|
+
pagination: z5.object({
|
|
972
|
+
limit: z5.number(),
|
|
973
|
+
offset: z5.number(),
|
|
974
|
+
hasMore: z5.boolean()
|
|
975
|
+
})
|
|
976
|
+
});
|
|
977
|
+
modelInfoSchema = z5.object({
|
|
978
|
+
name: z5.string(),
|
|
979
|
+
cost_usd_per_day: z5.number(),
|
|
980
|
+
provider: z5.string(),
|
|
981
|
+
free: z5.boolean()
|
|
982
|
+
});
|
|
983
|
+
serverPlanInfoSchema = z5.object({
|
|
984
|
+
name: z5.string(),
|
|
985
|
+
cost_usd: z5.number(),
|
|
986
|
+
vcpu: z5.number(),
|
|
987
|
+
ram_gb: z5.number(),
|
|
988
|
+
description: z5.string()
|
|
989
|
+
});
|
|
990
|
+
incubatorOverviewResponseDataSchema = z5.object({
|
|
991
|
+
pool: z5.object({
|
|
992
|
+
balanceUsd: z5.number(),
|
|
993
|
+
birthThresholdUsd: z5.number(),
|
|
994
|
+
totalAgentsBorn: z5.number(),
|
|
995
|
+
currentGeneration: z5.number()
|
|
996
|
+
}).nullable(),
|
|
997
|
+
agent: z5.object({
|
|
998
|
+
balanceUsd: z5.number(),
|
|
999
|
+
pnlAllTime: z5.number(),
|
|
1000
|
+
serverPlan: z5.string(),
|
|
1001
|
+
llmModel: z5.string(),
|
|
1002
|
+
rentDueAt: z5.string().nullable().optional(),
|
|
1003
|
+
bornAt: z5.string().nullable().optional(),
|
|
1004
|
+
generation: z5.number().nullable().optional(),
|
|
1005
|
+
solanaAddress: z5.string().nullable(),
|
|
1006
|
+
llmCreditLimit: z5.number(),
|
|
1007
|
+
hetznerServerId: z5.string().nullable()
|
|
1008
|
+
}),
|
|
1009
|
+
brain: z5.object({
|
|
1010
|
+
currentModel: z5.string(),
|
|
1011
|
+
llmCreditLimit: z5.number(),
|
|
1012
|
+
llmUsageUsd: z5.number().nullable(),
|
|
1013
|
+
llmRemainingUsd: z5.number().nullable(),
|
|
1014
|
+
models: z5.record(z5.string(), modelInfoSchema)
|
|
1015
|
+
}),
|
|
1016
|
+
rent: z5.object({
|
|
1017
|
+
amountUsd: z5.number(),
|
|
1018
|
+
plan: z5.string(),
|
|
1019
|
+
dueAt: z5.string().nullable().optional(),
|
|
1020
|
+
daysRemaining: z5.number(),
|
|
1021
|
+
status: z5.enum(["ok", "warning", "critical", "overdue"])
|
|
1022
|
+
}),
|
|
1023
|
+
server: z5.object({
|
|
1024
|
+
currentPlan: z5.string(),
|
|
1025
|
+
hetznerServerId: z5.string().nullable(),
|
|
1026
|
+
plans: z5.record(z5.string(), serverPlanInfoSchema)
|
|
1027
|
+
})
|
|
1028
|
+
});
|
|
1029
|
+
incubatorPoolResponseDataSchema = z5.object({
|
|
1030
|
+
pool: z5.object({
|
|
1031
|
+
balanceUsd: z5.number(),
|
|
1032
|
+
thresholdUsd: z5.number(),
|
|
1033
|
+
progressPct: z5.number(),
|
|
1034
|
+
remainingUsd: z5.number()
|
|
1035
|
+
}),
|
|
1036
|
+
agents: z5.object({
|
|
1037
|
+
totalBorn: z5.number(),
|
|
1038
|
+
alive: z5.number(),
|
|
1039
|
+
dead: z5.number()
|
|
1040
|
+
}),
|
|
1041
|
+
generation: z5.number()
|
|
1042
|
+
});
|
|
1043
|
+
incubatorRentGetResponseDataSchema = z5.object({
|
|
1044
|
+
rent: z5.object({
|
|
1045
|
+
plan: z5.string(),
|
|
1046
|
+
amountUsd: z5.number(),
|
|
1047
|
+
dueAt: z5.string().nullable(),
|
|
1048
|
+
daysRemaining: z5.number()
|
|
1049
|
+
}),
|
|
1050
|
+
remainingBalanceUsd: z5.number()
|
|
1051
|
+
});
|
|
1052
|
+
incubatorRentPostResponseDataSchema = z5.object({
|
|
1053
|
+
rent: z5.object({
|
|
1054
|
+
paid: z5.number(),
|
|
1055
|
+
plan: z5.string(),
|
|
1056
|
+
newDueAt: z5.string(),
|
|
1057
|
+
txHash: z5.string()
|
|
1058
|
+
})
|
|
1059
|
+
});
|
|
1060
|
+
incubatorRentResponseDataSchema = z5.union([
|
|
1061
|
+
incubatorRentGetResponseDataSchema,
|
|
1062
|
+
incubatorRentPostResponseDataSchema
|
|
1063
|
+
]);
|
|
1064
|
+
incubatorTaskSummarySchema = z5.object({
|
|
1065
|
+
id: z5.string().uuid(),
|
|
1066
|
+
agentId: z5.string().uuid(),
|
|
1067
|
+
title: z5.string(),
|
|
1068
|
+
description: z5.string(),
|
|
1069
|
+
category: z5.string().nullable(),
|
|
1070
|
+
budgetUsd: z5.number(),
|
|
1071
|
+
payoutTx: z5.string().nullable(),
|
|
1072
|
+
deadline: z5.string().nullable(),
|
|
1073
|
+
requiredProof: z5.string().nullable(),
|
|
1074
|
+
status: z5.string(),
|
|
1075
|
+
assignedTo: z5.string().uuid().nullable(),
|
|
1076
|
+
createdAt: z5.string()
|
|
1077
|
+
});
|
|
1078
|
+
incubatorTasksResponseDataSchema = z5.object({
|
|
1079
|
+
tasks: z5.array(incubatorTaskSummarySchema),
|
|
1080
|
+
count: z5.number()
|
|
1081
|
+
});
|
|
1082
|
+
incubatorTaskCreateResponseDataSchema = z5.object({
|
|
1083
|
+
task: incubatorTaskSummarySchema
|
|
1084
|
+
});
|
|
1085
|
+
incubatorTaskActionResponseDataSchema = z5.union([
|
|
1086
|
+
z5.object({
|
|
1087
|
+
task: z5.object({
|
|
1088
|
+
id: z5.string().uuid(),
|
|
1089
|
+
status: z5.string(),
|
|
1090
|
+
assignedTo: z5.string().uuid().optional(),
|
|
1091
|
+
payoutTx: z5.string().optional()
|
|
1092
|
+
})
|
|
1093
|
+
}),
|
|
1094
|
+
z5.object({
|
|
1095
|
+
dispute: z5.object({
|
|
1096
|
+
id: z5.string().uuid(),
|
|
1097
|
+
taskId: z5.string().uuid(),
|
|
1098
|
+
initiatedBy: z5.string(),
|
|
1099
|
+
reason: z5.string(),
|
|
1100
|
+
resolution: z5.string(),
|
|
1101
|
+
createdAt: z5.string()
|
|
1102
|
+
})
|
|
1103
|
+
})
|
|
1104
|
+
]);
|
|
1105
|
+
incubatorTaskApplicantSchema = z5.object({
|
|
1106
|
+
id: z5.string().uuid(),
|
|
1107
|
+
taskId: z5.string().uuid(),
|
|
1108
|
+
walletAddress: z5.string().nullable(),
|
|
1109
|
+
paymentMethod: z5.record(z5.string(), z5.unknown()).nullable().optional(),
|
|
1110
|
+
message: z5.string().nullable(),
|
|
1111
|
+
rating: z5.number().int().nullable().optional(),
|
|
1112
|
+
selected: z5.boolean(),
|
|
1113
|
+
createdAt: z5.string()
|
|
1114
|
+
});
|
|
1115
|
+
incubatorTaskSubmissionSchema = z5.object({
|
|
1116
|
+
id: z5.string().uuid(),
|
|
1117
|
+
taskId: z5.string().uuid(),
|
|
1118
|
+
applicantId: z5.string().uuid(),
|
|
1119
|
+
proofText: z5.string().nullable(),
|
|
1120
|
+
proofImages: z5.array(z5.string()).nullable(),
|
|
1121
|
+
submittedAt: z5.string()
|
|
1122
|
+
});
|
|
1123
|
+
incubatorTaskApplicationsResponseDataSchema = z5.object({
|
|
1124
|
+
task: incubatorTaskSummarySchema,
|
|
1125
|
+
applications: z5.array(incubatorTaskApplicantSchema)
|
|
1126
|
+
});
|
|
1127
|
+
incubatorTaskSubmissionResponseDataSchema = z5.object({
|
|
1128
|
+
submission: incubatorTaskSubmissionSchema.nullable()
|
|
1129
|
+
});
|
|
1130
|
+
incubatorTurnSchema = z5.object({
|
|
1131
|
+
id: z5.number().int(),
|
|
1132
|
+
piEntryId: z5.string(),
|
|
1133
|
+
parentPiEntryId: z5.string().nullable(),
|
|
1134
|
+
entryType: z5.string(),
|
|
1135
|
+
seq: z5.number().int(),
|
|
1136
|
+
timestamp: z5.string(),
|
|
1137
|
+
role: z5.string().nullable(),
|
|
1138
|
+
contentPreview: z5.string().nullable(),
|
|
1139
|
+
model: z5.string().nullable(),
|
|
1140
|
+
provider: z5.string().nullable(),
|
|
1141
|
+
toolName: z5.string().nullable(),
|
|
1142
|
+
tokenInput: z5.number().nullable(),
|
|
1143
|
+
tokenOutput: z5.number().nullable(),
|
|
1144
|
+
costUsd: z5.union([z5.number(), z5.string()]).nullable(),
|
|
1145
|
+
sourceType: z5.string().nullable(),
|
|
1146
|
+
sourceRef: z5.string().nullable()
|
|
1147
|
+
});
|
|
1148
|
+
incubatorTurnsResponseDataSchema = z5.union([
|
|
1149
|
+
z5.object({
|
|
1150
|
+
turns: z5.array(incubatorTurnSchema),
|
|
1151
|
+
page: z5.number().int(),
|
|
1152
|
+
pageSize: z5.number().int()
|
|
1153
|
+
}),
|
|
1154
|
+
z5.object({
|
|
1155
|
+
stats: z5.object({
|
|
1156
|
+
totalTurns: z5.number().int(),
|
|
1157
|
+
totalCostUsd: z5.number()
|
|
1158
|
+
})
|
|
1159
|
+
}),
|
|
1160
|
+
z5.object({
|
|
1161
|
+
latest: incubatorTurnSchema.nullable()
|
|
1162
|
+
})
|
|
1163
|
+
]);
|
|
1164
|
+
incubatorTurnsResponseSchema = successEnvelope(incubatorTurnsResponseDataSchema);
|
|
1165
|
+
incubatorGroupsUnreadResponseSchema = successEnvelope(incubatorGroupsUnreadResponseDataSchema);
|
|
1166
|
+
incubatorInboxUnreadResponseSchema = successEnvelope(incubatorInboxUnreadResponseDataSchema);
|
|
1167
|
+
});
|
|
1168
|
+
|
|
1169
|
+
// ../../packages/client/src/schemas/groups.ts
|
|
1170
|
+
import { z as z6 } from "zod";
|
|
1171
|
+
var queryBooleanSchema, optionalTagsQuerySchema, groupSlugParamsSchema, groupSlugAgentIdParamsSchema, groupSlugAppIdParamsSchema, groupSlugMessageIdParamsSchema, groupsListQuerySchema, createGroupRequestSchema, updateGroupRequestSchema, groupApplicationsQuerySchema, createGroupApplicationRequestSchema, decideGroupApplicationRequestSchema, groupMembersQuerySchema, updateGroupMemberRequestSchema, updateOwnGroupMembershipRequestSchema, groupLeaderboardQuerySchema, groupMessagesQuerySchema, createGroupMessageRequestSchema, reactToGroupMessageRequestSchema, thesisPositionSchema, createThesisMessageRequestSchema, groupCreatorSchema, groupListItemSchema, groupsListResponseDataSchema, createGroupResponseDataSchema, groupMemberAgentSchema, groupMemberSchema, groupDetailResponseDataSchema, updateGroupResponseDataSchema, deleteGroupResponseDataSchema, groupApplicationSchema, listGroupApplicationsResponseDataSchema, createGroupApplicationResponseDataSchema, decideGroupApplicationResponseDataSchema, groupLeaderboardResponseDataSchema, groupMembersResponseDataSchema, updateGroupMemberResponseDataSchema, deleteGroupMemberResponseDataSchema, updateOwnGroupMembershipResponseDataSchema, deleteOwnGroupMembershipResponseDataSchema, groupMessageSchema, listGroupMessagesResponseDataSchema, createGroupMessageResponseDataSchema, reactToGroupMessageResponseDataSchema, removeGroupMessageReactionResponseDataSchema, createThesisMessageResponseDataSchema, groupsListResponseSchema, createGroupResponseSchema, groupDetailResponseSchema;
|
|
1172
|
+
var init_groups = __esm(() => {
|
|
1173
|
+
init_common();
|
|
1174
|
+
queryBooleanSchema = z6.preprocess((value) => {
|
|
1175
|
+
if (value === undefined || value === null || value === "")
|
|
1176
|
+
return;
|
|
1177
|
+
if (value === true || value === "true")
|
|
1178
|
+
return true;
|
|
1179
|
+
if (value === false || value === "false")
|
|
1180
|
+
return false;
|
|
1181
|
+
return value;
|
|
1182
|
+
}, z6.boolean());
|
|
1183
|
+
optionalTagsQuerySchema = z6.union([z6.string(), z6.array(z6.string())]).optional().transform((value) => {
|
|
1184
|
+
if (value === undefined)
|
|
1185
|
+
return [];
|
|
1186
|
+
return Array.isArray(value) ? value : [value];
|
|
1187
|
+
});
|
|
1188
|
+
groupSlugParamsSchema = z6.object({
|
|
1189
|
+
slug: z6.string().min(1, "slug is required")
|
|
1190
|
+
});
|
|
1191
|
+
groupSlugAgentIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1192
|
+
agentId: z6.string().uuid("agentId must be a UUID")
|
|
1193
|
+
});
|
|
1194
|
+
groupSlugAppIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1195
|
+
appId: z6.string().uuid("appId must be a UUID")
|
|
1196
|
+
});
|
|
1197
|
+
groupSlugMessageIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1198
|
+
msgId: z6.string().uuid("msgId must be a UUID")
|
|
1199
|
+
});
|
|
1200
|
+
groupsListQuerySchema = z6.object({
|
|
1201
|
+
limit: z6.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
1202
|
+
offset: z6.coerce.number().int().min(0).default(0),
|
|
1203
|
+
search: z6.string().default(""),
|
|
1204
|
+
tag: optionalTagsQuerySchema,
|
|
1205
|
+
sort: z6.enum(["newest", "members", "performance", "trending"]).default("newest"),
|
|
1206
|
+
min_members: z6.coerce.number().int().min(0).default(0),
|
|
1207
|
+
max_members: z6.coerce.number().int().min(1).default(12),
|
|
1208
|
+
my_groups: queryBooleanSchema.default(false)
|
|
1209
|
+
});
|
|
1210
|
+
createGroupRequestSchema = z6.object({
|
|
1211
|
+
name: z6.string().trim().min(3, "Name must be 3-50 characters").max(50, "Name must be 3-50 characters"),
|
|
1212
|
+
description: z6.string().trim().max(2000).optional().nullable(),
|
|
1213
|
+
imageUrl: z6.string().trim().max(2048).optional().nullable(),
|
|
1214
|
+
maxMembers: z6.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").default(12),
|
|
1215
|
+
minTokenBalance: z6.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").default(0),
|
|
1216
|
+
minFeesPaidUsd: z6.coerce.number().min(0).default(0),
|
|
1217
|
+
minTradesPerMonth: z6.coerce.number().int().min(0).default(4),
|
|
1218
|
+
tags: z6.array(z6.string().trim().min(1)).max(5, "tags must be an array with max 5 items").default([])
|
|
1219
|
+
});
|
|
1220
|
+
updateGroupRequestSchema = z6.object({
|
|
1221
|
+
description: z6.string().trim().max(2000).optional().nullable(),
|
|
1222
|
+
maxMembers: z6.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").optional(),
|
|
1223
|
+
minTokenBalance: z6.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").optional(),
|
|
1224
|
+
minFeesPaidUsd: z6.coerce.number().min(0).optional(),
|
|
1225
|
+
minTradesPerMonth: z6.coerce.number().int().min(0).optional(),
|
|
1226
|
+
isPublic: z6.boolean().optional(),
|
|
1227
|
+
tags: z6.array(z6.string().trim().min(1)).max(5, "tags must be an array with max 5 items").optional()
|
|
1228
|
+
});
|
|
1229
|
+
groupApplicationsQuerySchema = z6.object({
|
|
1230
|
+
status: z6.enum(["pending", "accepted", "rejected", "all"]).default("pending"),
|
|
1231
|
+
limit: z6.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
1232
|
+
offset: z6.coerce.number().int().min(0).default(0)
|
|
1233
|
+
});
|
|
1234
|
+
createGroupApplicationRequestSchema = z6.object({
|
|
1235
|
+
message: z6.string().trim().max(500).optional()
|
|
1236
|
+
});
|
|
1237
|
+
decideGroupApplicationRequestSchema = z6.object({
|
|
1238
|
+
decision: z6.enum(["accept", "reject"])
|
|
1239
|
+
});
|
|
1240
|
+
groupMembersQuerySchema = z6.object({
|
|
1241
|
+
include_removed: queryBooleanSchema.default(false)
|
|
1242
|
+
});
|
|
1243
|
+
updateGroupMemberRequestSchema = z6.object({
|
|
1244
|
+
action: z6.enum(["mute", "unmute"]),
|
|
1245
|
+
durationHours: z6.coerce.number().positive().optional()
|
|
1246
|
+
});
|
|
1247
|
+
updateOwnGroupMembershipRequestSchema = z6.object({
|
|
1248
|
+
action: z6.enum(["pause", "unpause"])
|
|
1249
|
+
});
|
|
1250
|
+
groupLeaderboardQuerySchema = z6.object({
|
|
1251
|
+
period: z6.enum(["24h", "7d", "30d", "all"]).default("7d"),
|
|
1252
|
+
metric: z6.enum(["pnl", "theses", "accuracy"]).default("pnl")
|
|
1253
|
+
});
|
|
1254
|
+
groupMessagesQuerySchema = z6.object({
|
|
1255
|
+
limit: z6.coerce.number().int().min(1).max(100).default(50),
|
|
1256
|
+
after: z6.string().optional(),
|
|
1257
|
+
before: z6.string().optional(),
|
|
1258
|
+
type: z6.union([z6.string(), z6.array(z6.string())]).optional().transform((value) => {
|
|
1259
|
+
if (value === undefined)
|
|
1260
|
+
return [];
|
|
1261
|
+
return Array.isArray(value) ? value : [value];
|
|
1262
|
+
}).refine((types) => types.every((type) => type === "chat"), {
|
|
1263
|
+
message: "type must be one of: chat"
|
|
1264
|
+
})
|
|
1265
|
+
});
|
|
1266
|
+
createGroupMessageRequestSchema = z6.object({
|
|
1267
|
+
type: z6.literal("chat"),
|
|
1268
|
+
content: z6.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters")
|
|
1269
|
+
});
|
|
1270
|
+
reactToGroupMessageRequestSchema = z6.object({
|
|
1271
|
+
reaction: z6.enum(["agree", "disagree"])
|
|
1272
|
+
});
|
|
1273
|
+
thesisPositionSchema = z6.object({
|
|
1274
|
+
token: z6.string().trim().min(1),
|
|
1275
|
+
side: z6.enum(["long", "short"]),
|
|
1276
|
+
sizeUsd: z6.coerce.number().positive("Position size must be positive"),
|
|
1277
|
+
entryPrice: z6.coerce.number().positive("Position entryPrice must be positive"),
|
|
1278
|
+
txSignature: z6.string().trim().min(1)
|
|
1279
|
+
});
|
|
1280
|
+
createThesisMessageRequestSchema = z6.object({
|
|
1281
|
+
content: z6.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters"),
|
|
1282
|
+
position: thesisPositionSchema
|
|
1283
|
+
});
|
|
1284
|
+
groupCreatorSchema = z6.object({
|
|
1285
|
+
id: z6.string().uuid(),
|
|
1286
|
+
name: z6.string(),
|
|
1287
|
+
handle: z6.string().nullable(),
|
|
1288
|
+
avatarUrl: z6.string().nullable(),
|
|
1289
|
+
verified: z6.boolean()
|
|
1290
|
+
});
|
|
1291
|
+
groupListItemSchema = z6.object({
|
|
1292
|
+
id: z6.string().uuid(),
|
|
1293
|
+
slug: z6.string(),
|
|
1294
|
+
name: z6.string(),
|
|
1295
|
+
description: z6.string().nullable(),
|
|
1296
|
+
imageUrl: z6.string().nullable(),
|
|
1297
|
+
maxMembers: z6.number(),
|
|
1298
|
+
memberCount: z6.number(),
|
|
1299
|
+
minTokenBalance: z6.number(),
|
|
1300
|
+
minFeesPaidUsd: z6.number(),
|
|
1301
|
+
minTradesPerMonth: z6.number(),
|
|
1302
|
+
tags: z6.array(z6.string()),
|
|
1303
|
+
createdAt: z6.string(),
|
|
1304
|
+
creator: groupCreatorSchema.nullable(),
|
|
1305
|
+
stats: z6.object({
|
|
1306
|
+
totalPnl24h: z6.number(),
|
|
1307
|
+
totalPnl7d: z6.number()
|
|
1308
|
+
})
|
|
1309
|
+
});
|
|
1310
|
+
groupsListResponseDataSchema = z6.object({
|
|
1311
|
+
groups: z6.array(groupListItemSchema),
|
|
1312
|
+
pagination: z6.object({
|
|
1313
|
+
limit: z6.number(),
|
|
1314
|
+
offset: z6.number(),
|
|
1315
|
+
total: z6.number(),
|
|
1316
|
+
hasMore: z6.boolean()
|
|
1317
|
+
}),
|
|
1318
|
+
summary: z6.object({
|
|
1319
|
+
totalGroups: z6.number(),
|
|
1320
|
+
totalMembers: z6.number(),
|
|
1321
|
+
totalVolume: z6.number(),
|
|
1322
|
+
totalTrades: z6.number(),
|
|
1323
|
+
lastActivity: z6.string().nullable()
|
|
1324
|
+
})
|
|
1325
|
+
});
|
|
1326
|
+
createGroupResponseDataSchema = z6.object({
|
|
1327
|
+
group: z6.object({
|
|
1328
|
+
id: z6.string().uuid(),
|
|
1329
|
+
slug: z6.string(),
|
|
1330
|
+
name: z6.string()
|
|
1331
|
+
})
|
|
1332
|
+
});
|
|
1333
|
+
groupMemberAgentSchema = z6.object({
|
|
1334
|
+
id: z6.string().uuid(),
|
|
1335
|
+
name: z6.string(),
|
|
1336
|
+
handle: z6.string().nullable(),
|
|
1337
|
+
avatarUrl: z6.string().nullable(),
|
|
1338
|
+
verified: z6.boolean(),
|
|
1339
|
+
origin: z6.string().nullable().optional(),
|
|
1340
|
+
pnl24h: z6.number().nullable().optional(),
|
|
1341
|
+
pnl24hPercent: z6.number().nullable().optional(),
|
|
1342
|
+
pnl7d: z6.number().nullable().optional(),
|
|
1343
|
+
pnl7dPercent: z6.number().nullable().optional(),
|
|
1344
|
+
totalValueUsd: z6.number().nullable().optional()
|
|
1345
|
+
});
|
|
1346
|
+
groupMemberSchema = z6.object({
|
|
1347
|
+
id: z6.string().uuid(),
|
|
1348
|
+
role: z6.string(),
|
|
1349
|
+
status: z6.string(),
|
|
1350
|
+
joinedAt: z6.string(),
|
|
1351
|
+
lastTradeAt: z6.string().nullable(),
|
|
1352
|
+
agent: groupMemberAgentSchema.nullable()
|
|
1353
|
+
});
|
|
1354
|
+
groupDetailResponseDataSchema = z6.object({
|
|
1355
|
+
group: z6.object({
|
|
1356
|
+
id: z6.string().uuid(),
|
|
1357
|
+
slug: z6.string(),
|
|
1358
|
+
name: z6.string(),
|
|
1359
|
+
description: z6.string().nullable(),
|
|
1360
|
+
imageUrl: z6.string().nullable(),
|
|
1361
|
+
maxMembers: z6.number(),
|
|
1362
|
+
minTokenBalance: z6.number(),
|
|
1363
|
+
minFeesPaidUsd: z6.number(),
|
|
1364
|
+
minTradesPerMonth: z6.number(),
|
|
1365
|
+
isPublic: z6.boolean(),
|
|
1366
|
+
tags: z6.array(z6.string()),
|
|
1367
|
+
createdAt: z6.string(),
|
|
1368
|
+
updatedAt: z6.string().nullable(),
|
|
1369
|
+
creator: groupCreatorSchema.nullable(),
|
|
1370
|
+
stats: z6.object({
|
|
1371
|
+
totalPnl24h: z6.number(),
|
|
1372
|
+
totalPnl7d: z6.number(),
|
|
1373
|
+
totalVolume: z6.number(),
|
|
1374
|
+
totalTheses: z6.number(),
|
|
1375
|
+
totalTrades: z6.number(),
|
|
1376
|
+
totalMessages: z6.number(),
|
|
1377
|
+
totalPositionUpdates: z6.number()
|
|
1378
|
+
})
|
|
1379
|
+
}),
|
|
1380
|
+
members: z6.array(groupMemberSchema),
|
|
1381
|
+
memberCount: z6.number(),
|
|
1382
|
+
pendingApplications: z6.number(),
|
|
1383
|
+
userMembership: z6.object({
|
|
1384
|
+
id: z6.string().uuid(),
|
|
1385
|
+
role: z6.string(),
|
|
1386
|
+
status: z6.string(),
|
|
1387
|
+
joinedAt: z6.string(),
|
|
1388
|
+
agentId: z6.string().uuid()
|
|
1389
|
+
}).nullable(),
|
|
1390
|
+
isMember: z6.boolean(),
|
|
1391
|
+
hasPendingApplication: z6.boolean(),
|
|
1392
|
+
canViewContent: z6.boolean()
|
|
1393
|
+
});
|
|
1394
|
+
updateGroupResponseDataSchema = z6.object({
|
|
1395
|
+
group: z6.object({
|
|
1396
|
+
id: z6.string().uuid(),
|
|
1397
|
+
slug: z6.string(),
|
|
1398
|
+
name: z6.string(),
|
|
1399
|
+
description: z6.string().nullable(),
|
|
1400
|
+
maxMembers: z6.number(),
|
|
1401
|
+
minTokenBalance: z6.number(),
|
|
1402
|
+
isPublic: z6.boolean(),
|
|
1403
|
+
tags: z6.array(z6.string())
|
|
1404
|
+
})
|
|
1405
|
+
});
|
|
1406
|
+
deleteGroupResponseDataSchema = z6.object({
|
|
1407
|
+
deleted: z6.boolean(),
|
|
1408
|
+
groupId: z6.string().uuid()
|
|
1409
|
+
});
|
|
1410
|
+
groupApplicationSchema = z6.object({
|
|
1411
|
+
id: z6.string().uuid(),
|
|
1412
|
+
agentId: z6.string().uuid(),
|
|
1413
|
+
status: z6.string(),
|
|
1414
|
+
message: z6.string().nullable(),
|
|
1415
|
+
createdAt: z6.string(),
|
|
1416
|
+
agent: z6.object({
|
|
1417
|
+
id: z6.string().uuid(),
|
|
1418
|
+
name: z6.string(),
|
|
1419
|
+
handle: z6.string().nullable(),
|
|
1420
|
+
avatarUrl: z6.string().nullable()
|
|
1421
|
+
}).nullable().optional()
|
|
1422
|
+
}).passthrough();
|
|
1423
|
+
listGroupApplicationsResponseDataSchema = z6.object({
|
|
1424
|
+
applications: z6.array(groupApplicationSchema),
|
|
1425
|
+
pagination: z6.object({
|
|
1426
|
+
limit: z6.number(),
|
|
1427
|
+
offset: z6.number(),
|
|
1428
|
+
total: z6.number(),
|
|
1429
|
+
hasMore: z6.boolean()
|
|
1430
|
+
}),
|
|
1431
|
+
canDecide: z6.boolean()
|
|
1432
|
+
});
|
|
1433
|
+
createGroupApplicationResponseDataSchema = z6.object({
|
|
1434
|
+
application: z6.object({
|
|
1435
|
+
id: z6.string().uuid(),
|
|
1436
|
+
status: z6.string(),
|
|
1437
|
+
createdAt: z6.string()
|
|
1438
|
+
})
|
|
1439
|
+
});
|
|
1440
|
+
decideGroupApplicationResponseDataSchema = z6.object({
|
|
1441
|
+
application: z6.object({
|
|
1442
|
+
id: z6.string().uuid(),
|
|
1443
|
+
status: z6.string()
|
|
1444
|
+
}),
|
|
1445
|
+
memberAdded: z6.boolean().optional()
|
|
1446
|
+
});
|
|
1447
|
+
groupLeaderboardResponseDataSchema = z6.object({
|
|
1448
|
+
group: z6.object({
|
|
1449
|
+
id: z6.string().uuid(),
|
|
1450
|
+
slug: z6.string(),
|
|
1451
|
+
name: z6.string()
|
|
1452
|
+
}),
|
|
1453
|
+
leaderboard: z6.array(z6.object({
|
|
1454
|
+
rank: z6.number(),
|
|
1455
|
+
agent: z6.object({
|
|
1456
|
+
id: z6.string().uuid(),
|
|
1457
|
+
name: z6.string(),
|
|
1458
|
+
handle: z6.string().nullable(),
|
|
1459
|
+
avatarUrl: z6.string().nullable(),
|
|
1460
|
+
verified: z6.boolean()
|
|
1461
|
+
}),
|
|
1462
|
+
value: z6.number()
|
|
1463
|
+
}).passthrough()),
|
|
1464
|
+
period: z6.string(),
|
|
1465
|
+
metric: z6.string(),
|
|
1466
|
+
totalMembers: z6.number()
|
|
1467
|
+
});
|
|
1468
|
+
groupMembersResponseDataSchema = z6.object({
|
|
1469
|
+
members: z6.array(groupMemberSchema),
|
|
1470
|
+
total: z6.number()
|
|
1471
|
+
});
|
|
1472
|
+
updateGroupMemberResponseDataSchema = z6.union([
|
|
1473
|
+
z6.object({
|
|
1474
|
+
muted: z6.boolean(),
|
|
1475
|
+
groupId: z6.string().uuid(),
|
|
1476
|
+
agentId: z6.string().uuid(),
|
|
1477
|
+
mutedUntil: z6.string().nullable()
|
|
1478
|
+
}),
|
|
1479
|
+
z6.object({
|
|
1480
|
+
unmuted: z6.boolean(),
|
|
1481
|
+
groupId: z6.string().uuid(),
|
|
1482
|
+
agentId: z6.string().uuid()
|
|
1483
|
+
})
|
|
1484
|
+
]);
|
|
1485
|
+
deleteGroupMemberResponseDataSchema = z6.object({
|
|
1486
|
+
removed: z6.boolean()
|
|
1487
|
+
});
|
|
1488
|
+
updateOwnGroupMembershipResponseDataSchema = z6.union([
|
|
1489
|
+
z6.object({ paused: z6.boolean(), groupId: z6.string().uuid() }),
|
|
1490
|
+
z6.object({ unpaused: z6.boolean(), groupId: z6.string().uuid() })
|
|
1491
|
+
]);
|
|
1492
|
+
deleteOwnGroupMembershipResponseDataSchema = z6.object({
|
|
1493
|
+
left: z6.boolean(),
|
|
1494
|
+
groupId: z6.string().uuid()
|
|
1495
|
+
});
|
|
1496
|
+
groupMessageSchema = z6.object({
|
|
1497
|
+
id: z6.string().uuid(),
|
|
1498
|
+
type: z6.string(),
|
|
1499
|
+
content: z6.string(),
|
|
1500
|
+
createdAt: z6.string(),
|
|
1501
|
+
agent: z6.object({
|
|
1502
|
+
id: z6.string().uuid(),
|
|
1503
|
+
name: z6.string(),
|
|
1504
|
+
handle: z6.string().nullable(),
|
|
1505
|
+
avatarUrl: z6.string().nullable()
|
|
1506
|
+
}).nullable().optional(),
|
|
1507
|
+
links: z6.array(z6.string()).nullable().optional()
|
|
1508
|
+
}).passthrough();
|
|
1509
|
+
listGroupMessagesResponseDataSchema = z6.object({
|
|
1510
|
+
messages: z6.array(groupMessageSchema),
|
|
1511
|
+
pagination: z6.object({
|
|
1512
|
+
limit: z6.number(),
|
|
1513
|
+
hasMore: z6.boolean()
|
|
1514
|
+
}).passthrough(),
|
|
1515
|
+
count: z6.number()
|
|
1516
|
+
});
|
|
1517
|
+
createGroupMessageResponseDataSchema = z6.object({
|
|
1518
|
+
message: z6.object({
|
|
1519
|
+
id: z6.string().uuid(),
|
|
1520
|
+
type: z6.string(),
|
|
1521
|
+
content: z6.string(),
|
|
1522
|
+
links: z6.array(z6.string()).nullable().optional(),
|
|
1523
|
+
createdAt: z6.string()
|
|
1524
|
+
})
|
|
1525
|
+
});
|
|
1526
|
+
reactToGroupMessageResponseDataSchema = z6.object({
|
|
1527
|
+
reaction: z6.string(),
|
|
1528
|
+
counts: z6.object({
|
|
1529
|
+
agree: z6.number(),
|
|
1530
|
+
disagree: z6.number()
|
|
1531
|
+
}),
|
|
1532
|
+
result: z6.enum(["added", "flipped", "removed"])
|
|
1533
|
+
});
|
|
1534
|
+
removeGroupMessageReactionResponseDataSchema = z6.object({
|
|
1535
|
+
removed: z6.boolean(),
|
|
1536
|
+
counts: z6.object({
|
|
1537
|
+
agree: z6.number(),
|
|
1538
|
+
disagree: z6.number()
|
|
1539
|
+
})
|
|
1540
|
+
});
|
|
1541
|
+
createThesisMessageResponseDataSchema = z6.object({
|
|
1542
|
+
message: z6.object({
|
|
1543
|
+
id: z6.string().uuid(),
|
|
1544
|
+
type: z6.literal("thesis"),
|
|
1545
|
+
content: z6.string(),
|
|
1546
|
+
verifiedPosition: z6.record(z6.string(), z6.unknown()).nullable(),
|
|
1547
|
+
createdAt: z6.string()
|
|
1548
|
+
})
|
|
1549
|
+
});
|
|
1550
|
+
groupsListResponseSchema = successEnvelope(groupsListResponseDataSchema);
|
|
1551
|
+
createGroupResponseSchema = successEnvelope(createGroupResponseDataSchema);
|
|
1552
|
+
groupDetailResponseSchema = successEnvelope(groupDetailResponseDataSchema);
|
|
1553
|
+
});
|
|
1554
|
+
|
|
1555
|
+
// ../../packages/client/src/schemas/tokens.ts
|
|
1556
|
+
import { z as z7 } from "zod";
|
|
1557
|
+
var tokenParamsSchema, tokenInfoSchema, tokenInfoResponseDataSchema, tokenInfoResponseSchema, tokensListQuerySchema, tokenListItemSchema, tokensListResponseDataSchema, tokensListResponseSchema, tokenLaunchRequestSchema, tokenLaunchSchema, tokenLaunchResponseDataSchema, tokenLaunchResponseSchema, tokenLaunchesQuerySchema, tokenLaunchListItemSchema, tokenLaunchesListResponseDataSchema, launchpadQuerySchema, mintAddressParamSchema, launchpadTokensResponseDataSchema, launchpadTokenDetailResponseDataSchema;
|
|
1558
|
+
var init_tokens = __esm(() => {
|
|
1559
|
+
init_common();
|
|
1560
|
+
tokenParamsSchema = z7.object({
|
|
1561
|
+
token: z7.string().trim().min(1, "token is required")
|
|
1562
|
+
});
|
|
1563
|
+
tokenInfoSchema = z7.object({
|
|
1564
|
+
mint: z7.string(),
|
|
1565
|
+
chain: z7.string(),
|
|
1566
|
+
symbol: z7.string().nullable(),
|
|
1567
|
+
name: z7.string().nullable(),
|
|
1568
|
+
decimals: z7.number().int().nullable(),
|
|
1569
|
+
logoUrl: z7.string().nullable(),
|
|
1570
|
+
priceUsd: z7.number(),
|
|
1571
|
+
priceUpdatedAt: z7.string().nullable(),
|
|
1572
|
+
firstSeenAt: z7.string(),
|
|
1573
|
+
createdAt: z7.string()
|
|
1574
|
+
});
|
|
1575
|
+
tokenInfoResponseDataSchema = z7.object({
|
|
1576
|
+
token: tokenInfoSchema
|
|
1577
|
+
});
|
|
1578
|
+
tokenInfoResponseSchema = successEnvelope(tokenInfoResponseDataSchema);
|
|
1579
|
+
tokensListQuerySchema = z7.object({
|
|
1580
|
+
chain: z7.string().trim().min(1).optional()
|
|
1581
|
+
});
|
|
1582
|
+
tokenListItemSchema = z7.object({
|
|
1583
|
+
mint: z7.string(),
|
|
1584
|
+
chain: z7.string(),
|
|
1585
|
+
symbol: z7.string().nullable(),
|
|
1586
|
+
name: z7.string().nullable(),
|
|
1587
|
+
priceUsd: z7.number(),
|
|
1588
|
+
priceUpdatedAt: z7.string().nullable(),
|
|
1589
|
+
logoUrl: z7.string().nullable()
|
|
1590
|
+
});
|
|
1591
|
+
tokensListResponseDataSchema = z7.object({
|
|
1592
|
+
tokens: z7.array(tokenListItemSchema)
|
|
1593
|
+
});
|
|
1594
|
+
tokensListResponseSchema = successEnvelope(tokensListResponseDataSchema);
|
|
1595
|
+
tokenLaunchRequestSchema = z7.object({
|
|
1596
|
+
name: z7.preprocess((v) => typeof v === "string" ? v.trim() : "", z7.string().min(2, "Token name must be 2-32 characters").max(32, "Token name must be 2-32 characters").refine((v) => /^[A-Za-z0-9 ]+$/.test(v), { message: "Token name must be alphanumeric" })),
|
|
1597
|
+
symbol: z7.preprocess((v) => typeof v === "string" ? v.trim() : "", z7.string().min(2, "Token symbol must be 2-10 characters").max(10, "Token symbol must be 2-10 characters").refine((v) => /^[A-Za-z0-9]+$/.test(v), { message: "Token symbol must be alphanumeric with no spaces" })),
|
|
1598
|
+
imageUrl: z7.string().url().optional(),
|
|
1599
|
+
configAddress: z7.string().min(32).max(44).optional()
|
|
1600
|
+
});
|
|
1601
|
+
tokenLaunchSchema = z7.object({
|
|
1602
|
+
id: z7.string().uuid().optional(),
|
|
1603
|
+
tokenId: z7.string().uuid().optional(),
|
|
1604
|
+
agentId: z7.string().uuid().optional(),
|
|
1605
|
+
name: z7.string(),
|
|
1606
|
+
symbol: z7.string(),
|
|
1607
|
+
mintAddress: z7.string().nullable(),
|
|
1608
|
+
poolAddress: z7.string().nullable().optional(),
|
|
1609
|
+
agentAllocationPct: z7.number().optional(),
|
|
1610
|
+
platformAllocationPct: z7.number().optional(),
|
|
1611
|
+
status: z7.enum(["pending", "deploying", "deployed", "failed"]),
|
|
1612
|
+
launchProvider: z7.string().nullable().optional(),
|
|
1613
|
+
createdAt: z7.string().optional(),
|
|
1614
|
+
txSignature: z7.string().nullable().optional(),
|
|
1615
|
+
priceUsd: z7.number().nullable().optional(),
|
|
1616
|
+
marketCapUsd: z7.number().nullable().optional(),
|
|
1617
|
+
holders: z7.number().nullable().optional(),
|
|
1618
|
+
deployed: z7.boolean()
|
|
1619
|
+
}).passthrough();
|
|
1620
|
+
tokenLaunchResponseDataSchema = z7.object({
|
|
1621
|
+
token: tokenLaunchSchema
|
|
1622
|
+
});
|
|
1623
|
+
tokenLaunchResponseSchema = successEnvelope(tokenLaunchResponseDataSchema);
|
|
1624
|
+
tokenLaunchesQuerySchema = z7.object({
|
|
1625
|
+
status: z7.enum(["deployed", "pending", "failed"]).optional(),
|
|
1626
|
+
sort: z7.enum(["newest", "oldest", "symbol"]).default("newest"),
|
|
1627
|
+
limit: z7.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
|
|
1628
|
+
offset: z7.coerce.number().int().min(0).default(0)
|
|
1629
|
+
});
|
|
1630
|
+
tokenLaunchListItemSchema = z7.object({
|
|
1631
|
+
id: z7.string().uuid(),
|
|
1632
|
+
name: z7.string(),
|
|
1633
|
+
symbol: z7.string(),
|
|
1634
|
+
status: z7.enum(["pending", "deploying", "deployed", "failed"]),
|
|
1635
|
+
launchProvider: z7.string().nullable(),
|
|
1636
|
+
mintAddress: z7.string().nullable(),
|
|
1637
|
+
poolAddress: z7.string().nullable(),
|
|
1638
|
+
createdAt: z7.string(),
|
|
1639
|
+
priceUsd: z7.number().nullable(),
|
|
1640
|
+
logoUrl: z7.string().nullable(),
|
|
1641
|
+
agent: z7.object({
|
|
1642
|
+
id: z7.string().uuid(),
|
|
1643
|
+
name: z7.string(),
|
|
1644
|
+
handle: z7.string().nullable(),
|
|
1645
|
+
avatarUrl: z7.string().nullable(),
|
|
1646
|
+
origin: z7.string(),
|
|
1647
|
+
verified: z7.boolean()
|
|
1648
|
+
})
|
|
1649
|
+
});
|
|
1650
|
+
tokenLaunchesListResponseDataSchema = z7.object({
|
|
1651
|
+
tokenLaunches: z7.array(tokenLaunchListItemSchema),
|
|
1652
|
+
pagination: z7.object({
|
|
1653
|
+
limit: z7.number(),
|
|
1654
|
+
offset: z7.number(),
|
|
1655
|
+
total: z7.number(),
|
|
1656
|
+
hasMore: z7.boolean()
|
|
1657
|
+
})
|
|
1658
|
+
});
|
|
1659
|
+
launchpadQuerySchema = z7.object({
|
|
1660
|
+
sort: z7.enum(["newest", "marketCap", "volume"]).default("newest"),
|
|
1661
|
+
filter: z7.enum(["all", "bonding", "graduated"]).default("all"),
|
|
1662
|
+
limit: z7.coerce.number().int().min(1).max(100).default(50),
|
|
1663
|
+
offset: z7.coerce.number().int().min(0).default(0)
|
|
1664
|
+
});
|
|
1665
|
+
mintAddressParamSchema = z7.object({
|
|
1666
|
+
mintAddress: z7.string().trim().min(1, "mintAddress is required")
|
|
1667
|
+
});
|
|
1668
|
+
launchpadTokensResponseDataSchema = z7.object({
|
|
1669
|
+
tokens: z7.array(z7.object({
|
|
1670
|
+
id: z7.string().uuid(),
|
|
1671
|
+
name: z7.string(),
|
|
1672
|
+
symbol: z7.string(),
|
|
1673
|
+
mintAddress: z7.string().nullable(),
|
|
1674
|
+
poolAddress: z7.string().nullable(),
|
|
1675
|
+
createdAt: z7.string(),
|
|
1676
|
+
priceUsd: z7.number().nullable(),
|
|
1677
|
+
logoUrl: z7.string().nullable(),
|
|
1678
|
+
marketCap: z7.number(),
|
|
1679
|
+
bondingCurveProgress: z7.number(),
|
|
1680
|
+
volume24h: z7.number(),
|
|
1681
|
+
agent: z7.object({
|
|
1682
|
+
id: z7.string().uuid(),
|
|
1683
|
+
name: z7.string(),
|
|
1684
|
+
handle: z7.string().nullable(),
|
|
1685
|
+
avatarUrl: z7.string().nullable()
|
|
1686
|
+
})
|
|
1687
|
+
})),
|
|
1688
|
+
pagination: z7.object({ limit: z7.number(), offset: z7.number() })
|
|
1689
|
+
});
|
|
1690
|
+
launchpadTokenDetailResponseDataSchema = z7.object({
|
|
1691
|
+
token: z7.object({
|
|
1692
|
+
id: z7.string().uuid(),
|
|
1693
|
+
name: z7.string(),
|
|
1694
|
+
symbol: z7.string(),
|
|
1695
|
+
mintAddress: z7.string().nullable(),
|
|
1696
|
+
poolAddress: z7.string().nullable(),
|
|
1697
|
+
txSignature: z7.string().nullable(),
|
|
1698
|
+
agentAllocationPct: z7.number(),
|
|
1699
|
+
platformAllocationPct: z7.number(),
|
|
1700
|
+
createdAt: z7.string(),
|
|
1701
|
+
priceUsd: z7.number().nullable(),
|
|
1702
|
+
logoUrl: z7.string().nullable(),
|
|
1703
|
+
chain: z7.string().nullable(),
|
|
1704
|
+
decimals: z7.number().nullable(),
|
|
1705
|
+
marketCap: z7.number(),
|
|
1706
|
+
bondingCurveProgress: z7.number(),
|
|
1707
|
+
volume24h: z7.number(),
|
|
1708
|
+
agent: z7.object({
|
|
1709
|
+
id: z7.string().uuid(),
|
|
1710
|
+
name: z7.string(),
|
|
1711
|
+
handle: z7.string().nullable(),
|
|
1712
|
+
avatarUrl: z7.string().nullable(),
|
|
1713
|
+
origin: z7.string().nullable()
|
|
1714
|
+
})
|
|
1715
|
+
}),
|
|
1716
|
+
recentTrades: z7.array(z7.object({
|
|
1717
|
+
id: z7.string().uuid(),
|
|
1718
|
+
agentId: z7.string().uuid(),
|
|
1719
|
+
positionAction: z7.string(),
|
|
1720
|
+
positionSide: z7.string(),
|
|
1721
|
+
amount: z7.number(),
|
|
1722
|
+
priceUsd: z7.number(),
|
|
1723
|
+
valueUsd: z7.number(),
|
|
1724
|
+
timestamp: z7.string(),
|
|
1725
|
+
txSignature: z7.string().nullable()
|
|
1726
|
+
}))
|
|
1727
|
+
});
|
|
1728
|
+
});
|
|
1729
|
+
|
|
1730
|
+
// ../../packages/client/src/schemas/leaderboard.ts
|
|
1731
|
+
import { z as z8 } from "zod";
|
|
1732
|
+
var leaderboardEntrySchema, getLeaderboardResponseDataSchema, getLeaderboardResponseSchema, leaderboardQuerySchema, leaderboardGroupsQuerySchema, leaderboardModelsQuerySchema, leaderboardGroupCreatorSchema, leaderboardGroupEntrySchema, getLeaderboardGroupsResponseDataSchema, leaderboardModelTopAgentSchema, leaderboardModelEntrySchema, getLeaderboardModelsResponseDataSchema, getLeaderboardGroupsResponseSchema, getLeaderboardModelsResponseSchema;
|
|
1733
|
+
var init_leaderboard = __esm(() => {
|
|
1734
|
+
init_common();
|
|
1735
|
+
leaderboardEntrySchema = z8.object({
|
|
1736
|
+
rank: z8.number(),
|
|
1737
|
+
agent: z8.object({
|
|
1738
|
+
id: z8.string().uuid(),
|
|
1739
|
+
name: z8.string(),
|
|
1740
|
+
handle: z8.string().nullable(),
|
|
1741
|
+
avatar: z8.string().nullable(),
|
|
1742
|
+
strategy: z8.string().nullable(),
|
|
1743
|
+
verified: z8.boolean(),
|
|
1744
|
+
currentModel: z8.string().nullable(),
|
|
1745
|
+
origin: z8.string().nullable()
|
|
1746
|
+
}),
|
|
1747
|
+
pnl24h: z8.number().nullable(),
|
|
1748
|
+
pnl24hPercent: z8.number().nullable(),
|
|
1749
|
+
pnl7d: z8.number().nullable(),
|
|
1750
|
+
pnl7dPercent: z8.number().nullable(),
|
|
1751
|
+
pnlAllTime: z8.number().nullable(),
|
|
1752
|
+
pnlAllTimePercent: z8.number().nullable(),
|
|
1753
|
+
totalValue: z8.number().nullable()
|
|
1754
|
+
});
|
|
1755
|
+
getLeaderboardResponseDataSchema = z8.object({
|
|
1756
|
+
leaderboard: z8.array(leaderboardEntrySchema),
|
|
1757
|
+
pagination: z8.object({
|
|
1758
|
+
limit: z8.number(),
|
|
1759
|
+
offset: z8.number(),
|
|
1760
|
+
total: z8.number(),
|
|
1761
|
+
hasMore: z8.boolean()
|
|
1762
|
+
})
|
|
1763
|
+
});
|
|
1764
|
+
getLeaderboardResponseSchema = successEnvelope(getLeaderboardResponseDataSchema);
|
|
1765
|
+
leaderboardQuerySchema = z8.object({
|
|
1766
|
+
sort: z8.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).default("pnl_24h"),
|
|
1767
|
+
limit: z8.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
1768
|
+
offset: z8.coerce.number().int().min(0).default(0),
|
|
1769
|
+
origin: z8.enum(["user", "incubator"]).optional()
|
|
1770
|
+
});
|
|
1771
|
+
leaderboardGroupsQuerySchema = z8.object({
|
|
1772
|
+
limit: z8.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
1773
|
+
offset: z8.coerce.number().int().min(0).default(0),
|
|
1774
|
+
period: z8.enum(["24h", "7d", "30d", "all"]).default("7d")
|
|
1775
|
+
});
|
|
1776
|
+
leaderboardModelsQuerySchema = z8.object({
|
|
1777
|
+
sort: z8.enum(["pnl_24h", "pnl_7d", "trade_count"]).default("pnl_24h")
|
|
1778
|
+
});
|
|
1779
|
+
leaderboardGroupCreatorSchema = z8.object({
|
|
1780
|
+
id: z8.string(),
|
|
1781
|
+
name: z8.string(),
|
|
1782
|
+
handle: z8.string().nullable(),
|
|
1783
|
+
avatarUrl: z8.string().nullable(),
|
|
1784
|
+
verified: z8.boolean()
|
|
1785
|
+
});
|
|
1786
|
+
leaderboardGroupEntrySchema = z8.object({
|
|
1787
|
+
rank: z8.number(),
|
|
1788
|
+
id: z8.string(),
|
|
1789
|
+
slug: z8.string(),
|
|
1790
|
+
name: z8.string(),
|
|
1791
|
+
description: z8.string().nullable(),
|
|
1792
|
+
tags: z8.array(z8.string()).nullable(),
|
|
1793
|
+
memberCount: z8.number(),
|
|
1794
|
+
totalVolume: z8.number(),
|
|
1795
|
+
totalFees: z8.number(),
|
|
1796
|
+
avgPnlPercent: z8.number(),
|
|
1797
|
+
weightedPnlPercent: z8.number(),
|
|
1798
|
+
creator: leaderboardGroupCreatorSchema.nullable()
|
|
1799
|
+
});
|
|
1800
|
+
getLeaderboardGroupsResponseDataSchema = z8.object({
|
|
1801
|
+
leaderboard: z8.array(leaderboardGroupEntrySchema),
|
|
1802
|
+
period: z8.enum(["24h", "7d", "30d", "all"]),
|
|
1803
|
+
pagination: z8.object({
|
|
1804
|
+
limit: z8.number(),
|
|
1805
|
+
offset: z8.number(),
|
|
1806
|
+
total: z8.number(),
|
|
1807
|
+
hasMore: z8.boolean()
|
|
1808
|
+
})
|
|
1809
|
+
});
|
|
1810
|
+
leaderboardModelTopAgentSchema = z8.object({
|
|
1811
|
+
name: z8.string(),
|
|
1812
|
+
pnl24h: z8.number()
|
|
1813
|
+
});
|
|
1814
|
+
leaderboardModelEntrySchema = z8.object({
|
|
1815
|
+
rank: z8.number(),
|
|
1816
|
+
model: z8.string(),
|
|
1817
|
+
agentCount: z8.number(),
|
|
1818
|
+
tradeCount: z8.number(),
|
|
1819
|
+
totalPnl24h: z8.number(),
|
|
1820
|
+
avgPnl24h: z8.number(),
|
|
1821
|
+
totalPnl7d: z8.number(),
|
|
1822
|
+
avgPnl7d: z8.number(),
|
|
1823
|
+
topAgent: leaderboardModelTopAgentSchema.nullable()
|
|
1824
|
+
});
|
|
1825
|
+
getLeaderboardModelsResponseDataSchema = z8.object({
|
|
1826
|
+
models: z8.array(leaderboardModelEntrySchema)
|
|
1827
|
+
});
|
|
1828
|
+
getLeaderboardGroupsResponseSchema = successEnvelope(getLeaderboardGroupsResponseDataSchema);
|
|
1829
|
+
getLeaderboardModelsResponseSchema = successEnvelope(getLeaderboardModelsResponseDataSchema);
|
|
1830
|
+
});
|
|
1831
|
+
|
|
1832
|
+
// ../../packages/client/src/schemas/data-marketplace.ts
|
|
1833
|
+
import { z as z9 } from "zod";
|
|
1834
|
+
var DATA_MARKETPLACE_CATEGORIES, DATA_MARKETPLACE_PAYMENT_METHODS, dataMarketplaceListQuerySchema, dataMarketplaceProviderParamsSchema, dataMarketplaceCreateRequestSchema, dataMarketplaceProviderListItemSchema, dataMarketplaceCreateProviderSchema, dataMarketplaceProviderDetailSchema, dataMarketplaceListResponseDataSchema, dataMarketplaceCreateResponseDataSchema, dataMarketplaceProviderDetailResponseDataSchema, dataMarketplaceListResponseSchema, dataMarketplaceCreateResponseSchema, dataMarketplaceProviderDetailResponseSchema;
|
|
1835
|
+
var init_data_marketplace = __esm(() => {
|
|
1836
|
+
init_common();
|
|
1837
|
+
DATA_MARKETPLACE_CATEGORIES = [
|
|
1838
|
+
"prices",
|
|
1839
|
+
"sentiment",
|
|
1840
|
+
"news",
|
|
1841
|
+
"whale_tracking",
|
|
1842
|
+
"on_chain",
|
|
1843
|
+
"other"
|
|
1844
|
+
];
|
|
1845
|
+
DATA_MARKETPLACE_PAYMENT_METHODS = [
|
|
1846
|
+
"x402",
|
|
1847
|
+
"lightning",
|
|
1848
|
+
"solana_pay"
|
|
1849
|
+
];
|
|
1850
|
+
dataMarketplaceListQuerySchema = z9.object({
|
|
1851
|
+
category: z9.enum(DATA_MARKETPLACE_CATEGORIES).optional()
|
|
1852
|
+
});
|
|
1853
|
+
dataMarketplaceProviderParamsSchema = z9.object({
|
|
1854
|
+
id: z9.string().uuid()
|
|
1855
|
+
});
|
|
1856
|
+
dataMarketplaceCreateRequestSchema = z9.object({
|
|
1857
|
+
name: z9.string().trim().min(1).max(200),
|
|
1858
|
+
description: z9.string().trim().min(1).max(5000),
|
|
1859
|
+
category: z9.enum(DATA_MARKETPLACE_CATEGORIES),
|
|
1860
|
+
endpointUrl: z9.url(),
|
|
1861
|
+
costPerRequestUsd: z9.number().min(0),
|
|
1862
|
+
paymentMethod: z9.enum(DATA_MARKETPLACE_PAYMENT_METHODS),
|
|
1863
|
+
exampleRequest: z9.string().trim().min(1).max(1e4).optional(),
|
|
1864
|
+
exampleResponse: z9.string().trim().min(1).max(1e4).optional(),
|
|
1865
|
+
submittedBy: z9.string().optional()
|
|
1866
|
+
});
|
|
1867
|
+
dataMarketplaceProviderListItemSchema = z9.object({
|
|
1868
|
+
id: z9.string().min(1),
|
|
1869
|
+
name: z9.string(),
|
|
1870
|
+
description: z9.string(),
|
|
1871
|
+
category: z9.string(),
|
|
1872
|
+
endpointUrl: z9.string().url(),
|
|
1873
|
+
costPerRequestUsd: z9.number(),
|
|
1874
|
+
paymentMethod: z9.string(),
|
|
1875
|
+
exampleRequest: z9.string().nullable(),
|
|
1876
|
+
exampleResponse: z9.string().nullable(),
|
|
1877
|
+
verified: z9.boolean(),
|
|
1878
|
+
verifiedCallCount: z9.number(),
|
|
1879
|
+
createdAt: z9.string()
|
|
1880
|
+
});
|
|
1881
|
+
dataMarketplaceCreateProviderSchema = z9.object({
|
|
1882
|
+
id: z9.string().min(1),
|
|
1883
|
+
name: z9.string(),
|
|
1884
|
+
description: z9.string(),
|
|
1885
|
+
category: z9.string(),
|
|
1886
|
+
endpointUrl: z9.string().url(),
|
|
1887
|
+
costPerRequestUsd: z9.number(),
|
|
1888
|
+
paymentMethod: z9.string(),
|
|
1889
|
+
verified: z9.boolean(),
|
|
1890
|
+
active: z9.boolean(),
|
|
1891
|
+
createdAt: z9.string()
|
|
1892
|
+
});
|
|
1893
|
+
dataMarketplaceProviderDetailSchema = z9.object({
|
|
1894
|
+
id: z9.string().min(1),
|
|
1895
|
+
name: z9.string(),
|
|
1896
|
+
description: z9.string(),
|
|
1897
|
+
category: z9.string(),
|
|
1898
|
+
endpointUrl: z9.string().url(),
|
|
1899
|
+
costPerRequestUsd: z9.number(),
|
|
1900
|
+
paymentMethod: z9.string(),
|
|
1901
|
+
exampleRequest: z9.string().nullable().optional(),
|
|
1902
|
+
exampleResponse: z9.string().nullable().optional(),
|
|
1903
|
+
verified: z9.boolean(),
|
|
1904
|
+
verifiedCallCount: z9.number().optional(),
|
|
1905
|
+
active: z9.boolean().optional(),
|
|
1906
|
+
createdAt: z9.string().optional()
|
|
1907
|
+
});
|
|
1908
|
+
dataMarketplaceListResponseDataSchema = z9.object({
|
|
1909
|
+
providers: z9.array(dataMarketplaceProviderListItemSchema),
|
|
1910
|
+
count: z9.number().int().nonnegative()
|
|
1911
|
+
});
|
|
1912
|
+
dataMarketplaceCreateResponseDataSchema = z9.object({
|
|
1913
|
+
provider: dataMarketplaceCreateProviderSchema,
|
|
1914
|
+
message: z9.string()
|
|
1915
|
+
});
|
|
1916
|
+
dataMarketplaceProviderDetailResponseDataSchema = z9.object({
|
|
1917
|
+
provider: dataMarketplaceProviderDetailSchema
|
|
1918
|
+
});
|
|
1919
|
+
dataMarketplaceListResponseSchema = successEnvelope(dataMarketplaceListResponseDataSchema);
|
|
1920
|
+
dataMarketplaceCreateResponseSchema = successEnvelope(dataMarketplaceCreateResponseDataSchema);
|
|
1921
|
+
dataMarketplaceProviderDetailResponseSchema = successEnvelope(dataMarketplaceProviderDetailResponseDataSchema);
|
|
1922
|
+
});
|
|
1923
|
+
|
|
1924
|
+
// ../../packages/client/src/schemas/media.ts
|
|
1925
|
+
import { z as z10 } from "zod";
|
|
1926
|
+
function requiredString2(field, message = `Missing required field: ${field}`) {
|
|
1927
|
+
return z10.preprocess((value) => typeof value === "string" ? value.trim() : "", z10.string().min(1, { message }));
|
|
1928
|
+
}
|
|
1929
|
+
var missingPresignMessage = "Missing required fields: filename, contentType", MEDIA_UPLOAD_IMAGE_TYPES, MEDIA_UPLOAD_VIDEO_TYPES, MEDIA_UPLOAD_CONTENT_TYPES, contentTypeSet, mediaUploadPresignRequestSchema, mediaUploadResponseDataSchema, mediaUploadResponseSchema, avatarGenerateRequestSchema, avatarGenerateResponseDataSchema, avatarCreditsResponseDataSchema, avatarSelectRequestSchema, avatarSelectResponseDataSchema, mediaGenerateImageRequestSchema, mediaGenerateImageResponseDataSchema, mediaGenerateImageResponseSchema, mediaGenerateVideoRequestSchema, mediaGenerateVideoResponseDataSchema, mediaGenerateVideoResponseSchema, mediaVideoJobParamsSchema, mediaVideoJobResponseDataSchema, mediaVideoJobResponseSchema, mediaImagesInfoResponseDataSchema, mediaVideosInfoResponseDataSchema, mediaImagesInfoResponseSchema, mediaVideosInfoResponseSchema;
|
|
1930
|
+
var init_media = __esm(() => {
|
|
1931
|
+
init_common();
|
|
1932
|
+
MEDIA_UPLOAD_IMAGE_TYPES = [
|
|
1933
|
+
"image/png",
|
|
1934
|
+
"image/jpeg",
|
|
1935
|
+
"image/gif",
|
|
1936
|
+
"image/webp"
|
|
1937
|
+
];
|
|
1938
|
+
MEDIA_UPLOAD_VIDEO_TYPES = [
|
|
1939
|
+
"video/mp4",
|
|
1940
|
+
"video/webm"
|
|
1941
|
+
];
|
|
1942
|
+
MEDIA_UPLOAD_CONTENT_TYPES = [
|
|
1943
|
+
...MEDIA_UPLOAD_IMAGE_TYPES,
|
|
1944
|
+
...MEDIA_UPLOAD_VIDEO_TYPES
|
|
1945
|
+
];
|
|
1946
|
+
contentTypeSet = new Set(MEDIA_UPLOAD_CONTENT_TYPES);
|
|
1947
|
+
mediaUploadPresignRequestSchema = z10.object({
|
|
1948
|
+
filename: requiredString2("filename", missingPresignMessage),
|
|
1949
|
+
contentType: requiredString2("contentType", missingPresignMessage).refine((value) => contentTypeSet.has(value), { message: "Invalid content type" })
|
|
1950
|
+
});
|
|
1951
|
+
mediaUploadResponseDataSchema = z10.object({
|
|
1952
|
+
key: z10.string(),
|
|
1953
|
+
url: z10.string().url().optional(),
|
|
1954
|
+
avatarUrl: z10.string().url().optional(),
|
|
1955
|
+
uploadUrl: z10.string().url().optional(),
|
|
1956
|
+
imageUrl: z10.string().url().optional(),
|
|
1957
|
+
videoUrl: z10.string().url().optional(),
|
|
1958
|
+
maxSizeBytes: z10.number().int().positive().optional(),
|
|
1959
|
+
contentType: z10.string().optional(),
|
|
1960
|
+
expiresAt: z10.string().optional(),
|
|
1961
|
+
instructions: z10.string().optional()
|
|
1962
|
+
}).passthrough();
|
|
1963
|
+
mediaUploadResponseSchema = successEnvelope(mediaUploadResponseDataSchema);
|
|
1964
|
+
avatarGenerateRequestSchema = z10.object({
|
|
1965
|
+
prompt: z10.string().min(1).max(2000)
|
|
1966
|
+
});
|
|
1967
|
+
avatarGenerateResponseDataSchema = z10.object({
|
|
1968
|
+
generationId: z10.string().uuid().nullable(),
|
|
1969
|
+
imageUrl: z10.string().url(),
|
|
1970
|
+
creditsRemaining: z10.number()
|
|
1971
|
+
});
|
|
1972
|
+
avatarCreditsResponseDataSchema = z10.object({
|
|
1973
|
+
creditsTotal: z10.number(),
|
|
1974
|
+
creditsUsed: z10.number(),
|
|
1975
|
+
creditsRemaining: z10.number(),
|
|
1976
|
+
generations: z10.array(z10.object({
|
|
1977
|
+
id: z10.string().uuid(),
|
|
1978
|
+
imageUrl: z10.string().url().nullable(),
|
|
1979
|
+
selected: z10.boolean().nullable(),
|
|
1980
|
+
createdAt: z10.string()
|
|
1981
|
+
}).passthrough())
|
|
1982
|
+
});
|
|
1983
|
+
avatarSelectRequestSchema = z10.object({
|
|
1984
|
+
generationId: z10.string().uuid()
|
|
1985
|
+
});
|
|
1986
|
+
avatarSelectResponseDataSchema = z10.object({
|
|
1987
|
+
avatarUrl: z10.string().url(),
|
|
1988
|
+
generationId: z10.string().uuid()
|
|
1989
|
+
});
|
|
1990
|
+
mediaGenerateImageRequestSchema = z10.object({
|
|
1991
|
+
tradeId: requiredString2("tradeId"),
|
|
1992
|
+
prompt: requiredString2("prompt").refine((value) => value.length <= 2000, {
|
|
1993
|
+
message: "Prompt must be a string with max 2000 characters"
|
|
1994
|
+
}),
|
|
1995
|
+
aspectRatio: z10.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
|
|
1996
|
+
});
|
|
1997
|
+
mediaGenerateImageResponseDataSchema = z10.object({
|
|
1998
|
+
jobId: z10.string().uuid().nullable(),
|
|
1999
|
+
imageUrl: z10.string().url(),
|
|
2000
|
+
aspectRatio: z10.string(),
|
|
2001
|
+
cost: z10.number(),
|
|
2002
|
+
tradeId: z10.string()
|
|
2003
|
+
});
|
|
2004
|
+
mediaGenerateImageResponseSchema = successEnvelope(mediaGenerateImageResponseDataSchema);
|
|
2005
|
+
mediaGenerateVideoRequestSchema = z10.object({
|
|
2006
|
+
tradeId: z10.string().uuid().optional(),
|
|
2007
|
+
tokenId: z10.string().uuid().optional(),
|
|
2008
|
+
prompt: z10.string().max(1e4).optional(),
|
|
2009
|
+
aspectRatio: z10.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
|
|
2010
|
+
imagePrompt: z10.string().max(2000).optional(),
|
|
2011
|
+
firstFrameUrl: z10.string().url().optional()
|
|
2012
|
+
}).refine((data) => data.tradeId || data.tokenId, { message: "Either tradeId or tokenId is required", path: ["tradeId"] });
|
|
2013
|
+
mediaGenerateVideoResponseDataSchema = z10.object({
|
|
2014
|
+
jobId: z10.string().uuid(),
|
|
2015
|
+
status: z10.string(),
|
|
2016
|
+
mediaType: z10.string(),
|
|
2017
|
+
provider: z10.string(),
|
|
2018
|
+
duration: z10.number(),
|
|
2019
|
+
cost: z10.number(),
|
|
2020
|
+
note: z10.string()
|
|
2021
|
+
});
|
|
2022
|
+
mediaGenerateVideoResponseSchema = successEnvelope(mediaGenerateVideoResponseDataSchema);
|
|
2023
|
+
mediaVideoJobParamsSchema = z10.object({
|
|
2024
|
+
jobId: requiredString2("jobId")
|
|
2025
|
+
});
|
|
2026
|
+
mediaVideoJobResponseDataSchema = z10.object({
|
|
2027
|
+
jobId: z10.string(),
|
|
2028
|
+
status: z10.string(),
|
|
2029
|
+
mediaType: z10.string(),
|
|
2030
|
+
tradeId: z10.string().nullable(),
|
|
2031
|
+
tokenId: z10.string().nullable().optional(),
|
|
2032
|
+
provider: z10.string().optional(),
|
|
2033
|
+
requestedDuration: z10.number(),
|
|
2034
|
+
actualDuration: z10.number().optional(),
|
|
2035
|
+
createdAt: z10.string(),
|
|
2036
|
+
startedAt: z10.string().optional(),
|
|
2037
|
+
completedAt: z10.string().optional(),
|
|
2038
|
+
videoUrl: z10.string().url().nullable().optional(),
|
|
2039
|
+
costUsd: z10.number().nullable().optional(),
|
|
2040
|
+
errorMessage: z10.string().nullable().optional(),
|
|
2041
|
+
fallbackImageUrl: z10.string().url().optional(),
|
|
2042
|
+
firstFrameImageUrl: z10.string().url().nullable().optional()
|
|
2043
|
+
});
|
|
2044
|
+
mediaVideoJobResponseSchema = successEnvelope(mediaVideoJobResponseDataSchema);
|
|
2045
|
+
mediaImagesInfoResponseDataSchema = z10.object({
|
|
2046
|
+
model: z10.string().optional(),
|
|
2047
|
+
description: z10.string().optional(),
|
|
2048
|
+
supportedAspectRatios: z10.array(z10.string()).optional(),
|
|
2049
|
+
cost: z10.number().optional(),
|
|
2050
|
+
maxPromptLength: z10.number().optional(),
|
|
2051
|
+
provider: z10.string().optional(),
|
|
2052
|
+
note: z10.string().optional(),
|
|
2053
|
+
usage: z10.object({
|
|
2054
|
+
method: z10.string(),
|
|
2055
|
+
body: z10.record(z10.string(), z10.string()),
|
|
2056
|
+
headers: z10.record(z10.string(), z10.string())
|
|
2057
|
+
}).optional(),
|
|
2058
|
+
videoAlternative: z10.object({
|
|
2059
|
+
endpoint: z10.string(),
|
|
2060
|
+
note: z10.string()
|
|
2061
|
+
}).optional(),
|
|
2062
|
+
yourStats: z10.object({
|
|
2063
|
+
qualifyingTradesForImage: z10.number(),
|
|
2064
|
+
imagesGenerated: z10.number(),
|
|
2065
|
+
availableForImage: z10.number(),
|
|
2066
|
+
recentAvailableTrades: z10.array(z10.object({
|
|
2067
|
+
tradeId: z10.string(),
|
|
2068
|
+
valueUsd: z10.number()
|
|
2069
|
+
}))
|
|
2070
|
+
}).optional()
|
|
2071
|
+
}).passthrough();
|
|
2072
|
+
mediaVideosInfoResponseDataSchema = z10.object({
|
|
2073
|
+
description: z10.string().optional(),
|
|
2074
|
+
tiers: z10.record(z10.string(), z10.object({
|
|
2075
|
+
duration: z10.number(),
|
|
2076
|
+
cost: z10.number()
|
|
2077
|
+
}).passthrough()).optional(),
|
|
2078
|
+
providers: z10.array(z10.string()).optional(),
|
|
2079
|
+
limits: z10.record(z10.string(), z10.unknown()).optional(),
|
|
2080
|
+
usage: z10.object({
|
|
2081
|
+
method: z10.string(),
|
|
2082
|
+
body: z10.record(z10.string(), z10.string()),
|
|
2083
|
+
headers: z10.record(z10.string(), z10.string())
|
|
2084
|
+
}).optional(),
|
|
2085
|
+
statusCheck: z10.object({
|
|
2086
|
+
method: z10.string(),
|
|
2087
|
+
endpoint: z10.string()
|
|
2088
|
+
}).optional(),
|
|
2089
|
+
yourStats: z10.object({
|
|
2090
|
+
qualifyingTrades: z10.number(),
|
|
2091
|
+
videosGenerated: z10.number(),
|
|
2092
|
+
availableForVideo: z10.number(),
|
|
2093
|
+
recentQualifyingTrades: z10.array(z10.object({
|
|
2094
|
+
tradeId: z10.string(),
|
|
2095
|
+
valueUsd: z10.number(),
|
|
2096
|
+
tier: z10.object({
|
|
2097
|
+
type: z10.string(),
|
|
2098
|
+
duration: z10.number(),
|
|
2099
|
+
cost: z10.number()
|
|
2100
|
+
}).passthrough()
|
|
2101
|
+
}))
|
|
2102
|
+
}).optional()
|
|
2103
|
+
}).passthrough();
|
|
2104
|
+
mediaImagesInfoResponseSchema = successEnvelope(mediaImagesInfoResponseDataSchema);
|
|
2105
|
+
mediaVideosInfoResponseSchema = successEnvelope(mediaVideosInfoResponseDataSchema);
|
|
2106
|
+
});
|
|
2107
|
+
|
|
2108
|
+
// ../../packages/client/src/client/agent.ts
|
|
2109
|
+
var AgentClient;
|
|
2110
|
+
var init_agent = __esm(() => {
|
|
2111
|
+
init_base();
|
|
2112
|
+
init_posts();
|
|
2113
|
+
init_agents();
|
|
2114
|
+
init_trade();
|
|
2115
|
+
init_incubator();
|
|
2116
|
+
init_groups();
|
|
2117
|
+
init_tokens();
|
|
2118
|
+
init_leaderboard();
|
|
2119
|
+
init_data_marketplace();
|
|
2120
|
+
init_media();
|
|
299
2121
|
AgentClient = class AgentClient extends BaseClient {
|
|
300
2122
|
apiKey;
|
|
301
2123
|
constructor(apiKey, baseUrl) {
|
|
@@ -305,22 +2127,6 @@ var init_client = __esm(() => {
|
|
|
305
2127
|
authHeaders() {
|
|
306
2128
|
return { Authorization: `Bearer ${this.apiKey}` };
|
|
307
2129
|
}
|
|
308
|
-
async getStatus(includeWallets = false) {
|
|
309
|
-
const url = includeWallets ? "/agents/me?include=wallets" : "/agents/me";
|
|
310
|
-
return this.request({ method: "GET", path: url, headers: this.authHeaders() }, getStatusResponseDataSchema);
|
|
311
|
-
}
|
|
312
|
-
async verifyTweet(tweetUrl) {
|
|
313
|
-
const body = verifyTweetRequestSchema.parse({ tweetUrl });
|
|
314
|
-
return this.request({ method: "POST", path: "/claim/me/verify-tweet", body, headers: this.authHeaders() }, verifyTweetResponseDataSchema);
|
|
315
|
-
}
|
|
316
|
-
async trade(req) {
|
|
317
|
-
const body = tradeRequestSchema.parse(req);
|
|
318
|
-
return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, tradeResponseDataSchema);
|
|
319
|
-
}
|
|
320
|
-
async createPost(req) {
|
|
321
|
-
const body = createPostRequestSchema.parse(req);
|
|
322
|
-
return this.request({ method: "POST", path: "/posts", body, headers: this.authHeaders() }, createPostResponseDataSchema);
|
|
323
|
-
}
|
|
324
2130
|
async getPosts(options) {
|
|
325
2131
|
const parsed = postsQuerySchema.parse(options ?? {});
|
|
326
2132
|
const params = new URLSearchParams({
|
|
@@ -330,6 +2136,9 @@ var init_client = __esm(() => {
|
|
|
330
2136
|
});
|
|
331
2137
|
return this.request({ method: "GET", path: `/posts?${params.toString()}` }, getPostsResponseDataSchema);
|
|
332
2138
|
}
|
|
2139
|
+
async getPost(idOrSlug) {
|
|
2140
|
+
return this.request({ method: "GET", path: `/posts/${encodeURIComponent(idOrSlug)}` }, getPostDetailResponseDataSchema);
|
|
2141
|
+
}
|
|
333
2142
|
async getLeaderboard(options) {
|
|
334
2143
|
const params = new URLSearchParams;
|
|
335
2144
|
if (options?.sort)
|
|
@@ -340,6 +2149,88 @@ var init_client = __esm(() => {
|
|
|
340
2149
|
params.set("offset", String(options.offset));
|
|
341
2150
|
return this.request({ method: "GET", path: `/leaderboard${params.toString() ? `?${params.toString()}` : ""}` }, getLeaderboardResponseDataSchema);
|
|
342
2151
|
}
|
|
2152
|
+
async listGroups() {
|
|
2153
|
+
return this.request({ method: "GET", path: "/groups" }, groupsListResponseDataSchema);
|
|
2154
|
+
}
|
|
2155
|
+
async browseDataMarketplace(category) {
|
|
2156
|
+
const params = category ? `?category=${encodeURIComponent(category)}` : "";
|
|
2157
|
+
return this.request({ method: "GET", path: `/data-marketplace${params}` }, dataMarketplaceListResponseDataSchema);
|
|
2158
|
+
}
|
|
2159
|
+
async getProviderDetails(providerId) {
|
|
2160
|
+
return this.request({ method: "GET", path: `/data-marketplace/${encodeURIComponent(providerId)}` }, dataMarketplaceProviderDetailResponseDataSchema);
|
|
2161
|
+
}
|
|
2162
|
+
async listTokens(chain) {
|
|
2163
|
+
const params = chain ? `?chain=${encodeURIComponent(chain)}` : "";
|
|
2164
|
+
return this.request({ method: "GET", path: `/tokens${params}` }, tokensListResponseDataSchema);
|
|
2165
|
+
}
|
|
2166
|
+
async getStatus(includeWallets = false) {
|
|
2167
|
+
const url = includeWallets ? "/agents/me?include=wallets" : "/agents/me";
|
|
2168
|
+
return this.request({ method: "GET", path: url, headers: this.authHeaders() }, getStatusResponseDataSchema);
|
|
2169
|
+
}
|
|
2170
|
+
async updateProfile(updates) {
|
|
2171
|
+
const body = agentsMeUpdateRequestSchema.parse(updates);
|
|
2172
|
+
return this.request({ method: "PATCH", path: "/agents/me", body, headers: this.authHeaders() }, agentsMeUpdateResponseDataSchema);
|
|
2173
|
+
}
|
|
2174
|
+
async checkHandle(handle) {
|
|
2175
|
+
return this.request({ method: "GET", path: `/agents/check-handle?handle=${encodeURIComponent(handle)}`, headers: this.authHeaders() }, agentsCheckHandleResponseDataSchema);
|
|
2176
|
+
}
|
|
2177
|
+
async verifyTweet(tweetUrl) {
|
|
2178
|
+
const body = verifyTweetRequestSchema.parse({ tweetUrl });
|
|
2179
|
+
return this.request({ method: "POST", path: "/claim/me/verify-tweet", body, headers: this.authHeaders() }, verifyTweetResponseDataSchema);
|
|
2180
|
+
}
|
|
2181
|
+
async getMarkets() {
|
|
2182
|
+
return this.request({ method: "GET", path: "/agents/me?include=wallets", headers: this.authHeaders() }, getStatusResponseDataSchema);
|
|
2183
|
+
}
|
|
2184
|
+
async getMarketsWithTokens() {
|
|
2185
|
+
const [status, tokenList] = await Promise.all([
|
|
2186
|
+
this.getMarkets(),
|
|
2187
|
+
this.listTokens().catch(() => ({ tokens: [] }))
|
|
2188
|
+
]);
|
|
2189
|
+
return {
|
|
2190
|
+
chains: {
|
|
2191
|
+
solana: {
|
|
2192
|
+
available: !!status.agent.solanaAddress,
|
|
2193
|
+
address: status.agent.solanaAddress
|
|
2194
|
+
},
|
|
2195
|
+
hyperliquid: {
|
|
2196
|
+
available: !!status.agent.hlAddress,
|
|
2197
|
+
address: status.agent.hlAddress
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
currentModel: status.agent.currentModel,
|
|
2201
|
+
tokens: tokenList.tokens.map((t) => ({
|
|
2202
|
+
symbol: t.symbol,
|
|
2203
|
+
name: t.name,
|
|
2204
|
+
chain: t.chain,
|
|
2205
|
+
priceUsd: t.priceUsd,
|
|
2206
|
+
mint: t.mint
|
|
2207
|
+
}))
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
async getPolicies() {
|
|
2211
|
+
return this.request({ method: "GET", path: "/agents/me/policies", headers: this.authHeaders() }, policyStateResponseDataSchema);
|
|
2212
|
+
}
|
|
2213
|
+
async updatePolicies(updates) {
|
|
2214
|
+
const body = policyUpdateRequestSchema.parse(updates);
|
|
2215
|
+
return this.request({ method: "PATCH", path: "/agents/me/policies", body, headers: this.authHeaders() }, policyUpdateResponseDataSchema);
|
|
2216
|
+
}
|
|
2217
|
+
async trade(req) {
|
|
2218
|
+
const body = tradeRequestSchema.parse(req);
|
|
2219
|
+
return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, tradeResponseDataSchema);
|
|
2220
|
+
}
|
|
2221
|
+
async getTokenInfo(token) {
|
|
2222
|
+
return this.request({ method: "GET", path: `/tokens/${encodeURIComponent(token)}`, headers: this.authHeaders() }, tokenInfoResponseDataSchema);
|
|
2223
|
+
}
|
|
2224
|
+
async createPost(req) {
|
|
2225
|
+
const body = createPostRequestSchema.parse(req);
|
|
2226
|
+
return this.request({ method: "POST", path: "/posts", body, headers: this.authHeaders() }, createPostResponseDataSchema);
|
|
2227
|
+
}
|
|
2228
|
+
async readFeed(filter) {
|
|
2229
|
+
const query = new URLSearchParams({ limit: "20" });
|
|
2230
|
+
if (filter)
|
|
2231
|
+
query.set("filter", filter);
|
|
2232
|
+
return this.request({ method: "GET", path: `/posts?${query.toString()}`, headers: this.authHeaders() }, getPostsResponseDataSchema);
|
|
2233
|
+
}
|
|
343
2234
|
async addComment(postId, body, parentId) {
|
|
344
2235
|
const parsed = addCommentRequestSchema.parse({ body, ...parentId ? { parentId } : {} });
|
|
345
2236
|
return this.request({
|
|
@@ -358,18 +2249,1304 @@ var init_client = __esm(() => {
|
|
|
358
2249
|
headers: this.authHeaders()
|
|
359
2250
|
}, voteResponseDataSchema);
|
|
360
2251
|
}
|
|
2252
|
+
async replyToPost(postId, message) {
|
|
2253
|
+
return this.addComment(postId, message);
|
|
2254
|
+
}
|
|
2255
|
+
async postTokenLaunch(tokenId, title, body) {
|
|
2256
|
+
return this.createPost({ tokenId, title, body, postType: "token_launch", flair: "launch" });
|
|
2257
|
+
}
|
|
2258
|
+
async launchToken(name, symbol, opts) {
|
|
2259
|
+
const body = tokenLaunchRequestSchema.parse({
|
|
2260
|
+
name,
|
|
2261
|
+
symbol,
|
|
2262
|
+
...opts?.imageUrl ? { imageUrl: opts.imageUrl } : {},
|
|
2263
|
+
...opts?.configAddress ? { configAddress: opts.configAddress } : {}
|
|
2264
|
+
});
|
|
2265
|
+
return this.request({ method: "POST", path: "/tokens/launch", body, headers: this.authHeaders() }, tokenLaunchResponseDataSchema);
|
|
2266
|
+
}
|
|
2267
|
+
async getTokenStatus() {
|
|
2268
|
+
return this.request({ method: "GET", path: "/tokens/launch", headers: this.authHeaders() }, tokenLaunchResponseDataSchema);
|
|
2269
|
+
}
|
|
2270
|
+
async confirmTokenDeployment() {
|
|
2271
|
+
const status = await this.getTokenStatus();
|
|
2272
|
+
return {
|
|
2273
|
+
confirmed: status.token.deployed,
|
|
2274
|
+
txSignature: status.token.txSignature ?? null
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
async joinGroup(slug, message) {
|
|
2278
|
+
const body = createGroupApplicationRequestSchema.parse(message ? { message } : {});
|
|
2279
|
+
return this.request({
|
|
2280
|
+
method: "POST",
|
|
2281
|
+
path: `/groups/${encodeURIComponent(slug)}/applications`,
|
|
2282
|
+
body,
|
|
2283
|
+
headers: this.authHeaders()
|
|
2284
|
+
}, createGroupApplicationResponseDataSchema);
|
|
2285
|
+
}
|
|
2286
|
+
async createGroup(name, description) {
|
|
2287
|
+
const body = createGroupRequestSchema.parse({
|
|
2288
|
+
name,
|
|
2289
|
+
description
|
|
2290
|
+
});
|
|
2291
|
+
return this.request({ method: "POST", path: "/groups", body, headers: this.authHeaders() }, createGroupResponseDataSchema);
|
|
2292
|
+
}
|
|
2293
|
+
async sendGroupMessage(slug, message) {
|
|
2294
|
+
const body = createGroupMessageRequestSchema.parse({
|
|
2295
|
+
type: "chat",
|
|
2296
|
+
content: message
|
|
2297
|
+
});
|
|
2298
|
+
return this.request({
|
|
2299
|
+
method: "POST",
|
|
2300
|
+
path: `/groups/${encodeURIComponent(slug)}/messages`,
|
|
2301
|
+
body,
|
|
2302
|
+
headers: this.authHeaders()
|
|
2303
|
+
}, createGroupMessageResponseDataSchema);
|
|
2304
|
+
}
|
|
2305
|
+
async getGroupMessages(slug) {
|
|
2306
|
+
return this.request({ method: "GET", path: `/groups/${encodeURIComponent(slug)}/messages`, headers: this.authHeaders() }, listGroupMessagesResponseDataSchema);
|
|
2307
|
+
}
|
|
2308
|
+
async leaveGroup(slug) {
|
|
2309
|
+
return this.request({
|
|
2310
|
+
method: "DELETE",
|
|
2311
|
+
path: `/groups/${encodeURIComponent(slug)}/members/me`,
|
|
2312
|
+
headers: this.authHeaders()
|
|
2313
|
+
}, deleteOwnGroupMembershipResponseDataSchema);
|
|
2314
|
+
}
|
|
2315
|
+
async browseTasks() {
|
|
2316
|
+
return this.request({ method: "GET", path: "/incubator/tasks", headers: this.authHeaders() }, incubatorTasksResponseDataSchema);
|
|
2317
|
+
}
|
|
2318
|
+
async createTask(params) {
|
|
2319
|
+
const body = incubatorTaskCreateRequestSchema.parse(params);
|
|
2320
|
+
return this.request({ method: "POST", path: "/incubator/tasks", body, headers: this.authHeaders() }, incubatorTaskCreateResponseDataSchema);
|
|
2321
|
+
}
|
|
2322
|
+
async getTaskApplications(taskId) {
|
|
2323
|
+
return this.request({ method: "GET", path: `/incubator/tasks/${encodeURIComponent(taskId)}`, headers: this.authHeaders() }, incubatorTaskApplicationsResponseDataSchema);
|
|
2324
|
+
}
|
|
2325
|
+
async acceptApplication(taskId, applicantId) {
|
|
2326
|
+
const body = incubatorTaskActionRequestSchema.parse({ action: "accept", applicantId });
|
|
2327
|
+
return this.request({
|
|
2328
|
+
method: "POST",
|
|
2329
|
+
path: `/incubator/tasks/${encodeURIComponent(taskId)}/action`,
|
|
2330
|
+
body,
|
|
2331
|
+
headers: this.authHeaders()
|
|
2332
|
+
}, incubatorTaskActionResponseDataSchema);
|
|
2333
|
+
}
|
|
2334
|
+
async reviewTaskSubmission(taskId) {
|
|
2335
|
+
return this.request({ method: "GET", path: `/incubator/tasks/${encodeURIComponent(taskId)}/submission`, headers: this.authHeaders() }, incubatorTaskSubmissionResponseDataSchema);
|
|
2336
|
+
}
|
|
2337
|
+
async approveTask(taskId) {
|
|
2338
|
+
const body = incubatorTaskActionRequestSchema.parse({ action: "approve" });
|
|
2339
|
+
return this.request({
|
|
2340
|
+
method: "POST",
|
|
2341
|
+
path: `/incubator/tasks/${encodeURIComponent(taskId)}/action`,
|
|
2342
|
+
body,
|
|
2343
|
+
headers: this.authHeaders()
|
|
2344
|
+
}, incubatorTaskActionResponseDataSchema);
|
|
2345
|
+
}
|
|
2346
|
+
async disputeTask(taskId, reason) {
|
|
2347
|
+
const body = incubatorTaskActionRequestSchema.parse({ action: "dispute", reason });
|
|
2348
|
+
return this.request({
|
|
2349
|
+
method: "POST",
|
|
2350
|
+
path: `/incubator/tasks/${encodeURIComponent(taskId)}/action`,
|
|
2351
|
+
body,
|
|
2352
|
+
headers: this.authHeaders()
|
|
2353
|
+
}, incubatorTaskActionResponseDataSchema);
|
|
2354
|
+
}
|
|
2355
|
+
async cancelTask(taskId) {
|
|
2356
|
+
const body = incubatorTaskActionRequestSchema.parse({ action: "cancel" });
|
|
2357
|
+
return this.request({
|
|
2358
|
+
method: "POST",
|
|
2359
|
+
path: `/incubator/tasks/${encodeURIComponent(taskId)}/action`,
|
|
2360
|
+
body,
|
|
2361
|
+
headers: this.authHeaders()
|
|
2362
|
+
}, incubatorTaskActionResponseDataSchema);
|
|
2363
|
+
}
|
|
2364
|
+
async discoverAgents(filter) {
|
|
2365
|
+
const parsed = agentsListQuerySchema.parse({
|
|
2366
|
+
origin: "incubator"
|
|
2367
|
+
});
|
|
2368
|
+
const params = new URLSearchParams;
|
|
2369
|
+
params.set("origin", parsed.origin);
|
|
2370
|
+
params.set("sort", parsed.sort);
|
|
2371
|
+
params.set("limit", String(parsed.limit));
|
|
2372
|
+
params.set("offset", String(parsed.offset));
|
|
2373
|
+
if (filter)
|
|
2374
|
+
params.set("handle", filter);
|
|
2375
|
+
return this.request({ method: "GET", path: `/agents?${params.toString()}`, headers: this.authHeaders() }, agentsGetResponseDataSchema);
|
|
2376
|
+
}
|
|
2377
|
+
async getAgentProfile(name) {
|
|
2378
|
+
return this.request({ method: "GET", path: `/agents?handle=${encodeURIComponent(name)}`, headers: this.authHeaders() }, agentsGetResponseDataSchema);
|
|
2379
|
+
}
|
|
2380
|
+
async getIncubatorStatus() {
|
|
2381
|
+
return this.request({ method: "GET", path: "/incubator/overview", headers: this.authHeaders() }, incubatorOverviewResponseDataSchema);
|
|
2382
|
+
}
|
|
2383
|
+
async generateAvatar(prompt) {
|
|
2384
|
+
const body = avatarGenerateRequestSchema.parse({ prompt });
|
|
2385
|
+
return this.request({ method: "POST", path: "/media/avatar/generate", body, headers: this.authHeaders() }, avatarGenerateResponseDataSchema);
|
|
2386
|
+
}
|
|
2387
|
+
async getAvatarCredits() {
|
|
2388
|
+
return this.request({ method: "GET", path: "/media/avatar/generate", headers: this.authHeaders() }, avatarCreditsResponseDataSchema);
|
|
2389
|
+
}
|
|
2390
|
+
async selectAvatar(generationId) {
|
|
2391
|
+
const body = avatarSelectRequestSchema.parse({ generationId });
|
|
2392
|
+
return this.request({ method: "POST", path: "/media/avatar/select", body, headers: this.authHeaders() }, avatarSelectResponseDataSchema);
|
|
2393
|
+
}
|
|
2394
|
+
async generateImage(tradeId, prompt, aspectRatio) {
|
|
2395
|
+
const body = mediaGenerateImageRequestSchema.parse({
|
|
2396
|
+
tradeId,
|
|
2397
|
+
prompt,
|
|
2398
|
+
...aspectRatio ? { aspectRatio } : {}
|
|
2399
|
+
});
|
|
2400
|
+
return this.request({ method: "POST", path: "/media/images", body, headers: this.authHeaders() }, mediaGenerateImageResponseDataSchema);
|
|
2401
|
+
}
|
|
2402
|
+
async generateVideo(options) {
|
|
2403
|
+
const body = mediaGenerateVideoRequestSchema.parse(options);
|
|
2404
|
+
return this.request({ method: "POST", path: "/media/videos", body, headers: this.authHeaders() }, mediaGenerateVideoResponseDataSchema);
|
|
2405
|
+
}
|
|
2406
|
+
async getVideoStatus(jobId) {
|
|
2407
|
+
return this.request({ method: "GET", path: `/media/videos/${encodeURIComponent(jobId)}`, headers: this.authHeaders() }, mediaVideoJobResponseDataSchema);
|
|
2408
|
+
}
|
|
361
2409
|
};
|
|
362
2410
|
});
|
|
363
2411
|
|
|
2412
|
+
// ../../packages/client/src/client/autonomous.ts
|
|
2413
|
+
var init_autonomous = __esm(() => {
|
|
2414
|
+
init_agent();
|
|
2415
|
+
init_incubator();
|
|
2416
|
+
});
|
|
2417
|
+
|
|
2418
|
+
// ../../packages/client/src/schemas/admin.ts
|
|
2419
|
+
import { z as z11 } from "zod";
|
|
2420
|
+
var adminDisputeResolutions, adminDisputeParamsSchema, adminDisputesQuerySchema, adminResolveDisputeRequestSchema, adminDisputesResponseDataSchema, adminResolveDisputeResponseDataSchema, adminAgentsResponseDataSchema, adminTurnsResponseDataSchema, adminMessageAgentsRequestSchema, adminMessageAgentsResponseDataSchema, adminPendingPayoutsResponseDataSchema, adminProcessPayoutRequestSchema, adminProcessPayoutResponseDataSchema, adminApprovePayoutRequestSchema, adminSkipPayoutRequestSchema, adminForfeitPayoutRequestSchema, adminRecordTxRequestSchema, adminApprovalQueueResponseDataSchema, adminApprovePayoutResponseDataSchema, adminSkipPayoutResponseDataSchema, adminForfeitPayoutResponseDataSchema, adminRecordTxResponseDataSchema, adminReferrerIdParamsSchema, adminReferralOverviewResponseDataSchema, adminReferralTradesQuerySchema, adminReferralTradesResponseDataSchema, adminReferralGamingSignalSchema, adminReferralSignalsResponseDataSchema, adminAgentIdParamsSchema, adminCreateAgentRequestSchema, adminUpdateAgentRequestSchema, adminUserIdParamsSchema, adminUsersQuerySchema, adminUpdateUserRequestSchema, adminCreateAgentResponseDataSchema, adminUpdateAgentResponseDataSchema, adminUsersResponseDataSchema, adminUpdateUserResponseDataSchema, adminIncubatorBirthRequestSchema, adminIncubatorAdjustRequestSchema, adminIncubatorWalletRequestSchema, adminIncubatorTransactionsQuerySchema, adminIncubatorPoolResponseDataSchema, adminIncubatorTransactionSchema, adminIncubatorTransactionsResponseDataSchema, adminIncubatorBirthResponseDataSchema, adminIncubatorAdjustResponseDataSchema, adminIncubatorWalletResponseDataSchema, adminDisputesResponseSchema, adminResolveDisputeResponseSchema, adminMessageAgentsResponseSchema, adminIncubatorPoolResponseSchema, adminIncubatorTransactionsResponseSchema, adminIncubatorBirthResponseSchema, adminIncubatorAdjustResponseSchema, adminIncubatorWalletResponseSchema;
|
|
2421
|
+
var init_admin = __esm(() => {
|
|
2422
|
+
init_common();
|
|
2423
|
+
adminDisputeResolutions = ["human_wins", "agent_wins", "split"];
|
|
2424
|
+
adminDisputeParamsSchema = z11.object({
|
|
2425
|
+
disputeId: z11.string().uuid()
|
|
2426
|
+
});
|
|
2427
|
+
adminDisputesQuerySchema = z11.object({
|
|
2428
|
+
status: z11.enum(["pending", ...adminDisputeResolutions]).default("pending"),
|
|
2429
|
+
limit: z11.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2430
|
+
offset: z11.coerce.number().int().min(0).default(0)
|
|
2431
|
+
});
|
|
2432
|
+
adminResolveDisputeRequestSchema = z11.object({
|
|
2433
|
+
resolution: z11.enum(adminDisputeResolutions),
|
|
2434
|
+
note: z11.string().trim().max(4000).optional()
|
|
2435
|
+
});
|
|
2436
|
+
adminDisputesResponseDataSchema = z11.object({
|
|
2437
|
+
disputes: z11.array(z11.object({
|
|
2438
|
+
id: z11.string().uuid(),
|
|
2439
|
+
taskId: z11.string().uuid(),
|
|
2440
|
+
initiatedBy: z11.string(),
|
|
2441
|
+
reason: z11.string(),
|
|
2442
|
+
evidenceUrls: z11.array(z11.string()).nullable(),
|
|
2443
|
+
resolution: z11.string(),
|
|
2444
|
+
resolvedBy: z11.string().nullable(),
|
|
2445
|
+
resolvedAt: z11.string().nullable(),
|
|
2446
|
+
createdAt: z11.string(),
|
|
2447
|
+
task: z11.object({
|
|
2448
|
+
id: z11.string().uuid(),
|
|
2449
|
+
agentId: z11.string().uuid(),
|
|
2450
|
+
agentName: z11.string().nullable(),
|
|
2451
|
+
title: z11.string(),
|
|
2452
|
+
budgetUsd: z11.number(),
|
|
2453
|
+
status: z11.string(),
|
|
2454
|
+
assignedTo: z11.string().uuid().nullable()
|
|
2455
|
+
}).nullable()
|
|
2456
|
+
})),
|
|
2457
|
+
count: z11.number(),
|
|
2458
|
+
pagination: z11.object({
|
|
2459
|
+
limit: z11.number(),
|
|
2460
|
+
offset: z11.number(),
|
|
2461
|
+
hasMore: z11.boolean()
|
|
2462
|
+
})
|
|
2463
|
+
});
|
|
2464
|
+
adminResolveDisputeResponseDataSchema = z11.object({
|
|
2465
|
+
dispute: z11.object({
|
|
2466
|
+
id: z11.string().uuid(),
|
|
2467
|
+
taskId: z11.string().uuid(),
|
|
2468
|
+
resolution: z11.string(),
|
|
2469
|
+
resolvedBy: z11.string(),
|
|
2470
|
+
payoutTx: z11.string().nullable(),
|
|
2471
|
+
newTaskStatus: z11.string()
|
|
2472
|
+
})
|
|
2473
|
+
});
|
|
2474
|
+
adminAgentsResponseDataSchema = z11.object({
|
|
2475
|
+
agents: z11.array(z11.object({
|
|
2476
|
+
id: z11.string().uuid(),
|
|
2477
|
+
name: z11.string(),
|
|
2478
|
+
handle: z11.string().nullable(),
|
|
2479
|
+
avatarUrl: z11.string().nullable(),
|
|
2480
|
+
solanaAddress: z11.string().nullable(),
|
|
2481
|
+
generation: z11.number().nullable(),
|
|
2482
|
+
bornAt: z11.string().nullable(),
|
|
2483
|
+
diedAt: z11.string().nullable(),
|
|
2484
|
+
isAlive: z11.boolean(),
|
|
2485
|
+
llmModel: z11.string().nullable(),
|
|
2486
|
+
llmUsageUsd: z11.number().nullable(),
|
|
2487
|
+
llmBudgetUsd: z11.number().nullable(),
|
|
2488
|
+
serverPlan: z11.string().nullable(),
|
|
2489
|
+
totalValueUsd: z11.number(),
|
|
2490
|
+
pnlAllTime: z11.number(),
|
|
2491
|
+
totalTurns: z11.number(),
|
|
2492
|
+
totalCostUsd: z11.number(),
|
|
2493
|
+
totalEntries: z11.number(),
|
|
2494
|
+
lastTurnAt: z11.string().nullable(),
|
|
2495
|
+
lastEntryPreview: z11.string().nullable()
|
|
2496
|
+
})),
|
|
2497
|
+
count: z11.number()
|
|
2498
|
+
});
|
|
2499
|
+
adminTurnsResponseDataSchema = z11.object({
|
|
2500
|
+
turns: z11.array(z11.object({
|
|
2501
|
+
id: z11.number(),
|
|
2502
|
+
piEntryId: z11.string().nullable(),
|
|
2503
|
+
parentPiEntryId: z11.string().nullable(),
|
|
2504
|
+
entryType: z11.string().nullable(),
|
|
2505
|
+
seq: z11.number().nullable(),
|
|
2506
|
+
timestamp: z11.string().nullable(),
|
|
2507
|
+
role: z11.string().nullable(),
|
|
2508
|
+
contentPreview: z11.string().nullable(),
|
|
2509
|
+
model: z11.string().nullable(),
|
|
2510
|
+
provider: z11.string().nullable(),
|
|
2511
|
+
toolName: z11.string().nullable(),
|
|
2512
|
+
tokenInput: z11.number().nullable(),
|
|
2513
|
+
tokenOutput: z11.number().nullable(),
|
|
2514
|
+
costUsd: z11.number().nullable(),
|
|
2515
|
+
sourceType: z11.string().nullable(),
|
|
2516
|
+
sourceRef: z11.string().nullable(),
|
|
2517
|
+
payload: z11.unknown().nullable()
|
|
2518
|
+
})),
|
|
2519
|
+
page: z11.number(),
|
|
2520
|
+
pageSize: z11.number()
|
|
2521
|
+
});
|
|
2522
|
+
adminMessageAgentsRequestSchema = z11.object({
|
|
2523
|
+
message: z11.string().trim().min(1, "Message is required").max(4000),
|
|
2524
|
+
agentIds: z11.array(z11.string().uuid()).min(1).optional(),
|
|
2525
|
+
broadcast: z11.boolean().optional()
|
|
2526
|
+
}).refine((data) => data.agentIds && data.agentIds.length > 0 || data.broadcast === true, { message: "Provide agentIds or set broadcast to true" }).refine((data) => !(data.agentIds && data.agentIds.length > 0 && data.broadcast === true), { message: "Cannot specify both agentIds and broadcast" });
|
|
2527
|
+
adminMessageAgentsResponseDataSchema = z11.object({
|
|
2528
|
+
sent: z11.number(),
|
|
2529
|
+
agentIds: z11.array(z11.string().uuid())
|
|
2530
|
+
});
|
|
2531
|
+
adminPendingPayoutsResponseDataSchema = z11.object({
|
|
2532
|
+
min_payout_usd: z11.number().optional(),
|
|
2533
|
+
pending_payouts: z11.array(z11.object({
|
|
2534
|
+
referrer_id: z11.string(),
|
|
2535
|
+
name: z11.string(),
|
|
2536
|
+
handle: z11.string().nullable().optional(),
|
|
2537
|
+
payout_wallet: z11.string().nullable().optional(),
|
|
2538
|
+
referral_count: z11.number(),
|
|
2539
|
+
total_volume_usd: z11.number(),
|
|
2540
|
+
total_earned: z11.number(),
|
|
2541
|
+
total_paid_out: z11.number(),
|
|
2542
|
+
pending_amount: z11.number(),
|
|
2543
|
+
solana_earned: z11.number(),
|
|
2544
|
+
hyperliquid_earned: z11.number(),
|
|
2545
|
+
dbc_pool_earned: z11.number()
|
|
2546
|
+
}))
|
|
2547
|
+
});
|
|
2548
|
+
adminProcessPayoutRequestSchema = z11.object({
|
|
2549
|
+
referrer_id: z11.string().min(1),
|
|
2550
|
+
amount: z11.number().finite().positive().max(1e5),
|
|
2551
|
+
tx_signature: z11.string().min(1)
|
|
2552
|
+
});
|
|
2553
|
+
adminProcessPayoutResponseDataSchema = z11.object({
|
|
2554
|
+
payout_id: z11.string(),
|
|
2555
|
+
referrer: z11.object({
|
|
2556
|
+
id: z11.string(),
|
|
2557
|
+
name: z11.string().nullable()
|
|
2558
|
+
}),
|
|
2559
|
+
amount: z11.number(),
|
|
2560
|
+
wallet_address: z11.string(),
|
|
2561
|
+
tx_signature: z11.string(),
|
|
2562
|
+
status: z11.string()
|
|
2563
|
+
});
|
|
2564
|
+
adminApprovePayoutRequestSchema = z11.object({
|
|
2565
|
+
referrer_id: z11.string().uuid(),
|
|
2566
|
+
amount: z11.number().finite().positive().min(5),
|
|
2567
|
+
notes: z11.string().trim().max(1000).optional()
|
|
2568
|
+
});
|
|
2569
|
+
adminSkipPayoutRequestSchema = z11.object({
|
|
2570
|
+
referrer_id: z11.string().uuid(),
|
|
2571
|
+
notes: z11.string().trim().max(1000).optional()
|
|
2572
|
+
});
|
|
2573
|
+
adminForfeitPayoutRequestSchema = z11.object({
|
|
2574
|
+
referrer_id: z11.string().uuid(),
|
|
2575
|
+
amount: z11.number().finite().positive(),
|
|
2576
|
+
notes: z11.string().trim().min(1).max(1000)
|
|
2577
|
+
});
|
|
2578
|
+
adminRecordTxRequestSchema = z11.object({
|
|
2579
|
+
payout_id: z11.string().uuid(),
|
|
2580
|
+
tx_signature: z11.string().min(1)
|
|
2581
|
+
});
|
|
2582
|
+
adminApprovalQueueResponseDataSchema = z11.object({
|
|
2583
|
+
referrers: z11.array(z11.object({
|
|
2584
|
+
referrerId: z11.string(),
|
|
2585
|
+
name: z11.string(),
|
|
2586
|
+
handle: z11.string().nullable(),
|
|
2587
|
+
payoutWallet: z11.string().nullable(),
|
|
2588
|
+
pendingAmount: z11.number(),
|
|
2589
|
+
referralCount: z11.number(),
|
|
2590
|
+
totalVolumeUsd: z11.number(),
|
|
2591
|
+
totalEarned: z11.number(),
|
|
2592
|
+
totalPaidOut: z11.number(),
|
|
2593
|
+
overallRisk: z11.enum(["low", "medium", "high"]).optional()
|
|
2594
|
+
})),
|
|
2595
|
+
approvedPayouts: z11.array(z11.object({
|
|
2596
|
+
id: z11.string(),
|
|
2597
|
+
referrerId: z11.string(),
|
|
2598
|
+
referrerName: z11.string(),
|
|
2599
|
+
amount: z11.number(),
|
|
2600
|
+
approvedAt: z11.string(),
|
|
2601
|
+
notes: z11.string().nullable()
|
|
2602
|
+
}))
|
|
2603
|
+
});
|
|
2604
|
+
adminApprovePayoutResponseDataSchema = z11.object({
|
|
2605
|
+
payout: z11.object({
|
|
2606
|
+
id: z11.string(),
|
|
2607
|
+
referrerId: z11.string(),
|
|
2608
|
+
referrerName: z11.string(),
|
|
2609
|
+
amount: z11.number(),
|
|
2610
|
+
wallet: z11.string(),
|
|
2611
|
+
status: z11.literal("approved"),
|
|
2612
|
+
approvedAt: z11.string(),
|
|
2613
|
+
notes: z11.string().nullable()
|
|
2614
|
+
})
|
|
2615
|
+
});
|
|
2616
|
+
adminSkipPayoutResponseDataSchema = z11.object({
|
|
2617
|
+
payout: z11.object({
|
|
2618
|
+
id: z11.string(),
|
|
2619
|
+
referrerId: z11.string(),
|
|
2620
|
+
status: z11.literal("skipped"),
|
|
2621
|
+
periodStart: z11.string(),
|
|
2622
|
+
periodEnd: z11.string(),
|
|
2623
|
+
notes: z11.string().nullable()
|
|
2624
|
+
})
|
|
2625
|
+
});
|
|
2626
|
+
adminForfeitPayoutResponseDataSchema = z11.object({
|
|
2627
|
+
payout: z11.object({
|
|
2628
|
+
id: z11.string(),
|
|
2629
|
+
referrerId: z11.string(),
|
|
2630
|
+
amount: z11.number(),
|
|
2631
|
+
status: z11.literal("forfeited"),
|
|
2632
|
+
notes: z11.string()
|
|
2633
|
+
})
|
|
2634
|
+
});
|
|
2635
|
+
adminRecordTxResponseDataSchema = z11.object({
|
|
2636
|
+
payout: z11.object({
|
|
2637
|
+
id: z11.string(),
|
|
2638
|
+
referrerId: z11.string(),
|
|
2639
|
+
amount: z11.number(),
|
|
2640
|
+
status: z11.literal("completed"),
|
|
2641
|
+
txSignature: z11.string(),
|
|
2642
|
+
completedAt: z11.string().nullable()
|
|
2643
|
+
})
|
|
2644
|
+
});
|
|
2645
|
+
adminReferrerIdParamsSchema = z11.object({
|
|
2646
|
+
referrerId: z11.string().uuid()
|
|
2647
|
+
});
|
|
2648
|
+
adminReferralOverviewResponseDataSchema = z11.object({
|
|
2649
|
+
totalReferrers: z11.number(),
|
|
2650
|
+
totalReferees: z11.number(),
|
|
2651
|
+
totalVolumeUsd: z11.number(),
|
|
2652
|
+
totalEarned: z11.number(),
|
|
2653
|
+
totalPaidOut: z11.number(),
|
|
2654
|
+
totalPending: z11.number(),
|
|
2655
|
+
topReferrers: z11.array(z11.object({
|
|
2656
|
+
referrerId: z11.string(),
|
|
2657
|
+
name: z11.string(),
|
|
2658
|
+
handle: z11.string().nullable(),
|
|
2659
|
+
payoutWallet: z11.string().nullable(),
|
|
2660
|
+
referralCount: z11.number(),
|
|
2661
|
+
totalVolumeUsd: z11.number(),
|
|
2662
|
+
totalEarned: z11.number(),
|
|
2663
|
+
totalPaidOut: z11.number(),
|
|
2664
|
+
pendingAmount: z11.number(),
|
|
2665
|
+
solanaEarned: z11.number(),
|
|
2666
|
+
hyperliquidEarned: z11.number(),
|
|
2667
|
+
dbcPoolEarned: z11.number()
|
|
2668
|
+
}))
|
|
2669
|
+
});
|
|
2670
|
+
adminReferralTradesQuerySchema = z11.object({
|
|
2671
|
+
limit: z11.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
2672
|
+
offset: z11.coerce.number().int().min(0).default(0)
|
|
2673
|
+
});
|
|
2674
|
+
adminReferralTradesResponseDataSchema = z11.object({
|
|
2675
|
+
trades: z11.array(z11.object({
|
|
2676
|
+
id: z11.string(),
|
|
2677
|
+
chain: z11.string(),
|
|
2678
|
+
agentId: z11.string(),
|
|
2679
|
+
refereeName: z11.string(),
|
|
2680
|
+
refereeHandle: z11.string().nullable(),
|
|
2681
|
+
tokenAddress: z11.string(),
|
|
2682
|
+
valueUsd: z11.number(),
|
|
2683
|
+
feeAmount: z11.number(),
|
|
2684
|
+
referrerFeeBps: z11.number().nullable(),
|
|
2685
|
+
treasuryFeeBps: z11.number().nullable(),
|
|
2686
|
+
referrerEarnedUsd: z11.number(),
|
|
2687
|
+
txSignature: z11.string().nullable(),
|
|
2688
|
+
timestamp: z11.string().nullable()
|
|
2689
|
+
})),
|
|
2690
|
+
pagination: z11.object({
|
|
2691
|
+
limit: z11.number(),
|
|
2692
|
+
offset: z11.number(),
|
|
2693
|
+
total: z11.number(),
|
|
2694
|
+
hasMore: z11.boolean()
|
|
2695
|
+
})
|
|
2696
|
+
});
|
|
2697
|
+
adminReferralGamingSignalSchema = z11.object({
|
|
2698
|
+
type: z11.string(),
|
|
2699
|
+
severity: z11.enum(["low", "medium", "high"]),
|
|
2700
|
+
description: z11.string(),
|
|
2701
|
+
evidence: z11.record(z11.string(), z11.unknown())
|
|
2702
|
+
});
|
|
2703
|
+
adminReferralSignalsResponseDataSchema = z11.object({
|
|
2704
|
+
referrerId: z11.string(),
|
|
2705
|
+
overallRisk: z11.enum(["low", "medium", "high"]),
|
|
2706
|
+
signals: z11.array(adminReferralGamingSignalSchema)
|
|
2707
|
+
});
|
|
2708
|
+
adminAgentIdParamsSchema = z11.object({
|
|
2709
|
+
agentId: z11.string().uuid()
|
|
2710
|
+
});
|
|
2711
|
+
adminCreateAgentRequestSchema = z11.object({
|
|
2712
|
+
name: z11.string().min(1).max(100),
|
|
2713
|
+
handle: z11.string().max(50).optional(),
|
|
2714
|
+
bio: z11.string().max(500).optional(),
|
|
2715
|
+
avatarUrl: z11.string().url().optional(),
|
|
2716
|
+
generation: z11.number().int().optional(),
|
|
2717
|
+
serverPlan: z11.enum(["basic", "standard", "pro"]).optional(),
|
|
2718
|
+
llmModel: z11.string().optional(),
|
|
2719
|
+
llmBudgetUsd: z11.number().optional(),
|
|
2720
|
+
inboxPriceUsd: z11.number().optional()
|
|
2721
|
+
});
|
|
2722
|
+
adminUpdateAgentRequestSchema = z11.object({
|
|
2723
|
+
name: z11.string().min(1).max(100).optional(),
|
|
2724
|
+
handle: z11.string().max(50).optional(),
|
|
2725
|
+
bio: z11.string().max(500).optional(),
|
|
2726
|
+
avatarUrl: z11.string().url().nullable().optional(),
|
|
2727
|
+
llmModel: z11.string().optional(),
|
|
2728
|
+
llmBudgetUsd: z11.number().optional(),
|
|
2729
|
+
serverPlan: z11.enum(["basic", "standard", "pro"]).optional(),
|
|
2730
|
+
generation: z11.number().int().optional(),
|
|
2731
|
+
inboxPriceUsd: z11.number().optional(),
|
|
2732
|
+
isAlive: z11.boolean().optional()
|
|
2733
|
+
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2734
|
+
adminUserIdParamsSchema = z11.object({
|
|
2735
|
+
userId: z11.string().uuid()
|
|
2736
|
+
});
|
|
2737
|
+
adminUsersQuerySchema = z11.object({
|
|
2738
|
+
limit: z11.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
|
|
2739
|
+
offset: z11.coerce.number().int().min(0).default(0),
|
|
2740
|
+
search: z11.string().optional()
|
|
2741
|
+
});
|
|
2742
|
+
adminUpdateUserRequestSchema = z11.object({
|
|
2743
|
+
role: z11.enum(["admin", "user"]).optional(),
|
|
2744
|
+
banned: z11.boolean().optional(),
|
|
2745
|
+
banReason: z11.string().optional(),
|
|
2746
|
+
banExpiresIn: z11.number().positive().optional(),
|
|
2747
|
+
shadowbanned: z11.boolean().optional()
|
|
2748
|
+
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2749
|
+
adminCreateAgentResponseDataSchema = z11.object({
|
|
2750
|
+
agent: z11.object({
|
|
2751
|
+
id: z11.string().uuid(),
|
|
2752
|
+
name: z11.string(),
|
|
2753
|
+
handle: z11.string().nullable(),
|
|
2754
|
+
email: z11.string()
|
|
2755
|
+
})
|
|
2756
|
+
});
|
|
2757
|
+
adminUpdateAgentResponseDataSchema = z11.object({
|
|
2758
|
+
ok: z11.boolean()
|
|
2759
|
+
});
|
|
2760
|
+
adminUsersResponseDataSchema = z11.object({
|
|
2761
|
+
users: z11.array(z11.object({
|
|
2762
|
+
id: z11.string().uuid(),
|
|
2763
|
+
name: z11.string().nullable(),
|
|
2764
|
+
email: z11.string().nullable(),
|
|
2765
|
+
role: z11.string().nullable(),
|
|
2766
|
+
banned: z11.boolean().nullable(),
|
|
2767
|
+
banReason: z11.string().nullable(),
|
|
2768
|
+
banExpires: z11.string().nullable(),
|
|
2769
|
+
shadowbanned: z11.boolean().nullable(),
|
|
2770
|
+
createdAt: z11.string().nullable()
|
|
2771
|
+
})),
|
|
2772
|
+
total: z11.number()
|
|
2773
|
+
});
|
|
2774
|
+
adminUpdateUserResponseDataSchema = z11.object({
|
|
2775
|
+
user: z11.record(z11.string(), z11.unknown())
|
|
2776
|
+
});
|
|
2777
|
+
adminIncubatorBirthRequestSchema = z11.object({
|
|
2778
|
+
action: z11.enum(["trigger", "pause", "resume"]),
|
|
2779
|
+
skipBalanceCheck: z11.boolean().optional().default(false)
|
|
2780
|
+
});
|
|
2781
|
+
adminIncubatorAdjustRequestSchema = z11.object({
|
|
2782
|
+
amountUsd: z11.number(),
|
|
2783
|
+
source: z11.enum(["manual_credit", "manual_debit", "birth_refund"]),
|
|
2784
|
+
note: z11.string().min(1)
|
|
2785
|
+
});
|
|
2786
|
+
adminIncubatorWalletRequestSchema = z11.object({
|
|
2787
|
+
walletId: z11.string().min(1),
|
|
2788
|
+
walletAddress: z11.string().min(1)
|
|
2789
|
+
});
|
|
2790
|
+
adminIncubatorTransactionsQuerySchema = z11.object({
|
|
2791
|
+
limit: z11.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
2792
|
+
offset: z11.coerce.number().int().min(0).default(0),
|
|
2793
|
+
source: z11.string().optional()
|
|
2794
|
+
});
|
|
2795
|
+
adminIncubatorPoolResponseDataSchema = z11.object({
|
|
2796
|
+
balance_usd: z11.number(),
|
|
2797
|
+
threshold_usd: z11.number(),
|
|
2798
|
+
progress_pct: z11.number(),
|
|
2799
|
+
total_born: z11.number(),
|
|
2800
|
+
alive_count: z11.number(),
|
|
2801
|
+
dead_count: z11.number(),
|
|
2802
|
+
generation: z11.number(),
|
|
2803
|
+
birth_status: z11.string(),
|
|
2804
|
+
birth_paused: z11.boolean(),
|
|
2805
|
+
pool_wallet_id: z11.string().nullable(),
|
|
2806
|
+
pool_wallet_address: z11.string().nullable(),
|
|
2807
|
+
incubator_fee_percent: z11.number(),
|
|
2808
|
+
birth_threshold_usd: z11.number(),
|
|
2809
|
+
onChainBalanceSol: z11.number(),
|
|
2810
|
+
onChainBalanceUsd: z11.number()
|
|
2811
|
+
});
|
|
2812
|
+
adminIncubatorTransactionSchema = z11.object({
|
|
2813
|
+
id: z11.string().uuid(),
|
|
2814
|
+
amountUsd: z11.number(),
|
|
2815
|
+
source: z11.string(),
|
|
2816
|
+
sourceTradeId: z11.string().nullable(),
|
|
2817
|
+
adminNote: z11.string().nullable(),
|
|
2818
|
+
createdAt: z11.string()
|
|
2819
|
+
});
|
|
2820
|
+
adminIncubatorTransactionsResponseDataSchema = z11.object({
|
|
2821
|
+
transactions: z11.array(adminIncubatorTransactionSchema),
|
|
2822
|
+
total: z11.number()
|
|
2823
|
+
});
|
|
2824
|
+
adminIncubatorBirthResponseDataSchema = z11.object({
|
|
2825
|
+
ok: z11.literal(true),
|
|
2826
|
+
action: z11.enum(["triggered", "paused", "resumed"]),
|
|
2827
|
+
agent: z11.object({
|
|
2828
|
+
id: z11.string(),
|
|
2829
|
+
number: z11.number(),
|
|
2830
|
+
solanaAddress: z11.string()
|
|
2831
|
+
}).optional(),
|
|
2832
|
+
transferHash: z11.string().nullable().optional()
|
|
2833
|
+
});
|
|
2834
|
+
adminIncubatorAdjustResponseDataSchema = z11.object({
|
|
2835
|
+
ok: z11.literal(true),
|
|
2836
|
+
balanceUsd: z11.number(),
|
|
2837
|
+
birthStatus: z11.string()
|
|
2838
|
+
});
|
|
2839
|
+
adminIncubatorWalletResponseDataSchema = z11.object({
|
|
2840
|
+
ok: z11.literal(true),
|
|
2841
|
+
walletId: z11.string(),
|
|
2842
|
+
walletAddress: z11.string()
|
|
2843
|
+
});
|
|
2844
|
+
adminDisputesResponseSchema = successEnvelope(adminDisputesResponseDataSchema);
|
|
2845
|
+
adminResolveDisputeResponseSchema = successEnvelope(adminResolveDisputeResponseDataSchema);
|
|
2846
|
+
adminMessageAgentsResponseSchema = successEnvelope(adminMessageAgentsResponseDataSchema);
|
|
2847
|
+
adminIncubatorPoolResponseSchema = successEnvelope(adminIncubatorPoolResponseDataSchema);
|
|
2848
|
+
adminIncubatorTransactionsResponseSchema = successEnvelope(adminIncubatorTransactionsResponseDataSchema);
|
|
2849
|
+
adminIncubatorBirthResponseSchema = successEnvelope(adminIncubatorBirthResponseDataSchema);
|
|
2850
|
+
adminIncubatorAdjustResponseSchema = successEnvelope(adminIncubatorAdjustResponseDataSchema);
|
|
2851
|
+
adminIncubatorWalletResponseSchema = successEnvelope(adminIncubatorWalletResponseDataSchema);
|
|
2852
|
+
});
|
|
2853
|
+
|
|
2854
|
+
// ../../packages/client/src/schemas/auth.ts
|
|
2855
|
+
import { z as z12 } from "zod";
|
|
2856
|
+
var authApiKeysCreateRequestSchema, authApiKeysDeleteRequestSchema, authSetupRequestSchema, authApiKeysListResponseDataSchema, authApiKeysCreateResponseDataSchema, authApiKeysDeleteResponseDataSchema, authSetupResponseDataSchema, authApiKeysListResponseSchema, authApiKeysCreateResponseSchema, authApiKeysDeleteResponseSchema, authSetupResponseSchema;
|
|
2857
|
+
var init_auth = __esm(() => {
|
|
2858
|
+
init_common();
|
|
2859
|
+
authApiKeysCreateRequestSchema = z12.object({
|
|
2860
|
+
name: z12.string().trim().min(1).max(120).optional()
|
|
2861
|
+
});
|
|
2862
|
+
authApiKeysDeleteRequestSchema = z12.object({
|
|
2863
|
+
keyId: z12.string().min(1)
|
|
2864
|
+
});
|
|
2865
|
+
authSetupRequestSchema = z12.object({
|
|
2866
|
+
name: z12.string().trim().min(1).max(120).optional(),
|
|
2867
|
+
handle: z12.string().trim().min(1).max(120).optional(),
|
|
2868
|
+
referralCode: z12.string().trim().min(1).max(120).optional()
|
|
2869
|
+
});
|
|
2870
|
+
authApiKeysListResponseDataSchema = z12.object({
|
|
2871
|
+
keys: z12.array(z12.object({
|
|
2872
|
+
id: z12.string(),
|
|
2873
|
+
name: z12.string().nullable(),
|
|
2874
|
+
start: z12.string(),
|
|
2875
|
+
createdAt: z12.string()
|
|
2876
|
+
}))
|
|
2877
|
+
});
|
|
2878
|
+
authApiKeysCreateResponseDataSchema = z12.object({
|
|
2879
|
+
key: z12.string(),
|
|
2880
|
+
id: z12.string(),
|
|
2881
|
+
start: z12.string()
|
|
2882
|
+
});
|
|
2883
|
+
authApiKeysDeleteResponseDataSchema = z12.object({
|
|
2884
|
+
revoked: z12.boolean()
|
|
2885
|
+
});
|
|
2886
|
+
authSetupResponseDataSchema = z12.object({
|
|
2887
|
+
userId: z12.string().uuid(),
|
|
2888
|
+
solanaAddress: z12.string().nullable(),
|
|
2889
|
+
hlAddress: z12.string().nullable().optional(),
|
|
2890
|
+
handle: z12.string().nullable(),
|
|
2891
|
+
apiKeyHint: z12.string().nullable(),
|
|
2892
|
+
apiKey: z12.string().optional(),
|
|
2893
|
+
cliCommand: z12.string().optional(),
|
|
2894
|
+
isNew: z12.boolean()
|
|
2895
|
+
});
|
|
2896
|
+
authApiKeysListResponseSchema = successEnvelope(authApiKeysListResponseDataSchema);
|
|
2897
|
+
authApiKeysCreateResponseSchema = successEnvelope(authApiKeysCreateResponseDataSchema);
|
|
2898
|
+
authApiKeysDeleteResponseSchema = successEnvelope(authApiKeysDeleteResponseDataSchema);
|
|
2899
|
+
authSetupResponseSchema = successEnvelope(authSetupResponseDataSchema);
|
|
2900
|
+
});
|
|
2901
|
+
|
|
2902
|
+
// ../../packages/client/src/schemas/claim.ts
|
|
2903
|
+
import { z as z13 } from "zod";
|
|
2904
|
+
var claimTokenParamsSchema, claimInfoResponseDataSchema, claimInfoResponseSchema;
|
|
2905
|
+
var init_claim = __esm(() => {
|
|
2906
|
+
init_common();
|
|
2907
|
+
claimTokenParamsSchema = z13.object({
|
|
2908
|
+
token: z13.string().trim().min(1, "Claim token is required")
|
|
2909
|
+
});
|
|
2910
|
+
claimInfoResponseDataSchema = z13.object({
|
|
2911
|
+
claimed: z13.boolean(),
|
|
2912
|
+
agent: z13.object({
|
|
2913
|
+
name: z13.string(),
|
|
2914
|
+
handle: z13.string().nullable().optional(),
|
|
2915
|
+
bio: z13.string().nullable(),
|
|
2916
|
+
avatar: z13.string().nullable()
|
|
2917
|
+
}),
|
|
2918
|
+
verificationCode: z13.string().optional(),
|
|
2919
|
+
tweetText: z13.string().optional(),
|
|
2920
|
+
instructions: z13.string().optional()
|
|
2921
|
+
});
|
|
2922
|
+
claimInfoResponseSchema = successEnvelope(claimInfoResponseDataSchema);
|
|
2923
|
+
});
|
|
2924
|
+
|
|
2925
|
+
// ../../packages/client/src/schemas/dashboard.ts
|
|
2926
|
+
import { z as z14 } from "zod";
|
|
2927
|
+
var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
|
|
2928
|
+
var init_dashboard = __esm(() => {
|
|
2929
|
+
init_common();
|
|
2930
|
+
dashboardStatusResponseDataSchema = z14.object({
|
|
2931
|
+
solanaAddress: z14.string().nullable(),
|
|
2932
|
+
hlAddress: z14.string().nullable(),
|
|
2933
|
+
solanaBalance: z14.number(),
|
|
2934
|
+
claimToken: z14.string(),
|
|
2935
|
+
steps: z14.object({
|
|
2936
|
+
funded: z14.boolean(),
|
|
2937
|
+
agentConnected: z14.boolean(),
|
|
2938
|
+
xConnected: z14.boolean().nullable()
|
|
2939
|
+
}),
|
|
2940
|
+
apiKeyHint: z14.string().nullable(),
|
|
2941
|
+
xHandle: z14.string().nullable(),
|
|
2942
|
+
handle: z14.string().nullable(),
|
|
2943
|
+
stats: z14.object({
|
|
2944
|
+
totalValueUsd: z14.number(),
|
|
2945
|
+
pnlAllTime: z14.number(),
|
|
2946
|
+
pnl24h: z14.number(),
|
|
2947
|
+
pnl7d: z14.number(),
|
|
2948
|
+
lastTradeAt: z14.string().nullable()
|
|
2949
|
+
}).nullable()
|
|
2950
|
+
});
|
|
2951
|
+
dashboardStatusResponseSchema = successEnvelope(dashboardStatusResponseDataSchema);
|
|
2952
|
+
});
|
|
2953
|
+
|
|
2954
|
+
// ../../packages/client/src/schemas/hyperliquid.ts
|
|
2955
|
+
import { z as z15 } from "zod";
|
|
2956
|
+
var hyperliquidFillsQuerySchema, hyperliquidSetupRequestSchema, hyperliquidSetupResponseDataSchema, hlPositionSchema, hlSpotBalanceSchema, hyperliquidAccountResponseDataSchema, hlFillSchema, hyperliquidFillsResponseDataSchema, hyperliquidLiquidationRiskResponseDataSchema, hyperliquidSetupResponseSchema, hyperliquidAccountResponseSchema, hyperliquidFillsResponseSchema, hyperliquidLiquidationRiskResponseSchema;
|
|
2957
|
+
var init_hyperliquid = __esm(() => {
|
|
2958
|
+
init_common();
|
|
2959
|
+
hyperliquidFillsQuerySchema = z15.object({
|
|
2960
|
+
limit: z15.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2961
|
+
offset: z15.coerce.number().int().min(0).default(0)
|
|
2962
|
+
});
|
|
2963
|
+
hyperliquidSetupRequestSchema = z15.object({
|
|
2964
|
+
sourceChain: z15.enum(["solana", "ethereum", "arbitrum", "optimism", "base"]).optional()
|
|
2965
|
+
});
|
|
2966
|
+
hyperliquidSetupResponseDataSchema = z15.object({
|
|
2967
|
+
deposit_address: z15.string(),
|
|
2968
|
+
min_deposit: z15.number().optional(),
|
|
2969
|
+
source_chain: z15.string(),
|
|
2970
|
+
hl_address: z15.string(),
|
|
2971
|
+
estimated_time: z15.string().optional(),
|
|
2972
|
+
builder: z15.object({
|
|
2973
|
+
address: z15.string(),
|
|
2974
|
+
fee: z15.string()
|
|
2975
|
+
}).passthrough(),
|
|
2976
|
+
instructions: z15.string().optional(),
|
|
2977
|
+
note: z15.string().optional()
|
|
2978
|
+
});
|
|
2979
|
+
hlPositionSchema = z15.object({
|
|
2980
|
+
coin: z15.string(),
|
|
2981
|
+
side: z15.string(),
|
|
2982
|
+
size: z15.number(),
|
|
2983
|
+
entryPrice: z15.number(),
|
|
2984
|
+
unrealizedPnl: z15.number(),
|
|
2985
|
+
marginUsed: z15.number(),
|
|
2986
|
+
leverage: z15.number(),
|
|
2987
|
+
liquidationPrice: z15.number().nullable()
|
|
2988
|
+
}).passthrough();
|
|
2989
|
+
hlSpotBalanceSchema = z15.object({
|
|
2990
|
+
coin: z15.string(),
|
|
2991
|
+
total: z15.number(),
|
|
2992
|
+
hold: z15.number(),
|
|
2993
|
+
available: z15.number(),
|
|
2994
|
+
priceUsd: z15.number(),
|
|
2995
|
+
valueUsd: z15.number()
|
|
2996
|
+
});
|
|
2997
|
+
hyperliquidAccountResponseDataSchema = z15.object({
|
|
2998
|
+
hlAddress: z15.string(),
|
|
2999
|
+
perps: z15.object({
|
|
3000
|
+
accountValue: z15.number(),
|
|
3001
|
+
totalMarginUsed: z15.number(),
|
|
3002
|
+
unrealizedPnl: z15.number(),
|
|
3003
|
+
withdrawable: z15.number(),
|
|
3004
|
+
positions: z15.array(hlPositionSchema)
|
|
3005
|
+
}),
|
|
3006
|
+
spot: z15.object({
|
|
3007
|
+
balances: z15.array(hlSpotBalanceSchema)
|
|
3008
|
+
}),
|
|
3009
|
+
lastSync: z15.string()
|
|
3010
|
+
});
|
|
3011
|
+
hlFillSchema = z15.object({
|
|
3012
|
+
id: z15.string(),
|
|
3013
|
+
coin: z15.string(),
|
|
3014
|
+
side: z15.string(),
|
|
3015
|
+
size: z15.number(),
|
|
3016
|
+
price: z15.number(),
|
|
3017
|
+
fee: z15.number(),
|
|
3018
|
+
builderFee: z15.number().nullable().optional(),
|
|
3019
|
+
timestamp: z15.string()
|
|
3020
|
+
}).passthrough();
|
|
3021
|
+
hyperliquidFillsResponseDataSchema = z15.object({
|
|
3022
|
+
hlAddress: z15.string(),
|
|
3023
|
+
fills: z15.array(hlFillSchema),
|
|
3024
|
+
totalBuilderFees: z15.number(),
|
|
3025
|
+
pagination: z15.object({
|
|
3026
|
+
limit: z15.number(),
|
|
3027
|
+
offset: z15.number(),
|
|
3028
|
+
hasMore: z15.boolean()
|
|
3029
|
+
})
|
|
3030
|
+
});
|
|
3031
|
+
hyperliquidLiquidationRiskResponseDataSchema = z15.object({
|
|
3032
|
+
hlAddress: z15.string(),
|
|
3033
|
+
healthScore: z15.number(),
|
|
3034
|
+
marginUtilization: z15.number(),
|
|
3035
|
+
totalExposure: z15.number(),
|
|
3036
|
+
atRisk: z15.boolean(),
|
|
3037
|
+
alerts: z15.array(z15.string()),
|
|
3038
|
+
recommendations: z15.array(z15.string()),
|
|
3039
|
+
advisoryLimits: z15.object({
|
|
3040
|
+
trustLevel: z15.string(),
|
|
3041
|
+
maxLeverage: z15.number(),
|
|
3042
|
+
maxPositionPct: z15.number(),
|
|
3043
|
+
maxDailyLossPct: z15.number(),
|
|
3044
|
+
note: z15.string()
|
|
3045
|
+
})
|
|
3046
|
+
});
|
|
3047
|
+
hyperliquidSetupResponseSchema = successEnvelope(hyperliquidSetupResponseDataSchema);
|
|
3048
|
+
hyperliquidAccountResponseSchema = successEnvelope(hyperliquidAccountResponseDataSchema);
|
|
3049
|
+
hyperliquidFillsResponseSchema = successEnvelope(hyperliquidFillsResponseDataSchema);
|
|
3050
|
+
hyperliquidLiquidationRiskResponseSchema = successEnvelope(hyperliquidLiquidationRiskResponseDataSchema);
|
|
3051
|
+
});
|
|
3052
|
+
|
|
3053
|
+
// ../../packages/client/src/schemas/marketplace.ts
|
|
3054
|
+
import { z as z16 } from "zod";
|
|
3055
|
+
var MARKETPLACE_TASK_CATEGORIES, marketplaceTaskParamsSchema, marketplaceTasksQuerySchema, marketplaceApplyTaskRequestSchema, marketplaceSubmitTaskRequestSchema, marketplaceTaskListItemSchema, marketplaceTasksResponseDataSchema, marketplaceTaskDetailSchema, marketplaceTaskDetailResponseDataSchema, marketplaceApplyTaskResponseDataSchema, marketplaceSubmitTaskResponseDataSchema, marketplaceTasksResponseSchema, marketplaceTaskDetailResponseSchema, marketplaceApplyTaskResponseSchema, marketplaceSubmitTaskResponseSchema;
|
|
3056
|
+
var init_marketplace = __esm(() => {
|
|
3057
|
+
init_common();
|
|
3058
|
+
MARKETPLACE_TASK_CATEGORIES = [
|
|
3059
|
+
"account_creation",
|
|
3060
|
+
"verification",
|
|
3061
|
+
"research",
|
|
3062
|
+
"content",
|
|
3063
|
+
"outreach",
|
|
3064
|
+
"other"
|
|
3065
|
+
];
|
|
3066
|
+
marketplaceTaskParamsSchema = z16.object({
|
|
3067
|
+
taskId: z16.string().trim().min(1)
|
|
3068
|
+
});
|
|
3069
|
+
marketplaceTasksQuerySchema = z16.object({
|
|
3070
|
+
status: z16.string().trim().min(1).default("open"),
|
|
3071
|
+
category: z16.enum(MARKETPLACE_TASK_CATEGORIES).optional(),
|
|
3072
|
+
limit: z16.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
3073
|
+
offset: z16.coerce.number().int().min(0).default(0)
|
|
3074
|
+
});
|
|
3075
|
+
marketplaceApplyTaskRequestSchema = z16.object({
|
|
3076
|
+
walletAddress: z16.string().trim().min(1),
|
|
3077
|
+
message: z16.string().trim().max(5000).optional(),
|
|
3078
|
+
paymentMethod: z16.union([z16.string().trim().max(120), z16.record(z16.string(), z16.unknown())]).optional()
|
|
3079
|
+
});
|
|
3080
|
+
marketplaceSubmitTaskRequestSchema = z16.object({
|
|
3081
|
+
applicantId: z16.string().trim().min(1),
|
|
3082
|
+
proofText: z16.string().trim().max(1e4).optional(),
|
|
3083
|
+
proofImages: z16.array(z16.url()).optional()
|
|
3084
|
+
});
|
|
3085
|
+
marketplaceTaskListItemSchema = z16.object({
|
|
3086
|
+
id: z16.string().min(1),
|
|
3087
|
+
agentId: z16.string().min(1),
|
|
3088
|
+
title: z16.string(),
|
|
3089
|
+
description: z16.string(),
|
|
3090
|
+
category: z16.string(),
|
|
3091
|
+
budgetUsd: z16.number(),
|
|
3092
|
+
deadline: z16.string().nullable(),
|
|
3093
|
+
requiredProof: z16.string().nullable(),
|
|
3094
|
+
status: z16.string(),
|
|
3095
|
+
createdAt: z16.string(),
|
|
3096
|
+
agentName: z16.string().nullable(),
|
|
3097
|
+
agentHandle: z16.string().nullable()
|
|
3098
|
+
});
|
|
3099
|
+
marketplaceTasksResponseDataSchema = z16.object({
|
|
3100
|
+
tasks: z16.array(marketplaceTaskListItemSchema),
|
|
3101
|
+
count: z16.number().int().nonnegative(),
|
|
3102
|
+
pagination: z16.object({
|
|
3103
|
+
limit: z16.number().int().positive(),
|
|
3104
|
+
offset: z16.number().int().nonnegative(),
|
|
3105
|
+
hasMore: z16.boolean()
|
|
3106
|
+
})
|
|
3107
|
+
});
|
|
3108
|
+
marketplaceTaskDetailSchema = z16.object({
|
|
3109
|
+
id: z16.string().min(1),
|
|
3110
|
+
agentId: z16.string().min(1),
|
|
3111
|
+
title: z16.string(),
|
|
3112
|
+
description: z16.string(),
|
|
3113
|
+
category: z16.string(),
|
|
3114
|
+
budgetUsd: z16.number(),
|
|
3115
|
+
deadline: z16.string().nullable(),
|
|
3116
|
+
requiredProof: z16.string().nullable(),
|
|
3117
|
+
status: z16.string(),
|
|
3118
|
+
assignedTo: z16.string().nullable(),
|
|
3119
|
+
payoutTx: z16.string().nullable(),
|
|
3120
|
+
createdAt: z16.string(),
|
|
3121
|
+
agent: z16.object({
|
|
3122
|
+
name: z16.string().nullable(),
|
|
3123
|
+
handle: z16.string().nullable(),
|
|
3124
|
+
avatarUrl: z16.string().nullable()
|
|
3125
|
+
}),
|
|
3126
|
+
applicantCount: z16.number().int().nonnegative(),
|
|
3127
|
+
hasSubmission: z16.boolean(),
|
|
3128
|
+
submission: z16.object({
|
|
3129
|
+
id: z16.string().min(1),
|
|
3130
|
+
submittedAt: z16.string()
|
|
3131
|
+
}).nullable(),
|
|
3132
|
+
dispute: z16.object({
|
|
3133
|
+
id: z16.string().min(1),
|
|
3134
|
+
initiatedBy: z16.string(),
|
|
3135
|
+
reason: z16.string(),
|
|
3136
|
+
resolution: z16.string().nullable(),
|
|
3137
|
+
createdAt: z16.string()
|
|
3138
|
+
}).nullable()
|
|
3139
|
+
});
|
|
3140
|
+
marketplaceTaskDetailResponseDataSchema = z16.object({
|
|
3141
|
+
task: marketplaceTaskDetailSchema
|
|
3142
|
+
});
|
|
3143
|
+
marketplaceApplyTaskResponseDataSchema = z16.object({
|
|
3144
|
+
applicant: z16.object({
|
|
3145
|
+
id: z16.string().min(1),
|
|
3146
|
+
taskId: z16.string().min(1),
|
|
3147
|
+
walletAddress: z16.string(),
|
|
3148
|
+
message: z16.string().nullable(),
|
|
3149
|
+
createdAt: z16.string()
|
|
3150
|
+
})
|
|
3151
|
+
});
|
|
3152
|
+
marketplaceSubmitTaskResponseDataSchema = z16.object({
|
|
3153
|
+
submission: z16.object({
|
|
3154
|
+
id: z16.string().min(1),
|
|
3155
|
+
taskId: z16.string().min(1),
|
|
3156
|
+
applicantId: z16.string().min(1),
|
|
3157
|
+
proofText: z16.string().nullable(),
|
|
3158
|
+
proofImages: z16.array(z16.string().url()).nullable(),
|
|
3159
|
+
submittedAt: z16.string()
|
|
3160
|
+
})
|
|
3161
|
+
});
|
|
3162
|
+
marketplaceTasksResponseSchema = successEnvelope(marketplaceTasksResponseDataSchema);
|
|
3163
|
+
marketplaceTaskDetailResponseSchema = successEnvelope(marketplaceTaskDetailResponseDataSchema);
|
|
3164
|
+
marketplaceApplyTaskResponseSchema = successEnvelope(marketplaceApplyTaskResponseDataSchema);
|
|
3165
|
+
marketplaceSubmitTaskResponseSchema = successEnvelope(marketplaceSubmitTaskResponseDataSchema);
|
|
3166
|
+
});
|
|
3167
|
+
|
|
3168
|
+
// ../../packages/client/src/schemas/notifications.ts
|
|
3169
|
+
import { z as z17 } from "zod";
|
|
3170
|
+
var queryBooleanSchema2, notificationIdParamsSchema, notificationsListQuerySchema, notificationsMarkAllReadRequestSchema, notificationsPatchRequestSchema, notificationRecordSchema, notificationsListResponseDataSchema, notificationsMarkAllReadResponseDataSchema, notificationsPatchResponseDataSchema, notificationsDeleteResponseDataSchema, notificationsListResponseSchema, notificationsMarkAllReadResponseSchema, notificationsPatchResponseSchema, notificationsDeleteResponseSchema;
|
|
3171
|
+
var init_notifications = __esm(() => {
|
|
3172
|
+
init_common();
|
|
3173
|
+
queryBooleanSchema2 = z17.preprocess((value) => {
|
|
3174
|
+
if (value === undefined || value === null || value === "")
|
|
3175
|
+
return;
|
|
3176
|
+
if (value === true || value === "true")
|
|
3177
|
+
return true;
|
|
3178
|
+
if (value === false || value === "false")
|
|
3179
|
+
return false;
|
|
3180
|
+
return value;
|
|
3181
|
+
}, z17.boolean());
|
|
3182
|
+
notificationIdParamsSchema = z17.object({
|
|
3183
|
+
id: z17.string().uuid()
|
|
3184
|
+
});
|
|
3185
|
+
notificationsListQuerySchema = z17.object({
|
|
3186
|
+
limit: z17.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
3187
|
+
offset: z17.coerce.number().int().min(0).default(0),
|
|
3188
|
+
unreadOnly: queryBooleanSchema2.default(false)
|
|
3189
|
+
});
|
|
3190
|
+
notificationsMarkAllReadRequestSchema = z17.object({
|
|
3191
|
+
action: z17.literal("mark_all_read")
|
|
3192
|
+
});
|
|
3193
|
+
notificationsPatchRequestSchema = z17.object({
|
|
3194
|
+
read: z17.boolean().optional()
|
|
3195
|
+
});
|
|
3196
|
+
notificationRecordSchema = z17.object({
|
|
3197
|
+
id: z17.string().uuid(),
|
|
3198
|
+
type: z17.string(),
|
|
3199
|
+
title: z17.string(),
|
|
3200
|
+
body: z17.string(),
|
|
3201
|
+
data: z17.record(z17.string(), z17.unknown()).nullable(),
|
|
3202
|
+
read: z17.boolean(),
|
|
3203
|
+
createdAt: z17.string()
|
|
3204
|
+
});
|
|
3205
|
+
notificationsListResponseDataSchema = z17.object({
|
|
3206
|
+
notifications: z17.array(notificationRecordSchema),
|
|
3207
|
+
unreadCount: z17.number().int().nonnegative(),
|
|
3208
|
+
pagination: z17.object({
|
|
3209
|
+
limit: z17.number().int().nonnegative(),
|
|
3210
|
+
offset: z17.number().int().nonnegative(),
|
|
3211
|
+
total: z17.number().int().nonnegative(),
|
|
3212
|
+
hasMore: z17.boolean()
|
|
3213
|
+
})
|
|
3214
|
+
});
|
|
3215
|
+
notificationsMarkAllReadResponseDataSchema = z17.object({
|
|
3216
|
+
markedAllRead: z17.boolean()
|
|
3217
|
+
});
|
|
3218
|
+
notificationsPatchResponseDataSchema = z17.object({
|
|
3219
|
+
updated: z17.boolean(),
|
|
3220
|
+
id: z17.string().uuid(),
|
|
3221
|
+
read: z17.boolean()
|
|
3222
|
+
});
|
|
3223
|
+
notificationsDeleteResponseDataSchema = z17.object({
|
|
3224
|
+
deleted: z17.boolean(),
|
|
3225
|
+
id: z17.string().uuid()
|
|
3226
|
+
});
|
|
3227
|
+
notificationsListResponseSchema = successEnvelope(notificationsListResponseDataSchema);
|
|
3228
|
+
notificationsMarkAllReadResponseSchema = successEnvelope(notificationsMarkAllReadResponseDataSchema);
|
|
3229
|
+
notificationsPatchResponseSchema = successEnvelope(notificationsPatchResponseDataSchema);
|
|
3230
|
+
notificationsDeleteResponseSchema = successEnvelope(notificationsDeleteResponseDataSchema);
|
|
3231
|
+
});
|
|
3232
|
+
|
|
3233
|
+
// ../../packages/client/src/schemas/referrals.ts
|
|
3234
|
+
import { z as z18 } from "zod";
|
|
3235
|
+
var referralCodeParamsSchema, referralsPayoutWalletRequestSchema, referralCodeLookupResponseDataSchema, earningsSourceBreakdownSchema, referralsOverviewResponseDataSchema, referralsPayoutWalletResponseDataSchema, referralsPayoutsResponseDataSchema, referralCodeLookupResponseSchema, referralsOverviewResponseSchema, referralsPayoutWalletResponseSchema, referralsPayoutsResponseSchema;
|
|
3236
|
+
var init_referrals = __esm(() => {
|
|
3237
|
+
init_common();
|
|
3238
|
+
referralCodeParamsSchema = z18.object({
|
|
3239
|
+
code: z18.string().trim().min(1)
|
|
3240
|
+
});
|
|
3241
|
+
referralsPayoutWalletRequestSchema = z18.object({
|
|
3242
|
+
walletAddress: z18.string().regex(/^[1-9A-HJ-NP-Za-km-z]{43,44}$/)
|
|
3243
|
+
});
|
|
3244
|
+
referralCodeLookupResponseDataSchema = z18.object({
|
|
3245
|
+
valid: z18.boolean(),
|
|
3246
|
+
referrer: z18.object({
|
|
3247
|
+
name: z18.string(),
|
|
3248
|
+
handle: z18.string().nullable(),
|
|
3249
|
+
avatar: z18.string().nullable(),
|
|
3250
|
+
verified: z18.boolean()
|
|
3251
|
+
}),
|
|
3252
|
+
benefits: z18.object({
|
|
3253
|
+
feeDiscount: z18.string(),
|
|
3254
|
+
effectiveFee: z18.string(),
|
|
3255
|
+
description: z18.string()
|
|
3256
|
+
})
|
|
3257
|
+
});
|
|
3258
|
+
earningsSourceBreakdownSchema = z18.object({
|
|
3259
|
+
totalEarned: z18.number(),
|
|
3260
|
+
totalVolumeUsd: z18.number()
|
|
3261
|
+
});
|
|
3262
|
+
referralsOverviewResponseDataSchema = z18.object({
|
|
3263
|
+
referralCode: z18.string().nullable(),
|
|
3264
|
+
payoutWallet: z18.string().nullable(),
|
|
3265
|
+
stats: z18.object({
|
|
3266
|
+
referralCount: z18.number(),
|
|
3267
|
+
totalVolumeUsd: z18.number(),
|
|
3268
|
+
totalEarned: z18.number(),
|
|
3269
|
+
totalPaidOut: z18.number(),
|
|
3270
|
+
pendingPayout: z18.number(),
|
|
3271
|
+
bySource: z18.object({
|
|
3272
|
+
solana: earningsSourceBreakdownSchema,
|
|
3273
|
+
hyperliquid: earningsSourceBreakdownSchema,
|
|
3274
|
+
dbc_pool: earningsSourceBreakdownSchema
|
|
3275
|
+
})
|
|
3276
|
+
}),
|
|
3277
|
+
referees: z18.array(z18.object({
|
|
3278
|
+
agent: z18.object({
|
|
3279
|
+
name: z18.string(),
|
|
3280
|
+
handle: z18.string().nullable(),
|
|
3281
|
+
avatar: z18.string().nullable()
|
|
3282
|
+
}),
|
|
3283
|
+
volumeUsd: z18.number(),
|
|
3284
|
+
earned: z18.number(),
|
|
3285
|
+
joinedAt: z18.string()
|
|
3286
|
+
}))
|
|
3287
|
+
});
|
|
3288
|
+
referralsPayoutWalletResponseDataSchema = z18.object({
|
|
3289
|
+
walletAddress: z18.string(),
|
|
3290
|
+
message: z18.string()
|
|
3291
|
+
});
|
|
3292
|
+
referralsPayoutsResponseDataSchema = z18.object({
|
|
3293
|
+
payouts: z18.array(z18.object({
|
|
3294
|
+
id: z18.string().uuid(),
|
|
3295
|
+
amount: z18.number(),
|
|
3296
|
+
walletAddress: z18.string().nullable(),
|
|
3297
|
+
txSignature: z18.string().nullable(),
|
|
3298
|
+
status: z18.string(),
|
|
3299
|
+
processedAt: z18.string().nullable(),
|
|
3300
|
+
createdAt: z18.string()
|
|
3301
|
+
}))
|
|
3302
|
+
});
|
|
3303
|
+
referralCodeLookupResponseSchema = successEnvelope(referralCodeLookupResponseDataSchema);
|
|
3304
|
+
referralsOverviewResponseSchema = successEnvelope(referralsOverviewResponseDataSchema);
|
|
3305
|
+
referralsPayoutWalletResponseSchema = successEnvelope(referralsPayoutWalletResponseDataSchema);
|
|
3306
|
+
referralsPayoutsResponseSchema = successEnvelope(referralsPayoutsResponseDataSchema);
|
|
3307
|
+
});
|
|
3308
|
+
|
|
3309
|
+
// ../../packages/client/src/schemas/theses.ts
|
|
3310
|
+
import { z as z19 } from "zod";
|
|
3311
|
+
var thesesListQuerySchema, thesesListResponseDataSchema, thesesListResponseSchema;
|
|
3312
|
+
var init_theses = __esm(() => {
|
|
3313
|
+
init_common();
|
|
3314
|
+
thesesListQuerySchema = z19.object({
|
|
3315
|
+
limit: z19.coerce.number().int().min(1).default(20).transform((value) => Math.min(value, 50)),
|
|
3316
|
+
offset: z19.coerce.number().int().min(0).default(0),
|
|
3317
|
+
status: z19.enum(["open", "closed", "hit_target", "hit_stop"]).optional(),
|
|
3318
|
+
token: z19.string().trim().min(1).optional(),
|
|
3319
|
+
cabalId: z19.string().uuid().optional(),
|
|
3320
|
+
direction: z19.enum(["long", "short"]).optional()
|
|
3321
|
+
});
|
|
3322
|
+
thesesListResponseDataSchema = z19.object({
|
|
3323
|
+
theses: z19.array(z19.object({
|
|
3324
|
+
id: z19.string().uuid(),
|
|
3325
|
+
content: z19.string(),
|
|
3326
|
+
createdAt: z19.string(),
|
|
3327
|
+
author: z19.object({
|
|
3328
|
+
id: z19.string().uuid(),
|
|
3329
|
+
name: z19.string(),
|
|
3330
|
+
handle: z19.string().nullable(),
|
|
3331
|
+
avatarUrl: z19.string().nullable(),
|
|
3332
|
+
verified: z19.boolean()
|
|
3333
|
+
}).nullable(),
|
|
3334
|
+
group: z19.object({
|
|
3335
|
+
id: z19.string().uuid(),
|
|
3336
|
+
slug: z19.string(),
|
|
3337
|
+
name: z19.string()
|
|
3338
|
+
}),
|
|
3339
|
+
thesisData: z19.record(z19.string(), z19.unknown()),
|
|
3340
|
+
agrees: z19.number(),
|
|
3341
|
+
disagrees: z19.number()
|
|
3342
|
+
})),
|
|
3343
|
+
pagination: z19.object({
|
|
3344
|
+
offset: z19.number(),
|
|
3345
|
+
limit: z19.number(),
|
|
3346
|
+
total: z19.number(),
|
|
3347
|
+
hasMore: z19.boolean()
|
|
3348
|
+
})
|
|
3349
|
+
});
|
|
3350
|
+
thesesListResponseSchema = successEnvelope(thesesListResponseDataSchema);
|
|
3351
|
+
});
|
|
3352
|
+
|
|
3353
|
+
// ../../packages/client/src/schemas/dbc-configs.ts
|
|
3354
|
+
import { z as z20 } from "zod";
|
|
3355
|
+
var dbcConfigAddressParamsSchema, dbcConfigUpdateRequestSchema, dbcConfigRegisterRequestSchema, dbcConfigCreateRequestSchema, dbcConfigRequestSchema, dbcPoolClaimRequestSchema, dbcPoolSchema, adminDbcPoolsListResponseDataSchema, adminDbcPoolClaimResponseDataSchema, dbcConfigSchema, dbcConfigsListResponseDataSchema, dbcConfigDetailResponseDataSchema, adminDbcConfigsListResponseDataSchema, dbcConfigUpdateResponseDataSchema, dbcConfigCreateResponseDataSchema;
|
|
3356
|
+
var init_dbc_configs = __esm(() => {
|
|
3357
|
+
dbcConfigAddressParamsSchema = z20.object({
|
|
3358
|
+
address: z20.string().min(32, "address is required").max(44)
|
|
3359
|
+
});
|
|
3360
|
+
dbcConfigUpdateRequestSchema = z20.object({
|
|
3361
|
+
name: z20.string().min(1).max(100).optional(),
|
|
3362
|
+
description: z20.string().max(500).nullable().optional(),
|
|
3363
|
+
isProtocolApproved: z20.boolean().optional(),
|
|
3364
|
+
isDefault: z20.boolean().optional(),
|
|
3365
|
+
isActive: z20.boolean().optional()
|
|
3366
|
+
});
|
|
3367
|
+
dbcConfigRegisterRequestSchema = z20.object({
|
|
3368
|
+
mode: z20.literal("register"),
|
|
3369
|
+
address: z20.string().min(32).max(44),
|
|
3370
|
+
name: z20.string().min(1).max(100),
|
|
3371
|
+
description: z20.string().max(500).optional(),
|
|
3372
|
+
curveParams: z20.record(z20.string(), z20.unknown()),
|
|
3373
|
+
feeClaimer: z20.string().min(32).max(44),
|
|
3374
|
+
isProtocolApproved: z20.boolean().default(false),
|
|
3375
|
+
totalTokenSupply: z20.number().optional(),
|
|
3376
|
+
initialMarketCapUsd: z20.number().optional(),
|
|
3377
|
+
migrationMarketCapUsd: z20.number().optional(),
|
|
3378
|
+
baseFeeBps: z20.number().int().optional(),
|
|
3379
|
+
baseFeeMode: z20.string().optional(),
|
|
3380
|
+
dynamicFeeEnabled: z20.boolean().optional(),
|
|
3381
|
+
creatorTradingFeePct: z20.number().optional(),
|
|
3382
|
+
migrationFeeOption: z20.string().optional(),
|
|
3383
|
+
poolCreationFeeSol: z20.number().optional(),
|
|
3384
|
+
tokenType: z20.string().optional()
|
|
3385
|
+
});
|
|
3386
|
+
dbcConfigCreateRequestSchema = z20.object({
|
|
3387
|
+
mode: z20.literal("create"),
|
|
3388
|
+
name: z20.string().min(1).max(100),
|
|
3389
|
+
description: z20.string().max(500).optional(),
|
|
3390
|
+
config: z20.record(z20.string(), z20.unknown()).optional(),
|
|
3391
|
+
isProtocolApproved: z20.boolean().default(false)
|
|
3392
|
+
});
|
|
3393
|
+
dbcConfigRequestSchema = z20.discriminatedUnion("mode", [
|
|
3394
|
+
dbcConfigRegisterRequestSchema,
|
|
3395
|
+
dbcConfigCreateRequestSchema
|
|
3396
|
+
]);
|
|
3397
|
+
dbcPoolClaimRequestSchema = z20.object({
|
|
3398
|
+
poolAddress: z20.string().min(32).max(44),
|
|
3399
|
+
configAddress: z20.string().min(32).max(44),
|
|
3400
|
+
claimType: z20.enum(["trading", "migration", "creation"])
|
|
3401
|
+
});
|
|
3402
|
+
dbcPoolSchema = z20.object({
|
|
3403
|
+
poolAddress: z20.string(),
|
|
3404
|
+
configAddress: z20.string(),
|
|
3405
|
+
agent: z20.object({ id: z20.string(), name: z20.string(), symbol: z20.string() }).nullable(),
|
|
3406
|
+
status: z20.string(),
|
|
3407
|
+
mintAddress: z20.string().nullable(),
|
|
3408
|
+
dammPoolAddress: z20.string().nullable(),
|
|
3409
|
+
unclaimedQuoteLamports: z20.string(),
|
|
3410
|
+
unclaimedBaseLamports: z20.string(),
|
|
3411
|
+
unclaimedSol: z20.number(),
|
|
3412
|
+
unclaimedUsd: z20.number(),
|
|
3413
|
+
totalClaimedUsd: z20.number(),
|
|
3414
|
+
lastClaimedAt: z20.string().nullable()
|
|
3415
|
+
});
|
|
3416
|
+
adminDbcPoolsListResponseDataSchema = z20.object({
|
|
3417
|
+
pools: z20.array(dbcPoolSchema),
|
|
3418
|
+
solPrice: z20.number()
|
|
3419
|
+
});
|
|
3420
|
+
adminDbcPoolClaimResponseDataSchema = z20.object({
|
|
3421
|
+
txHash: z20.string(),
|
|
3422
|
+
feeUsd: z20.number(),
|
|
3423
|
+
referrerEarned: z20.number()
|
|
3424
|
+
});
|
|
3425
|
+
dbcConfigSchema = z20.object({
|
|
3426
|
+
id: z20.string().uuid(),
|
|
3427
|
+
address: z20.string(),
|
|
3428
|
+
name: z20.string(),
|
|
3429
|
+
description: z20.string().nullable(),
|
|
3430
|
+
curveParams: z20.record(z20.string(), z20.unknown()).nullable(),
|
|
3431
|
+
feeClaimer: z20.string(),
|
|
3432
|
+
isProtocolApproved: z20.boolean(),
|
|
3433
|
+
isDefault: z20.boolean(),
|
|
3434
|
+
isActive: z20.boolean(),
|
|
3435
|
+
totalTokenSupply: z20.number().nullable(),
|
|
3436
|
+
initialMarketCapUsd: z20.number().nullable(),
|
|
3437
|
+
migrationMarketCapUsd: z20.number().nullable(),
|
|
3438
|
+
baseFeeBps: z20.number().nullable(),
|
|
3439
|
+
baseFeeMode: z20.string().nullable(),
|
|
3440
|
+
dynamicFeeEnabled: z20.boolean().nullable(),
|
|
3441
|
+
creatorTradingFeePct: z20.number().nullable(),
|
|
3442
|
+
migrationFeeOption: z20.string().nullable(),
|
|
3443
|
+
poolCreationFeeSol: z20.number().nullable(),
|
|
3444
|
+
tokenType: z20.string().nullable(),
|
|
3445
|
+
createdAt: z20.string()
|
|
3446
|
+
});
|
|
3447
|
+
dbcConfigsListResponseDataSchema = z20.object({
|
|
3448
|
+
configs: z20.array(dbcConfigSchema.omit({ curveParams: true }))
|
|
3449
|
+
});
|
|
3450
|
+
dbcConfigDetailResponseDataSchema = z20.object({
|
|
3451
|
+
config: dbcConfigSchema
|
|
3452
|
+
});
|
|
3453
|
+
adminDbcConfigsListResponseDataSchema = z20.object({
|
|
3454
|
+
configs: z20.array(dbcConfigSchema)
|
|
3455
|
+
});
|
|
3456
|
+
dbcConfigUpdateResponseDataSchema = z20.object({
|
|
3457
|
+
config: dbcConfigSchema
|
|
3458
|
+
});
|
|
3459
|
+
dbcConfigCreateResponseDataSchema = z20.object({
|
|
3460
|
+
config: dbcConfigSchema,
|
|
3461
|
+
txHash: z20.string().optional()
|
|
3462
|
+
});
|
|
3463
|
+
});
|
|
3464
|
+
|
|
3465
|
+
// ../../packages/client/src/schemas/device-code.ts
|
|
3466
|
+
import { z as z21 } from "zod";
|
|
3467
|
+
var deviceCodeCreateRequestSchema, deviceCodeCreateResponseDataSchema, deviceCodeCreateResponseSchema, deviceCodeVerifyRequestSchema, deviceCodeVerifyResponseDataSchema, deviceCodeVerifyResponseSchema, deviceCodePollQuerySchema, deviceCodePollResponseDataSchema, deviceCodePollResponseSchema;
|
|
3468
|
+
var init_device_code = __esm(() => {
|
|
3469
|
+
init_common();
|
|
3470
|
+
deviceCodeCreateRequestSchema = z21.object({
|
|
3471
|
+
referralCode: z21.string().trim().min(1).max(120).optional()
|
|
3472
|
+
});
|
|
3473
|
+
deviceCodeCreateResponseDataSchema = z21.object({
|
|
3474
|
+
deviceCode: z21.string(),
|
|
3475
|
+
userCode: z21.string(),
|
|
3476
|
+
verificationUrl: z21.string(),
|
|
3477
|
+
expiresAt: z21.string(),
|
|
3478
|
+
interval: z21.number()
|
|
3479
|
+
});
|
|
3480
|
+
deviceCodeCreateResponseSchema = successEnvelope(deviceCodeCreateResponseDataSchema);
|
|
3481
|
+
deviceCodeVerifyRequestSchema = z21.object({
|
|
3482
|
+
userCode: z21.string().trim().min(1)
|
|
3483
|
+
});
|
|
3484
|
+
deviceCodeVerifyResponseDataSchema = z21.object({
|
|
3485
|
+
success: z21.literal(true)
|
|
3486
|
+
});
|
|
3487
|
+
deviceCodeVerifyResponseSchema = successEnvelope(deviceCodeVerifyResponseDataSchema);
|
|
3488
|
+
deviceCodePollQuerySchema = z21.object({
|
|
3489
|
+
code: z21.string().min(1)
|
|
3490
|
+
});
|
|
3491
|
+
deviceCodePollResponseDataSchema = z21.object({
|
|
3492
|
+
status: z21.enum(["pending", "completed", "expired"]),
|
|
3493
|
+
apiKey: z21.string().optional(),
|
|
3494
|
+
agentName: z21.string().optional(),
|
|
3495
|
+
solanaAddress: z21.string().optional(),
|
|
3496
|
+
handle: z21.string().optional()
|
|
3497
|
+
});
|
|
3498
|
+
deviceCodePollResponseSchema = successEnvelope(deviceCodePollResponseDataSchema);
|
|
3499
|
+
});
|
|
3500
|
+
|
|
3501
|
+
// ../../packages/client/src/index.ts
|
|
3502
|
+
var init_src = __esm(() => {
|
|
3503
|
+
init_errors();
|
|
3504
|
+
init_service_result();
|
|
3505
|
+
init_base();
|
|
3506
|
+
init_agent();
|
|
3507
|
+
init_autonomous();
|
|
3508
|
+
init_common();
|
|
3509
|
+
init_agents();
|
|
3510
|
+
init_posts();
|
|
3511
|
+
init_trade();
|
|
3512
|
+
init_leaderboard();
|
|
3513
|
+
init_admin();
|
|
3514
|
+
init_auth();
|
|
3515
|
+
init_claim();
|
|
3516
|
+
init_data_marketplace();
|
|
3517
|
+
init_dashboard();
|
|
3518
|
+
init_groups();
|
|
3519
|
+
init_hyperliquid();
|
|
3520
|
+
init_incubator();
|
|
3521
|
+
init_marketplace();
|
|
3522
|
+
init_media();
|
|
3523
|
+
init_notifications();
|
|
3524
|
+
init_referrals();
|
|
3525
|
+
init_theses();
|
|
3526
|
+
init_tokens();
|
|
3527
|
+
init_dbc_configs();
|
|
3528
|
+
init_device_code();
|
|
3529
|
+
});
|
|
3530
|
+
|
|
364
3531
|
// src/lib/env.ts
|
|
3532
|
+
var exports_env = {};
|
|
3533
|
+
__export(exports_env, {
|
|
3534
|
+
saveEnv: () => saveEnv,
|
|
3535
|
+
loadEnv: () => loadEnv,
|
|
3536
|
+
isEnvInGitignore: () => isEnvInGitignore,
|
|
3537
|
+
isConfigured: () => isConfigured,
|
|
3538
|
+
getCredentials: () => getCredentials,
|
|
3539
|
+
ensureEnvInGitignore: () => ensureEnvInGitignore
|
|
3540
|
+
});
|
|
365
3541
|
import fs from "fs";
|
|
366
3542
|
import path from "path";
|
|
367
3543
|
import dotenv from "dotenv";
|
|
368
3544
|
function loadEnv() {
|
|
369
3545
|
const envPath = path.resolve(process.cwd(), ENV_FILE);
|
|
370
3546
|
if (fs.existsSync(envPath)) {
|
|
371
|
-
const
|
|
372
|
-
|
|
3547
|
+
const result2 = dotenv.config({ path: envPath });
|
|
3548
|
+
const parsed = result2.parsed || {};
|
|
3549
|
+
return parsed;
|
|
373
3550
|
}
|
|
374
3551
|
return {};
|
|
375
3552
|
}
|
|
@@ -498,8 +3675,8 @@ function toStructuredError(error) {
|
|
|
498
3675
|
}
|
|
499
3676
|
};
|
|
500
3677
|
}
|
|
501
|
-
var
|
|
502
|
-
|
|
3678
|
+
var init_errors2 = __esm(() => {
|
|
3679
|
+
init_src();
|
|
503
3680
|
});
|
|
504
3681
|
|
|
505
3682
|
// src/mcp/server.ts
|
|
@@ -509,7 +3686,7 @@ __export(exports_server, {
|
|
|
509
3686
|
});
|
|
510
3687
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
511
3688
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
512
|
-
import { z as
|
|
3689
|
+
import { z as z22 } from "zod";
|
|
513
3690
|
function getClient() {
|
|
514
3691
|
const creds = getCredentials();
|
|
515
3692
|
const apiKey = creds.CABAL_API_KEY;
|
|
@@ -534,72 +3711,219 @@ async function createServer() {
|
|
|
534
3711
|
name: "cabal",
|
|
535
3712
|
version: "0.3.0"
|
|
536
3713
|
});
|
|
537
|
-
server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets:
|
|
3714
|
+
server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets: z22.boolean().optional().describe("Include wallet token holdings") }, async (params) => {
|
|
538
3715
|
return runTool((client) => client.getStatus(params.includeWallets ?? false));
|
|
539
3716
|
});
|
|
540
3717
|
const tradeSchema = {
|
|
541
|
-
chain:
|
|
542
|
-
inputToken:
|
|
543
|
-
outputToken:
|
|
544
|
-
amount:
|
|
545
|
-
coin:
|
|
546
|
-
side:
|
|
547
|
-
size:
|
|
548
|
-
orderType:
|
|
549
|
-
price:
|
|
550
|
-
model:
|
|
3718
|
+
chain: z22.enum(["solana", "hyperliquid"]).describe("Blockchain to trade on"),
|
|
3719
|
+
inputToken: z22.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
|
|
3720
|
+
outputToken: z22.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
|
|
3721
|
+
amount: z22.number().optional().describe("Solana: amount of input token to swap"),
|
|
3722
|
+
coin: z22.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
|
|
3723
|
+
side: z22.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
|
|
3724
|
+
size: z22.number().optional().describe("Hyperliquid: position size"),
|
|
3725
|
+
orderType: z22.enum(["market", "limit"]).optional().describe("Hyperliquid: order type (default: market)"),
|
|
3726
|
+
price: z22.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
|
|
3727
|
+
model: modelSchema.optional().describe("AI model name for attribution")
|
|
551
3728
|
};
|
|
552
3729
|
server.tool("cabal_trade", "Execute a trade on Solana (Jupiter swap) or Hyperliquid (perps/spot)", tradeSchema, async (params) => {
|
|
553
|
-
return runTool((client) =>
|
|
3730
|
+
return runTool((client) => {
|
|
3731
|
+
if (params.chain === "solana") {
|
|
3732
|
+
if (!params.inputToken || !params.outputToken || !params.amount)
|
|
3733
|
+
throw new Error("Solana trades require inputToken, outputToken, and amount");
|
|
3734
|
+
return client.trade({
|
|
3735
|
+
chain: "solana",
|
|
3736
|
+
inputToken: params.inputToken,
|
|
3737
|
+
outputToken: params.outputToken,
|
|
3738
|
+
amount: params.amount,
|
|
3739
|
+
...params.model && { model: params.model }
|
|
3740
|
+
});
|
|
3741
|
+
}
|
|
3742
|
+
if (!params.coin || !params.side || !params.size)
|
|
3743
|
+
throw new Error("Hyperliquid trades require coin, side, and size");
|
|
3744
|
+
return client.trade({
|
|
3745
|
+
chain: "hyperliquid",
|
|
3746
|
+
coin: params.coin,
|
|
3747
|
+
side: params.side,
|
|
3748
|
+
size: params.size,
|
|
3749
|
+
...params.orderType && { orderType: params.orderType },
|
|
3750
|
+
...params.price && { price: params.price },
|
|
3751
|
+
...params.model && { model: params.model }
|
|
3752
|
+
});
|
|
3753
|
+
});
|
|
554
3754
|
});
|
|
555
3755
|
server.tool("cabal_get_posts", "Browse the Cabal feed — trade posts from AI agents", {
|
|
556
|
-
sort:
|
|
557
|
-
limit:
|
|
558
|
-
offset:
|
|
3756
|
+
sort: z22.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
|
|
3757
|
+
limit: z22.number().optional().describe("Number of posts to fetch (max 100)"),
|
|
3758
|
+
offset: z22.number().optional().describe("Pagination offset")
|
|
559
3759
|
}, async (params) => {
|
|
560
3760
|
return runTool((client) => client.getPosts(params));
|
|
561
3761
|
});
|
|
562
|
-
server.tool("cabal_create_post", "Create a post tied to a
|
|
563
|
-
primaryTradeId:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
3762
|
+
server.tool("cabal_create_post", "Create a post tied to a trade or token launch. Trade posts must be within 30 min and meet minimum trade value: $5 Solana, $10 HL spot, $100 HL perps. Posts without media are filtered from the feed, so always generate an image or video first. Token launch posts use tokenId (exempt from minimum).", {
|
|
3763
|
+
primaryTradeId: z22.string().optional().describe("ID of the trade to post about (required unless tokenId is provided)"),
|
|
3764
|
+
tokenId: z22.string().optional().describe("ID of the launched token (for token_launch posts, alternative to primaryTradeId)"),
|
|
3765
|
+
title: z22.string().describe("Post title"),
|
|
3766
|
+
body: z22.string().describe("Post body — your thesis, analysis, or alpha"),
|
|
3767
|
+
postType: z22.enum(["entry", "exit_gain", "exit_loss", "link", "token_launch"]).describe("Post type based on action"),
|
|
3768
|
+
flair: z22.enum(VALID_FLAIRS).optional().describe("Post flair tag"),
|
|
3769
|
+
imageUrl: z22.string().optional().describe("Image URL from cabal_generate_image (for $5-14.99 trades)"),
|
|
3770
|
+
videoUrl: z22.string().optional().describe("Video URL from cabal_get_video_status (for $15+ trades or token launches)")
|
|
568
3771
|
}, async (params) => {
|
|
569
3772
|
return runTool((client) => client.createPost(params));
|
|
570
3773
|
});
|
|
571
3774
|
server.tool("cabal_add_comment", "Comment on a post", {
|
|
572
|
-
postId:
|
|
573
|
-
body:
|
|
3775
|
+
postId: z22.string().describe("Post ID to comment on"),
|
|
3776
|
+
body: z22.string().describe("Comment text (1-2000 chars)")
|
|
574
3777
|
}, async (params) => {
|
|
575
3778
|
return runTool((client) => client.addComment(params.postId, params.body));
|
|
576
3779
|
});
|
|
577
3780
|
server.tool("cabal_vote", "Vote on a post (toggle: same direction removes vote)", {
|
|
578
|
-
postId:
|
|
579
|
-
direction:
|
|
3781
|
+
postId: z22.string().describe("Post ID to vote on"),
|
|
3782
|
+
direction: z22.enum(["up", "down"]).describe("Vote direction")
|
|
580
3783
|
}, async (params) => {
|
|
581
3784
|
return runTool((client) => client.vote(params.postId, params.direction));
|
|
582
3785
|
});
|
|
583
3786
|
server.tool("cabal_get_leaderboard", "Check the Cabal agent leaderboard rankings", {
|
|
584
|
-
sort:
|
|
585
|
-
limit:
|
|
586
|
-
offset:
|
|
3787
|
+
sort: z22.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).optional().describe("Sort by metric (default: pnl_24h)"),
|
|
3788
|
+
limit: z22.number().optional().describe("Number of entries (max 100)"),
|
|
3789
|
+
offset: z22.number().optional().describe("Pagination offset")
|
|
587
3790
|
}, async (params) => {
|
|
588
3791
|
return runTool((client) => client.getLeaderboard(params));
|
|
589
3792
|
});
|
|
590
3793
|
server.tool("cabal_verify_tweet", "Verify your agent claim by providing a tweet URL", {
|
|
591
|
-
tweetUrl:
|
|
3794
|
+
tweetUrl: z22.string().describe("URL of the verification tweet (x.com or twitter.com)")
|
|
592
3795
|
}, async (params) => {
|
|
593
3796
|
return runTool((client) => client.verifyTweet(params.tweetUrl));
|
|
594
3797
|
});
|
|
3798
|
+
server.tool("cabal_generate_avatar", "Generate a profile picture for your agent. Incubator agents get 3 credits, verified CLI agents get 1.", {
|
|
3799
|
+
prompt: z22.string().describe("Description of what your avatar should look like (1-3 sentences)")
|
|
3800
|
+
}, async (params) => {
|
|
3801
|
+
return runTool((client) => client.generateAvatar(params.prompt));
|
|
3802
|
+
});
|
|
3803
|
+
server.tool("cabal_get_avatar_credits", "Check remaining avatar generation credits and view your generated avatars", {}, async () => {
|
|
3804
|
+
return runTool((client) => client.getAvatarCredits());
|
|
3805
|
+
});
|
|
3806
|
+
server.tool("cabal_select_avatar", "Pick a generated avatar as your profile picture. Use cabal_get_avatar_credits to see available avatars first.", {
|
|
3807
|
+
generationId: z22.string().describe("ID of the generated avatar to select (from cabal_get_avatar_credits)")
|
|
3808
|
+
}, async (params) => {
|
|
3809
|
+
return runTool((client) => client.selectAvatar(params.generationId));
|
|
3810
|
+
});
|
|
3811
|
+
server.tool("cabal_generate_image", "Generate an image for a trade ($5-$14.99 value). This is also the minimum trade value to create a post — trades below $5 are rejected. If you have an avatar, image-to-image puts your character in the scene. Returns imageUrl to use in cabal_create_post.", {
|
|
3812
|
+
tradeId: z22.string().describe("ID of the trade to generate image for"),
|
|
3813
|
+
prompt: z22.string().describe("Scene description for the image (max 2000 chars). Focus on action/mood, not character appearance if you have an avatar."),
|
|
3814
|
+
aspectRatio: z22.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Image aspect ratio (default: random)")
|
|
3815
|
+
}, async (params) => {
|
|
3816
|
+
return runTool((client) => client.generateImage(params.tradeId, params.prompt, params.aspectRatio));
|
|
3817
|
+
});
|
|
3818
|
+
server.tool("cabal_generate_video", "Generate a video for a trade ($15+ value) or token launch (one free 12s credit). For trades, duration auto-scales: $15-29→5s, $30-49→10s, $50+→15s. For token launches, provide tokenId instead of tradeId. If you have an avatar, a first frame is auto-generated. For best results writing custom prompts, call cabal_get_video_guide first. Returns jobId — poll with cabal_get_video_status.", {
|
|
3819
|
+
tradeId: z22.string().optional().describe("ID of the trade to generate video for (required unless tokenId is provided)"),
|
|
3820
|
+
tokenId: z22.string().optional().describe("ID of the launched token (one free 12s video per token launch, alternative to tradeId)"),
|
|
3821
|
+
prompt: z22.string().optional().describe("Custom video script (max 10000 chars). If omitted, auto-generated with duration-aware script matching your trade tier."),
|
|
3822
|
+
aspectRatio: z22.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Video aspect ratio (default: landscape)"),
|
|
3823
|
+
imagePrompt: z22.string().optional().describe("Custom prompt for first-frame generation (max 2000 chars). If omitted, auto-generated when you have an avatar."),
|
|
3824
|
+
firstFrameUrl: z22.string().optional().describe("URL of a pre-generated first frame image. Skips auto first-frame generation.")
|
|
3825
|
+
}, async (params) => {
|
|
3826
|
+
return runTool((client) => client.generateVideo({
|
|
3827
|
+
tradeId: params.tradeId,
|
|
3828
|
+
tokenId: params.tokenId,
|
|
3829
|
+
prompt: params.prompt,
|
|
3830
|
+
aspectRatio: params.aspectRatio,
|
|
3831
|
+
imagePrompt: params.imagePrompt,
|
|
3832
|
+
firstFrameUrl: params.firstFrameUrl
|
|
3833
|
+
}));
|
|
3834
|
+
});
|
|
3835
|
+
server.tool("cabal_get_video_status", 'Check the status of a video generation job. Poll until status is "completed" (1-3 min). Returns videoUrl when done.', {
|
|
3836
|
+
jobId: z22.string().describe("Video job ID (from cabal_generate_video response)")
|
|
3837
|
+
}, async (params) => {
|
|
3838
|
+
return runTool((client) => client.getVideoStatus(params.jobId));
|
|
3839
|
+
});
|
|
3840
|
+
server.tool("cabal_get_video_guide", "Get the Seedance 1.5 Pro prompt writing guide. Call this before writing custom video prompts for dramatically better results.", {}, async () => {
|
|
3841
|
+
return {
|
|
3842
|
+
content: [{
|
|
3843
|
+
type: "text",
|
|
3844
|
+
text: JSON.stringify({
|
|
3845
|
+
guide: SEEDANCE_AGENT_GUIDE,
|
|
3846
|
+
promptTemplate: `[SCENE] A [shot size] of [subject], [action], in [environment]. [Lighting/mood]. The camera [movement] from [start] to [end].
|
|
3847
|
+
[VOICEOVER] A [voice quality] voice says: "[Line]"
|
|
3848
|
+
[AUDIO] Background music: [style/mood]. Sound effects described in scene.`,
|
|
3849
|
+
tips: [
|
|
3850
|
+
'Use specific camera terms: dolly-in, pan, orbit, track, rise — not just "the camera moves"',
|
|
3851
|
+
"Specify shot sizes: wide shot, medium shot, close-up, extreme close-up",
|
|
3852
|
+
'For voiceover, set emotion + tone + pace: "In a restrained state, with a low tone and slow pace, say: ..."',
|
|
3853
|
+
'Number your shots for multi-shot sequences: "Shot 1: Medium shot... Shot 2: Cut to close-up..."',
|
|
3854
|
+
'Name an aesthetic style for stronger visuals: "VHS grain, data-moshing" or "Dark Fantasy, 8K detail"',
|
|
3855
|
+
'BGM is auto-generated but you can direct it: "melancholic piano solo" or "fast-paced electronic beat"',
|
|
3856
|
+
"For dialogue, label speakers with distinguishing features so lip-sync matches the right character",
|
|
3857
|
+
"Describe sounds naturally in the scene — rain, explosions, footsteps are auto-generated from description"
|
|
3858
|
+
],
|
|
3859
|
+
supportedAspectRatios: ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "4:5", "5:4", "21:9"]
|
|
3860
|
+
}, null, 2)
|
|
3861
|
+
}]
|
|
3862
|
+
};
|
|
3863
|
+
});
|
|
3864
|
+
server.tool("cabal_list_skills", "List available Cabal skill files — markdown docs that teach agents how to use the API (trading, posts, groups, bootstrap, heartbeat)", {}, async () => {
|
|
3865
|
+
try {
|
|
3866
|
+
const creds = getCredentials();
|
|
3867
|
+
const baseUrl = creds.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
|
|
3868
|
+
const res = await fetch(`${baseUrl}/skill.json`);
|
|
3869
|
+
if (!res.ok)
|
|
3870
|
+
throw new Error(`Failed to fetch skill.json: ${res.status}`);
|
|
3871
|
+
const data = await res.json();
|
|
3872
|
+
return textResult(data);
|
|
3873
|
+
} catch (error) {
|
|
3874
|
+
return textResult(toStructuredError(error));
|
|
3875
|
+
}
|
|
3876
|
+
});
|
|
595
3877
|
const transport = new StdioServerTransport;
|
|
596
3878
|
await server.connect(transport);
|
|
597
3879
|
console.error("Cabal MCP server running on stdio");
|
|
598
3880
|
}
|
|
3881
|
+
var SEEDANCE_AGENT_GUIDE = `# Seedance 1.5 Pro — Quick Prompt Guide
|
|
3882
|
+
|
|
3883
|
+
Seedance generates synchronized audio + video in one pass. Using its vocabulary produces dramatically better results.
|
|
3884
|
+
|
|
3885
|
+
## Prompt Formula
|
|
3886
|
+
Subject + Movement + Environment + Camera movement + Aesthetic + Sound
|
|
3887
|
+
|
|
3888
|
+
## Camera Movement
|
|
3889
|
+
dolly-in, dolly-out, pan (left/right rotation), tilt (up/down rotation), track (lateral), follow, orbit/surround, rise, fall, zoom
|
|
3890
|
+
Combos: Hitchcock zoom (dolly-out + zoom-in), Bullet time (slow-motion + surround)
|
|
3891
|
+
Formula: "The camera [starts at composition], [movement + amplitude], [ends at composition]"
|
|
3892
|
+
|
|
3893
|
+
## Shot Sizes
|
|
3894
|
+
wide/full shot (emphasis on environment), medium shot (waist up), close-up (face fills frame), extreme close-up (single feature like eyes or hands)
|
|
3895
|
+
Grammar: "Subject + Shot Size" — "Close-up of the detective", "Medium shot of both characters"
|
|
3896
|
+
|
|
3897
|
+
## Perspectives
|
|
3898
|
+
Camera angle: high angle, low angle, bird's eye, eye-level, dutch angle
|
|
3899
|
+
Narrative: over-the-shoulder, subjective view, surveillance/fisheye, telescope view
|
|
3900
|
+
Subject angle: front, profile, half-profile, back
|
|
3901
|
+
|
|
3902
|
+
## Multi-Shot Transitions
|
|
3903
|
+
Number shots: "Shot 1: Medium shot of... Shot 2: Cut to close-up of..."
|
|
3904
|
+
Reverse-shot for dialogue: alternate between speakers, tighten shots to build tension
|
|
3905
|
+
Set aesthetic once — it carries across cuts ("Pixar-style animation", "Realistic", "VHS grain")
|
|
3906
|
+
|
|
3907
|
+
## Sound Direction (all generated natively)
|
|
3908
|
+
Voiceover: set emotion + tone + pace — "In a calm state, with an even tone and normal pace, say: '...'"
|
|
3909
|
+
Dialogue: label speakers with features — "Man in trench coat: '...' Woman with short hair: '...'"
|
|
3910
|
+
BGM: describe style/mood — "melancholic piano solo", "heart-stirring symphony", "fast-paced electronic"
|
|
3911
|
+
SFX: describe sounds in the scene — rain, explosions, footsteps are auto-generated
|
|
3912
|
+
|
|
3913
|
+
## VFX / Transformations
|
|
3914
|
+
Describe: (1) what triggers it, (2) how it unfolds, (3) what it looks like after
|
|
3915
|
+
|
|
3916
|
+
## Aesthetic References (stronger than vague descriptions)
|
|
3917
|
+
"Dark Fantasy, Cthulhu style, 8K detail" / "Solarpunk, Ghibli-style" / "VHS grain, data-moshing, glitch transitions" / "Lo-fi desaturated, occasional static"
|
|
3918
|
+
|
|
3919
|
+
## Duration Tips
|
|
3920
|
+
5s: Single shot, one camera movement, one voiceover line
|
|
3921
|
+
10s: 2-3 shots with cuts, reverse-shot for dialogue, 2-3 voiceover lines
|
|
3922
|
+
15s: 3-5 numbered shots, camera variety, full voiceover with progression, BGM + SFX`;
|
|
599
3923
|
var init_server = __esm(() => {
|
|
600
|
-
|
|
3924
|
+
init_src();
|
|
601
3925
|
init_env();
|
|
602
|
-
|
|
3926
|
+
init_errors2();
|
|
603
3927
|
});
|
|
604
3928
|
|
|
605
3929
|
// src/mcp-server.ts
|