@railbeam/stardorm-api-contract 0.0.1 → 0.0.2
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/dist/index.d.mts +7157 -1300
- package/dist/index.d.ts +7157 -1300
- package/dist/index.js +295 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +270 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/catalog-build.ts +33 -3
- package/src/chat-api.ts +85 -5
- package/src/conversation-sync.ts +41 -0
- package/src/conversation.ts +10 -2
- package/src/credit-card.ts +20 -29
- package/src/financial-snapshot.ts +28 -0
- package/src/handler-result.ts +65 -0
- package/src/handlers.ts +4 -0
- package/src/index.ts +56 -4
- package/src/marketplace-hire.ts +26 -0
- package/src/payment-request.ts +6 -0
- package/src/swap.ts +73 -0
- package/src/transfer-form.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -99,6 +99,19 @@ function buildStardormCatalogResponse() {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// src/catalog-build.ts
|
|
102
|
+
var STARDORM_CATALOG_AGENT_KEYS_ORDERED = [
|
|
103
|
+
"beam-default",
|
|
104
|
+
"ledger",
|
|
105
|
+
"fiscus",
|
|
106
|
+
"scribe",
|
|
107
|
+
"yieldr",
|
|
108
|
+
"audita",
|
|
109
|
+
"settler",
|
|
110
|
+
"quanta",
|
|
111
|
+
"ramp",
|
|
112
|
+
"passport",
|
|
113
|
+
"capita"
|
|
114
|
+
];
|
|
102
115
|
function resolveStardormChainAgentId(agentKey) {
|
|
103
116
|
const trimmed = agentKey.trim();
|
|
104
117
|
if (/^\d+$/.test(trimmed)) {
|
|
@@ -111,12 +124,18 @@ function resolveStardormChainAgentId(agentKey) {
|
|
|
111
124
|
const n = Number.parseInt(m[1], 10);
|
|
112
125
|
return Number.isFinite(n) && n > 0 ? n : null;
|
|
113
126
|
}
|
|
127
|
+
const slug = trimmed.toLowerCase();
|
|
128
|
+
const idx = STARDORM_CATALOG_AGENT_KEYS_ORDERED.indexOf(slug);
|
|
129
|
+
if (idx >= 0) return idx + 1;
|
|
114
130
|
return null;
|
|
115
131
|
}
|
|
116
132
|
function resolveStardormAgentKey(chainAgentId) {
|
|
117
133
|
const n = typeof chainAgentId === "string" ? Number.parseInt(chainAgentId, 10) : Number(chainAgentId);
|
|
118
134
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
119
|
-
|
|
135
|
+
const idx = n - 1;
|
|
136
|
+
if (idx >= 0 && idx < STARDORM_CATALOG_AGENT_KEYS_ORDERED.length && STARDORM_CATALOG_AGENT_KEYS_ORDERED[idx]) {
|
|
137
|
+
return STARDORM_CATALOG_AGENT_KEYS_ORDERED[idx];
|
|
138
|
+
}
|
|
120
139
|
return `chain-${n}`;
|
|
121
140
|
}
|
|
122
141
|
var authChallengeBodySchema = zod.z.object({
|
|
@@ -154,7 +173,11 @@ var HANDLER_ACTION_IDS = [
|
|
|
154
173
|
/** Confirms an ERC-20 transfer draft; user signs in their wallet / Beam Send. */
|
|
155
174
|
"draft_erc20_transfer",
|
|
156
175
|
/** Confirms an NFT (ERC-721 / ERC-1155) transfer draft; user signs in their wallet / Beam Send. */
|
|
157
|
-
"draft_nft_transfer"
|
|
176
|
+
"draft_nft_transfer",
|
|
177
|
+
/** Confirms a Uniswap V3 single-hop swap on 0G mainnet; user signs approve + router in wallet. */
|
|
178
|
+
"draft_token_swap",
|
|
179
|
+
/** Direct the user to hire a marketplace specialist for a task this agent cannot run. */
|
|
180
|
+
"suggest_marketplace_hire"
|
|
158
181
|
];
|
|
159
182
|
function isHandlerActionId(id) {
|
|
160
183
|
return HANDLER_ACTION_IDS.includes(id);
|
|
@@ -170,6 +193,19 @@ var storageUploadResponseSchema = zod.z.object({
|
|
|
170
193
|
rootHash: zod.z.string().min(1),
|
|
171
194
|
txHash: zod.z.string().optional()
|
|
172
195
|
});
|
|
196
|
+
function stripJsonNulls(value) {
|
|
197
|
+
if (value === null) return void 0;
|
|
198
|
+
if (Array.isArray(value)) return value.map(stripJsonNulls);
|
|
199
|
+
if (typeof value === "object") {
|
|
200
|
+
const out = {};
|
|
201
|
+
for (const [k, v] of Object.entries(value)) {
|
|
202
|
+
const stripped = stripJsonNulls(v);
|
|
203
|
+
if (stripped !== void 0) out[k] = stripped;
|
|
204
|
+
}
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
return value;
|
|
208
|
+
}
|
|
173
209
|
var stardormChatRichRowSchema = zod.z.object({
|
|
174
210
|
label: zod.z.string(),
|
|
175
211
|
value: zod.z.string()
|
|
@@ -236,6 +272,48 @@ var stardormChatRichBlockSchema = zod.z.discriminatedUnion("type", [
|
|
|
236
272
|
type: zod.z.literal("credit_card"),
|
|
237
273
|
title: zod.z.string().min(1),
|
|
238
274
|
rows: stardormChatRichRows
|
|
275
|
+
}),
|
|
276
|
+
zod.z.object({
|
|
277
|
+
type: zod.z.literal("swap_checkout_form"),
|
|
278
|
+
title: zod.z.string().min(1).max(200),
|
|
279
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
280
|
+
supportedAssets: zod.z.array(x402SupportedAssetSchema).min(1).max(24),
|
|
281
|
+
networks: zod.z.array(
|
|
282
|
+
zod.z.object({
|
|
283
|
+
id: zod.z.string().min(1).max(64),
|
|
284
|
+
label: zod.z.string().min(1).max(120)
|
|
285
|
+
})
|
|
286
|
+
).max(16).optional(),
|
|
287
|
+
/** Default V3 fee tier when the form does not override (500, 3000, 10000). */
|
|
288
|
+
defaultPoolFee: zod.z.union([zod.z.literal(500), zod.z.literal(3e3), zod.z.literal(1e4)]).optional()
|
|
289
|
+
}),
|
|
290
|
+
zod.z.object({
|
|
291
|
+
type: zod.z.literal("marketplace_hire"),
|
|
292
|
+
title: zod.z.string().min(1).max(200),
|
|
293
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
294
|
+
specialistName: zod.z.string().min(1).max(80),
|
|
295
|
+
specialistAgentKey: zod.z.string().min(1).max(64),
|
|
296
|
+
category: zod.z.enum(["Payments", "Taxes", "Reports", "DeFi", "Compliance", "General"]).optional(),
|
|
297
|
+
capability: zod.z.string().min(1).max(400).optional(),
|
|
298
|
+
userTask: zod.z.string().max(500).optional(),
|
|
299
|
+
/** App path to open the marketplace (default `/marketplace`). */
|
|
300
|
+
marketplacePath: zod.z.string().min(1).max(256).default("/marketplace"),
|
|
301
|
+
/** App path to the specialist profile when known (e.g. `/agents/chain-2`). */
|
|
302
|
+
agentProfilePath: zod.z.string().min(1).max(256).optional(),
|
|
303
|
+
requiredHandler: zod.z.string().min(1).max(64).optional()
|
|
304
|
+
}),
|
|
305
|
+
zod.z.object({
|
|
306
|
+
type: zod.z.literal("transfer_checkout_form"),
|
|
307
|
+
title: zod.z.string().min(1).max(200),
|
|
308
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
309
|
+
supportedAssets: zod.z.array(x402SupportedAssetSchema).min(1).max(24),
|
|
310
|
+
networks: zod.z.array(
|
|
311
|
+
zod.z.object({
|
|
312
|
+
id: zod.z.string().min(1).max(64),
|
|
313
|
+
label: zod.z.string().min(1).max(120)
|
|
314
|
+
})
|
|
315
|
+
).max(16).optional(),
|
|
316
|
+
defaultTo: zod.z.string().max(66).optional()
|
|
239
317
|
})
|
|
240
318
|
]);
|
|
241
319
|
var stardormChatJsonBodySchema = zod.z.object({
|
|
@@ -260,16 +338,25 @@ var stardormChatAttachmentSchema = zod.z.object({
|
|
|
260
338
|
hash: zod.z.string().min(1),
|
|
261
339
|
size: zod.z.string().optional()
|
|
262
340
|
});
|
|
263
|
-
|
|
341
|
+
function nullishOptional(schema) {
|
|
342
|
+
return zod.z.preprocess((v) => v === null ? void 0 : v, schema);
|
|
343
|
+
}
|
|
344
|
+
var stardormChatSuccessObjectSchema = zod.z.object({
|
|
264
345
|
agentKey: zod.z.string().min(1),
|
|
265
346
|
reply: zod.z.string(),
|
|
266
|
-
structured: stardormChatStructuredSchema.optional(),
|
|
347
|
+
structured: nullishOptional(stardormChatStructuredSchema.optional()),
|
|
267
348
|
/** Structured card rows for the client (model or server-generated). */
|
|
268
|
-
rich: stardormChatRichBlockSchema.optional(),
|
|
349
|
+
rich: nullishOptional(stardormChatRichBlockSchema.optional()),
|
|
269
350
|
/** Files the server uploaded to 0G Storage from the user's chat turn (echoed for immediate render). */
|
|
270
|
-
attachments:
|
|
351
|
+
attachments: nullishOptional(
|
|
352
|
+
zod.z.array(stardormChatAttachmentSchema).optional()
|
|
353
|
+
),
|
|
271
354
|
compute: stardormChatComputeSchema
|
|
272
355
|
});
|
|
356
|
+
var stardormChatSuccessSchema = zod.z.preprocess(
|
|
357
|
+
(v) => v != null && typeof v === "object" ? stripJsonNulls(v) : v,
|
|
358
|
+
stardormChatSuccessObjectSchema
|
|
359
|
+
);
|
|
273
360
|
var stardormChatClientErrorSchema = zod.z.object({
|
|
274
361
|
error: zod.z.string().min(1)
|
|
275
362
|
});
|
|
@@ -330,6 +417,46 @@ var executeHandlerResponseSchema = zod.z.object({
|
|
|
330
417
|
data: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
331
418
|
rich: stardormChatRichBlockSchema.optional()
|
|
332
419
|
});
|
|
420
|
+
var chatHandlerWalletTxResultSchema = zod.z.object({
|
|
421
|
+
kind: zod.z.literal("wallet_tx"),
|
|
422
|
+
status: zod.z.enum(["submitted", "confirmed", "failed"]),
|
|
423
|
+
txHash: zod.z.string().regex(/^0x[a-fA-F0-9]{64}$/).optional(),
|
|
424
|
+
error: zod.z.string().max(2e3).optional(),
|
|
425
|
+
network: zod.z.string().min(1).max(64).optional(),
|
|
426
|
+
chainId: zod.z.number().int().positive().optional(),
|
|
427
|
+
handler: zod.z.string().min(1).max(64).optional(),
|
|
428
|
+
updatedAt: zod.z.number().int().positive()
|
|
429
|
+
});
|
|
430
|
+
var chatHandlerServerResultSchema = zod.z.object({
|
|
431
|
+
kind: zod.z.literal("server"),
|
|
432
|
+
status: zod.z.enum(["completed", "failed"]).default("completed"),
|
|
433
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
434
|
+
updatedAt: zod.z.number().int().positive()
|
|
435
|
+
});
|
|
436
|
+
var chatHandlerResultSchema = zod.z.discriminatedUnion("kind", [
|
|
437
|
+
chatHandlerWalletTxResultSchema,
|
|
438
|
+
chatHandlerServerResultSchema
|
|
439
|
+
]);
|
|
440
|
+
var patchChatMessageResultBodySchema = zod.z.object({
|
|
441
|
+
result: chatHandlerResultSchema
|
|
442
|
+
});
|
|
443
|
+
var patchChatMessageResultResponseSchema = zod.z.object({
|
|
444
|
+
ok: zod.z.literal(true),
|
|
445
|
+
messageId: zod.z.string().min(1),
|
|
446
|
+
result: chatHandlerResultSchema,
|
|
447
|
+
rich: zod.z.object({
|
|
448
|
+
type: zod.z.literal("tx"),
|
|
449
|
+
title: zod.z.string(),
|
|
450
|
+
rows: zod.z.array(
|
|
451
|
+
zod.z.object({
|
|
452
|
+
label: zod.z.string(),
|
|
453
|
+
value: zod.z.string()
|
|
454
|
+
})
|
|
455
|
+
).optional()
|
|
456
|
+
}).optional()
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// src/conversation.ts
|
|
333
460
|
var chatHistoryQuerySchema = zod.z.object({
|
|
334
461
|
limit: zod.z.coerce.number().int().min(1).max(100).default(40),
|
|
335
462
|
/** When omitted, the server uses the user’s active conversation. */
|
|
@@ -387,8 +514,13 @@ var chatHistoryMessageSchema = zod.z.object({
|
|
|
387
514
|
content: zod.z.string(),
|
|
388
515
|
createdAt: zod.z.number(),
|
|
389
516
|
attachments: zod.z.array(chatHistoryAttachmentSchema).optional(),
|
|
390
|
-
rich:
|
|
517
|
+
rich: zod.z.preprocess(
|
|
518
|
+
(v) => v != null && typeof v === "object" ? stripJsonNulls(v) : v,
|
|
519
|
+
stardormChatRichBlockSchema.optional()
|
|
520
|
+
).optional(),
|
|
391
521
|
handlerCta: chatHistoryHandlerCtaSchema.optional(),
|
|
522
|
+
/** Wallet or server outcome for this bubble (tx hash, checkout ids, …). */
|
|
523
|
+
result: chatHandlerResultSchema.optional(),
|
|
392
524
|
followUp: chatFollowUpSchema.optional(),
|
|
393
525
|
model: zod.z.string().optional(),
|
|
394
526
|
verified: zod.z.boolean().optional(),
|
|
@@ -429,6 +561,32 @@ var createConversationBodySchema = zod.z.object({
|
|
|
429
561
|
var deleteConversationResponseSchema = zod.z.object({
|
|
430
562
|
deleted: zod.z.literal(true)
|
|
431
563
|
});
|
|
564
|
+
var conversationSyncThreadSchema = zod.z.object({
|
|
565
|
+
v: zod.z.literal(1),
|
|
566
|
+
op: zod.z.literal("thread"),
|
|
567
|
+
conversationId: zod.z.string().min(1)
|
|
568
|
+
});
|
|
569
|
+
var conversationSyncThreadMessagesSchema = zod.z.object({
|
|
570
|
+
v: zod.z.literal(1),
|
|
571
|
+
op: zod.z.literal("thread_messages"),
|
|
572
|
+
conversationId: zod.z.string().min(1),
|
|
573
|
+
messages: zod.z.array(chatHistoryMessageSchema).min(1)
|
|
574
|
+
});
|
|
575
|
+
var conversationSyncConversationsSchema = zod.z.object({
|
|
576
|
+
v: zod.z.literal(1),
|
|
577
|
+
op: zod.z.literal("conversations")
|
|
578
|
+
});
|
|
579
|
+
var conversationSyncConversationDeletedSchema = zod.z.object({
|
|
580
|
+
v: zod.z.literal(1),
|
|
581
|
+
op: zod.z.literal("conversation_deleted"),
|
|
582
|
+
conversationId: zod.z.string().min(1)
|
|
583
|
+
});
|
|
584
|
+
var conversationSyncPayloadSchema = zod.z.discriminatedUnion("op", [
|
|
585
|
+
conversationSyncThreadSchema,
|
|
586
|
+
conversationSyncThreadMessagesSchema,
|
|
587
|
+
conversationSyncConversationsSchema,
|
|
588
|
+
conversationSyncConversationDeletedSchema
|
|
589
|
+
]);
|
|
432
590
|
var agentOnchainFeedbackItemSchema = zod.z.object({
|
|
433
591
|
id: zod.z.string(),
|
|
434
592
|
agentId: zod.z.number(),
|
|
@@ -516,13 +674,33 @@ var publicPaymentRequestSchema = zod.z.object({
|
|
|
516
674
|
attachment: stardormChatAttachmentSchema.optional(),
|
|
517
675
|
/** Set when status is `paid` (on-chain settlement recorded). */
|
|
518
676
|
txHash: zod.z.string().optional(),
|
|
519
|
-
paidByWallet: zod.z.string().optional()
|
|
677
|
+
paidByWallet: zod.z.string().optional(),
|
|
678
|
+
/** When true, checkout can settle via x402 facilitator + wallet-signed payload. */
|
|
679
|
+
facilitatorSettlement: zod.z.boolean().optional()
|
|
520
680
|
});
|
|
521
681
|
var mePaymentRequestsQuerySchema = zod.z.object({
|
|
522
|
-
limit: zod.z.coerce.number().int().min(1).max(50).default(20)
|
|
682
|
+
limit: zod.z.coerce.number().int().min(1).max(50).default(20),
|
|
683
|
+
/** 1-based page index (sorted by `updatedAt` descending). */
|
|
684
|
+
page: zod.z.coerce.number().int().min(1).default(1)
|
|
523
685
|
});
|
|
524
686
|
var paymentRequestsListResponseSchema = zod.z.object({
|
|
525
|
-
items: zod.z.array(publicPaymentRequestSchema)
|
|
687
|
+
items: zod.z.array(publicPaymentRequestSchema),
|
|
688
|
+
/** Total rows matching the wallet filter (ignores pagination). */
|
|
689
|
+
total: zod.z.number().int().min(0)
|
|
690
|
+
});
|
|
691
|
+
var financialSnapshotDailyRowSchema = zod.z.object({
|
|
692
|
+
bucketStart: zod.z.string(),
|
|
693
|
+
bucket: zod.z.string(),
|
|
694
|
+
revenueUsd: zod.z.number().optional(),
|
|
695
|
+
walletBalance0g: zod.z.number().optional(),
|
|
696
|
+
monthlySpend0g: zod.z.number().optional(),
|
|
697
|
+
spendByCategory: zod.z.record(zod.z.number()).default({})
|
|
698
|
+
});
|
|
699
|
+
var meFinancialSnapshotsQuerySchema = zod.z.object({
|
|
700
|
+
days: zod.z.coerce.number().int().min(7).max(90).default(30)
|
|
701
|
+
});
|
|
702
|
+
var financialSnapshotsListResponseSchema = zod.z.object({
|
|
703
|
+
items: zod.z.array(financialSnapshotDailyRowSchema)
|
|
526
704
|
});
|
|
527
705
|
var onRampFormNetworkOptionSchema = zod.z.object({
|
|
528
706
|
id: zod.z.string().min(1).max(64),
|
|
@@ -667,24 +845,18 @@ var creditCardSensitiveDetailsSchema = zod.z.object({
|
|
|
667
845
|
var creditCardsListResponseSchema = zod.z.object({
|
|
668
846
|
cards: zod.z.array(creditCardPublicSchema)
|
|
669
847
|
});
|
|
670
|
-
var creditCardFundBodySchema = zod.z.object({
|
|
671
|
-
amountCents: zod.z.coerce.number().int().min(1).max(1e8),
|
|
672
|
-
fundingTxHash: zod.z.string().regex(/^0x[a-fA-F0-9]{64}$/).optional(),
|
|
673
|
-
fundingChainId: zod.z.coerce.number().int().positive().optional()
|
|
674
|
-
}).refine(
|
|
675
|
-
(d) => d.fundingTxHash == null && d.fundingChainId == null || d.fundingTxHash != null && d.fundingChainId != null,
|
|
676
|
-
{
|
|
677
|
-
message: "fundingTxHash and fundingChainId must both be provided or both omitted",
|
|
678
|
-
path: ["fundingTxHash"]
|
|
679
|
-
}
|
|
680
|
-
);
|
|
681
848
|
var creditCardFundQuoteQuerySchema = zod.z.object({
|
|
682
849
|
amountCents: zod.z.coerce.number().int().min(1).max(1e8)
|
|
683
850
|
});
|
|
684
|
-
var
|
|
685
|
-
onchainFundingRequired: zod.z.literal(false)
|
|
851
|
+
var creditCardFundQuoteX402Schema = zod.z.object({
|
|
852
|
+
onchainFundingRequired: zod.z.literal(false),
|
|
853
|
+
chainId: zod.z.number().int(),
|
|
854
|
+
recipient: zod.z.string().min(1),
|
|
855
|
+
usdcAsset: zod.z.string().min(1),
|
|
856
|
+
usdcAmountBaseUnits: zod.z.string().regex(/^\d+$/),
|
|
857
|
+
usdcDecimals: zod.z.number().int().min(0).max(18)
|
|
686
858
|
});
|
|
687
|
-
var
|
|
859
|
+
var creditCardFundQuoteNativeSchema = zod.z.object({
|
|
688
860
|
onchainFundingRequired: zod.z.literal(true),
|
|
689
861
|
chainId: zod.z.number().int(),
|
|
690
862
|
recipient: zod.z.string().min(1),
|
|
@@ -693,10 +865,11 @@ var creditCardFundQuoteOnChainSchema = zod.z.object({
|
|
|
693
865
|
nativeSymbol: zod.z.string().min(1),
|
|
694
866
|
nativeDecimals: zod.z.number().int().min(0).max(18)
|
|
695
867
|
});
|
|
696
|
-
var
|
|
868
|
+
var creditCardFundQuoteSchema = zod.z.discriminatedUnion(
|
|
697
869
|
"onchainFundingRequired",
|
|
698
|
-
[
|
|
870
|
+
[creditCardFundQuoteX402Schema, creditCardFundQuoteNativeSchema]
|
|
699
871
|
);
|
|
872
|
+
var creditCardFundQuoteResponseSchema = creditCardFundQuoteSchema;
|
|
700
873
|
var creditCardWithdrawBodySchema = zod.z.object({
|
|
701
874
|
amountCents: zod.z.coerce.number().int().min(1).max(1e8)
|
|
702
875
|
});
|
|
@@ -884,6 +1057,76 @@ var draftNftTransferInputSchema = zod.z.object({
|
|
|
884
1057
|
});
|
|
885
1058
|
}
|
|
886
1059
|
});
|
|
1060
|
+
var swapFormNetworkOptionSchema = zod.z.object({
|
|
1061
|
+
id: zod.z.string().min(1).max(64),
|
|
1062
|
+
label: zod.z.string().min(1).max(120)
|
|
1063
|
+
});
|
|
1064
|
+
var swapFormCtaParamsSchema = zod.z.object({
|
|
1065
|
+
_swapForm: zod.z.literal(true),
|
|
1066
|
+
supportedAssets: zod.z.array(x402SupportedAssetSchema).min(1).max(24),
|
|
1067
|
+
networks: zod.z.array(swapFormNetworkOptionSchema).max(16).optional(),
|
|
1068
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
1069
|
+
/** Default Uniswap V3 pool fee tier (500, 3000, or 10000). */
|
|
1070
|
+
defaultPoolFee: zod.z.union([zod.z.literal(500), zod.z.literal(3e3), zod.z.literal(1e4)]).optional()
|
|
1071
|
+
});
|
|
1072
|
+
function isSwapFormCtaParams(v) {
|
|
1073
|
+
return swapFormCtaParamsSchema.safeParse(v).success;
|
|
1074
|
+
}
|
|
1075
|
+
var caip2Eip1552 = zod.z.string().min(8).max(64).regex(/^eip155:\d+$/, "network must be CAIP-2 form eip155:<chainId>");
|
|
1076
|
+
var evmAddress202 = zod.z.string().trim().refine((s) => /^0x[a-fA-F0-9]{40}$/.test(s), "must be a 0x-prefixed 20-byte EVM address").transform((s) => s.trim().toLowerCase());
|
|
1077
|
+
var positiveWeiString2 = zod.z.string().trim().regex(/^[1-9]\d*$/, "must be a positive integer decimal string (base units)");
|
|
1078
|
+
var nonNegativeWeiString = zod.z.string().trim().regex(/^\d+$/, "must be a non-negative integer decimal string (base units)");
|
|
1079
|
+
var poolFeeSchema = zod.z.union([
|
|
1080
|
+
zod.z.literal(500),
|
|
1081
|
+
zod.z.literal(3e3),
|
|
1082
|
+
zod.z.literal(1e4)
|
|
1083
|
+
]);
|
|
1084
|
+
var draftTokenSwapInputSchema = zod.z.object({
|
|
1085
|
+
network: caip2Eip1552,
|
|
1086
|
+
tokenIn: evmAddress202,
|
|
1087
|
+
tokenInSymbol: zod.z.string().min(1).max(32).optional(),
|
|
1088
|
+
tokenInDecimals: zod.z.number().int().min(0).max(36),
|
|
1089
|
+
tokenOut: evmAddress202,
|
|
1090
|
+
tokenOutSymbol: zod.z.string().min(1).max(32).optional(),
|
|
1091
|
+
tokenOutDecimals: zod.z.number().int().min(0).max(36),
|
|
1092
|
+
amountInWei: positiveWeiString2,
|
|
1093
|
+
/** Slippage floor in `tokenOut` base units; `0` accepts any output. */
|
|
1094
|
+
amountOutMinimumWei: nonNegativeWeiString.default("0"),
|
|
1095
|
+
poolFee: poolFeeSchema.default(3e3),
|
|
1096
|
+
/** Filled server-side from deployment when omitted. */
|
|
1097
|
+
router: evmAddress202.optional(),
|
|
1098
|
+
/** Unix seconds; wallet may refresh if expired. */
|
|
1099
|
+
deadlineUnix: zod.z.number().int().positive().optional(),
|
|
1100
|
+
note: zod.z.string().max(500).optional()
|
|
1101
|
+
});
|
|
1102
|
+
var transferFormNetworkOptionSchema = zod.z.object({
|
|
1103
|
+
id: zod.z.string().min(1).max(64),
|
|
1104
|
+
label: zod.z.string().min(1).max(120)
|
|
1105
|
+
});
|
|
1106
|
+
var transferFormCtaParamsSchema = zod.z.object({
|
|
1107
|
+
_transferForm: zod.z.literal(true),
|
|
1108
|
+
supportedAssets: zod.z.array(x402SupportedAssetSchema).min(1).max(24),
|
|
1109
|
+
networks: zod.z.array(transferFormNetworkOptionSchema).max(16).optional(),
|
|
1110
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
1111
|
+
/** When set, pre-fill recipient in the form. */
|
|
1112
|
+
defaultTo: zod.z.string().trim().refine((s) => /^0x[a-fA-F0-9]{40}$/.test(s), "defaultTo must be 0x\u202640").transform((s) => s.toLowerCase()).optional()
|
|
1113
|
+
});
|
|
1114
|
+
function isTransferFormCtaParams(v) {
|
|
1115
|
+
return transferFormCtaParamsSchema.safeParse(v).success;
|
|
1116
|
+
}
|
|
1117
|
+
var marketplaceSpecialistAgentKeySchema = zod.z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/i);
|
|
1118
|
+
var suggestMarketplaceHireInputSchema = zod.z.object({
|
|
1119
|
+
specialistAgentKey: marketplaceSpecialistAgentKeySchema,
|
|
1120
|
+
specialistName: zod.z.string().min(1).max(80).optional(),
|
|
1121
|
+
category: zod.z.enum(["Payments", "Taxes", "Reports", "DeFi", "Compliance", "General"]).optional(),
|
|
1122
|
+
/** One line: what the specialist runs for the user (handler names ok). */
|
|
1123
|
+
capability: zod.z.string().min(1).max(400).optional(),
|
|
1124
|
+
/** Short description of what the user was trying to do. */
|
|
1125
|
+
userTask: zod.z.string().min(1).max(500).optional(),
|
|
1126
|
+
intro: zod.z.string().max(2e3).optional(),
|
|
1127
|
+
/** Optional handler the user needs after hiring (for display only). */
|
|
1128
|
+
requiredHandler: handlerActionIdSchema.optional()
|
|
1129
|
+
});
|
|
887
1130
|
|
|
888
1131
|
exports.HANDLER_ACTION_IDS = HANDLER_ACTION_IDS;
|
|
889
1132
|
exports.ISO_3166_1_ALPHA2_CODES = ISO_3166_1_ALPHA2_CODES;
|
|
@@ -906,23 +1149,31 @@ exports.billingRangeEndOfDay = billingRangeEndOfDay;
|
|
|
906
1149
|
exports.buildStardormCatalogResponse = buildStardormCatalogResponse;
|
|
907
1150
|
exports.catalogResponseSchema = catalogResponseSchema;
|
|
908
1151
|
exports.chatFollowUpSchema = chatFollowUpSchema;
|
|
1152
|
+
exports.chatHandlerResultSchema = chatHandlerResultSchema;
|
|
1153
|
+
exports.chatHandlerServerResultSchema = chatHandlerServerResultSchema;
|
|
1154
|
+
exports.chatHandlerWalletTxResultSchema = chatHandlerWalletTxResultSchema;
|
|
909
1155
|
exports.chatHistoryAttachmentSchema = chatHistoryAttachmentSchema;
|
|
910
1156
|
exports.chatHistoryHandlerCtaSchema = chatHistoryHandlerCtaSchema;
|
|
911
1157
|
exports.chatHistoryMessageSchema = chatHistoryMessageSchema;
|
|
912
1158
|
exports.chatHistoryQuerySchema = chatHistoryQuerySchema;
|
|
913
1159
|
exports.chatHistoryResponseSchema = chatHistoryResponseSchema;
|
|
914
1160
|
exports.conversationSummarySchema = conversationSummarySchema;
|
|
1161
|
+
exports.conversationSyncConversationDeletedSchema = conversationSyncConversationDeletedSchema;
|
|
1162
|
+
exports.conversationSyncConversationsSchema = conversationSyncConversationsSchema;
|
|
1163
|
+
exports.conversationSyncPayloadSchema = conversationSyncPayloadSchema;
|
|
1164
|
+
exports.conversationSyncThreadMessagesSchema = conversationSyncThreadMessagesSchema;
|
|
1165
|
+
exports.conversationSyncThreadSchema = conversationSyncThreadSchema;
|
|
915
1166
|
exports.conversationsListResponseSchema = conversationsListResponseSchema;
|
|
916
1167
|
exports.conversationsPageResponseSchema = conversationsPageResponseSchema;
|
|
917
1168
|
exports.conversationsQuerySchema = conversationsQuerySchema;
|
|
918
1169
|
exports.createConversationBodySchema = createConversationBodySchema;
|
|
919
1170
|
exports.createCreditCardInputSchema = createCreditCardInputSchema;
|
|
920
1171
|
exports.creditCardFormCtaParamsSchema = creditCardFormCtaParamsSchema;
|
|
921
|
-
exports.
|
|
922
|
-
exports.creditCardFundQuoteOffChainSchema = creditCardFundQuoteOffChainSchema;
|
|
923
|
-
exports.creditCardFundQuoteOnChainSchema = creditCardFundQuoteOnChainSchema;
|
|
1172
|
+
exports.creditCardFundQuoteNativeSchema = creditCardFundQuoteNativeSchema;
|
|
924
1173
|
exports.creditCardFundQuoteQuerySchema = creditCardFundQuoteQuerySchema;
|
|
925
1174
|
exports.creditCardFundQuoteResponseSchema = creditCardFundQuoteResponseSchema;
|
|
1175
|
+
exports.creditCardFundQuoteSchema = creditCardFundQuoteSchema;
|
|
1176
|
+
exports.creditCardFundQuoteX402Schema = creditCardFundQuoteX402Schema;
|
|
926
1177
|
exports.creditCardPublicSchema = creditCardPublicSchema;
|
|
927
1178
|
exports.creditCardSensitiveDetailsSchema = creditCardSensitiveDetailsSchema;
|
|
928
1179
|
exports.creditCardWithdrawBodySchema = creditCardWithdrawBodySchema;
|
|
@@ -931,8 +1182,11 @@ exports.deleteConversationResponseSchema = deleteConversationResponseSchema;
|
|
|
931
1182
|
exports.draftErc20TransferInputSchema = draftErc20TransferInputSchema;
|
|
932
1183
|
exports.draftNativeTransferInputSchema = draftNativeTransferInputSchema;
|
|
933
1184
|
exports.draftNftTransferInputSchema = draftNftTransferInputSchema;
|
|
1185
|
+
exports.draftTokenSwapInputSchema = draftTokenSwapInputSchema;
|
|
934
1186
|
exports.executeHandlerBodySchema = executeHandlerBodySchema;
|
|
935
1187
|
exports.executeHandlerResponseSchema = executeHandlerResponseSchema;
|
|
1188
|
+
exports.financialSnapshotDailyRowSchema = financialSnapshotDailyRowSchema;
|
|
1189
|
+
exports.financialSnapshotsListResponseSchema = financialSnapshotsListResponseSchema;
|
|
936
1190
|
exports.generateFinancialActivityReportInputSchema = generateFinancialActivityReportInputSchema;
|
|
937
1191
|
exports.generatePaymentInvoiceInputSchema = generatePaymentInvoiceInputSchema;
|
|
938
1192
|
exports.handlerActionIdSchema = handlerActionIdSchema;
|
|
@@ -941,7 +1195,11 @@ exports.isCreditCardFormCtaParams = isCreditCardFormCtaParams;
|
|
|
941
1195
|
exports.isHandlerActionId = isHandlerActionId;
|
|
942
1196
|
exports.isIso3166Alpha2 = isIso3166Alpha2;
|
|
943
1197
|
exports.isOnRampFormCtaParams = isOnRampFormCtaParams;
|
|
1198
|
+
exports.isSwapFormCtaParams = isSwapFormCtaParams;
|
|
1199
|
+
exports.isTransferFormCtaParams = isTransferFormCtaParams;
|
|
944
1200
|
exports.isoCountryDisplayName = isoCountryDisplayName;
|
|
1201
|
+
exports.marketplaceSpecialistAgentKeySchema = marketplaceSpecialistAgentKeySchema;
|
|
1202
|
+
exports.meFinancialSnapshotsQuerySchema = meFinancialSnapshotsQuerySchema;
|
|
945
1203
|
exports.meOnRampsQuerySchema = meOnRampsQuerySchema;
|
|
946
1204
|
exports.mePaymentRequestsQuerySchema = mePaymentRequestsQuerySchema;
|
|
947
1205
|
exports.onRampFormCtaParamsSchema = onRampFormCtaParamsSchema;
|
|
@@ -950,6 +1208,8 @@ exports.onRampRecordSchema = onRampRecordSchema;
|
|
|
950
1208
|
exports.onRampRecordStatusSchema = onRampRecordStatusSchema;
|
|
951
1209
|
exports.onRampTokensInputSchema = onRampTokensInputSchema;
|
|
952
1210
|
exports.onRampsListResponseSchema = onRampsListResponseSchema;
|
|
1211
|
+
exports.patchChatMessageResultBodySchema = patchChatMessageResultBodySchema;
|
|
1212
|
+
exports.patchChatMessageResultResponseSchema = patchChatMessageResultResponseSchema;
|
|
953
1213
|
exports.paymentRequestStatusSchema = paymentRequestStatusSchema;
|
|
954
1214
|
exports.paymentRequestTypeSchema = paymentRequestTypeSchema;
|
|
955
1215
|
exports.paymentRequestsListResponseSchema = paymentRequestsListResponseSchema;
|
|
@@ -970,8 +1230,14 @@ exports.stardormChatStructuredSchema = stardormChatStructuredSchema;
|
|
|
970
1230
|
exports.stardormChatSuccessSchema = stardormChatSuccessSchema;
|
|
971
1231
|
exports.storageUploadBodySchema = storageUploadBodySchema;
|
|
972
1232
|
exports.storageUploadResponseSchema = storageUploadResponseSchema;
|
|
1233
|
+
exports.stripJsonNulls = stripJsonNulls;
|
|
973
1234
|
exports.stripeKycInputSchema = stripeKycInputSchema;
|
|
1235
|
+
exports.suggestMarketplaceHireInputSchema = suggestMarketplaceHireInputSchema;
|
|
1236
|
+
exports.swapFormCtaParamsSchema = swapFormCtaParamsSchema;
|
|
1237
|
+
exports.swapFormNetworkOptionSchema = swapFormNetworkOptionSchema;
|
|
974
1238
|
exports.taxRateForCountry = taxRateForCountry;
|
|
1239
|
+
exports.transferFormCtaParamsSchema = transferFormCtaParamsSchema;
|
|
1240
|
+
exports.transferFormNetworkOptionSchema = transferFormNetworkOptionSchema;
|
|
975
1241
|
exports.updateUserBodySchema = updateUserBodySchema;
|
|
976
1242
|
exports.userAvatarPresetSchema = userAvatarPresetSchema;
|
|
977
1243
|
exports.userKycStatusDocumentSchema = userKycStatusDocumentSchema;
|