@illalabs/interfaces 0.23.0 → 0.24.1-canary-beta-60a2dc6d

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.
@@ -1,156 +1,529 @@
1
1
  import { z } from "zod";
2
2
  export declare const DeFiConfigSchema: z.ZodUnion<[z.ZodObject<{
3
- lending: z.ZodEnum<["aave"]>;
3
+ lending: z.ZodEnum<["aave", "morpho"]>;
4
4
  supply: z.ZodOptional<z.ZodNever>;
5
5
  withdraw: z.ZodOptional<z.ZodNever>;
6
6
  }, "strict", z.ZodTypeAny, {
7
- lending: "aave";
7
+ lending: "aave" | "morpho";
8
8
  supply?: undefined;
9
9
  withdraw?: undefined;
10
10
  }, {
11
- lending: "aave";
11
+ lending: "aave" | "morpho";
12
12
  supply?: undefined;
13
13
  withdraw?: undefined;
14
14
  }>, z.ZodObject<{
15
15
  lending: z.ZodOptional<z.ZodNever>;
16
- supply: z.ZodEnum<["aave"]>;
17
- withdraw: z.ZodEnum<["aave"]>;
16
+ supply: z.ZodEnum<["aave", "morpho"]>;
17
+ withdraw: z.ZodEnum<["aave", "morpho"]>;
18
18
  }, "strict", z.ZodTypeAny, {
19
- supply: "aave";
20
- withdraw: "aave";
19
+ supply: "aave" | "morpho";
20
+ withdraw: "aave" | "morpho";
21
21
  lending?: undefined;
22
22
  }, {
23
- supply: "aave";
24
- withdraw: "aave";
23
+ supply: "aave" | "morpho";
24
+ withdraw: "aave" | "morpho";
25
25
  lending?: undefined;
26
26
  }>]>;
27
27
  export declare const SwapBridgeProviderSchema: z.ZodEnum<["lifi", "aerodrome"]>;
28
+ /**
29
+ * Per-key allowlist over the full tool surface. When present on an
30
+ * {@link AutoRouterConfigSchema} it is authoritative: only the listed
31
+ * categories are built (an arbitrary subset, e.g. prediction-markets-only, or
32
+ * swap + balances with no transfer). When absent, the legacy `defi` /
33
+ * `swapOrBridge` fields drive the narrower custom tool set and the canonical
34
+ * full surface is unchanged.
35
+ *
36
+ * `transfer` / `balances` / `exchangeRate` / `resolveName` are boolean-only:
37
+ * they have no autorouter-selectable provider today.
38
+ */
39
+ export declare const ToolsAllowlistSchema: z.ZodObject<{
40
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
41
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
42
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
43
+ }, "strict", z.ZodTypeAny, {
44
+ provider?: "lifi" | "aerodrome" | undefined;
45
+ }, {
46
+ provider?: "lifi" | "aerodrome" | undefined;
47
+ }>]>>;
48
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
49
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ provider?: "lifi" | undefined;
52
+ }, {
53
+ provider?: "lifi" | undefined;
54
+ }>]>>;
55
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
56
+ provider: z.ZodOptional<z.ZodEnum<["aave", "morpho"]>>;
57
+ supply: z.ZodOptional<z.ZodBoolean>;
58
+ withdraw: z.ZodOptional<z.ZodBoolean>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ supply?: boolean | undefined;
61
+ withdraw?: boolean | undefined;
62
+ provider?: "aave" | "morpho" | undefined;
63
+ }, {
64
+ supply?: boolean | undefined;
65
+ withdraw?: boolean | undefined;
66
+ provider?: "aave" | "morpho" | undefined;
67
+ }>]>>;
68
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
69
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
70
+ }, "strict", z.ZodTypeAny, {
71
+ provider?: "polymarket" | undefined;
72
+ }, {
73
+ provider?: "polymarket" | undefined;
74
+ }>]>>;
75
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
76
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
77
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
78
+ }, "strict", z.ZodTypeAny, {
79
+ swap?: true | {
80
+ provider?: "lifi" | "aerodrome" | undefined;
81
+ } | undefined;
82
+ bridge?: true | {
83
+ provider?: "lifi" | undefined;
84
+ } | undefined;
85
+ transfer?: true | undefined;
86
+ exchangeRate?: true | undefined;
87
+ resolveName?: true | undefined;
88
+ lend?: true | {
89
+ supply?: boolean | undefined;
90
+ withdraw?: boolean | undefined;
91
+ provider?: "aave" | "morpho" | undefined;
92
+ } | undefined;
93
+ predictionMarkets?: true | {
94
+ provider?: "polymarket" | undefined;
95
+ } | undefined;
96
+ balances?: true | undefined;
97
+ }, {
98
+ swap?: true | {
99
+ provider?: "lifi" | "aerodrome" | undefined;
100
+ } | undefined;
101
+ bridge?: true | {
102
+ provider?: "lifi" | undefined;
103
+ } | undefined;
104
+ transfer?: true | undefined;
105
+ exchangeRate?: true | undefined;
106
+ resolveName?: true | undefined;
107
+ lend?: true | {
108
+ supply?: boolean | undefined;
109
+ withdraw?: boolean | undefined;
110
+ provider?: "aave" | "morpho" | undefined;
111
+ } | undefined;
112
+ predictionMarkets?: true | {
113
+ provider?: "polymarket" | undefined;
114
+ } | undefined;
115
+ balances?: true | undefined;
116
+ }>;
28
117
  export declare const AutoRouterConfigSchema: z.ZodObject<{
29
118
  defi: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
30
- lending: z.ZodEnum<["aave"]>;
119
+ lending: z.ZodEnum<["aave", "morpho"]>;
31
120
  supply: z.ZodOptional<z.ZodNever>;
32
121
  withdraw: z.ZodOptional<z.ZodNever>;
33
122
  }, "strict", z.ZodTypeAny, {
34
- lending: "aave";
123
+ lending: "aave" | "morpho";
35
124
  supply?: undefined;
36
125
  withdraw?: undefined;
37
126
  }, {
38
- lending: "aave";
127
+ lending: "aave" | "morpho";
39
128
  supply?: undefined;
40
129
  withdraw?: undefined;
41
130
  }>, z.ZodObject<{
42
131
  lending: z.ZodOptional<z.ZodNever>;
43
- supply: z.ZodEnum<["aave"]>;
44
- withdraw: z.ZodEnum<["aave"]>;
132
+ supply: z.ZodEnum<["aave", "morpho"]>;
133
+ withdraw: z.ZodEnum<["aave", "morpho"]>;
45
134
  }, "strict", z.ZodTypeAny, {
46
- supply: "aave";
47
- withdraw: "aave";
135
+ supply: "aave" | "morpho";
136
+ withdraw: "aave" | "morpho";
48
137
  lending?: undefined;
49
138
  }, {
50
- supply: "aave";
51
- withdraw: "aave";
139
+ supply: "aave" | "morpho";
140
+ withdraw: "aave" | "morpho";
52
141
  lending?: undefined;
53
142
  }>]>>;
54
143
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
144
+ tools: z.ZodOptional<z.ZodObject<{
145
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
146
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
147
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
148
+ }, "strict", z.ZodTypeAny, {
149
+ provider?: "lifi" | "aerodrome" | undefined;
150
+ }, {
151
+ provider?: "lifi" | "aerodrome" | undefined;
152
+ }>]>>;
153
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
154
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
155
+ }, "strict", z.ZodTypeAny, {
156
+ provider?: "lifi" | undefined;
157
+ }, {
158
+ provider?: "lifi" | undefined;
159
+ }>]>>;
160
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
161
+ provider: z.ZodOptional<z.ZodEnum<["aave", "morpho"]>>;
162
+ supply: z.ZodOptional<z.ZodBoolean>;
163
+ withdraw: z.ZodOptional<z.ZodBoolean>;
164
+ }, "strict", z.ZodTypeAny, {
165
+ supply?: boolean | undefined;
166
+ withdraw?: boolean | undefined;
167
+ provider?: "aave" | "morpho" | undefined;
168
+ }, {
169
+ supply?: boolean | undefined;
170
+ withdraw?: boolean | undefined;
171
+ provider?: "aave" | "morpho" | undefined;
172
+ }>]>>;
173
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
174
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
175
+ }, "strict", z.ZodTypeAny, {
176
+ provider?: "polymarket" | undefined;
177
+ }, {
178
+ provider?: "polymarket" | undefined;
179
+ }>]>>;
180
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
181
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
182
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
183
+ }, "strict", z.ZodTypeAny, {
184
+ swap?: true | {
185
+ provider?: "lifi" | "aerodrome" | undefined;
186
+ } | undefined;
187
+ bridge?: true | {
188
+ provider?: "lifi" | undefined;
189
+ } | undefined;
190
+ transfer?: true | undefined;
191
+ exchangeRate?: true | undefined;
192
+ resolveName?: true | undefined;
193
+ lend?: true | {
194
+ supply?: boolean | undefined;
195
+ withdraw?: boolean | undefined;
196
+ provider?: "aave" | "morpho" | undefined;
197
+ } | undefined;
198
+ predictionMarkets?: true | {
199
+ provider?: "polymarket" | undefined;
200
+ } | undefined;
201
+ balances?: true | undefined;
202
+ }, {
203
+ swap?: true | {
204
+ provider?: "lifi" | "aerodrome" | undefined;
205
+ } | undefined;
206
+ bridge?: true | {
207
+ provider?: "lifi" | undefined;
208
+ } | undefined;
209
+ transfer?: true | undefined;
210
+ exchangeRate?: true | undefined;
211
+ resolveName?: true | undefined;
212
+ lend?: true | {
213
+ supply?: boolean | undefined;
214
+ withdraw?: boolean | undefined;
215
+ provider?: "aave" | "morpho" | undefined;
216
+ } | undefined;
217
+ predictionMarkets?: true | {
218
+ provider?: "polymarket" | undefined;
219
+ } | undefined;
220
+ balances?: true | undefined;
221
+ }>>;
222
+ chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["Ethereum", "Polygon", "Optimism", "Base", "Arbitrum", "Avalanche", "BSC"]>, "many">>;
55
223
  }, "strict", z.ZodTypeAny, {
56
224
  defi?: {
57
- lending: "aave";
225
+ lending: "aave" | "morpho";
58
226
  supply?: undefined;
59
227
  withdraw?: undefined;
60
228
  } | {
61
- supply: "aave";
62
- withdraw: "aave";
229
+ supply: "aave" | "morpho";
230
+ withdraw: "aave" | "morpho";
63
231
  lending?: undefined;
64
232
  } | undefined;
65
233
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
234
+ tools?: {
235
+ swap?: true | {
236
+ provider?: "lifi" | "aerodrome" | undefined;
237
+ } | undefined;
238
+ bridge?: true | {
239
+ provider?: "lifi" | undefined;
240
+ } | undefined;
241
+ transfer?: true | undefined;
242
+ exchangeRate?: true | undefined;
243
+ resolveName?: true | undefined;
244
+ lend?: true | {
245
+ supply?: boolean | undefined;
246
+ withdraw?: boolean | undefined;
247
+ provider?: "aave" | "morpho" | undefined;
248
+ } | undefined;
249
+ predictionMarkets?: true | {
250
+ provider?: "polymarket" | undefined;
251
+ } | undefined;
252
+ balances?: true | undefined;
253
+ } | undefined;
254
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
66
255
  }, {
67
256
  defi?: {
68
- lending: "aave";
257
+ lending: "aave" | "morpho";
69
258
  supply?: undefined;
70
259
  withdraw?: undefined;
71
260
  } | {
72
- supply: "aave";
73
- withdraw: "aave";
261
+ supply: "aave" | "morpho";
262
+ withdraw: "aave" | "morpho";
74
263
  lending?: undefined;
75
264
  } | undefined;
76
265
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
266
+ tools?: {
267
+ swap?: true | {
268
+ provider?: "lifi" | "aerodrome" | undefined;
269
+ } | undefined;
270
+ bridge?: true | {
271
+ provider?: "lifi" | undefined;
272
+ } | undefined;
273
+ transfer?: true | undefined;
274
+ exchangeRate?: true | undefined;
275
+ resolveName?: true | undefined;
276
+ lend?: true | {
277
+ supply?: boolean | undefined;
278
+ withdraw?: boolean | undefined;
279
+ provider?: "aave" | "morpho" | undefined;
280
+ } | undefined;
281
+ predictionMarkets?: true | {
282
+ provider?: "polymarket" | undefined;
283
+ } | undefined;
284
+ balances?: true | undefined;
285
+ } | undefined;
286
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
77
287
  }>;
78
288
  export declare const ToolAutorouterSchema: z.ZodObject<{
79
289
  autoRouter: z.ZodOptional<z.ZodObject<{
80
290
  defi: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
81
- lending: z.ZodEnum<["aave"]>;
291
+ lending: z.ZodEnum<["aave", "morpho"]>;
82
292
  supply: z.ZodOptional<z.ZodNever>;
83
293
  withdraw: z.ZodOptional<z.ZodNever>;
84
294
  }, "strict", z.ZodTypeAny, {
85
- lending: "aave";
295
+ lending: "aave" | "morpho";
86
296
  supply?: undefined;
87
297
  withdraw?: undefined;
88
298
  }, {
89
- lending: "aave";
299
+ lending: "aave" | "morpho";
90
300
  supply?: undefined;
91
301
  withdraw?: undefined;
92
302
  }>, z.ZodObject<{
93
303
  lending: z.ZodOptional<z.ZodNever>;
94
- supply: z.ZodEnum<["aave"]>;
95
- withdraw: z.ZodEnum<["aave"]>;
304
+ supply: z.ZodEnum<["aave", "morpho"]>;
305
+ withdraw: z.ZodEnum<["aave", "morpho"]>;
96
306
  }, "strict", z.ZodTypeAny, {
97
- supply: "aave";
98
- withdraw: "aave";
307
+ supply: "aave" | "morpho";
308
+ withdraw: "aave" | "morpho";
99
309
  lending?: undefined;
100
310
  }, {
101
- supply: "aave";
102
- withdraw: "aave";
311
+ supply: "aave" | "morpho";
312
+ withdraw: "aave" | "morpho";
103
313
  lending?: undefined;
104
314
  }>]>>;
105
315
  swapOrBridge: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
316
+ tools: z.ZodOptional<z.ZodObject<{
317
+ transfer: z.ZodOptional<z.ZodLiteral<true>>;
318
+ swap: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
319
+ provider: z.ZodOptional<z.ZodEnum<["lifi", "aerodrome"]>>;
320
+ }, "strict", z.ZodTypeAny, {
321
+ provider?: "lifi" | "aerodrome" | undefined;
322
+ }, {
323
+ provider?: "lifi" | "aerodrome" | undefined;
324
+ }>]>>;
325
+ bridge: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
326
+ provider: z.ZodOptional<z.ZodEnum<["lifi"]>>;
327
+ }, "strict", z.ZodTypeAny, {
328
+ provider?: "lifi" | undefined;
329
+ }, {
330
+ provider?: "lifi" | undefined;
331
+ }>]>>;
332
+ lend: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
333
+ provider: z.ZodOptional<z.ZodEnum<["aave", "morpho"]>>;
334
+ supply: z.ZodOptional<z.ZodBoolean>;
335
+ withdraw: z.ZodOptional<z.ZodBoolean>;
336
+ }, "strict", z.ZodTypeAny, {
337
+ supply?: boolean | undefined;
338
+ withdraw?: boolean | undefined;
339
+ provider?: "aave" | "morpho" | undefined;
340
+ }, {
341
+ supply?: boolean | undefined;
342
+ withdraw?: boolean | undefined;
343
+ provider?: "aave" | "morpho" | undefined;
344
+ }>]>>;
345
+ predictionMarkets: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodObject<{
346
+ provider: z.ZodOptional<z.ZodEnum<["polymarket"]>>;
347
+ }, "strict", z.ZodTypeAny, {
348
+ provider?: "polymarket" | undefined;
349
+ }, {
350
+ provider?: "polymarket" | undefined;
351
+ }>]>>;
352
+ balances: z.ZodOptional<z.ZodLiteral<true>>;
353
+ exchangeRate: z.ZodOptional<z.ZodLiteral<true>>;
354
+ resolveName: z.ZodOptional<z.ZodLiteral<true>>;
355
+ }, "strict", z.ZodTypeAny, {
356
+ swap?: true | {
357
+ provider?: "lifi" | "aerodrome" | undefined;
358
+ } | undefined;
359
+ bridge?: true | {
360
+ provider?: "lifi" | undefined;
361
+ } | undefined;
362
+ transfer?: true | undefined;
363
+ exchangeRate?: true | undefined;
364
+ resolveName?: true | undefined;
365
+ lend?: true | {
366
+ supply?: boolean | undefined;
367
+ withdraw?: boolean | undefined;
368
+ provider?: "aave" | "morpho" | undefined;
369
+ } | undefined;
370
+ predictionMarkets?: true | {
371
+ provider?: "polymarket" | undefined;
372
+ } | undefined;
373
+ balances?: true | undefined;
374
+ }, {
375
+ swap?: true | {
376
+ provider?: "lifi" | "aerodrome" | undefined;
377
+ } | undefined;
378
+ bridge?: true | {
379
+ provider?: "lifi" | undefined;
380
+ } | undefined;
381
+ transfer?: true | undefined;
382
+ exchangeRate?: true | undefined;
383
+ resolveName?: true | undefined;
384
+ lend?: true | {
385
+ supply?: boolean | undefined;
386
+ withdraw?: boolean | undefined;
387
+ provider?: "aave" | "morpho" | undefined;
388
+ } | undefined;
389
+ predictionMarkets?: true | {
390
+ provider?: "polymarket" | undefined;
391
+ } | undefined;
392
+ balances?: true | undefined;
393
+ }>>;
394
+ chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["Ethereum", "Polygon", "Optimism", "Base", "Arbitrum", "Avalanche", "BSC"]>, "many">>;
106
395
  }, "strict", z.ZodTypeAny, {
107
396
  defi?: {
108
- lending: "aave";
397
+ lending: "aave" | "morpho";
109
398
  supply?: undefined;
110
399
  withdraw?: undefined;
111
400
  } | {
112
- supply: "aave";
113
- withdraw: "aave";
401
+ supply: "aave" | "morpho";
402
+ withdraw: "aave" | "morpho";
114
403
  lending?: undefined;
115
404
  } | undefined;
116
405
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
406
+ tools?: {
407
+ swap?: true | {
408
+ provider?: "lifi" | "aerodrome" | undefined;
409
+ } | undefined;
410
+ bridge?: true | {
411
+ provider?: "lifi" | undefined;
412
+ } | undefined;
413
+ transfer?: true | undefined;
414
+ exchangeRate?: true | undefined;
415
+ resolveName?: true | undefined;
416
+ lend?: true | {
417
+ supply?: boolean | undefined;
418
+ withdraw?: boolean | undefined;
419
+ provider?: "aave" | "morpho" | undefined;
420
+ } | undefined;
421
+ predictionMarkets?: true | {
422
+ provider?: "polymarket" | undefined;
423
+ } | undefined;
424
+ balances?: true | undefined;
425
+ } | undefined;
426
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
117
427
  }, {
118
428
  defi?: {
119
- lending: "aave";
429
+ lending: "aave" | "morpho";
120
430
  supply?: undefined;
121
431
  withdraw?: undefined;
122
432
  } | {
123
- supply: "aave";
124
- withdraw: "aave";
433
+ supply: "aave" | "morpho";
434
+ withdraw: "aave" | "morpho";
125
435
  lending?: undefined;
126
436
  } | undefined;
127
437
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
438
+ tools?: {
439
+ swap?: true | {
440
+ provider?: "lifi" | "aerodrome" | undefined;
441
+ } | undefined;
442
+ bridge?: true | {
443
+ provider?: "lifi" | undefined;
444
+ } | undefined;
445
+ transfer?: true | undefined;
446
+ exchangeRate?: true | undefined;
447
+ resolveName?: true | undefined;
448
+ lend?: true | {
449
+ supply?: boolean | undefined;
450
+ withdraw?: boolean | undefined;
451
+ provider?: "aave" | "morpho" | undefined;
452
+ } | undefined;
453
+ predictionMarkets?: true | {
454
+ provider?: "polymarket" | undefined;
455
+ } | undefined;
456
+ balances?: true | undefined;
457
+ } | undefined;
458
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
128
459
  }>>;
129
460
  }, "strict", z.ZodTypeAny, {
130
461
  autoRouter?: {
131
462
  defi?: {
132
- lending: "aave";
463
+ lending: "aave" | "morpho";
133
464
  supply?: undefined;
134
465
  withdraw?: undefined;
135
466
  } | {
136
- supply: "aave";
137
- withdraw: "aave";
467
+ supply: "aave" | "morpho";
468
+ withdraw: "aave" | "morpho";
138
469
  lending?: undefined;
139
470
  } | undefined;
140
471
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
472
+ tools?: {
473
+ swap?: true | {
474
+ provider?: "lifi" | "aerodrome" | undefined;
475
+ } | undefined;
476
+ bridge?: true | {
477
+ provider?: "lifi" | undefined;
478
+ } | undefined;
479
+ transfer?: true | undefined;
480
+ exchangeRate?: true | undefined;
481
+ resolveName?: true | undefined;
482
+ lend?: true | {
483
+ supply?: boolean | undefined;
484
+ withdraw?: boolean | undefined;
485
+ provider?: "aave" | "morpho" | undefined;
486
+ } | undefined;
487
+ predictionMarkets?: true | {
488
+ provider?: "polymarket" | undefined;
489
+ } | undefined;
490
+ balances?: true | undefined;
491
+ } | undefined;
492
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
141
493
  } | undefined;
142
494
  }, {
143
495
  autoRouter?: {
144
496
  defi?: {
145
- lending: "aave";
497
+ lending: "aave" | "morpho";
146
498
  supply?: undefined;
147
499
  withdraw?: undefined;
148
500
  } | {
149
- supply: "aave";
150
- withdraw: "aave";
501
+ supply: "aave" | "morpho";
502
+ withdraw: "aave" | "morpho";
151
503
  lending?: undefined;
152
504
  } | undefined;
153
505
  swapOrBridge?: "lifi" | "aerodrome" | undefined;
506
+ tools?: {
507
+ swap?: true | {
508
+ provider?: "lifi" | "aerodrome" | undefined;
509
+ } | undefined;
510
+ bridge?: true | {
511
+ provider?: "lifi" | undefined;
512
+ } | undefined;
513
+ transfer?: true | undefined;
514
+ exchangeRate?: true | undefined;
515
+ resolveName?: true | undefined;
516
+ lend?: true | {
517
+ supply?: boolean | undefined;
518
+ withdraw?: boolean | undefined;
519
+ provider?: "aave" | "morpho" | undefined;
520
+ } | undefined;
521
+ predictionMarkets?: true | {
522
+ provider?: "polymarket" | undefined;
523
+ } | undefined;
524
+ balances?: true | undefined;
525
+ } | undefined;
526
+ chains?: ("Ethereum" | "Polygon" | "Optimism" | "Base" | "Arbitrum" | "Avalanche" | "BSC")[] | undefined;
154
527
  } | undefined;
155
528
  }>;
156
529
  //# sourceMappingURL=toolAutorouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;IAAkD,CAAC;AAGhF,eAAO,MAAM,wBAAwB,kCAAgC,CAAC;AAGtE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpB,CAAC"}
1
+ {"version":3,"file":"toolAutorouter.d.ts","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;IAAkD,CAAC;AAGhF,eAAO,MAAM,wBAAwB,kCAAgC,CAAC;AA0CtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAYd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { LENDING_PROVIDERS, SWAP_BRIDGE_PROVIDERS } from "../utils/constants.js";
2
+ import { LENDING_PROVIDERS, PREDICTION_MARKET_PROVIDERS, SUPPORTED_BRIDGE_PROVIDERS, SUPPORTED_CHAIN_NAMES, SUPPORTED_SWAP_PROVIDERS, SWAP_BRIDGE_PROVIDERS, } from "../utils/constants.js";
3
3
  // Define the Zod schema for LendingProvider
4
4
  const LendingProviderSchema = z.enum(LENDING_PROVIDERS);
5
5
  // Define the schemas for DeFi configuration
@@ -21,11 +21,79 @@ const ActionsOnlySchema = z
21
21
  export const DeFiConfigSchema = z.union([LendingOnlySchema, ActionsOnlySchema]);
22
22
  // Define the Zod schema for SwapBridgeProvider
23
23
  export const SwapBridgeProviderSchema = z.enum(SWAP_BRIDGE_PROVIDERS);
24
+ // ===== Per-key tool category allowlist =====
25
+ //
26
+ // Each category value is `true` (enable with the server's default provider[s])
27
+ // or an object that pins a provider. Categories whose tools route to a single
28
+ // provider today (`bridge` -> lifi, `lend` -> aave, `predictionMarkets` ->
29
+ // polymarket) still accept a `provider` for forward-compatibility; only `swap`
30
+ // (lifi/aerodrome) has a runtime-meaningful choice, enforced at the swap tool's
31
+ // `protocol` enum.
32
+ const SwapCategorySchema = z.union([
33
+ z.literal(true),
34
+ z.object({ provider: z.enum(SUPPORTED_SWAP_PROVIDERS).optional() }).strict(),
35
+ ]);
36
+ const BridgeCategorySchema = z.union([
37
+ z.literal(true),
38
+ z.object({ provider: z.enum(SUPPORTED_BRIDGE_PROVIDERS).optional() }).strict(),
39
+ ]);
40
+ /**
41
+ * Lending category. Read (listings/positions) is implied whenever `lend` is
42
+ * present; `supply`/`withdraw` default to enabled and can be turned off
43
+ * individually to express, for example, a read-only lending key.
44
+ */
45
+ const LendCategorySchema = z.union([
46
+ z.literal(true),
47
+ z
48
+ .object({
49
+ provider: LendingProviderSchema.optional(),
50
+ supply: z.boolean().optional(),
51
+ withdraw: z.boolean().optional(),
52
+ })
53
+ .strict(),
54
+ ]);
55
+ const PredictionMarketsCategorySchema = z.union([
56
+ z.literal(true),
57
+ z.object({ provider: z.enum(PREDICTION_MARKET_PROVIDERS).optional() }).strict(),
58
+ ]);
59
+ /**
60
+ * Per-key allowlist over the full tool surface. When present on an
61
+ * {@link AutoRouterConfigSchema} it is authoritative: only the listed
62
+ * categories are built (an arbitrary subset, e.g. prediction-markets-only, or
63
+ * swap + balances with no transfer). When absent, the legacy `defi` /
64
+ * `swapOrBridge` fields drive the narrower custom tool set and the canonical
65
+ * full surface is unchanged.
66
+ *
67
+ * `transfer` / `balances` / `exchangeRate` / `resolveName` are boolean-only:
68
+ * they have no autorouter-selectable provider today.
69
+ */
70
+ export const ToolsAllowlistSchema = z
71
+ .object({
72
+ transfer: z.literal(true).optional(),
73
+ swap: SwapCategorySchema.optional(),
74
+ bridge: BridgeCategorySchema.optional(),
75
+ lend: LendCategorySchema.optional(),
76
+ predictionMarkets: PredictionMarketsCategorySchema.optional(),
77
+ balances: z.literal(true).optional(),
78
+ exchangeRate: z.literal(true).optional(),
79
+ resolveName: z.literal(true).optional(),
80
+ })
81
+ .strict();
82
+ /**
83
+ * Optional per-key chain allowlist, orthogonal to the provider/tool filters
84
+ * above. When set, every resolved tool is restricted to these chains (the
85
+ * tool's `chain` enum is narrowed), independent of which providers/categories
86
+ * are enabled. A chain-only config (no `tools`/`defi`/`swapOrBridge`) keeps the
87
+ * full tool surface, just limited to these chains.
88
+ */
89
+ const ChainAllowlistSchema = z.array(z.enum(SUPPORTED_CHAIN_NAMES)).min(1);
24
90
  // Define the main AutoRouterConfig schema
25
91
  export const AutoRouterConfigSchema = z
26
92
  .object({
27
93
  defi: DeFiConfigSchema.optional(),
28
94
  swapOrBridge: SwapBridgeProviderSchema.optional(),
95
+ tools: ToolsAllowlistSchema.optional(),
96
+ chains: ChainAllowlistSchema.optional(),
29
97
  })
30
98
  .strict();
31
99
  // Define the Zod schema for ToolAutorouter
@@ -1 +1 @@
1
- {"version":3,"file":"toolAutorouter.js","sourceRoot":"","sources":["../../src/schemas/toolAutorouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,4CAA4C;AAC5C,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAExD,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC;KACtB,MAAM,CAAC;IACJ,OAAO,EAAE,qBAAqB;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC;KACD,MAAM,EAAE,CAAC;AAEd,MAAM,iBAAiB,GAAG,CAAC;KACtB,MAAM,CAAC;IACJ,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,qBAAqB;IAC7B,QAAQ,EAAE,qBAAqB;CAClC,CAAC;KACD,MAAM,EAAE,CAAC;AAEd,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEhF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAEtE,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAA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