@illalabs/interfaces 0.3.0-canary.e77570c1 → 0.3.0
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/schemas/chatContext.d.ts +3 -0
- package/dist/schemas/chatContext.d.ts.map +1 -1
- package/dist/schemas/chatRequestBody.d.ts +12 -0
- package/dist/schemas/chatRequestBody.d.ts.map +1 -1
- package/dist/schemas/messages.d.ts +473 -0
- package/dist/schemas/messages.d.ts.map +1 -1
- package/dist/schemas/messages.js +64 -0
- package/dist/schemas/messages.js.map +1 -1
- package/dist/schemas/modelContext.d.ts +3 -3
- package/dist/schemas/telemetryEvents.d.ts +772 -0
- package/dist/schemas/telemetryEvents.d.ts.map +1 -1
- package/dist/schemas/userContext.d.ts +3 -0
- package/dist/schemas/userContext.d.ts.map +1 -1
- package/dist/schemas/userContext.js +4 -0
- package/dist/schemas/userContext.js.map +1 -1
- package/dist/types/actions/inputs.d.ts +5 -2
- package/dist/types/actions/inputs.d.ts.map +1 -1
- package/dist/types/actions/outputs.d.ts +19 -1
- package/dist/types/actions/outputs.d.ts.map +1 -1
- package/dist/types/actions/tools/getWalletBalanceAction.d.ts +2 -1
- package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
- package/dist/types/actions/tools/index.d.ts +9 -0
- package/dist/types/actions/tools/index.d.ts.map +1 -1
- package/dist/types/actions/tools/polymarketPostOrderAction.d.ts +81 -0
- package/dist/types/actions/tools/polymarketPostOrderAction.d.ts.map +1 -0
- package/dist/types/actions/tools/polymarketPostOrderAction.js +2 -0
- package/dist/types/actions/tools/polymarketPostOrderAction.js.map +1 -0
- package/dist/types/actions/tools/predictionMarketsBetAction.d.ts +19 -0
- package/dist/types/actions/tools/predictionMarketsBetAction.d.ts.map +1 -0
- package/dist/types/actions/tools/predictionMarketsBetAction.js +2 -0
- package/dist/types/actions/tools/predictionMarketsBetAction.js.map +1 -0
- package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts +2 -1
- package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts.map +1 -1
- package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts +25 -0
- package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts.map +1 -0
- package/dist/types/actions/tools/predictionMarketsPositionsAction.js +2 -0
- package/dist/types/actions/tools/predictionMarketsPositionsAction.js.map +1 -0
- package/dist/utils/constants.d.ts +3 -3
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +9 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +2 -2
|
@@ -81,10 +81,13 @@ export declare const ChatContextSchema: z.ZodObject<Pick<{
|
|
|
81
81
|
messages: z.ZodArray<z.ZodType<import("@ai-sdk/provider-utils").ModelMessage, z.ZodTypeDef, import("@ai-sdk/provider-utils").ModelMessage>, "many">;
|
|
82
82
|
userContext: z.ZodObject<{
|
|
83
83
|
address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
84
|
+
signerWallet: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
84
85
|
}, "strict", z.ZodTypeAny, {
|
|
85
86
|
address: `0x${string}`;
|
|
87
|
+
signerWallet?: `0x${string}` | undefined;
|
|
86
88
|
}, {
|
|
87
89
|
address: string;
|
|
90
|
+
signerWallet?: string | undefined;
|
|
88
91
|
}>;
|
|
89
92
|
prompt: z.ZodOptional<z.ZodObject<{
|
|
90
93
|
role: z.ZodLiteral<"user">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../src/schemas/chatContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../src/schemas/chatContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7B,CAAC"}
|
|
@@ -81,10 +81,13 @@ export declare const CoreApiChatBodyRequestBaseSchema: z.ZodObject<{
|
|
|
81
81
|
messages: z.ZodArray<z.ZodType<import("@ai-sdk/provider-utils").ModelMessage, z.ZodTypeDef, import("@ai-sdk/provider-utils").ModelMessage>, "many">;
|
|
82
82
|
userContext: z.ZodObject<{
|
|
83
83
|
address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
84
|
+
signerWallet: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
84
85
|
}, "strict", z.ZodTypeAny, {
|
|
85
86
|
address: `0x${string}`;
|
|
87
|
+
signerWallet?: `0x${string}` | undefined;
|
|
86
88
|
}, {
|
|
87
89
|
address: string;
|
|
90
|
+
signerWallet?: string | undefined;
|
|
88
91
|
}>;
|
|
89
92
|
prompt: z.ZodOptional<z.ZodObject<{
|
|
90
93
|
role: z.ZodLiteral<"user">;
|
|
@@ -211,6 +214,7 @@ export declare const CoreApiChatBodyRequestBaseSchema: z.ZodObject<{
|
|
|
211
214
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
212
215
|
userContext: {
|
|
213
216
|
address: `0x${string}`;
|
|
217
|
+
signerWallet?: `0x${string}` | undefined;
|
|
214
218
|
};
|
|
215
219
|
languageModel: string;
|
|
216
220
|
personalityContext: {
|
|
@@ -258,6 +262,7 @@ export declare const CoreApiChatBodyRequestBaseSchema: z.ZodObject<{
|
|
|
258
262
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
259
263
|
userContext: {
|
|
260
264
|
address: string;
|
|
265
|
+
signerWallet?: string | undefined;
|
|
261
266
|
};
|
|
262
267
|
languageModel: string;
|
|
263
268
|
prompt?: {
|
|
@@ -370,10 +375,13 @@ export declare const CoreApiChatBodyRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
370
375
|
messages: z.ZodArray<z.ZodType<import("@ai-sdk/provider-utils").ModelMessage, z.ZodTypeDef, import("@ai-sdk/provider-utils").ModelMessage>, "many">;
|
|
371
376
|
userContext: z.ZodObject<{
|
|
372
377
|
address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
378
|
+
signerWallet: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
373
379
|
}, "strict", z.ZodTypeAny, {
|
|
374
380
|
address: `0x${string}`;
|
|
381
|
+
signerWallet?: `0x${string}` | undefined;
|
|
375
382
|
}, {
|
|
376
383
|
address: string;
|
|
384
|
+
signerWallet?: string | undefined;
|
|
377
385
|
}>;
|
|
378
386
|
prompt: z.ZodOptional<z.ZodObject<{
|
|
379
387
|
role: z.ZodLiteral<"user">;
|
|
@@ -500,6 +508,7 @@ export declare const CoreApiChatBodyRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
500
508
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
501
509
|
userContext: {
|
|
502
510
|
address: `0x${string}`;
|
|
511
|
+
signerWallet?: `0x${string}` | undefined;
|
|
503
512
|
};
|
|
504
513
|
languageModel: string;
|
|
505
514
|
personalityContext: {
|
|
@@ -547,6 +556,7 @@ export declare const CoreApiChatBodyRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
547
556
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
548
557
|
userContext: {
|
|
549
558
|
address: string;
|
|
559
|
+
signerWallet?: string | undefined;
|
|
550
560
|
};
|
|
551
561
|
languageModel: string;
|
|
552
562
|
prompt?: {
|
|
@@ -594,6 +604,7 @@ export declare const CoreApiChatBodyRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
594
604
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
595
605
|
userContext: {
|
|
596
606
|
address: `0x${string}`;
|
|
607
|
+
signerWallet?: `0x${string}` | undefined;
|
|
597
608
|
};
|
|
598
609
|
languageModel: string;
|
|
599
610
|
personalityContext: {
|
|
@@ -641,6 +652,7 @@ export declare const CoreApiChatBodyRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
641
652
|
messages: import("@ai-sdk/provider-utils").ModelMessage[];
|
|
642
653
|
userContext: {
|
|
643
654
|
address: string;
|
|
655
|
+
signerWallet?: string | undefined;
|
|
644
656
|
};
|
|
645
657
|
languageModel: string;
|
|
646
658
|
prompt?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatRequestBody.d.ts","sourceRoot":"","sources":["../../src/schemas/chatRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"chatRequestBody.d.ts","sourceRoot":"","sources":["../../src/schemas/chatRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASrC,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxD,CAAC;AAEd,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IALjC,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpE,CAAC"}
|
|
@@ -1,6 +1,151 @@
|
|
|
1
1
|
import type { ModelMessage } from "@ai-sdk/provider-utils";
|
|
2
2
|
import type { PrepareTransactionRequestReturnType } from "viem";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
/**
|
|
5
|
+
* EIP-712 typed data structure for off-chain signatures
|
|
6
|
+
*/
|
|
7
|
+
export declare const EIP712TypedDataSchema: z.ZodObject<{
|
|
8
|
+
types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}, {
|
|
15
|
+
type: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}>, "many">>;
|
|
18
|
+
domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
19
|
+
message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
+
primaryType: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
message: Record<string, unknown>;
|
|
23
|
+
types: Record<string, {
|
|
24
|
+
type: string;
|
|
25
|
+
name: string;
|
|
26
|
+
}[]>;
|
|
27
|
+
domain: Record<string, unknown>;
|
|
28
|
+
primaryType: string;
|
|
29
|
+
}, {
|
|
30
|
+
message: Record<string, unknown>;
|
|
31
|
+
types: Record<string, {
|
|
32
|
+
type: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}[]>;
|
|
35
|
+
domain: Record<string, unknown>;
|
|
36
|
+
primaryType: string;
|
|
37
|
+
}>;
|
|
38
|
+
export type EIP712TypedData = z.infer<typeof EIP712TypedDataSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* Generic signature request for off-chain signing.
|
|
41
|
+
* Used when an action requires the client to sign data.
|
|
42
|
+
*
|
|
43
|
+
* This is a discriminated union based on `signMethod`:
|
|
44
|
+
* - `signMethod: 'typedData'` requires `typedData` (EIP-712 typed data for eth_signTypedData_v4)
|
|
45
|
+
* - `signMethod: 'message'` requires `rawHash` (for personal_sign)
|
|
46
|
+
*/
|
|
47
|
+
export declare const SignatureRequestSchema: z.ZodDiscriminatedUnion<"signMethod", [z.ZodObject<{
|
|
48
|
+
/** Unique identifier for this signature request */
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
/** Address of the signer (EOA) */
|
|
51
|
+
signerAddress: z.ZodString;
|
|
52
|
+
/** Human-readable description for the UI */
|
|
53
|
+
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
/** Generic key-value metadata for action-specific data */
|
|
55
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
} & {
|
|
57
|
+
signMethod: z.ZodLiteral<"typedData">;
|
|
58
|
+
/** EIP-712 typed data to be signed */
|
|
59
|
+
typedData: z.ZodObject<{
|
|
60
|
+
types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
type: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
type: string;
|
|
65
|
+
name: string;
|
|
66
|
+
}, {
|
|
67
|
+
type: string;
|
|
68
|
+
name: string;
|
|
69
|
+
}>, "many">>;
|
|
70
|
+
domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
71
|
+
message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
72
|
+
primaryType: z.ZodString;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
message: Record<string, unknown>;
|
|
75
|
+
types: Record<string, {
|
|
76
|
+
type: string;
|
|
77
|
+
name: string;
|
|
78
|
+
}[]>;
|
|
79
|
+
domain: Record<string, unknown>;
|
|
80
|
+
primaryType: string;
|
|
81
|
+
}, {
|
|
82
|
+
message: Record<string, unknown>;
|
|
83
|
+
types: Record<string, {
|
|
84
|
+
type: string;
|
|
85
|
+
name: string;
|
|
86
|
+
}[]>;
|
|
87
|
+
domain: Record<string, unknown>;
|
|
88
|
+
primaryType: string;
|
|
89
|
+
}>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
id: string;
|
|
92
|
+
signerAddress: string;
|
|
93
|
+
signMethod: "typedData";
|
|
94
|
+
typedData: {
|
|
95
|
+
message: Record<string, unknown>;
|
|
96
|
+
types: Record<string, {
|
|
97
|
+
type: string;
|
|
98
|
+
name: string;
|
|
99
|
+
}[]>;
|
|
100
|
+
domain: Record<string, unknown>;
|
|
101
|
+
primaryType: string;
|
|
102
|
+
};
|
|
103
|
+
description?: string | undefined;
|
|
104
|
+
metadata?: Record<string, unknown> | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
id: string;
|
|
107
|
+
signerAddress: string;
|
|
108
|
+
signMethod: "typedData";
|
|
109
|
+
typedData: {
|
|
110
|
+
message: Record<string, unknown>;
|
|
111
|
+
types: Record<string, {
|
|
112
|
+
type: string;
|
|
113
|
+
name: string;
|
|
114
|
+
}[]>;
|
|
115
|
+
domain: Record<string, unknown>;
|
|
116
|
+
primaryType: string;
|
|
117
|
+
};
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
metadata?: Record<string, unknown> | undefined;
|
|
120
|
+
}>, z.ZodObject<{
|
|
121
|
+
/** Unique identifier for this signature request */
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
/** Address of the signer (EOA) */
|
|
124
|
+
signerAddress: z.ZodString;
|
|
125
|
+
/** Human-readable description for the UI */
|
|
126
|
+
description: z.ZodOptional<z.ZodString>;
|
|
127
|
+
/** Generic key-value metadata for action-specific data */
|
|
128
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
|
+
} & {
|
|
130
|
+
signMethod: z.ZodLiteral<"message">;
|
|
131
|
+
/** Raw hash to be signed */
|
|
132
|
+
rawHash: z.ZodString;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
id: string;
|
|
135
|
+
signerAddress: string;
|
|
136
|
+
signMethod: "message";
|
|
137
|
+
rawHash: string;
|
|
138
|
+
description?: string | undefined;
|
|
139
|
+
metadata?: Record<string, unknown> | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
id: string;
|
|
142
|
+
signerAddress: string;
|
|
143
|
+
signMethod: "message";
|
|
144
|
+
rawHash: string;
|
|
145
|
+
description?: string | undefined;
|
|
146
|
+
metadata?: Record<string, unknown> | undefined;
|
|
147
|
+
}>]>;
|
|
148
|
+
export type SignatureRequest = z.infer<typeof SignatureRequestSchema>;
|
|
4
149
|
export declare const PendingToolCallSchema: z.ZodObject<{
|
|
5
150
|
type: z.ZodLiteral<"tool-call">;
|
|
6
151
|
toolCallId: z.ZodString;
|
|
@@ -95,6 +240,266 @@ export declare const PendingToolCallSchema: z.ZodObject<{
|
|
|
95
240
|
} | undefined;
|
|
96
241
|
};
|
|
97
242
|
type: "SingleTransaction";
|
|
243
|
+
}>, z.ZodObject<{
|
|
244
|
+
type: z.ZodLiteral<"SignatureRequests">;
|
|
245
|
+
value: z.ZodObject<{
|
|
246
|
+
signatureRequests: z.ZodArray<z.ZodDiscriminatedUnion<"signMethod", [z.ZodObject<{
|
|
247
|
+
/** Unique identifier for this signature request */
|
|
248
|
+
id: z.ZodString;
|
|
249
|
+
/** Address of the signer (EOA) */
|
|
250
|
+
signerAddress: z.ZodString;
|
|
251
|
+
/** Human-readable description for the UI */
|
|
252
|
+
description: z.ZodOptional<z.ZodString>;
|
|
253
|
+
/** Generic key-value metadata for action-specific data */
|
|
254
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
255
|
+
} & {
|
|
256
|
+
signMethod: z.ZodLiteral<"typedData">;
|
|
257
|
+
/** EIP-712 typed data to be signed */
|
|
258
|
+
typedData: z.ZodObject<{
|
|
259
|
+
types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
type: z.ZodString;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
type: string;
|
|
264
|
+
name: string;
|
|
265
|
+
}, {
|
|
266
|
+
type: string;
|
|
267
|
+
name: string;
|
|
268
|
+
}>, "many">>;
|
|
269
|
+
domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
270
|
+
message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
271
|
+
primaryType: z.ZodString;
|
|
272
|
+
}, "strip", z.ZodTypeAny, {
|
|
273
|
+
message: Record<string, unknown>;
|
|
274
|
+
types: Record<string, {
|
|
275
|
+
type: string;
|
|
276
|
+
name: string;
|
|
277
|
+
}[]>;
|
|
278
|
+
domain: Record<string, unknown>;
|
|
279
|
+
primaryType: string;
|
|
280
|
+
}, {
|
|
281
|
+
message: Record<string, unknown>;
|
|
282
|
+
types: Record<string, {
|
|
283
|
+
type: string;
|
|
284
|
+
name: string;
|
|
285
|
+
}[]>;
|
|
286
|
+
domain: Record<string, unknown>;
|
|
287
|
+
primaryType: string;
|
|
288
|
+
}>;
|
|
289
|
+
}, "strip", z.ZodTypeAny, {
|
|
290
|
+
id: string;
|
|
291
|
+
signerAddress: string;
|
|
292
|
+
signMethod: "typedData";
|
|
293
|
+
typedData: {
|
|
294
|
+
message: Record<string, unknown>;
|
|
295
|
+
types: Record<string, {
|
|
296
|
+
type: string;
|
|
297
|
+
name: string;
|
|
298
|
+
}[]>;
|
|
299
|
+
domain: Record<string, unknown>;
|
|
300
|
+
primaryType: string;
|
|
301
|
+
};
|
|
302
|
+
description?: string | undefined;
|
|
303
|
+
metadata?: Record<string, unknown> | undefined;
|
|
304
|
+
}, {
|
|
305
|
+
id: string;
|
|
306
|
+
signerAddress: string;
|
|
307
|
+
signMethod: "typedData";
|
|
308
|
+
typedData: {
|
|
309
|
+
message: Record<string, unknown>;
|
|
310
|
+
types: Record<string, {
|
|
311
|
+
type: string;
|
|
312
|
+
name: string;
|
|
313
|
+
}[]>;
|
|
314
|
+
domain: Record<string, unknown>;
|
|
315
|
+
primaryType: string;
|
|
316
|
+
};
|
|
317
|
+
description?: string | undefined;
|
|
318
|
+
metadata?: Record<string, unknown> | undefined;
|
|
319
|
+
}>, z.ZodObject<{
|
|
320
|
+
/** Unique identifier for this signature request */
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
/** Address of the signer (EOA) */
|
|
323
|
+
signerAddress: z.ZodString;
|
|
324
|
+
/** Human-readable description for the UI */
|
|
325
|
+
description: z.ZodOptional<z.ZodString>;
|
|
326
|
+
/** Generic key-value metadata for action-specific data */
|
|
327
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
328
|
+
} & {
|
|
329
|
+
signMethod: z.ZodLiteral<"message">;
|
|
330
|
+
/** Raw hash to be signed */
|
|
331
|
+
rawHash: z.ZodString;
|
|
332
|
+
}, "strip", z.ZodTypeAny, {
|
|
333
|
+
id: string;
|
|
334
|
+
signerAddress: string;
|
|
335
|
+
signMethod: "message";
|
|
336
|
+
rawHash: string;
|
|
337
|
+
description?: string | undefined;
|
|
338
|
+
metadata?: Record<string, unknown> | undefined;
|
|
339
|
+
}, {
|
|
340
|
+
id: string;
|
|
341
|
+
signerAddress: string;
|
|
342
|
+
signMethod: "message";
|
|
343
|
+
rawHash: string;
|
|
344
|
+
description?: string | undefined;
|
|
345
|
+
metadata?: Record<string, unknown> | undefined;
|
|
346
|
+
}>]>, "many">;
|
|
347
|
+
transactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
348
|
+
transaction: z.ZodType<PrepareTransactionRequestReturnType>;
|
|
349
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
350
|
+
explorerUrl: z.ZodOptional<z.ZodString>;
|
|
351
|
+
usdValue: z.ZodOptional<z.ZodString>;
|
|
352
|
+
}, "strip", z.ZodTypeAny, {
|
|
353
|
+
explorerUrl?: string | undefined;
|
|
354
|
+
usdValue?: string | undefined;
|
|
355
|
+
}, {
|
|
356
|
+
explorerUrl?: string | undefined;
|
|
357
|
+
usdValue?: string | undefined;
|
|
358
|
+
}>>;
|
|
359
|
+
}, "strip", z.ZodTypeAny, {
|
|
360
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
361
|
+
metadata?: {
|
|
362
|
+
explorerUrl?: string | undefined;
|
|
363
|
+
usdValue?: string | undefined;
|
|
364
|
+
} | undefined;
|
|
365
|
+
}, {
|
|
366
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
367
|
+
metadata?: {
|
|
368
|
+
explorerUrl?: string | undefined;
|
|
369
|
+
usdValue?: string | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
}>, "many">>;
|
|
372
|
+
}, "strip", z.ZodTypeAny, {
|
|
373
|
+
signatureRequests: ({
|
|
374
|
+
id: string;
|
|
375
|
+
signerAddress: string;
|
|
376
|
+
signMethod: "typedData";
|
|
377
|
+
typedData: {
|
|
378
|
+
message: Record<string, unknown>;
|
|
379
|
+
types: Record<string, {
|
|
380
|
+
type: string;
|
|
381
|
+
name: string;
|
|
382
|
+
}[]>;
|
|
383
|
+
domain: Record<string, unknown>;
|
|
384
|
+
primaryType: string;
|
|
385
|
+
};
|
|
386
|
+
description?: string | undefined;
|
|
387
|
+
metadata?: Record<string, unknown> | undefined;
|
|
388
|
+
} | {
|
|
389
|
+
id: string;
|
|
390
|
+
signerAddress: string;
|
|
391
|
+
signMethod: "message";
|
|
392
|
+
rawHash: string;
|
|
393
|
+
description?: string | undefined;
|
|
394
|
+
metadata?: Record<string, unknown> | undefined;
|
|
395
|
+
})[];
|
|
396
|
+
transactions?: {
|
|
397
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
398
|
+
metadata?: {
|
|
399
|
+
explorerUrl?: string | undefined;
|
|
400
|
+
usdValue?: string | undefined;
|
|
401
|
+
} | undefined;
|
|
402
|
+
}[] | undefined;
|
|
403
|
+
}, {
|
|
404
|
+
signatureRequests: ({
|
|
405
|
+
id: string;
|
|
406
|
+
signerAddress: string;
|
|
407
|
+
signMethod: "typedData";
|
|
408
|
+
typedData: {
|
|
409
|
+
message: Record<string, unknown>;
|
|
410
|
+
types: Record<string, {
|
|
411
|
+
type: string;
|
|
412
|
+
name: string;
|
|
413
|
+
}[]>;
|
|
414
|
+
domain: Record<string, unknown>;
|
|
415
|
+
primaryType: string;
|
|
416
|
+
};
|
|
417
|
+
description?: string | undefined;
|
|
418
|
+
metadata?: Record<string, unknown> | undefined;
|
|
419
|
+
} | {
|
|
420
|
+
id: string;
|
|
421
|
+
signerAddress: string;
|
|
422
|
+
signMethod: "message";
|
|
423
|
+
rawHash: string;
|
|
424
|
+
description?: string | undefined;
|
|
425
|
+
metadata?: Record<string, unknown> | undefined;
|
|
426
|
+
})[];
|
|
427
|
+
transactions?: {
|
|
428
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
429
|
+
metadata?: {
|
|
430
|
+
explorerUrl?: string | undefined;
|
|
431
|
+
usdValue?: string | undefined;
|
|
432
|
+
} | undefined;
|
|
433
|
+
}[] | undefined;
|
|
434
|
+
}>;
|
|
435
|
+
}, "strip", z.ZodTypeAny, {
|
|
436
|
+
value: {
|
|
437
|
+
signatureRequests: ({
|
|
438
|
+
id: string;
|
|
439
|
+
signerAddress: string;
|
|
440
|
+
signMethod: "typedData";
|
|
441
|
+
typedData: {
|
|
442
|
+
message: Record<string, unknown>;
|
|
443
|
+
types: Record<string, {
|
|
444
|
+
type: string;
|
|
445
|
+
name: string;
|
|
446
|
+
}[]>;
|
|
447
|
+
domain: Record<string, unknown>;
|
|
448
|
+
primaryType: string;
|
|
449
|
+
};
|
|
450
|
+
description?: string | undefined;
|
|
451
|
+
metadata?: Record<string, unknown> | undefined;
|
|
452
|
+
} | {
|
|
453
|
+
id: string;
|
|
454
|
+
signerAddress: string;
|
|
455
|
+
signMethod: "message";
|
|
456
|
+
rawHash: string;
|
|
457
|
+
description?: string | undefined;
|
|
458
|
+
metadata?: Record<string, unknown> | undefined;
|
|
459
|
+
})[];
|
|
460
|
+
transactions?: {
|
|
461
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
462
|
+
metadata?: {
|
|
463
|
+
explorerUrl?: string | undefined;
|
|
464
|
+
usdValue?: string | undefined;
|
|
465
|
+
} | undefined;
|
|
466
|
+
}[] | undefined;
|
|
467
|
+
};
|
|
468
|
+
type: "SignatureRequests";
|
|
469
|
+
}, {
|
|
470
|
+
value: {
|
|
471
|
+
signatureRequests: ({
|
|
472
|
+
id: string;
|
|
473
|
+
signerAddress: string;
|
|
474
|
+
signMethod: "typedData";
|
|
475
|
+
typedData: {
|
|
476
|
+
message: Record<string, unknown>;
|
|
477
|
+
types: Record<string, {
|
|
478
|
+
type: string;
|
|
479
|
+
name: string;
|
|
480
|
+
}[]>;
|
|
481
|
+
domain: Record<string, unknown>;
|
|
482
|
+
primaryType: string;
|
|
483
|
+
};
|
|
484
|
+
description?: string | undefined;
|
|
485
|
+
metadata?: Record<string, unknown> | undefined;
|
|
486
|
+
} | {
|
|
487
|
+
id: string;
|
|
488
|
+
signerAddress: string;
|
|
489
|
+
signMethod: "message";
|
|
490
|
+
rawHash: string;
|
|
491
|
+
description?: string | undefined;
|
|
492
|
+
metadata?: Record<string, unknown> | undefined;
|
|
493
|
+
})[];
|
|
494
|
+
transactions?: {
|
|
495
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
496
|
+
metadata?: {
|
|
497
|
+
explorerUrl?: string | undefined;
|
|
498
|
+
usdValue?: string | undefined;
|
|
499
|
+
} | undefined;
|
|
500
|
+
}[] | undefined;
|
|
501
|
+
};
|
|
502
|
+
type: "SignatureRequests";
|
|
98
503
|
}>]>;
|
|
99
504
|
}, "strict", z.ZodTypeAny, {
|
|
100
505
|
type: "tool-call";
|
|
@@ -116,6 +521,40 @@ export declare const PendingToolCallSchema: z.ZodObject<{
|
|
|
116
521
|
} | undefined;
|
|
117
522
|
};
|
|
118
523
|
type: "SingleTransaction";
|
|
524
|
+
} | {
|
|
525
|
+
value: {
|
|
526
|
+
signatureRequests: ({
|
|
527
|
+
id: string;
|
|
528
|
+
signerAddress: string;
|
|
529
|
+
signMethod: "typedData";
|
|
530
|
+
typedData: {
|
|
531
|
+
message: Record<string, unknown>;
|
|
532
|
+
types: Record<string, {
|
|
533
|
+
type: string;
|
|
534
|
+
name: string;
|
|
535
|
+
}[]>;
|
|
536
|
+
domain: Record<string, unknown>;
|
|
537
|
+
primaryType: string;
|
|
538
|
+
};
|
|
539
|
+
description?: string | undefined;
|
|
540
|
+
metadata?: Record<string, unknown> | undefined;
|
|
541
|
+
} | {
|
|
542
|
+
id: string;
|
|
543
|
+
signerAddress: string;
|
|
544
|
+
signMethod: "message";
|
|
545
|
+
rawHash: string;
|
|
546
|
+
description?: string | undefined;
|
|
547
|
+
metadata?: Record<string, unknown> | undefined;
|
|
548
|
+
})[];
|
|
549
|
+
transactions?: {
|
|
550
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
551
|
+
metadata?: {
|
|
552
|
+
explorerUrl?: string | undefined;
|
|
553
|
+
usdValue?: string | undefined;
|
|
554
|
+
} | undefined;
|
|
555
|
+
}[] | undefined;
|
|
556
|
+
};
|
|
557
|
+
type: "SignatureRequests";
|
|
119
558
|
};
|
|
120
559
|
toolCallId: string;
|
|
121
560
|
toolName: string;
|
|
@@ -139,6 +578,40 @@ export declare const PendingToolCallSchema: z.ZodObject<{
|
|
|
139
578
|
} | undefined;
|
|
140
579
|
};
|
|
141
580
|
type: "SingleTransaction";
|
|
581
|
+
} | {
|
|
582
|
+
value: {
|
|
583
|
+
signatureRequests: ({
|
|
584
|
+
id: string;
|
|
585
|
+
signerAddress: string;
|
|
586
|
+
signMethod: "typedData";
|
|
587
|
+
typedData: {
|
|
588
|
+
message: Record<string, unknown>;
|
|
589
|
+
types: Record<string, {
|
|
590
|
+
type: string;
|
|
591
|
+
name: string;
|
|
592
|
+
}[]>;
|
|
593
|
+
domain: Record<string, unknown>;
|
|
594
|
+
primaryType: string;
|
|
595
|
+
};
|
|
596
|
+
description?: string | undefined;
|
|
597
|
+
metadata?: Record<string, unknown> | undefined;
|
|
598
|
+
} | {
|
|
599
|
+
id: string;
|
|
600
|
+
signerAddress: string;
|
|
601
|
+
signMethod: "message";
|
|
602
|
+
rawHash: string;
|
|
603
|
+
description?: string | undefined;
|
|
604
|
+
metadata?: Record<string, unknown> | undefined;
|
|
605
|
+
})[];
|
|
606
|
+
transactions?: {
|
|
607
|
+
transaction: PrepareTransactionRequestReturnType;
|
|
608
|
+
metadata?: {
|
|
609
|
+
explorerUrl?: string | undefined;
|
|
610
|
+
usdValue?: string | undefined;
|
|
611
|
+
} | undefined;
|
|
612
|
+
}[] | undefined;
|
|
613
|
+
};
|
|
614
|
+
type: "SignatureRequests";
|
|
142
615
|
};
|
|
143
616
|
toolCallId: string;
|
|
144
617
|
toolName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/schemas/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wB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P-712 typed data structure for off-chain signatures
|
|
5
|
+
*/
|
|
6
|
+
export const EIP712TypedDataSchema = z.object({
|
|
7
|
+
types: z.record(z.array(z.object({
|
|
8
|
+
name: z.string(),
|
|
9
|
+
type: z.string(),
|
|
10
|
+
}))),
|
|
11
|
+
domain: z.record(z.unknown()),
|
|
12
|
+
message: z.record(z.unknown()),
|
|
13
|
+
primaryType: z.string(),
|
|
14
|
+
});
|
|
15
|
+
/** Common fields shared by all signature request types */
|
|
16
|
+
const SignatureRequestBaseSchema = z.object({
|
|
17
|
+
/** Unique identifier for this signature request */
|
|
18
|
+
id: z.string(),
|
|
19
|
+
/** Address of the signer (EOA) */
|
|
20
|
+
signerAddress: z.string(),
|
|
21
|
+
/** Human-readable description for the UI */
|
|
22
|
+
description: z.string().optional(),
|
|
23
|
+
/** Generic key-value metadata for action-specific data */
|
|
24
|
+
metadata: z.record(z.unknown()).optional(),
|
|
25
|
+
});
|
|
26
|
+
/** Signature request for EIP-712 typed data signing (eth_signTypedData_v4) */
|
|
27
|
+
const TypedDataSignatureRequestSchema = SignatureRequestBaseSchema.extend({
|
|
28
|
+
signMethod: z.literal("typedData"),
|
|
29
|
+
/** EIP-712 typed data to be signed */
|
|
30
|
+
typedData: EIP712TypedDataSchema,
|
|
31
|
+
});
|
|
32
|
+
/** Signature request for raw message signing (personal_sign) */
|
|
33
|
+
const MessageSignatureRequestSchema = SignatureRequestBaseSchema.extend({
|
|
34
|
+
signMethod: z.literal("message"),
|
|
35
|
+
/** Raw hash to be signed */
|
|
36
|
+
rawHash: z.string(),
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Generic signature request for off-chain signing.
|
|
40
|
+
* Used when an action requires the client to sign data.
|
|
41
|
+
*
|
|
42
|
+
* This is a discriminated union based on `signMethod`:
|
|
43
|
+
* - `signMethod: 'typedData'` requires `typedData` (EIP-712 typed data for eth_signTypedData_v4)
|
|
44
|
+
* - `signMethod: 'message'` requires `rawHash` (for personal_sign)
|
|
45
|
+
*/
|
|
46
|
+
export const SignatureRequestSchema = z.discriminatedUnion("signMethod", [
|
|
47
|
+
TypedDataSignatureRequestSchema,
|
|
48
|
+
MessageSignatureRequestSchema,
|
|
49
|
+
]);
|
|
3
50
|
export const PendingToolCallSchema = z
|
|
4
51
|
.object({
|
|
5
52
|
type: z.literal("tool-call"),
|
|
@@ -30,6 +77,23 @@ export const PendingToolCallSchema = z
|
|
|
30
77
|
.optional(),
|
|
31
78
|
}),
|
|
32
79
|
}),
|
|
80
|
+
z.object({
|
|
81
|
+
type: z.literal("SignatureRequests"),
|
|
82
|
+
value: z.object({
|
|
83
|
+
signatureRequests: z.array(SignatureRequestSchema),
|
|
84
|
+
transactions: z
|
|
85
|
+
.array(z.object({
|
|
86
|
+
transaction: z.unknown(),
|
|
87
|
+
metadata: z
|
|
88
|
+
.object({
|
|
89
|
+
explorerUrl: z.string().optional(),
|
|
90
|
+
usdValue: z.string().optional(),
|
|
91
|
+
})
|
|
92
|
+
.optional(),
|
|
93
|
+
}))
|
|
94
|
+
.optional(),
|
|
95
|
+
}),
|
|
96
|
+
}),
|
|
33
97
|
]),
|
|
34
98
|
})
|
|
35
99
|
.strict();
|