web3agent 0.1.0 → 0.2.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.
@@ -0,0 +1,1450 @@
1
+ import { Chain } from 'viem';
2
+ import { z } from 'zod';
3
+ import { W as Web3AgentRuntime, a as WalletState, R as RuntimeHealth, b as RuntimeConfig } from './types-B_VpZGqQ.js';
4
+ export { C as CreateRuntimeOptions, c as RuntimeToolListener, T as ToolCatalogEntry, d as ToolCategory, e as ToolErrorPayload, f as ToolResultError, g as ToolResultPayload, h as ToolSource, i as ToolSuccessPayload } from './types-B_VpZGqQ.js';
5
+ export { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
6
+
7
+ /**
8
+ * Well-known token registry — canonical contract addresses for major tokens
9
+ * across all chains supported by web3agent.
10
+ *
11
+ * Sources: Official project docs, CoinGecko, chain explorers.
12
+ * Only tokens with high confidence (verified contracts, high TVL) are included.
13
+ *
14
+ * To add a token: append to the chain's entry with verified address + decimals.
15
+ */
16
+ interface TokenEntry {
17
+ address: string;
18
+ decimals: number;
19
+ name: string;
20
+ symbol: string;
21
+ }
22
+
23
+ interface ResolvedToken extends TokenEntry {
24
+ chainId: number;
25
+ source: "registry" | "dexscreener";
26
+ note?: string;
27
+ warnings?: string[];
28
+ }
29
+
30
+ declare const typedDataPayloadSchema: z.ZodObject<{
31
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
32
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
33
+ name: z.ZodString;
34
+ type: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ name: string;
37
+ type: string;
38
+ }, {
39
+ name: string;
40
+ type: string;
41
+ }>, "many">>;
42
+ primaryType: z.ZodString;
43
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ message: Record<string, unknown>;
46
+ types: Record<string, {
47
+ name: string;
48
+ type: string;
49
+ }[]>;
50
+ primaryType: string;
51
+ domain: Record<string, unknown>;
52
+ }, {
53
+ message: Record<string, unknown>;
54
+ types: Record<string, {
55
+ name: string;
56
+ type: string;
57
+ }[]>;
58
+ primaryType: string;
59
+ domain: Record<string, unknown>;
60
+ }>;
61
+ declare const preparedTransactionRequestSchema: z.ZodObject<{
62
+ to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
63
+ chainId: z.ZodNumber;
64
+ data: z.ZodOptional<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
65
+ value: z.ZodOptional<z.ZodString>;
66
+ gasLimit: z.ZodOptional<z.ZodString>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ to: `0x${string}`;
69
+ chainId: number;
70
+ data?: `0x${string}` | undefined;
71
+ value?: string | undefined;
72
+ gasLimit?: string | undefined;
73
+ }, {
74
+ to: `0x${string}`;
75
+ chainId: number;
76
+ data?: `0x${string}` | undefined;
77
+ value?: string | undefined;
78
+ gasLimit?: string | undefined;
79
+ }>;
80
+ declare const preparedTransactionActionSchema: z.ZodObject<{
81
+ id: z.ZodString;
82
+ type: z.ZodLiteral<"transaction">;
83
+ label: z.ZodString;
84
+ tx: z.ZodObject<{
85
+ to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
86
+ chainId: z.ZodNumber;
87
+ data: z.ZodOptional<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
88
+ value: z.ZodOptional<z.ZodString>;
89
+ gasLimit: z.ZodOptional<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ to: `0x${string}`;
92
+ chainId: number;
93
+ data?: `0x${string}` | undefined;
94
+ value?: string | undefined;
95
+ gasLimit?: string | undefined;
96
+ }, {
97
+ to: `0x${string}`;
98
+ chainId: number;
99
+ data?: `0x${string}` | undefined;
100
+ value?: string | undefined;
101
+ gasLimit?: string | undefined;
102
+ }>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ id: string;
105
+ type: "transaction";
106
+ label: string;
107
+ tx: {
108
+ to: `0x${string}`;
109
+ chainId: number;
110
+ data?: `0x${string}` | undefined;
111
+ value?: string | undefined;
112
+ gasLimit?: string | undefined;
113
+ };
114
+ }, {
115
+ id: string;
116
+ type: "transaction";
117
+ label: string;
118
+ tx: {
119
+ to: `0x${string}`;
120
+ chainId: number;
121
+ data?: `0x${string}` | undefined;
122
+ value?: string | undefined;
123
+ gasLimit?: string | undefined;
124
+ };
125
+ }>;
126
+ declare const preparedSignTypedDataActionSchema: z.ZodObject<{
127
+ id: z.ZodString;
128
+ type: z.ZodLiteral<"signTypedData">;
129
+ label: z.ZodString;
130
+ chainId: z.ZodNumber;
131
+ eip712: z.ZodObject<{
132
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
133
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
134
+ name: z.ZodString;
135
+ type: z.ZodString;
136
+ }, "strip", z.ZodTypeAny, {
137
+ name: string;
138
+ type: string;
139
+ }, {
140
+ name: string;
141
+ type: string;
142
+ }>, "many">>;
143
+ primaryType: z.ZodString;
144
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ message: Record<string, unknown>;
147
+ types: Record<string, {
148
+ name: string;
149
+ type: string;
150
+ }[]>;
151
+ primaryType: string;
152
+ domain: Record<string, unknown>;
153
+ }, {
154
+ message: Record<string, unknown>;
155
+ types: Record<string, {
156
+ name: string;
157
+ type: string;
158
+ }[]>;
159
+ primaryType: string;
160
+ domain: Record<string, unknown>;
161
+ }>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ id: string;
164
+ type: "signTypedData";
165
+ chainId: number;
166
+ label: string;
167
+ eip712: {
168
+ message: Record<string, unknown>;
169
+ types: Record<string, {
170
+ name: string;
171
+ type: string;
172
+ }[]>;
173
+ primaryType: string;
174
+ domain: Record<string, unknown>;
175
+ };
176
+ }, {
177
+ id: string;
178
+ type: "signTypedData";
179
+ chainId: number;
180
+ label: string;
181
+ eip712: {
182
+ message: Record<string, unknown>;
183
+ types: Record<string, {
184
+ name: string;
185
+ type: string;
186
+ }[]>;
187
+ primaryType: string;
188
+ domain: Record<string, unknown>;
189
+ };
190
+ }>;
191
+ declare const preparedSignMessageActionSchema: z.ZodObject<{
192
+ id: z.ZodString;
193
+ type: z.ZodLiteral<"signMessage">;
194
+ label: z.ZodString;
195
+ chainId: z.ZodNumber;
196
+ message: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ id: string;
199
+ type: "signMessage";
200
+ chainId: number;
201
+ message: string;
202
+ label: string;
203
+ }, {
204
+ id: string;
205
+ type: "signMessage";
206
+ chainId: number;
207
+ message: string;
208
+ label: string;
209
+ }>;
210
+ declare const preparedActionSchema: z.ZodUnion<[z.ZodObject<{
211
+ id: z.ZodString;
212
+ type: z.ZodLiteral<"transaction">;
213
+ label: z.ZodString;
214
+ tx: z.ZodObject<{
215
+ to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
216
+ chainId: z.ZodNumber;
217
+ data: z.ZodOptional<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
218
+ value: z.ZodOptional<z.ZodString>;
219
+ gasLimit: z.ZodOptional<z.ZodString>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ to: `0x${string}`;
222
+ chainId: number;
223
+ data?: `0x${string}` | undefined;
224
+ value?: string | undefined;
225
+ gasLimit?: string | undefined;
226
+ }, {
227
+ to: `0x${string}`;
228
+ chainId: number;
229
+ data?: `0x${string}` | undefined;
230
+ value?: string | undefined;
231
+ gasLimit?: string | undefined;
232
+ }>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ id: string;
235
+ type: "transaction";
236
+ label: string;
237
+ tx: {
238
+ to: `0x${string}`;
239
+ chainId: number;
240
+ data?: `0x${string}` | undefined;
241
+ value?: string | undefined;
242
+ gasLimit?: string | undefined;
243
+ };
244
+ }, {
245
+ id: string;
246
+ type: "transaction";
247
+ label: string;
248
+ tx: {
249
+ to: `0x${string}`;
250
+ chainId: number;
251
+ data?: `0x${string}` | undefined;
252
+ value?: string | undefined;
253
+ gasLimit?: string | undefined;
254
+ };
255
+ }>, z.ZodObject<{
256
+ id: z.ZodString;
257
+ type: z.ZodLiteral<"signTypedData">;
258
+ label: z.ZodString;
259
+ chainId: z.ZodNumber;
260
+ eip712: z.ZodObject<{
261
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
262
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
263
+ name: z.ZodString;
264
+ type: z.ZodString;
265
+ }, "strip", z.ZodTypeAny, {
266
+ name: string;
267
+ type: string;
268
+ }, {
269
+ name: string;
270
+ type: string;
271
+ }>, "many">>;
272
+ primaryType: z.ZodString;
273
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ message: Record<string, unknown>;
276
+ types: Record<string, {
277
+ name: string;
278
+ type: string;
279
+ }[]>;
280
+ primaryType: string;
281
+ domain: Record<string, unknown>;
282
+ }, {
283
+ message: Record<string, unknown>;
284
+ types: Record<string, {
285
+ name: string;
286
+ type: string;
287
+ }[]>;
288
+ primaryType: string;
289
+ domain: Record<string, unknown>;
290
+ }>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ id: string;
293
+ type: "signTypedData";
294
+ chainId: number;
295
+ label: string;
296
+ eip712: {
297
+ message: Record<string, unknown>;
298
+ types: Record<string, {
299
+ name: string;
300
+ type: string;
301
+ }[]>;
302
+ primaryType: string;
303
+ domain: Record<string, unknown>;
304
+ };
305
+ }, {
306
+ id: string;
307
+ type: "signTypedData";
308
+ chainId: number;
309
+ label: string;
310
+ eip712: {
311
+ message: Record<string, unknown>;
312
+ types: Record<string, {
313
+ name: string;
314
+ type: string;
315
+ }[]>;
316
+ primaryType: string;
317
+ domain: Record<string, unknown>;
318
+ };
319
+ }>, z.ZodObject<{
320
+ id: z.ZodString;
321
+ type: z.ZodLiteral<"signMessage">;
322
+ label: z.ZodString;
323
+ chainId: z.ZodNumber;
324
+ message: z.ZodString;
325
+ }, "strip", z.ZodTypeAny, {
326
+ id: string;
327
+ type: "signMessage";
328
+ chainId: number;
329
+ message: string;
330
+ label: string;
331
+ }, {
332
+ id: string;
333
+ type: "signMessage";
334
+ chainId: number;
335
+ message: string;
336
+ label: string;
337
+ }>]>;
338
+ declare const operationActionResultSchema: z.ZodUnion<[z.ZodObject<{
339
+ type: z.ZodLiteral<"transaction">;
340
+ txHash: z.ZodString;
341
+ status: z.ZodLiteral<"confirmed">;
342
+ }, "strip", z.ZodTypeAny, {
343
+ type: "transaction";
344
+ status: "confirmed";
345
+ txHash: string;
346
+ }, {
347
+ type: "transaction";
348
+ status: "confirmed";
349
+ txHash: string;
350
+ }>, z.ZodObject<{
351
+ type: z.ZodLiteral<"signature">;
352
+ signature: z.ZodString;
353
+ }, "strip", z.ZodTypeAny, {
354
+ type: "signature";
355
+ signature: string;
356
+ }, {
357
+ type: "signature";
358
+ signature: string;
359
+ }>, z.ZodObject<{
360
+ type: z.ZodLiteral<"messageSignature">;
361
+ signature: z.ZodString;
362
+ }, "strip", z.ZodTypeAny, {
363
+ type: "messageSignature";
364
+ signature: string;
365
+ }, {
366
+ type: "messageSignature";
367
+ signature: string;
368
+ }>]>;
369
+
370
+ declare const lifiGetQuoteSchema: z.ZodObject<{
371
+ fromChainId: z.ZodNumber;
372
+ toChainId: z.ZodNumber;
373
+ fromTokenAddress: z.ZodString;
374
+ toTokenAddress: z.ZodString;
375
+ fromAmount: z.ZodString;
376
+ }, "strip", z.ZodTypeAny, {
377
+ fromChainId: number;
378
+ toChainId: number;
379
+ fromTokenAddress: string;
380
+ toTokenAddress: string;
381
+ fromAmount: string;
382
+ }, {
383
+ fromChainId: number;
384
+ toChainId: number;
385
+ fromTokenAddress: string;
386
+ toTokenAddress: string;
387
+ fromAmount: string;
388
+ }>;
389
+ declare const lifiExecuteBridgeSchema: z.ZodObject<{
390
+ fromChainId: z.ZodNumber;
391
+ toChainId: z.ZodNumber;
392
+ fromTokenAddress: z.ZodString;
393
+ toTokenAddress: z.ZodString;
394
+ fromAmount: z.ZodString;
395
+ }, "strip", z.ZodTypeAny, {
396
+ fromChainId: number;
397
+ toChainId: number;
398
+ fromTokenAddress: string;
399
+ toTokenAddress: string;
400
+ fromAmount: string;
401
+ }, {
402
+ fromChainId: number;
403
+ toChainId: number;
404
+ fromTokenAddress: string;
405
+ toTokenAddress: string;
406
+ fromAmount: string;
407
+ }>;
408
+ declare const lifiPrepareBridgeIntentSchema: z.ZodObject<{
409
+ fromChainId: z.ZodNumber;
410
+ toChainId: z.ZodNumber;
411
+ fromTokenAddress: z.ZodString;
412
+ toTokenAddress: z.ZodString;
413
+ fromAmount: z.ZodString;
414
+ } & {
415
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
416
+ approvalAmount: z.ZodOptional<z.ZodString>;
417
+ }, "strip", z.ZodTypeAny, {
418
+ account: `0x${string}`;
419
+ fromChainId: number;
420
+ toChainId: number;
421
+ fromTokenAddress: string;
422
+ toTokenAddress: string;
423
+ fromAmount: string;
424
+ approvalAmount?: string | undefined;
425
+ }, {
426
+ account: `0x${string}`;
427
+ fromChainId: number;
428
+ toChainId: number;
429
+ fromTokenAddress: string;
430
+ toTokenAddress: string;
431
+ fromAmount: string;
432
+ approvalAmount?: string | undefined;
433
+ }>;
434
+
435
+ declare const operationResumeStateSchema: z.ZodObject<{
436
+ version: z.ZodLiteral<1>;
437
+ integration: z.ZodEnum<["orbs", "lifi", "goat"]>;
438
+ kind: z.ZodString;
439
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ version: 1;
442
+ state: Record<string, unknown>;
443
+ kind: string;
444
+ integration: "goat" | "lifi" | "orbs";
445
+ }, {
446
+ version: 1;
447
+ state: Record<string, unknown>;
448
+ kind: string;
449
+ integration: "goat" | "lifi" | "orbs";
450
+ }>;
451
+ declare const prepareOperationSchema: z.ZodUnion<[z.ZodObject<{
452
+ chainId: z.ZodOptional<z.ZodNumber>;
453
+ fromToken: z.ZodString;
454
+ toToken: z.ZodString;
455
+ inAmount: z.ZodString;
456
+ slippage: z.ZodOptional<z.ZodNumber>;
457
+ } & {
458
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
459
+ } & {
460
+ integration: z.ZodLiteral<"orbs">;
461
+ kind: z.ZodLiteral<"swap">;
462
+ }, "strip", z.ZodTypeAny, {
463
+ account: `0x${string}`;
464
+ fromToken: string;
465
+ toToken: string;
466
+ inAmount: string;
467
+ kind: "swap";
468
+ integration: "orbs";
469
+ chainId?: number | undefined;
470
+ slippage?: number | undefined;
471
+ }, {
472
+ account: `0x${string}`;
473
+ fromToken: string;
474
+ toToken: string;
475
+ inAmount: string;
476
+ kind: "swap";
477
+ integration: "orbs";
478
+ chainId?: number | undefined;
479
+ slippage?: number | undefined;
480
+ }>, z.ZodObject<{
481
+ chainId: z.ZodOptional<z.ZodNumber>;
482
+ srcToken: z.ZodString;
483
+ dstToken: z.ZodString;
484
+ srcAmount: z.ZodString;
485
+ chunks: z.ZodNumber;
486
+ fillDelay: z.ZodNumber;
487
+ } & {
488
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
489
+ } & {
490
+ integration: z.ZodLiteral<"orbs">;
491
+ kind: z.ZodLiteral<"twap">;
492
+ }, "strip", z.ZodTypeAny, {
493
+ account: `0x${string}`;
494
+ srcToken: string;
495
+ dstToken: string;
496
+ srcAmount: string;
497
+ chunks: number;
498
+ fillDelay: number;
499
+ kind: "twap";
500
+ integration: "orbs";
501
+ chainId?: number | undefined;
502
+ }, {
503
+ account: `0x${string}`;
504
+ srcToken: string;
505
+ dstToken: string;
506
+ srcAmount: string;
507
+ chunks: number;
508
+ fillDelay: number;
509
+ kind: "twap";
510
+ integration: "orbs";
511
+ chainId?: number | undefined;
512
+ }>, z.ZodObject<{
513
+ chainId: z.ZodOptional<z.ZodNumber>;
514
+ srcToken: z.ZodString;
515
+ dstToken: z.ZodString;
516
+ srcAmount: z.ZodString;
517
+ dstMinAmount: z.ZodString;
518
+ expiry: z.ZodOptional<z.ZodNumber>;
519
+ } & {
520
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
521
+ } & {
522
+ integration: z.ZodLiteral<"orbs">;
523
+ kind: z.ZodLiteral<"limit">;
524
+ }, "strip", z.ZodTypeAny, {
525
+ account: `0x${string}`;
526
+ srcToken: string;
527
+ dstToken: string;
528
+ srcAmount: string;
529
+ dstMinAmount: string;
530
+ kind: "limit";
531
+ integration: "orbs";
532
+ chainId?: number | undefined;
533
+ expiry?: number | undefined;
534
+ }, {
535
+ account: `0x${string}`;
536
+ srcToken: string;
537
+ dstToken: string;
538
+ srcAmount: string;
539
+ dstMinAmount: string;
540
+ kind: "limit";
541
+ integration: "orbs";
542
+ chainId?: number | undefined;
543
+ expiry?: number | undefined;
544
+ }>, z.ZodObject<{
545
+ fromChainId: z.ZodNumber;
546
+ toChainId: z.ZodNumber;
547
+ fromTokenAddress: z.ZodString;
548
+ toTokenAddress: z.ZodString;
549
+ fromAmount: z.ZodString;
550
+ } & {
551
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
552
+ approvalAmount: z.ZodOptional<z.ZodString>;
553
+ } & {
554
+ integration: z.ZodLiteral<"lifi">;
555
+ kind: z.ZodLiteral<"bridge">;
556
+ }, "strip", z.ZodTypeAny, {
557
+ account: `0x${string}`;
558
+ fromChainId: number;
559
+ toChainId: number;
560
+ fromTokenAddress: string;
561
+ toTokenAddress: string;
562
+ fromAmount: string;
563
+ kind: "bridge";
564
+ integration: "lifi";
565
+ approvalAmount?: string | undefined;
566
+ }, {
567
+ account: `0x${string}`;
568
+ fromChainId: number;
569
+ toChainId: number;
570
+ fromTokenAddress: string;
571
+ toTokenAddress: string;
572
+ fromAmount: string;
573
+ kind: "bridge";
574
+ integration: "lifi";
575
+ approvalAmount?: string | undefined;
576
+ }>, z.ZodObject<{
577
+ integration: z.ZodLiteral<"goat">;
578
+ kind: z.ZodLiteral<"tool">;
579
+ toolName: z.ZodString;
580
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
581
+ chainId: z.ZodNumber;
582
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
583
+ }, "strip", z.ZodTypeAny, {
584
+ chainId: number;
585
+ account: `0x${string}`;
586
+ kind: "tool";
587
+ toolName: string;
588
+ integration: "goat";
589
+ params?: Record<string, unknown> | undefined;
590
+ }, {
591
+ chainId: number;
592
+ account: `0x${string}`;
593
+ kind: "tool";
594
+ toolName: string;
595
+ integration: "goat";
596
+ params?: Record<string, unknown> | undefined;
597
+ }>]>;
598
+ declare const resumeOperationSchema: z.ZodObject<{
599
+ resumeState: z.ZodObject<{
600
+ version: z.ZodLiteral<1>;
601
+ integration: z.ZodEnum<["orbs", "lifi", "goat"]>;
602
+ kind: z.ZodString;
603
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
604
+ }, "strip", z.ZodTypeAny, {
605
+ version: 1;
606
+ state: Record<string, unknown>;
607
+ kind: string;
608
+ integration: "goat" | "lifi" | "orbs";
609
+ }, {
610
+ version: 1;
611
+ state: Record<string, unknown>;
612
+ kind: string;
613
+ integration: "goat" | "lifi" | "orbs";
614
+ }>;
615
+ actionResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
616
+ type: z.ZodLiteral<"transaction">;
617
+ txHash: z.ZodString;
618
+ status: z.ZodLiteral<"confirmed">;
619
+ }, "strip", z.ZodTypeAny, {
620
+ type: "transaction";
621
+ status: "confirmed";
622
+ txHash: string;
623
+ }, {
624
+ type: "transaction";
625
+ status: "confirmed";
626
+ txHash: string;
627
+ }>, z.ZodObject<{
628
+ type: z.ZodLiteral<"signature">;
629
+ signature: z.ZodString;
630
+ }, "strip", z.ZodTypeAny, {
631
+ type: "signature";
632
+ signature: string;
633
+ }, {
634
+ type: "signature";
635
+ signature: string;
636
+ }>, z.ZodObject<{
637
+ type: z.ZodLiteral<"messageSignature">;
638
+ signature: z.ZodString;
639
+ }, "strip", z.ZodTypeAny, {
640
+ type: "messageSignature";
641
+ signature: string;
642
+ }, {
643
+ type: "messageSignature";
644
+ signature: string;
645
+ }>]>>>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ resumeState: {
648
+ version: 1;
649
+ state: Record<string, unknown>;
650
+ kind: string;
651
+ integration: "goat" | "lifi" | "orbs";
652
+ };
653
+ actionResults?: Record<string, {
654
+ type: "transaction";
655
+ status: "confirmed";
656
+ txHash: string;
657
+ } | {
658
+ type: "signature";
659
+ signature: string;
660
+ } | {
661
+ type: "messageSignature";
662
+ signature: string;
663
+ }> | undefined;
664
+ }, {
665
+ resumeState: {
666
+ version: 1;
667
+ state: Record<string, unknown>;
668
+ kind: string;
669
+ integration: "goat" | "lifi" | "orbs";
670
+ };
671
+ actionResults?: Record<string, {
672
+ type: "transaction";
673
+ status: "confirmed";
674
+ txHash: string;
675
+ } | {
676
+ type: "signature";
677
+ signature: string;
678
+ } | {
679
+ type: "messageSignature";
680
+ signature: string;
681
+ }> | undefined;
682
+ }>;
683
+
684
+ declare const orbsGetQuoteSchema: z.ZodObject<{
685
+ chainId: z.ZodOptional<z.ZodNumber>;
686
+ fromToken: z.ZodString;
687
+ toToken: z.ZodString;
688
+ inAmount: z.ZodString;
689
+ slippage: z.ZodOptional<z.ZodNumber>;
690
+ }, "strip", z.ZodTypeAny, {
691
+ fromToken: string;
692
+ toToken: string;
693
+ inAmount: string;
694
+ chainId?: number | undefined;
695
+ slippage?: number | undefined;
696
+ }, {
697
+ fromToken: string;
698
+ toToken: string;
699
+ inAmount: string;
700
+ chainId?: number | undefined;
701
+ slippage?: number | undefined;
702
+ }>;
703
+ declare const orbsSwapSchema: z.ZodObject<{
704
+ chainId: z.ZodOptional<z.ZodNumber>;
705
+ fromToken: z.ZodString;
706
+ toToken: z.ZodString;
707
+ inAmount: z.ZodString;
708
+ slippage: z.ZodOptional<z.ZodNumber>;
709
+ }, "strip", z.ZodTypeAny, {
710
+ fromToken: string;
711
+ toToken: string;
712
+ inAmount: string;
713
+ chainId?: number | undefined;
714
+ slippage?: number | undefined;
715
+ }, {
716
+ fromToken: string;
717
+ toToken: string;
718
+ inAmount: string;
719
+ chainId?: number | undefined;
720
+ slippage?: number | undefined;
721
+ }>;
722
+ declare const orbsPrepareSwapIntentSchema: z.ZodObject<{
723
+ chainId: z.ZodOptional<z.ZodNumber>;
724
+ fromToken: z.ZodString;
725
+ toToken: z.ZodString;
726
+ inAmount: z.ZodString;
727
+ slippage: z.ZodOptional<z.ZodNumber>;
728
+ } & {
729
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
730
+ }, "strip", z.ZodTypeAny, {
731
+ account: `0x${string}`;
732
+ fromToken: string;
733
+ toToken: string;
734
+ inAmount: string;
735
+ chainId?: number | undefined;
736
+ slippage?: number | undefined;
737
+ }, {
738
+ account: `0x${string}`;
739
+ fromToken: string;
740
+ toToken: string;
741
+ inAmount: string;
742
+ chainId?: number | undefined;
743
+ slippage?: number | undefined;
744
+ }>;
745
+ declare const orbsGetRequiredApprovalsSchema: z.ZodObject<{
746
+ chainId: z.ZodOptional<z.ZodNumber>;
747
+ fromToken: z.ZodString;
748
+ inAmount: z.ZodString;
749
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
750
+ }, "strip", z.ZodTypeAny, {
751
+ account: `0x${string}`;
752
+ fromToken: string;
753
+ inAmount: string;
754
+ chainId?: number | undefined;
755
+ }, {
756
+ account: `0x${string}`;
757
+ fromToken: string;
758
+ inAmount: string;
759
+ chainId?: number | undefined;
760
+ }>;
761
+ declare const orbsPlaceTwapSchema: z.ZodObject<{
762
+ chainId: z.ZodOptional<z.ZodNumber>;
763
+ srcToken: z.ZodString;
764
+ dstToken: z.ZodString;
765
+ srcAmount: z.ZodString;
766
+ chunks: z.ZodNumber;
767
+ fillDelay: z.ZodNumber;
768
+ }, "strip", z.ZodTypeAny, {
769
+ srcToken: string;
770
+ dstToken: string;
771
+ srcAmount: string;
772
+ chunks: number;
773
+ fillDelay: number;
774
+ chainId?: number | undefined;
775
+ }, {
776
+ srcToken: string;
777
+ dstToken: string;
778
+ srcAmount: string;
779
+ chunks: number;
780
+ fillDelay: number;
781
+ chainId?: number | undefined;
782
+ }>;
783
+ declare const orbsPrepareTwapIntentSchema: z.ZodObject<{
784
+ chainId: z.ZodOptional<z.ZodNumber>;
785
+ srcToken: z.ZodString;
786
+ dstToken: z.ZodString;
787
+ srcAmount: z.ZodString;
788
+ chunks: z.ZodNumber;
789
+ fillDelay: z.ZodNumber;
790
+ } & {
791
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
792
+ }, "strip", z.ZodTypeAny, {
793
+ account: `0x${string}`;
794
+ srcToken: string;
795
+ dstToken: string;
796
+ srcAmount: string;
797
+ chunks: number;
798
+ fillDelay: number;
799
+ chainId?: number | undefined;
800
+ }, {
801
+ account: `0x${string}`;
802
+ srcToken: string;
803
+ dstToken: string;
804
+ srcAmount: string;
805
+ chunks: number;
806
+ fillDelay: number;
807
+ chainId?: number | undefined;
808
+ }>;
809
+ declare const orbsPlaceLimitSchema: z.ZodObject<{
810
+ chainId: z.ZodOptional<z.ZodNumber>;
811
+ srcToken: z.ZodString;
812
+ dstToken: z.ZodString;
813
+ srcAmount: z.ZodString;
814
+ dstMinAmount: z.ZodString;
815
+ expiry: z.ZodOptional<z.ZodNumber>;
816
+ }, "strip", z.ZodTypeAny, {
817
+ srcToken: string;
818
+ dstToken: string;
819
+ srcAmount: string;
820
+ dstMinAmount: string;
821
+ chainId?: number | undefined;
822
+ expiry?: number | undefined;
823
+ }, {
824
+ srcToken: string;
825
+ dstToken: string;
826
+ srcAmount: string;
827
+ dstMinAmount: string;
828
+ chainId?: number | undefined;
829
+ expiry?: number | undefined;
830
+ }>;
831
+ declare const orbsPrepareLimitIntentSchema: z.ZodObject<{
832
+ chainId: z.ZodOptional<z.ZodNumber>;
833
+ srcToken: z.ZodString;
834
+ dstToken: z.ZodString;
835
+ srcAmount: z.ZodString;
836
+ dstMinAmount: z.ZodString;
837
+ expiry: z.ZodOptional<z.ZodNumber>;
838
+ } & {
839
+ account: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
840
+ }, "strip", z.ZodTypeAny, {
841
+ account: `0x${string}`;
842
+ srcToken: string;
843
+ dstToken: string;
844
+ srcAmount: string;
845
+ dstMinAmount: string;
846
+ chainId?: number | undefined;
847
+ expiry?: number | undefined;
848
+ }, {
849
+ account: `0x${string}`;
850
+ srcToken: string;
851
+ dstToken: string;
852
+ srcAmount: string;
853
+ dstMinAmount: string;
854
+ chainId?: number | undefined;
855
+ expiry?: number | undefined;
856
+ }>;
857
+ declare const orbsSubmitSignedSwapSchema: z.ZodObject<{
858
+ chainId: z.ZodOptional<z.ZodNumber>;
859
+ quote: z.ZodRecord<z.ZodString, z.ZodUnknown>;
860
+ signature: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
861
+ }, "strip", z.ZodTypeAny, {
862
+ signature: `0x${string}`;
863
+ quote: Record<string, unknown>;
864
+ chainId?: number | undefined;
865
+ }, {
866
+ signature: `0x${string}`;
867
+ quote: Record<string, unknown>;
868
+ chainId?: number | undefined;
869
+ }>;
870
+ declare const orbsSubmitSignedTwapOrderSchema: z.ZodObject<{
871
+ order: z.ZodRecord<z.ZodString, z.ZodUnknown>;
872
+ signature: z.ZodObject<{
873
+ v: z.ZodNumber;
874
+ r: z.ZodString;
875
+ s: z.ZodString;
876
+ }, "strip", z.ZodTypeAny, {
877
+ r: string;
878
+ s: string;
879
+ v: number;
880
+ }, {
881
+ r: string;
882
+ s: string;
883
+ v: number;
884
+ }>;
885
+ }, "strip", z.ZodTypeAny, {
886
+ signature: {
887
+ r: string;
888
+ s: string;
889
+ v: number;
890
+ };
891
+ order: Record<string, unknown>;
892
+ }, {
893
+ signature: {
894
+ r: string;
895
+ s: string;
896
+ v: number;
897
+ };
898
+ order: Record<string, unknown>;
899
+ }>;
900
+ declare const orbsSwapStatusSchema: z.ZodObject<{
901
+ chainId: z.ZodOptional<z.ZodNumber>;
902
+ sessionId: z.ZodString;
903
+ user: z.ZodString;
904
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
905
+ }, "strip", z.ZodTypeAny, {
906
+ user: string;
907
+ sessionId: string;
908
+ chainId?: number | undefined;
909
+ maxAttempts?: number | undefined;
910
+ }, {
911
+ user: string;
912
+ sessionId: string;
913
+ chainId?: number | undefined;
914
+ maxAttempts?: number | undefined;
915
+ }>;
916
+ declare const orbsListOrdersSchema: z.ZodObject<{
917
+ chainId: z.ZodOptional<z.ZodNumber>;
918
+ }, "strip", z.ZodTypeAny, {
919
+ chainId?: number | undefined;
920
+ }, {
921
+ chainId?: number | undefined;
922
+ }>;
923
+
924
+ declare const resolveTokenSchema: z.ZodObject<{
925
+ symbol: z.ZodString;
926
+ chainId: z.ZodNumber;
927
+ }, "strip", z.ZodTypeAny, {
928
+ symbol: string;
929
+ chainId: number;
930
+ }, {
931
+ symbol: string;
932
+ chainId: number;
933
+ }>;
934
+ declare const listChainTokensSchema: z.ZodObject<{
935
+ chainId: z.ZodNumber;
936
+ }, "strip", z.ZodTypeAny, {
937
+ chainId: number;
938
+ }, {
939
+ chainId: number;
940
+ }>;
941
+
942
+ declare const walletFromMnemonicSchema: z.ZodObject<{
943
+ mnemonic: z.ZodString;
944
+ accountIndex: z.ZodOptional<z.ZodNumber>;
945
+ addressIndex: z.ZodOptional<z.ZodNumber>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ mnemonic: string;
948
+ accountIndex?: number | undefined;
949
+ addressIndex?: number | undefined;
950
+ }, {
951
+ mnemonic: string;
952
+ accountIndex?: number | undefined;
953
+ addressIndex?: number | undefined;
954
+ }>;
955
+ declare const walletDeriveAddressesSchema: z.ZodObject<{
956
+ mnemonic: z.ZodString;
957
+ count: z.ZodOptional<z.ZodNumber>;
958
+ }, "strip", z.ZodTypeAny, {
959
+ mnemonic: string;
960
+ count?: number | undefined;
961
+ }, {
962
+ mnemonic: string;
963
+ count?: number | undefined;
964
+ }>;
965
+ declare const walletActivateSchema: z.ZodEffects<z.ZodObject<{
966
+ privateKey: z.ZodOptional<z.ZodString>;
967
+ mnemonic: z.ZodOptional<z.ZodString>;
968
+ accountIndex: z.ZodOptional<z.ZodNumber>;
969
+ addressIndex: z.ZodOptional<z.ZodNumber>;
970
+ }, "strip", z.ZodTypeAny, {
971
+ privateKey?: string | undefined;
972
+ mnemonic?: string | undefined;
973
+ accountIndex?: number | undefined;
974
+ addressIndex?: number | undefined;
975
+ }, {
976
+ privateKey?: string | undefined;
977
+ mnemonic?: string | undefined;
978
+ accountIndex?: number | undefined;
979
+ addressIndex?: number | undefined;
980
+ }>, {
981
+ privateKey?: string | undefined;
982
+ mnemonic?: string | undefined;
983
+ accountIndex?: number | undefined;
984
+ addressIndex?: number | undefined;
985
+ }, {
986
+ privateKey?: string | undefined;
987
+ mnemonic?: string | undefined;
988
+ accountIndex?: number | undefined;
989
+ addressIndex?: number | undefined;
990
+ }>;
991
+ declare const walletSetConfirmationSchema: z.ZodObject<{
992
+ enabled: z.ZodBoolean;
993
+ }, "strip", z.ZodTypeAny, {
994
+ enabled: boolean;
995
+ }, {
996
+ enabled: boolean;
997
+ }>;
998
+ declare const transactionConfirmSchema: z.ZodObject<{
999
+ id: z.ZodString;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ id: string;
1002
+ }, {
1003
+ id: string;
1004
+ }>;
1005
+ declare const transactionDenySchema: z.ZodObject<{
1006
+ id: z.ZodString;
1007
+ }, "strip", z.ZodTypeAny, {
1008
+ id: string;
1009
+ }, {
1010
+ id: string;
1011
+ }>;
1012
+ declare const transactionSimulateSchema: z.ZodObject<{
1013
+ chainId: z.ZodNumber;
1014
+ to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
1015
+ data: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
1016
+ value: z.ZodOptional<z.ZodString>;
1017
+ from: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ from: `0x${string}`;
1020
+ data: `0x${string}`;
1021
+ to: `0x${string}`;
1022
+ chainId: number;
1023
+ value?: string | undefined;
1024
+ }, {
1025
+ from: `0x${string}`;
1026
+ data: `0x${string}`;
1027
+ to: `0x${string}`;
1028
+ chainId: number;
1029
+ value?: string | undefined;
1030
+ }>;
1031
+
1032
+ type ResolveTokenInput = z.infer<typeof resolveTokenSchema>;
1033
+ type ListChainTokensInput = z.infer<typeof listChainTokensSchema>;
1034
+ type LifiQuoteInput = z.infer<typeof lifiGetQuoteSchema>;
1035
+ type ExecuteBridgeInput = z.infer<typeof lifiExecuteBridgeSchema>;
1036
+ type PrepareBridgeIntentInput = z.infer<typeof lifiPrepareBridgeIntentSchema>;
1037
+ type OrbsQuoteInput = z.infer<typeof orbsGetQuoteSchema>;
1038
+ type ExecuteSameChainSwapInput = OrbsQuoteInput;
1039
+ type PrepareSwapIntentInput = z.infer<typeof orbsPrepareSwapIntentSchema>;
1040
+ type GetRequiredApprovalsInput = z.infer<typeof orbsGetRequiredApprovalsSchema>;
1041
+ type PlaceTwapOrderInput = z.infer<typeof orbsPlaceTwapSchema>;
1042
+ type PrepareTwapIntentInput = z.infer<typeof orbsPrepareTwapIntentSchema>;
1043
+ type PlaceLimitOrderInput = z.infer<typeof orbsPlaceLimitSchema>;
1044
+ type PrepareLimitIntentInput = z.infer<typeof orbsPrepareLimitIntentSchema>;
1045
+ type SubmitSignedSwapInput = z.infer<typeof orbsSubmitSignedSwapSchema>;
1046
+ type SubmitSignedTwapOrderInput = z.infer<typeof orbsSubmitSignedTwapOrderSchema>;
1047
+ type SwapStatusInput = z.infer<typeof orbsSwapStatusSchema>;
1048
+ type ListOrdersInput = z.infer<typeof orbsListOrdersSchema>;
1049
+ type WalletActivateInput = z.infer<typeof walletActivateSchema>;
1050
+ type WalletSetConfirmationInput = z.infer<typeof walletSetConfirmationSchema>;
1051
+ type WalletFromMnemonicInput = z.infer<typeof walletFromMnemonicSchema>;
1052
+ type WalletDeriveAddressesInput = z.infer<typeof walletDeriveAddressesSchema>;
1053
+ type TransactionConfirmInput = z.infer<typeof transactionConfirmSchema>;
1054
+ type TransactionDenyInput = z.infer<typeof transactionDenySchema>;
1055
+ type SimulateTransactionInput = z.infer<typeof transactionSimulateSchema>;
1056
+ interface RuntimeBoundOptions {
1057
+ runtime?: Web3AgentRuntime;
1058
+ }
1059
+ interface SupportedChainEntry {
1060
+ id: number;
1061
+ name: string;
1062
+ nativeCurrency: Chain["nativeCurrency"];
1063
+ }
1064
+ interface SupportedChainsResult {
1065
+ note: string;
1066
+ chains: SupportedChainEntry[];
1067
+ }
1068
+ type ChainLookupResult = Chain | undefined;
1069
+ interface WalletGenerateResult {
1070
+ address: string;
1071
+ privateKey: string;
1072
+ warning: string;
1073
+ }
1074
+ interface WalletGenerateMnemonicResult {
1075
+ mnemonic: string;
1076
+ firstAddress: string;
1077
+ derivationPath: string;
1078
+ warning: string;
1079
+ }
1080
+ interface WalletAddressDerivationResult {
1081
+ address: string;
1082
+ derivationPath: string;
1083
+ }
1084
+ interface WalletDerivedAddressEntry {
1085
+ index: number;
1086
+ address: string;
1087
+ derivationPath: string;
1088
+ }
1089
+ interface WalletDeactivationResult {
1090
+ mode: WalletState["mode"];
1091
+ message: string;
1092
+ }
1093
+ interface WalletConfirmationResult {
1094
+ confirmationRequired: boolean;
1095
+ message: string;
1096
+ }
1097
+ interface TransactionDenyResult {
1098
+ denied: true;
1099
+ id: string;
1100
+ message: string;
1101
+ }
1102
+ interface TransactionListEntry {
1103
+ id: string;
1104
+ type: string;
1105
+ description: string;
1106
+ createdAt: string;
1107
+ expiresIn: number;
1108
+ walletAddress?: string;
1109
+ }
1110
+ interface TransactionListResult {
1111
+ count: number;
1112
+ operations: TransactionListEntry[];
1113
+ }
1114
+ interface ServerStatusResult {
1115
+ walletMode: WalletState["mode"];
1116
+ activeChainId: number;
1117
+ confirmWrites: boolean;
1118
+ backends: RuntimeHealth["backends"];
1119
+ toolCount: number;
1120
+ }
1121
+ interface PendingConfirmationResult {
1122
+ status: "pending_confirmation";
1123
+ id: string;
1124
+ summary: string;
1125
+ }
1126
+ type TypedDataPayload = z.infer<typeof typedDataPayloadSchema>;
1127
+ interface ApprovalStep {
1128
+ type: "wrap" | "approve";
1129
+ label: string;
1130
+ tx: {
1131
+ to: `0x${string}`;
1132
+ data?: `0x${string}`;
1133
+ value?: string;
1134
+ };
1135
+ }
1136
+ interface SwapIntent {
1137
+ eip712: TypedDataPayload;
1138
+ quote: {
1139
+ sessionId: string;
1140
+ inToken: string;
1141
+ outToken: string;
1142
+ inAmount: string;
1143
+ outAmount: string;
1144
+ minAmountOut: string;
1145
+ user: string;
1146
+ [key: string]: unknown;
1147
+ };
1148
+ requiredApprovals: ApprovalStep[];
1149
+ chainId: number;
1150
+ }
1151
+ interface TwapIntent {
1152
+ eip712: TypedDataPayload;
1153
+ order: Record<string, unknown>;
1154
+ chainId: number;
1155
+ meta: {
1156
+ chunks: number;
1157
+ fillDelaySeconds: number;
1158
+ durationSeconds: number;
1159
+ srcAmountPerChunk: string;
1160
+ };
1161
+ }
1162
+ interface LimitIntent {
1163
+ eip712: TypedDataPayload;
1164
+ order: Record<string, unknown>;
1165
+ chainId: number;
1166
+ meta: {
1167
+ expirySeconds: number;
1168
+ dstMinAmount: string;
1169
+ };
1170
+ }
1171
+ type PreparedTransactionRequest = z.infer<typeof preparedTransactionRequestSchema>;
1172
+ type PreparedTransactionAction = z.infer<typeof preparedTransactionActionSchema>;
1173
+ type PreparedSignTypedDataAction = z.infer<typeof preparedSignTypedDataActionSchema>;
1174
+ type PreparedSignMessageAction = z.infer<typeof preparedSignMessageActionSchema>;
1175
+ type PreparedAction = z.infer<typeof preparedActionSchema>;
1176
+ type PreparedOperationIntegration = "orbs" | "lifi" | "goat";
1177
+ interface OperationResumeState {
1178
+ version: 1;
1179
+ integration: PreparedOperationIntegration;
1180
+ kind: string;
1181
+ state: Record<string, unknown>;
1182
+ }
1183
+ interface PreparedOperation {
1184
+ integration: PreparedOperationIntegration;
1185
+ kind: string;
1186
+ summary: string;
1187
+ actions: PreparedAction[];
1188
+ resumeState: OperationResumeState;
1189
+ meta?: Record<string, unknown>;
1190
+ }
1191
+ interface OperationTransactionResult {
1192
+ type: "transaction";
1193
+ txHash: string;
1194
+ status: "confirmed";
1195
+ }
1196
+ interface OperationSignatureResult {
1197
+ type: "signature";
1198
+ signature: string;
1199
+ }
1200
+ interface OperationMessageSignatureResult {
1201
+ type: "messageSignature";
1202
+ signature: string;
1203
+ }
1204
+ type OperationActionResult = z.infer<typeof operationActionResultSchema>;
1205
+ type PrepareOperationInput = z.infer<typeof prepareOperationSchema>;
1206
+ interface ResumeOperationInput {
1207
+ resumeState: OperationResumeState;
1208
+ actionResults?: Record<string, OperationActionResult>;
1209
+ }
1210
+ interface ResumeOperationPendingResult {
1211
+ completed: false;
1212
+ operation: PreparedOperation;
1213
+ }
1214
+ interface ResumeOperationCompletedResult {
1215
+ completed: true;
1216
+ integration: PreparedOperationIntegration;
1217
+ kind: string;
1218
+ result: CompletedOperationResult;
1219
+ }
1220
+ type PrepareOperationResult = PreparedOperation | ResumeOperationCompletedResult;
1221
+ type ResumeOperationResult = ResumeOperationPendingResult | ResumeOperationCompletedResult;
1222
+ interface BridgeTxStep {
1223
+ type: "approval" | "bridge";
1224
+ label: string;
1225
+ tx: PreparedTransactionRequest;
1226
+ }
1227
+ interface BridgeIntent {
1228
+ steps: BridgeTxStep[];
1229
+ actions: PreparedAction[];
1230
+ estimate: {
1231
+ fromToken: string;
1232
+ toToken: string;
1233
+ fromAmount: string;
1234
+ fromAmountUSD?: string;
1235
+ toAmount: string;
1236
+ toAmountUSD?: string;
1237
+ toAmountMin: string;
1238
+ gasCostUSD?: string;
1239
+ estimatedDurationSeconds?: number;
1240
+ };
1241
+ fromChainId: number;
1242
+ toChainId: number;
1243
+ }
1244
+ interface BalanceChange {
1245
+ token: `0x${string}`;
1246
+ symbol: string | null;
1247
+ decimals: number | null;
1248
+ amount: string;
1249
+ direction: "in" | "out";
1250
+ }
1251
+ interface SimulationResult {
1252
+ success: true;
1253
+ gasEstimate: string;
1254
+ balanceChanges: BalanceChange[];
1255
+ }
1256
+ interface SwapSubmissionResult {
1257
+ sessionId: string;
1258
+ txHash?: string;
1259
+ status: "submitted" | "completed" | "failed";
1260
+ error?: string;
1261
+ }
1262
+ interface TwapOrderResult {
1263
+ orderId: string;
1264
+ status: string;
1265
+ txHash?: string;
1266
+ }
1267
+ interface CompletedOperationResult {
1268
+ status?: string;
1269
+ message?: string;
1270
+ txHash?: string;
1271
+ [key: string]: unknown;
1272
+ }
1273
+ type WriteOperationResult = PendingConfirmationResult | CompletedOperationResult;
1274
+ interface SameChainSwapQuoteResult {
1275
+ kind: "same-chain";
1276
+ provider: "orbs";
1277
+ chainId: number;
1278
+ quote: Record<string, unknown>;
1279
+ }
1280
+ interface CrossChainSwapQuoteSummary {
1281
+ fromChainId: number;
1282
+ toChainId: number;
1283
+ fromToken?: string;
1284
+ toToken?: string;
1285
+ fromAmount: string;
1286
+ fromAmountUSD?: string;
1287
+ toAmount?: string;
1288
+ toAmountUSD?: string;
1289
+ toAmountMin?: string;
1290
+ gasCostUSD?: string;
1291
+ estimatedDurationSeconds?: number;
1292
+ includedSteps?: Array<{
1293
+ type?: string;
1294
+ tool?: string;
1295
+ }>;
1296
+ }
1297
+ interface CrossChainSwapQuoteResult {
1298
+ kind: "cross-chain";
1299
+ provider: "lifi";
1300
+ quote: CrossChainSwapQuoteSummary;
1301
+ }
1302
+ type SwapQuoteResult = SameChainSwapQuoteResult | CrossChainSwapQuoteResult;
1303
+ interface TokenSwappableResult {
1304
+ swappable: boolean;
1305
+ provider: "orbs" | "lifi";
1306
+ kind: "same-chain" | "cross-chain";
1307
+ reason?: string;
1308
+ }
1309
+ interface SwapStatusResult {
1310
+ provider: "orbs";
1311
+ status: Record<string, unknown>;
1312
+ }
1313
+ interface SwapHistoryEntry {
1314
+ id: string;
1315
+ provider: "orbs" | "lifi";
1316
+ status: "pending_confirmation" | "confirmed" | "denied" | "expired";
1317
+ walletAddress?: string;
1318
+ description: string;
1319
+ timestamp: string;
1320
+ }
1321
+ interface SwapHistoryResult {
1322
+ walletAddress?: string;
1323
+ entries: SwapHistoryEntry[];
1324
+ }
1325
+ interface ListOrdersResult {
1326
+ count: number;
1327
+ orders: Array<{
1328
+ id: string;
1329
+ type: string;
1330
+ status: string;
1331
+ srcToken: string;
1332
+ dstToken: string;
1333
+ srcAmount: string;
1334
+ progress?: unknown;
1335
+ createdAt?: string;
1336
+ }>;
1337
+ }
1338
+ type RootResolveTokenResult = ResolvedToken;
1339
+
1340
+ declare function getChain(id: number): ChainLookupResult;
1341
+ declare function findChainByName(name: string): ChainLookupResult;
1342
+ declare function isSupportedChain(chainId: number): boolean;
1343
+ declare function listSupportedChains(options?: RuntimeBoundOptions): Promise<SupportedChainsResult>;
1344
+ declare function listSupportedChainEntries(options?: RuntimeBoundOptions): Promise<SupportedChainEntry[]>;
1345
+
1346
+ interface Web3AgentErrorOptions {
1347
+ code: string;
1348
+ message: string;
1349
+ details?: unknown;
1350
+ cause?: unknown;
1351
+ }
1352
+ declare class Web3AgentError extends Error {
1353
+ readonly code: string;
1354
+ readonly details?: unknown;
1355
+ readonly cause?: unknown;
1356
+ constructor(options: Web3AgentErrorOptions);
1357
+ static fromUnknown(code: string, error: unknown, fallbackMessage?: string, details?: unknown): Web3AgentError;
1358
+ }
1359
+
1360
+ declare function prepareSwapIntent(params: PrepareSwapIntentInput): Promise<SwapIntent>;
1361
+ declare function prepareTwapIntent(params: PrepareTwapIntentInput): Promise<TwapIntent>;
1362
+ declare function prepareLimitIntent(params: PrepareLimitIntentInput): Promise<LimitIntent>;
1363
+ declare function prepareBridgeIntent(params: PrepareBridgeIntentInput): Promise<BridgeIntent>;
1364
+ declare function submitSignedSwap(params: {
1365
+ chainId: number;
1366
+ quote: Record<string, unknown>;
1367
+ signature: `0x${string}`;
1368
+ }): Promise<SwapSubmissionResult>;
1369
+ declare function submitSignedTwapOrder(params: {
1370
+ order: Record<string, unknown>;
1371
+ signature: {
1372
+ v: number;
1373
+ r: string;
1374
+ s: string;
1375
+ };
1376
+ }): Promise<TwapOrderResult>;
1377
+
1378
+ declare function getRequiredApprovals(params: GetRequiredApprovalsInput): Promise<ApprovalStep[]>;
1379
+
1380
+ declare function prepareOperation(params: PrepareOperationInput): Promise<PrepareOperationResult>;
1381
+ declare function resumeOperation(params: ResumeOperationInput): Promise<ResumeOperationResult>;
1382
+
1383
+ declare function placeLimitOrder(params: PlaceLimitOrderInput, options?: RuntimeBoundOptions): Promise<WriteOperationResult>;
1384
+ declare function placeTwapOrder(params: PlaceTwapOrderInput, options?: RuntimeBoundOptions): Promise<WriteOperationResult>;
1385
+ declare function listOrders(params: ListOrdersInput, options?: RuntimeBoundOptions): Promise<ListOrdersResult>;
1386
+
1387
+ declare function clearTraceSupportCache(): void;
1388
+ declare function simulateTransaction(params: SimulateTransactionInput): Promise<SimulationResult>;
1389
+
1390
+ declare function getSwapQuote(params: LifiQuoteInput | OrbsQuoteInput, options?: RuntimeBoundOptions): Promise<SwapQuoteResult>;
1391
+ declare function isTokenSwappable(params: LifiQuoteInput | OrbsQuoteInput, options?: RuntimeBoundOptions): Promise<TokenSwappableResult>;
1392
+ declare function executeSameChainSwap(params: ExecuteSameChainSwapInput, options?: RuntimeBoundOptions): Promise<WriteOperationResult>;
1393
+ declare function executeBridge(params: ExecuteBridgeInput, options?: RuntimeBoundOptions): Promise<WriteOperationResult>;
1394
+ declare function getSwapStatus(params: SwapStatusInput, options?: RuntimeBoundOptions): Promise<SwapStatusResult>;
1395
+ declare function getSwapHistory(_params?: {
1396
+ walletAddress?: string;
1397
+ }): Promise<SwapHistoryResult>;
1398
+
1399
+ declare function resolveToken(params: ResolveTokenInput): Promise<RootResolveTokenResult>;
1400
+ declare function resolveCanonicalToken(params: ResolveTokenInput): Promise<RootResolveTokenResult>;
1401
+ declare function resolveTokenSync(params: ResolveTokenInput): RootResolveTokenResult | null;
1402
+ declare function resolveCanonicalTokenSync(params: ResolveTokenInput): RootResolveTokenResult | null;
1403
+ declare function listChainTokens(params: ListChainTokensInput): {
1404
+ chainId: number;
1405
+ chainName: string;
1406
+ tokens: TokenEntry[];
1407
+ };
1408
+
1409
+ declare function parseEnv(env?: Partial<Record<string, string>>): RuntimeConfig;
1410
+ declare function setConfig(config: RuntimeConfig): void;
1411
+ declare function resetConfig(): void;
1412
+
1413
+ /**
1414
+ * Normalize EIP-712 typed data to match ethers.js `_TypedDataEncoder.getPayload()`.
1415
+ *
1416
+ * The Orbs solver verifies signatures against the ethers-normalized hash, which:
1417
+ * - Lowercases all `address` values (both in domain and message)
1418
+ * - Converts all `uint*`/`int*` values to decimal strings
1419
+ * - Converts `bool` values to proper booleans
1420
+ * - Recurses into nested structs and arrays
1421
+ *
1422
+ * Without this, viem's `signTypedData` produces a valid but DIFFERENT signature
1423
+ * hash, and the solver silently ignores the order.
1424
+ */
1425
+ declare function normalizeEip712ForSigning(domain: Record<string, unknown>, types: Record<string, Array<{
1426
+ name: string;
1427
+ type: string;
1428
+ }>>, primaryType: string, message: Record<string, unknown>): {
1429
+ domain: Record<string, unknown>;
1430
+ types: Record<string, Array<{
1431
+ name: string;
1432
+ type: string;
1433
+ }>>;
1434
+ primaryType: string;
1435
+ message: Record<string, unknown>;
1436
+ };
1437
+ interface SwapResult {
1438
+ sessionId: string;
1439
+ txHash?: string;
1440
+ status: "submitted" | "completed" | "failed";
1441
+ error?: string;
1442
+ }
1443
+ declare function pollSwapStatus(params: {
1444
+ chainId: number;
1445
+ sessionId: string;
1446
+ user: string;
1447
+ maxAttempts?: number;
1448
+ }): Promise<SwapResult>;
1449
+
1450
+ export { type ApprovalStep, type BalanceChange, type BridgeIntent, type BridgeTxStep, type ChainLookupResult, type CompletedOperationResult, type CrossChainSwapQuoteResult, type CrossChainSwapQuoteSummary, type ExecuteBridgeInput, type ExecuteSameChainSwapInput, type GetRequiredApprovalsInput, type LifiQuoteInput, type LimitIntent, type ListChainTokensInput, type ListOrdersInput, type ListOrdersResult, type OperationActionResult, type OperationMessageSignatureResult, type OperationResumeState, type OperationSignatureResult, type OperationTransactionResult, type PendingConfirmationResult, type PlaceLimitOrderInput, type PlaceTwapOrderInput, type PrepareBridgeIntentInput, type PrepareLimitIntentInput, type PrepareOperationInput, type PrepareOperationResult, type PrepareSwapIntentInput, type PrepareTwapIntentInput, type PreparedAction, type PreparedOperation, type PreparedOperationIntegration, type PreparedSignMessageAction, type PreparedSignTypedDataAction, type PreparedTransactionAction, type ResolveTokenInput, type ResumeOperationCompletedResult, type ResumeOperationInput, type ResumeOperationPendingResult, type ResumeOperationResult, type RootResolveTokenResult, type RuntimeBoundOptions, RuntimeHealth, type SameChainSwapQuoteResult, type ServerStatusResult, type SimulateTransactionInput, type SimulationResult, type SubmitSignedSwapInput, type SubmitSignedTwapOrderInput, type SupportedChainEntry, type SupportedChainsResult, type SwapHistoryEntry, type SwapHistoryResult, type SwapIntent, type SwapQuoteResult, type SwapStatusInput, type SwapStatusResult, type SwapSubmissionResult, type TokenSwappableResult, type TransactionConfirmInput, type TransactionDenyInput, type TransactionDenyResult, type TransactionListEntry, type TransactionListResult, type TwapIntent, type TwapOrderResult, type WalletActivateInput, type WalletAddressDerivationResult, type WalletConfirmationResult, type WalletDeactivationResult, type WalletDeriveAddressesInput, type WalletDerivedAddressEntry, type WalletFromMnemonicInput, type WalletGenerateMnemonicResult, type WalletGenerateResult, type WalletSetConfirmationInput, WalletState, Web3AgentError, Web3AgentRuntime, type WriteOperationResult, clearTraceSupportCache, executeBridge, executeSameChainSwap, findChainByName, getChain, getRequiredApprovals, getSwapHistory, getSwapQuote, getSwapStatus, isSupportedChain, isTokenSwappable, lifiExecuteBridgeSchema, lifiGetQuoteSchema, lifiPrepareBridgeIntentSchema, listChainTokens, listChainTokensSchema, listOrders, listSupportedChainEntries, listSupportedChains, normalizeEip712ForSigning, operationActionResultSchema, operationResumeStateSchema, orbsGetQuoteSchema, orbsGetRequiredApprovalsSchema, orbsListOrdersSchema, orbsPlaceLimitSchema, orbsPlaceTwapSchema, orbsPrepareLimitIntentSchema, orbsPrepareSwapIntentSchema, orbsPrepareTwapIntentSchema, orbsSubmitSignedSwapSchema, orbsSubmitSignedTwapOrderSchema, orbsSwapSchema, orbsSwapStatusSchema, parseEnv, placeLimitOrder, placeTwapOrder, pollSwapStatus, prepareBridgeIntent, prepareLimitIntent, prepareOperation, prepareOperationSchema, prepareSwapIntent, prepareTwapIntent, resetConfig, resolveCanonicalToken, resolveCanonicalTokenSync, resolveToken, resolveTokenSchema, resolveTokenSync, resumeOperation, resumeOperationSchema, setConfig, simulateTransaction, submitSignedSwap, submitSignedTwapOrder, transactionConfirmSchema, transactionDenySchema, transactionSimulateSchema, walletActivateSchema, walletDeriveAddressesSchema, walletFromMnemonicSchema, walletSetConfirmationSchema };