@earnforge/sdk 0.1.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,2929 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/retry.d.ts
4
+ interface RetryOptions {
5
+ maxRetries?: number;
6
+ baseDelay?: number;
7
+ maxDelay?: number;
8
+ }
9
+ /**
10
+ * Retry with exponential backoff on 429 / 5xx / network errors.
11
+ */
12
+ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
13
+ declare function isRetryable(error: unknown): boolean;
14
+ //#endregion
15
+ //#region src/schemas/vault.d.ts
16
+ /** Protocol info — always has name + url */
17
+ declare const ProtocolSchema: z.ZodObject<{
18
+ name: z.ZodString;
19
+ url: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ name: string;
22
+ url: string;
23
+ }, {
24
+ name: string;
25
+ url: string;
26
+ }>;
27
+ /** Underlying token — symbol, address, decimals */
28
+ declare const UnderlyingTokenSchema: z.ZodObject<{
29
+ symbol: z.ZodString;
30
+ address: z.ZodString;
31
+ decimals: z.ZodNumber;
32
+ }, "strip", z.ZodTypeAny, {
33
+ symbol: string;
34
+ address: string;
35
+ decimals: number;
36
+ }, {
37
+ symbol: string;
38
+ address: string;
39
+ decimals: number;
40
+ }>;
41
+ /** Pack (deposit or redeem method) */
42
+ declare const PackSchema: z.ZodObject<{
43
+ name: z.ZodString;
44
+ stepsType: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ name: string;
47
+ stepsType: string;
48
+ }, {
49
+ name: string;
50
+ stepsType: string;
51
+ }>;
52
+ /**
53
+ * APY — base and total always present.
54
+ * reward: Morpho returns 0, Euler/Aave return null. Normalize to 0.
55
+ * (Pitfall #17)
56
+ */
57
+ declare const ApySchema: z.ZodObject<{
58
+ base: z.ZodNumber;
59
+ total: z.ZodNumber;
60
+ reward: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ base: number;
63
+ total: number;
64
+ reward: number;
65
+ }, {
66
+ base: number;
67
+ total: number;
68
+ reward: number | null;
69
+ }>;
70
+ /**
71
+ * TVL — usd is always a string from the API.
72
+ * We parse it into { raw, parsed, bigint } at the boundary.
73
+ * (Pitfall #8)
74
+ */
75
+ declare const TvlSchema: z.ZodObject<{
76
+ usd: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ usd: string;
79
+ }, {
80
+ usd: string;
81
+ }>;
82
+ type TvlParsed = {
83
+ raw: string;
84
+ parsed: number;
85
+ bigint: bigint;
86
+ };
87
+ declare function parseTvl(tvl: z.infer<typeof TvlSchema>): TvlParsed;
88
+ /**
89
+ * Analytics — apy1d, apy7d, apy30d can all be null.
90
+ * Fallback chain: apy.total → apy30d → apy7d → apy1d
91
+ * (Pitfalls #7, #18)
92
+ */
93
+ declare const AnalyticsSchema: z.ZodObject<{
94
+ apy: z.ZodObject<{
95
+ base: z.ZodNumber;
96
+ total: z.ZodNumber;
97
+ reward: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
98
+ }, "strip", z.ZodTypeAny, {
99
+ base: number;
100
+ total: number;
101
+ reward: number;
102
+ }, {
103
+ base: number;
104
+ total: number;
105
+ reward: number | null;
106
+ }>;
107
+ tvl: z.ZodObject<{
108
+ usd: z.ZodString;
109
+ }, "strip", z.ZodTypeAny, {
110
+ usd: string;
111
+ }, {
112
+ usd: string;
113
+ }>;
114
+ apy1d: z.ZodNullable<z.ZodNumber>;
115
+ apy7d: z.ZodNullable<z.ZodNumber>;
116
+ apy30d: z.ZodNullable<z.ZodNumber>;
117
+ updatedAt: z.ZodString;
118
+ }, "strip", z.ZodTypeAny, {
119
+ apy: {
120
+ base: number;
121
+ total: number;
122
+ reward: number;
123
+ };
124
+ tvl: {
125
+ usd: string;
126
+ };
127
+ apy1d: number | null;
128
+ apy7d: number | null;
129
+ apy30d: number | null;
130
+ updatedAt: string;
131
+ }, {
132
+ apy: {
133
+ base: number;
134
+ total: number;
135
+ reward: number | null;
136
+ };
137
+ tvl: {
138
+ usd: string;
139
+ };
140
+ apy1d: number | null;
141
+ apy7d: number | null;
142
+ apy30d: number | null;
143
+ updatedAt: string;
144
+ }>;
145
+ /**
146
+ * Get best available APY with fallback chain.
147
+ * Order: apy.total → apy30d → apy7d → apy1d
148
+ */
149
+ declare function getBestApy(analytics: z.infer<typeof AnalyticsSchema>): number;
150
+ /**
151
+ * Vault schema — generated from real fixture (earn.li.fi, Apr 11 2026).
152
+ *
153
+ * Key edge cases handled:
154
+ * - description is optional (~14% of vaults have it) (Pitfall #16)
155
+ * - underlyingTokens can be empty array (Pitfall #15)
156
+ * - apy.reward null → 0 (Pitfall #17)
157
+ * - apy1d/apy7d/apy30d nullable (Pitfall #18)
158
+ * - tvl.usd is a string (Pitfall #8)
159
+ */
160
+ declare const VaultSchema: z.ZodObject<{
161
+ address: z.ZodString;
162
+ chainId: z.ZodNumber;
163
+ name: z.ZodString;
164
+ slug: z.ZodString;
165
+ network: z.ZodString;
166
+ description: z.ZodOptional<z.ZodString>;
167
+ protocol: z.ZodObject<{
168
+ name: z.ZodString;
169
+ url: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ name: string;
172
+ url: string;
173
+ }, {
174
+ name: string;
175
+ url: string;
176
+ }>;
177
+ provider: z.ZodString;
178
+ syncedAt: z.ZodString;
179
+ tags: z.ZodArray<z.ZodString, "many">;
180
+ underlyingTokens: z.ZodArray<z.ZodObject<{
181
+ symbol: z.ZodString;
182
+ address: z.ZodString;
183
+ decimals: z.ZodNumber;
184
+ }, "strip", z.ZodTypeAny, {
185
+ symbol: string;
186
+ address: string;
187
+ decimals: number;
188
+ }, {
189
+ symbol: string;
190
+ address: string;
191
+ decimals: number;
192
+ }>, "many">;
193
+ lpTokens: z.ZodArray<z.ZodUnknown, "many">;
194
+ analytics: z.ZodObject<{
195
+ apy: z.ZodObject<{
196
+ base: z.ZodNumber;
197
+ total: z.ZodNumber;
198
+ reward: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ base: number;
201
+ total: number;
202
+ reward: number;
203
+ }, {
204
+ base: number;
205
+ total: number;
206
+ reward: number | null;
207
+ }>;
208
+ tvl: z.ZodObject<{
209
+ usd: z.ZodString;
210
+ }, "strip", z.ZodTypeAny, {
211
+ usd: string;
212
+ }, {
213
+ usd: string;
214
+ }>;
215
+ apy1d: z.ZodNullable<z.ZodNumber>;
216
+ apy7d: z.ZodNullable<z.ZodNumber>;
217
+ apy30d: z.ZodNullable<z.ZodNumber>;
218
+ updatedAt: z.ZodString;
219
+ }, "strip", z.ZodTypeAny, {
220
+ apy: {
221
+ base: number;
222
+ total: number;
223
+ reward: number;
224
+ };
225
+ tvl: {
226
+ usd: string;
227
+ };
228
+ apy1d: number | null;
229
+ apy7d: number | null;
230
+ apy30d: number | null;
231
+ updatedAt: string;
232
+ }, {
233
+ apy: {
234
+ base: number;
235
+ total: number;
236
+ reward: number | null;
237
+ };
238
+ tvl: {
239
+ usd: string;
240
+ };
241
+ apy1d: number | null;
242
+ apy7d: number | null;
243
+ apy30d: number | null;
244
+ updatedAt: string;
245
+ }>;
246
+ isTransactional: z.ZodBoolean;
247
+ isRedeemable: z.ZodBoolean;
248
+ depositPacks: z.ZodArray<z.ZodObject<{
249
+ name: z.ZodString;
250
+ stepsType: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ name: string;
253
+ stepsType: string;
254
+ }, {
255
+ name: string;
256
+ stepsType: string;
257
+ }>, "many">;
258
+ redeemPacks: z.ZodArray<z.ZodObject<{
259
+ name: z.ZodString;
260
+ stepsType: z.ZodString;
261
+ }, "strip", z.ZodTypeAny, {
262
+ name: string;
263
+ stepsType: string;
264
+ }, {
265
+ name: string;
266
+ stepsType: string;
267
+ }>, "many">;
268
+ }, "strip", z.ZodTypeAny, {
269
+ name: string;
270
+ address: string;
271
+ chainId: number;
272
+ slug: string;
273
+ network: string;
274
+ protocol: {
275
+ name: string;
276
+ url: string;
277
+ };
278
+ provider: string;
279
+ syncedAt: string;
280
+ tags: string[];
281
+ underlyingTokens: {
282
+ symbol: string;
283
+ address: string;
284
+ decimals: number;
285
+ }[];
286
+ lpTokens: unknown[];
287
+ analytics: {
288
+ apy: {
289
+ base: number;
290
+ total: number;
291
+ reward: number;
292
+ };
293
+ tvl: {
294
+ usd: string;
295
+ };
296
+ apy1d: number | null;
297
+ apy7d: number | null;
298
+ apy30d: number | null;
299
+ updatedAt: string;
300
+ };
301
+ isTransactional: boolean;
302
+ isRedeemable: boolean;
303
+ depositPacks: {
304
+ name: string;
305
+ stepsType: string;
306
+ }[];
307
+ redeemPacks: {
308
+ name: string;
309
+ stepsType: string;
310
+ }[];
311
+ description?: string | undefined;
312
+ }, {
313
+ name: string;
314
+ address: string;
315
+ chainId: number;
316
+ slug: string;
317
+ network: string;
318
+ protocol: {
319
+ name: string;
320
+ url: string;
321
+ };
322
+ provider: string;
323
+ syncedAt: string;
324
+ tags: string[];
325
+ underlyingTokens: {
326
+ symbol: string;
327
+ address: string;
328
+ decimals: number;
329
+ }[];
330
+ lpTokens: unknown[];
331
+ analytics: {
332
+ apy: {
333
+ base: number;
334
+ total: number;
335
+ reward: number | null;
336
+ };
337
+ tvl: {
338
+ usd: string;
339
+ };
340
+ apy1d: number | null;
341
+ apy7d: number | null;
342
+ apy30d: number | null;
343
+ updatedAt: string;
344
+ };
345
+ isTransactional: boolean;
346
+ isRedeemable: boolean;
347
+ depositPacks: {
348
+ name: string;
349
+ stepsType: string;
350
+ }[];
351
+ redeemPacks: {
352
+ name: string;
353
+ stepsType: string;
354
+ }[];
355
+ description?: string | undefined;
356
+ }>;
357
+ type Vault = z.infer<typeof VaultSchema>;
358
+ /** Paginated vault list response */
359
+ declare const VaultListResponseSchema: z.ZodObject<{
360
+ data: z.ZodArray<z.ZodObject<{
361
+ address: z.ZodString;
362
+ chainId: z.ZodNumber;
363
+ name: z.ZodString;
364
+ slug: z.ZodString;
365
+ network: z.ZodString;
366
+ description: z.ZodOptional<z.ZodString>;
367
+ protocol: z.ZodObject<{
368
+ name: z.ZodString;
369
+ url: z.ZodString;
370
+ }, "strip", z.ZodTypeAny, {
371
+ name: string;
372
+ url: string;
373
+ }, {
374
+ name: string;
375
+ url: string;
376
+ }>;
377
+ provider: z.ZodString;
378
+ syncedAt: z.ZodString;
379
+ tags: z.ZodArray<z.ZodString, "many">;
380
+ underlyingTokens: z.ZodArray<z.ZodObject<{
381
+ symbol: z.ZodString;
382
+ address: z.ZodString;
383
+ decimals: z.ZodNumber;
384
+ }, "strip", z.ZodTypeAny, {
385
+ symbol: string;
386
+ address: string;
387
+ decimals: number;
388
+ }, {
389
+ symbol: string;
390
+ address: string;
391
+ decimals: number;
392
+ }>, "many">;
393
+ lpTokens: z.ZodArray<z.ZodUnknown, "many">;
394
+ analytics: z.ZodObject<{
395
+ apy: z.ZodObject<{
396
+ base: z.ZodNumber;
397
+ total: z.ZodNumber;
398
+ reward: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ base: number;
401
+ total: number;
402
+ reward: number;
403
+ }, {
404
+ base: number;
405
+ total: number;
406
+ reward: number | null;
407
+ }>;
408
+ tvl: z.ZodObject<{
409
+ usd: z.ZodString;
410
+ }, "strip", z.ZodTypeAny, {
411
+ usd: string;
412
+ }, {
413
+ usd: string;
414
+ }>;
415
+ apy1d: z.ZodNullable<z.ZodNumber>;
416
+ apy7d: z.ZodNullable<z.ZodNumber>;
417
+ apy30d: z.ZodNullable<z.ZodNumber>;
418
+ updatedAt: z.ZodString;
419
+ }, "strip", z.ZodTypeAny, {
420
+ apy: {
421
+ base: number;
422
+ total: number;
423
+ reward: number;
424
+ };
425
+ tvl: {
426
+ usd: string;
427
+ };
428
+ apy1d: number | null;
429
+ apy7d: number | null;
430
+ apy30d: number | null;
431
+ updatedAt: string;
432
+ }, {
433
+ apy: {
434
+ base: number;
435
+ total: number;
436
+ reward: number | null;
437
+ };
438
+ tvl: {
439
+ usd: string;
440
+ };
441
+ apy1d: number | null;
442
+ apy7d: number | null;
443
+ apy30d: number | null;
444
+ updatedAt: string;
445
+ }>;
446
+ isTransactional: z.ZodBoolean;
447
+ isRedeemable: z.ZodBoolean;
448
+ depositPacks: z.ZodArray<z.ZodObject<{
449
+ name: z.ZodString;
450
+ stepsType: z.ZodString;
451
+ }, "strip", z.ZodTypeAny, {
452
+ name: string;
453
+ stepsType: string;
454
+ }, {
455
+ name: string;
456
+ stepsType: string;
457
+ }>, "many">;
458
+ redeemPacks: z.ZodArray<z.ZodObject<{
459
+ name: z.ZodString;
460
+ stepsType: z.ZodString;
461
+ }, "strip", z.ZodTypeAny, {
462
+ name: string;
463
+ stepsType: string;
464
+ }, {
465
+ name: string;
466
+ stepsType: string;
467
+ }>, "many">;
468
+ }, "strip", z.ZodTypeAny, {
469
+ name: string;
470
+ address: string;
471
+ chainId: number;
472
+ slug: string;
473
+ network: string;
474
+ protocol: {
475
+ name: string;
476
+ url: string;
477
+ };
478
+ provider: string;
479
+ syncedAt: string;
480
+ tags: string[];
481
+ underlyingTokens: {
482
+ symbol: string;
483
+ address: string;
484
+ decimals: number;
485
+ }[];
486
+ lpTokens: unknown[];
487
+ analytics: {
488
+ apy: {
489
+ base: number;
490
+ total: number;
491
+ reward: number;
492
+ };
493
+ tvl: {
494
+ usd: string;
495
+ };
496
+ apy1d: number | null;
497
+ apy7d: number | null;
498
+ apy30d: number | null;
499
+ updatedAt: string;
500
+ };
501
+ isTransactional: boolean;
502
+ isRedeemable: boolean;
503
+ depositPacks: {
504
+ name: string;
505
+ stepsType: string;
506
+ }[];
507
+ redeemPacks: {
508
+ name: string;
509
+ stepsType: string;
510
+ }[];
511
+ description?: string | undefined;
512
+ }, {
513
+ name: string;
514
+ address: string;
515
+ chainId: number;
516
+ slug: string;
517
+ network: string;
518
+ protocol: {
519
+ name: string;
520
+ url: string;
521
+ };
522
+ provider: string;
523
+ syncedAt: string;
524
+ tags: string[];
525
+ underlyingTokens: {
526
+ symbol: string;
527
+ address: string;
528
+ decimals: number;
529
+ }[];
530
+ lpTokens: unknown[];
531
+ analytics: {
532
+ apy: {
533
+ base: number;
534
+ total: number;
535
+ reward: number | null;
536
+ };
537
+ tvl: {
538
+ usd: string;
539
+ };
540
+ apy1d: number | null;
541
+ apy7d: number | null;
542
+ apy30d: number | null;
543
+ updatedAt: string;
544
+ };
545
+ isTransactional: boolean;
546
+ isRedeemable: boolean;
547
+ depositPacks: {
548
+ name: string;
549
+ stepsType: string;
550
+ }[];
551
+ redeemPacks: {
552
+ name: string;
553
+ stepsType: string;
554
+ }[];
555
+ description?: string | undefined;
556
+ }>, "many">;
557
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
558
+ total: z.ZodNumber;
559
+ }, "strip", z.ZodTypeAny, {
560
+ total: number;
561
+ data: {
562
+ name: string;
563
+ address: string;
564
+ chainId: number;
565
+ slug: string;
566
+ network: string;
567
+ protocol: {
568
+ name: string;
569
+ url: string;
570
+ };
571
+ provider: string;
572
+ syncedAt: string;
573
+ tags: string[];
574
+ underlyingTokens: {
575
+ symbol: string;
576
+ address: string;
577
+ decimals: number;
578
+ }[];
579
+ lpTokens: unknown[];
580
+ analytics: {
581
+ apy: {
582
+ base: number;
583
+ total: number;
584
+ reward: number;
585
+ };
586
+ tvl: {
587
+ usd: string;
588
+ };
589
+ apy1d: number | null;
590
+ apy7d: number | null;
591
+ apy30d: number | null;
592
+ updatedAt: string;
593
+ };
594
+ isTransactional: boolean;
595
+ isRedeemable: boolean;
596
+ depositPacks: {
597
+ name: string;
598
+ stepsType: string;
599
+ }[];
600
+ redeemPacks: {
601
+ name: string;
602
+ stepsType: string;
603
+ }[];
604
+ description?: string | undefined;
605
+ }[];
606
+ nextCursor?: string | null | undefined;
607
+ }, {
608
+ total: number;
609
+ data: {
610
+ name: string;
611
+ address: string;
612
+ chainId: number;
613
+ slug: string;
614
+ network: string;
615
+ protocol: {
616
+ name: string;
617
+ url: string;
618
+ };
619
+ provider: string;
620
+ syncedAt: string;
621
+ tags: string[];
622
+ underlyingTokens: {
623
+ symbol: string;
624
+ address: string;
625
+ decimals: number;
626
+ }[];
627
+ lpTokens: unknown[];
628
+ analytics: {
629
+ apy: {
630
+ base: number;
631
+ total: number;
632
+ reward: number | null;
633
+ };
634
+ tvl: {
635
+ usd: string;
636
+ };
637
+ apy1d: number | null;
638
+ apy7d: number | null;
639
+ apy30d: number | null;
640
+ updatedAt: string;
641
+ };
642
+ isTransactional: boolean;
643
+ isRedeemable: boolean;
644
+ depositPacks: {
645
+ name: string;
646
+ stepsType: string;
647
+ }[];
648
+ redeemPacks: {
649
+ name: string;
650
+ stepsType: string;
651
+ }[];
652
+ description?: string | undefined;
653
+ }[];
654
+ nextCursor?: string | null | undefined;
655
+ }>;
656
+ type VaultListResponse = z.infer<typeof VaultListResponseSchema>;
657
+ //#endregion
658
+ //#region src/schemas/chain.d.ts
659
+ /** Chain schema — from GET /v1/earn/chains */
660
+ declare const ChainSchema: z.ZodObject<{
661
+ chainId: z.ZodNumber;
662
+ name: z.ZodString;
663
+ networkCaip: z.ZodString;
664
+ }, "strip", z.ZodTypeAny, {
665
+ name: string;
666
+ chainId: number;
667
+ networkCaip: string;
668
+ }, {
669
+ name: string;
670
+ chainId: number;
671
+ networkCaip: string;
672
+ }>;
673
+ type Chain = z.infer<typeof ChainSchema>;
674
+ declare const ChainListResponseSchema: z.ZodArray<z.ZodObject<{
675
+ chainId: z.ZodNumber;
676
+ name: z.ZodString;
677
+ networkCaip: z.ZodString;
678
+ }, "strip", z.ZodTypeAny, {
679
+ name: string;
680
+ chainId: number;
681
+ networkCaip: string;
682
+ }, {
683
+ name: string;
684
+ chainId: number;
685
+ networkCaip: string;
686
+ }>, "many">;
687
+ //#endregion
688
+ //#region src/schemas/protocol.d.ts
689
+ /** Protocol schema — from GET /v1/earn/protocols */
690
+ declare const ProtocolDetailSchema: z.ZodObject<{
691
+ name: z.ZodString;
692
+ url: z.ZodString;
693
+ }, "strip", z.ZodTypeAny, {
694
+ name: string;
695
+ url: string;
696
+ }, {
697
+ name: string;
698
+ url: string;
699
+ }>;
700
+ type ProtocolDetail = z.infer<typeof ProtocolDetailSchema>;
701
+ declare const ProtocolListResponseSchema: z.ZodArray<z.ZodObject<{
702
+ name: z.ZodString;
703
+ url: z.ZodString;
704
+ }, "strip", z.ZodTypeAny, {
705
+ name: string;
706
+ url: string;
707
+ }, {
708
+ name: string;
709
+ url: string;
710
+ }>, "many">;
711
+ //#endregion
712
+ //#region src/schemas/portfolio.d.ts
713
+ /** Position asset */
714
+ declare const PositionAssetSchema: z.ZodObject<{
715
+ address: z.ZodString;
716
+ name: z.ZodString;
717
+ symbol: z.ZodString;
718
+ decimals: z.ZodNumber;
719
+ }, "strip", z.ZodTypeAny, {
720
+ symbol: string;
721
+ name: string;
722
+ address: string;
723
+ decimals: number;
724
+ }, {
725
+ symbol: string;
726
+ name: string;
727
+ address: string;
728
+ decimals: number;
729
+ }>;
730
+ /** Single portfolio position */
731
+ declare const PositionSchema: z.ZodObject<{
732
+ chainId: z.ZodNumber;
733
+ protocolName: z.ZodString;
734
+ asset: z.ZodObject<{
735
+ address: z.ZodString;
736
+ name: z.ZodString;
737
+ symbol: z.ZodString;
738
+ decimals: z.ZodNumber;
739
+ }, "strip", z.ZodTypeAny, {
740
+ symbol: string;
741
+ name: string;
742
+ address: string;
743
+ decimals: number;
744
+ }, {
745
+ symbol: string;
746
+ name: string;
747
+ address: string;
748
+ decimals: number;
749
+ }>;
750
+ balanceUsd: z.ZodString;
751
+ balanceNative: z.ZodString;
752
+ }, "strip", z.ZodTypeAny, {
753
+ chainId: number;
754
+ protocolName: string;
755
+ asset: {
756
+ symbol: string;
757
+ name: string;
758
+ address: string;
759
+ decimals: number;
760
+ };
761
+ balanceUsd: string;
762
+ balanceNative: string;
763
+ }, {
764
+ chainId: number;
765
+ protocolName: string;
766
+ asset: {
767
+ symbol: string;
768
+ name: string;
769
+ address: string;
770
+ decimals: number;
771
+ };
772
+ balanceUsd: string;
773
+ balanceNative: string;
774
+ }>;
775
+ type Position = z.infer<typeof PositionSchema>;
776
+ /** Portfolio response */
777
+ declare const PortfolioResponseSchema: z.ZodObject<{
778
+ positions: z.ZodArray<z.ZodObject<{
779
+ chainId: z.ZodNumber;
780
+ protocolName: z.ZodString;
781
+ asset: z.ZodObject<{
782
+ address: z.ZodString;
783
+ name: z.ZodString;
784
+ symbol: z.ZodString;
785
+ decimals: z.ZodNumber;
786
+ }, "strip", z.ZodTypeAny, {
787
+ symbol: string;
788
+ name: string;
789
+ address: string;
790
+ decimals: number;
791
+ }, {
792
+ symbol: string;
793
+ name: string;
794
+ address: string;
795
+ decimals: number;
796
+ }>;
797
+ balanceUsd: z.ZodString;
798
+ balanceNative: z.ZodString;
799
+ }, "strip", z.ZodTypeAny, {
800
+ chainId: number;
801
+ protocolName: string;
802
+ asset: {
803
+ symbol: string;
804
+ name: string;
805
+ address: string;
806
+ decimals: number;
807
+ };
808
+ balanceUsd: string;
809
+ balanceNative: string;
810
+ }, {
811
+ chainId: number;
812
+ protocolName: string;
813
+ asset: {
814
+ symbol: string;
815
+ name: string;
816
+ address: string;
817
+ decimals: number;
818
+ };
819
+ balanceUsd: string;
820
+ balanceNative: string;
821
+ }>, "many">;
822
+ }, "strip", z.ZodTypeAny, {
823
+ positions: {
824
+ chainId: number;
825
+ protocolName: string;
826
+ asset: {
827
+ symbol: string;
828
+ name: string;
829
+ address: string;
830
+ decimals: number;
831
+ };
832
+ balanceUsd: string;
833
+ balanceNative: string;
834
+ }[];
835
+ }, {
836
+ positions: {
837
+ chainId: number;
838
+ protocolName: string;
839
+ asset: {
840
+ symbol: string;
841
+ name: string;
842
+ address: string;
843
+ decimals: number;
844
+ };
845
+ balanceUsd: string;
846
+ balanceNative: string;
847
+ }[];
848
+ }>;
849
+ type PortfolioResponse = z.infer<typeof PortfolioResponseSchema>;
850
+ //#endregion
851
+ //#region src/schemas/quote.d.ts
852
+ /** Token info in Composer responses */
853
+ declare const ComposerTokenSchema: z.ZodObject<{
854
+ address: z.ZodString;
855
+ chainId: z.ZodNumber;
856
+ symbol: z.ZodString;
857
+ decimals: z.ZodNumber;
858
+ name: z.ZodString;
859
+ coinKey: z.ZodOptional<z.ZodString>;
860
+ logoURI: z.ZodOptional<z.ZodString>;
861
+ priceUSD: z.ZodOptional<z.ZodString>;
862
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
863
+ verificationStatus: z.ZodOptional<z.ZodString>;
864
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
865
+ }, "strip", z.ZodTypeAny, {
866
+ symbol: string;
867
+ name: string;
868
+ address: string;
869
+ decimals: number;
870
+ chainId: number;
871
+ tags?: string[] | undefined;
872
+ coinKey?: string | undefined;
873
+ logoURI?: string | undefined;
874
+ priceUSD?: string | undefined;
875
+ verificationStatus?: string | undefined;
876
+ verificationStatusBreakdown?: unknown[] | undefined;
877
+ }, {
878
+ symbol: string;
879
+ name: string;
880
+ address: string;
881
+ decimals: number;
882
+ chainId: number;
883
+ tags?: string[] | undefined;
884
+ coinKey?: string | undefined;
885
+ logoURI?: string | undefined;
886
+ priceUSD?: string | undefined;
887
+ verificationStatus?: string | undefined;
888
+ verificationStatusBreakdown?: unknown[] | undefined;
889
+ }>;
890
+ /** Tool details */
891
+ declare const ToolDetailsSchema: z.ZodObject<{
892
+ key: z.ZodString;
893
+ name: z.ZodString;
894
+ logoURI: z.ZodOptional<z.ZodString>;
895
+ }, "strip", z.ZodTypeAny, {
896
+ name: string;
897
+ key: string;
898
+ logoURI?: string | undefined;
899
+ }, {
900
+ name: string;
901
+ key: string;
902
+ logoURI?: string | undefined;
903
+ }>;
904
+ /** Fee split */
905
+ declare const FeeSplitSchema: z.ZodObject<{
906
+ integratorFee: z.ZodString;
907
+ lifiFee: z.ZodString;
908
+ }, "strip", z.ZodTypeAny, {
909
+ integratorFee: string;
910
+ lifiFee: string;
911
+ }, {
912
+ integratorFee: string;
913
+ lifiFee: string;
914
+ }>;
915
+ /** Fee cost */
916
+ declare const FeeCostSchema: z.ZodObject<{
917
+ name: z.ZodString;
918
+ description: z.ZodOptional<z.ZodString>;
919
+ token: z.ZodObject<{
920
+ address: z.ZodString;
921
+ chainId: z.ZodNumber;
922
+ symbol: z.ZodString;
923
+ decimals: z.ZodNumber;
924
+ name: z.ZodString;
925
+ coinKey: z.ZodOptional<z.ZodString>;
926
+ logoURI: z.ZodOptional<z.ZodString>;
927
+ priceUSD: z.ZodOptional<z.ZodString>;
928
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
929
+ verificationStatus: z.ZodOptional<z.ZodString>;
930
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ symbol: string;
933
+ name: string;
934
+ address: string;
935
+ decimals: number;
936
+ chainId: number;
937
+ tags?: string[] | undefined;
938
+ coinKey?: string | undefined;
939
+ logoURI?: string | undefined;
940
+ priceUSD?: string | undefined;
941
+ verificationStatus?: string | undefined;
942
+ verificationStatusBreakdown?: unknown[] | undefined;
943
+ }, {
944
+ symbol: string;
945
+ name: string;
946
+ address: string;
947
+ decimals: number;
948
+ chainId: number;
949
+ tags?: string[] | undefined;
950
+ coinKey?: string | undefined;
951
+ logoURI?: string | undefined;
952
+ priceUSD?: string | undefined;
953
+ verificationStatus?: string | undefined;
954
+ verificationStatusBreakdown?: unknown[] | undefined;
955
+ }>;
956
+ amount: z.ZodString;
957
+ amountUSD: z.ZodString;
958
+ percentage: z.ZodString;
959
+ included: z.ZodBoolean;
960
+ feeSplit: z.ZodOptional<z.ZodObject<{
961
+ integratorFee: z.ZodString;
962
+ lifiFee: z.ZodString;
963
+ }, "strip", z.ZodTypeAny, {
964
+ integratorFee: string;
965
+ lifiFee: string;
966
+ }, {
967
+ integratorFee: string;
968
+ lifiFee: string;
969
+ }>>;
970
+ }, "strip", z.ZodTypeAny, {
971
+ name: string;
972
+ token: {
973
+ symbol: string;
974
+ name: string;
975
+ address: string;
976
+ decimals: number;
977
+ chainId: number;
978
+ tags?: string[] | undefined;
979
+ coinKey?: string | undefined;
980
+ logoURI?: string | undefined;
981
+ priceUSD?: string | undefined;
982
+ verificationStatus?: string | undefined;
983
+ verificationStatusBreakdown?: unknown[] | undefined;
984
+ };
985
+ amount: string;
986
+ amountUSD: string;
987
+ percentage: string;
988
+ included: boolean;
989
+ description?: string | undefined;
990
+ feeSplit?: {
991
+ integratorFee: string;
992
+ lifiFee: string;
993
+ } | undefined;
994
+ }, {
995
+ name: string;
996
+ token: {
997
+ symbol: string;
998
+ name: string;
999
+ address: string;
1000
+ decimals: number;
1001
+ chainId: number;
1002
+ tags?: string[] | undefined;
1003
+ coinKey?: string | undefined;
1004
+ logoURI?: string | undefined;
1005
+ priceUSD?: string | undefined;
1006
+ verificationStatus?: string | undefined;
1007
+ verificationStatusBreakdown?: unknown[] | undefined;
1008
+ };
1009
+ amount: string;
1010
+ amountUSD: string;
1011
+ percentage: string;
1012
+ included: boolean;
1013
+ description?: string | undefined;
1014
+ feeSplit?: {
1015
+ integratorFee: string;
1016
+ lifiFee: string;
1017
+ } | undefined;
1018
+ }>;
1019
+ /** Gas cost */
1020
+ declare const GasCostSchema: z.ZodObject<{
1021
+ type: z.ZodString;
1022
+ price: z.ZodOptional<z.ZodString>;
1023
+ estimate: z.ZodOptional<z.ZodString>;
1024
+ limit: z.ZodOptional<z.ZodString>;
1025
+ amount: z.ZodString;
1026
+ amountUSD: z.ZodString;
1027
+ token: z.ZodObject<{
1028
+ address: z.ZodString;
1029
+ chainId: z.ZodNumber;
1030
+ symbol: z.ZodString;
1031
+ decimals: z.ZodNumber;
1032
+ name: z.ZodString;
1033
+ coinKey: z.ZodOptional<z.ZodString>;
1034
+ logoURI: z.ZodOptional<z.ZodString>;
1035
+ priceUSD: z.ZodOptional<z.ZodString>;
1036
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1037
+ verificationStatus: z.ZodOptional<z.ZodString>;
1038
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1039
+ }, "strip", z.ZodTypeAny, {
1040
+ symbol: string;
1041
+ name: string;
1042
+ address: string;
1043
+ decimals: number;
1044
+ chainId: number;
1045
+ tags?: string[] | undefined;
1046
+ coinKey?: string | undefined;
1047
+ logoURI?: string | undefined;
1048
+ priceUSD?: string | undefined;
1049
+ verificationStatus?: string | undefined;
1050
+ verificationStatusBreakdown?: unknown[] | undefined;
1051
+ }, {
1052
+ symbol: string;
1053
+ name: string;
1054
+ address: string;
1055
+ decimals: number;
1056
+ chainId: number;
1057
+ tags?: string[] | undefined;
1058
+ coinKey?: string | undefined;
1059
+ logoURI?: string | undefined;
1060
+ priceUSD?: string | undefined;
1061
+ verificationStatus?: string | undefined;
1062
+ verificationStatusBreakdown?: unknown[] | undefined;
1063
+ }>;
1064
+ }, "strip", z.ZodTypeAny, {
1065
+ type: string;
1066
+ token: {
1067
+ symbol: string;
1068
+ name: string;
1069
+ address: string;
1070
+ decimals: number;
1071
+ chainId: number;
1072
+ tags?: string[] | undefined;
1073
+ coinKey?: string | undefined;
1074
+ logoURI?: string | undefined;
1075
+ priceUSD?: string | undefined;
1076
+ verificationStatus?: string | undefined;
1077
+ verificationStatusBreakdown?: unknown[] | undefined;
1078
+ };
1079
+ amount: string;
1080
+ amountUSD: string;
1081
+ price?: string | undefined;
1082
+ estimate?: string | undefined;
1083
+ limit?: string | undefined;
1084
+ }, {
1085
+ type: string;
1086
+ token: {
1087
+ symbol: string;
1088
+ name: string;
1089
+ address: string;
1090
+ decimals: number;
1091
+ chainId: number;
1092
+ tags?: string[] | undefined;
1093
+ coinKey?: string | undefined;
1094
+ logoURI?: string | undefined;
1095
+ priceUSD?: string | undefined;
1096
+ verificationStatus?: string | undefined;
1097
+ verificationStatusBreakdown?: unknown[] | undefined;
1098
+ };
1099
+ amount: string;
1100
+ amountUSD: string;
1101
+ price?: string | undefined;
1102
+ estimate?: string | undefined;
1103
+ limit?: string | undefined;
1104
+ }>;
1105
+ /** Quote action */
1106
+ declare const QuoteActionSchema: z.ZodObject<{
1107
+ fromToken: z.ZodObject<{
1108
+ address: z.ZodString;
1109
+ chainId: z.ZodNumber;
1110
+ symbol: z.ZodString;
1111
+ decimals: z.ZodNumber;
1112
+ name: z.ZodString;
1113
+ coinKey: z.ZodOptional<z.ZodString>;
1114
+ logoURI: z.ZodOptional<z.ZodString>;
1115
+ priceUSD: z.ZodOptional<z.ZodString>;
1116
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1117
+ verificationStatus: z.ZodOptional<z.ZodString>;
1118
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1119
+ }, "strip", z.ZodTypeAny, {
1120
+ symbol: string;
1121
+ name: string;
1122
+ address: string;
1123
+ decimals: number;
1124
+ chainId: number;
1125
+ tags?: string[] | undefined;
1126
+ coinKey?: string | undefined;
1127
+ logoURI?: string | undefined;
1128
+ priceUSD?: string | undefined;
1129
+ verificationStatus?: string | undefined;
1130
+ verificationStatusBreakdown?: unknown[] | undefined;
1131
+ }, {
1132
+ symbol: string;
1133
+ name: string;
1134
+ address: string;
1135
+ decimals: number;
1136
+ chainId: number;
1137
+ tags?: string[] | undefined;
1138
+ coinKey?: string | undefined;
1139
+ logoURI?: string | undefined;
1140
+ priceUSD?: string | undefined;
1141
+ verificationStatus?: string | undefined;
1142
+ verificationStatusBreakdown?: unknown[] | undefined;
1143
+ }>;
1144
+ fromAmount: z.ZodString;
1145
+ toToken: z.ZodObject<{
1146
+ address: z.ZodString;
1147
+ chainId: z.ZodNumber;
1148
+ symbol: z.ZodString;
1149
+ decimals: z.ZodNumber;
1150
+ name: z.ZodString;
1151
+ coinKey: z.ZodOptional<z.ZodString>;
1152
+ logoURI: z.ZodOptional<z.ZodString>;
1153
+ priceUSD: z.ZodOptional<z.ZodString>;
1154
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1155
+ verificationStatus: z.ZodOptional<z.ZodString>;
1156
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1157
+ }, "strip", z.ZodTypeAny, {
1158
+ symbol: string;
1159
+ name: string;
1160
+ address: string;
1161
+ decimals: number;
1162
+ chainId: number;
1163
+ tags?: string[] | undefined;
1164
+ coinKey?: string | undefined;
1165
+ logoURI?: string | undefined;
1166
+ priceUSD?: string | undefined;
1167
+ verificationStatus?: string | undefined;
1168
+ verificationStatusBreakdown?: unknown[] | undefined;
1169
+ }, {
1170
+ symbol: string;
1171
+ name: string;
1172
+ address: string;
1173
+ decimals: number;
1174
+ chainId: number;
1175
+ tags?: string[] | undefined;
1176
+ coinKey?: string | undefined;
1177
+ logoURI?: string | undefined;
1178
+ priceUSD?: string | undefined;
1179
+ verificationStatus?: string | undefined;
1180
+ verificationStatusBreakdown?: unknown[] | undefined;
1181
+ }>;
1182
+ fromChainId: z.ZodNumber;
1183
+ toChainId: z.ZodNumber;
1184
+ slippage: z.ZodNumber;
1185
+ fromAddress: z.ZodString;
1186
+ toAddress: z.ZodString;
1187
+ }, "strip", z.ZodTypeAny, {
1188
+ fromToken: {
1189
+ symbol: string;
1190
+ name: string;
1191
+ address: string;
1192
+ decimals: number;
1193
+ chainId: number;
1194
+ tags?: string[] | undefined;
1195
+ coinKey?: string | undefined;
1196
+ logoURI?: string | undefined;
1197
+ priceUSD?: string | undefined;
1198
+ verificationStatus?: string | undefined;
1199
+ verificationStatusBreakdown?: unknown[] | undefined;
1200
+ };
1201
+ fromAmount: string;
1202
+ toToken: {
1203
+ symbol: string;
1204
+ name: string;
1205
+ address: string;
1206
+ decimals: number;
1207
+ chainId: number;
1208
+ tags?: string[] | undefined;
1209
+ coinKey?: string | undefined;
1210
+ logoURI?: string | undefined;
1211
+ priceUSD?: string | undefined;
1212
+ verificationStatus?: string | undefined;
1213
+ verificationStatusBreakdown?: unknown[] | undefined;
1214
+ };
1215
+ fromChainId: number;
1216
+ toChainId: number;
1217
+ slippage: number;
1218
+ fromAddress: string;
1219
+ toAddress: string;
1220
+ }, {
1221
+ fromToken: {
1222
+ symbol: string;
1223
+ name: string;
1224
+ address: string;
1225
+ decimals: number;
1226
+ chainId: number;
1227
+ tags?: string[] | undefined;
1228
+ coinKey?: string | undefined;
1229
+ logoURI?: string | undefined;
1230
+ priceUSD?: string | undefined;
1231
+ verificationStatus?: string | undefined;
1232
+ verificationStatusBreakdown?: unknown[] | undefined;
1233
+ };
1234
+ fromAmount: string;
1235
+ toToken: {
1236
+ symbol: string;
1237
+ name: string;
1238
+ address: string;
1239
+ decimals: number;
1240
+ chainId: number;
1241
+ tags?: string[] | undefined;
1242
+ coinKey?: string | undefined;
1243
+ logoURI?: string | undefined;
1244
+ priceUSD?: string | undefined;
1245
+ verificationStatus?: string | undefined;
1246
+ verificationStatusBreakdown?: unknown[] | undefined;
1247
+ };
1248
+ fromChainId: number;
1249
+ toChainId: number;
1250
+ slippage: number;
1251
+ fromAddress: string;
1252
+ toAddress: string;
1253
+ }>;
1254
+ /** Quote estimate */
1255
+ declare const QuoteEstimateSchema: z.ZodObject<{
1256
+ tool: z.ZodString;
1257
+ approvalAddress: z.ZodOptional<z.ZodString>;
1258
+ toAmountMin: z.ZodString;
1259
+ toAmount: z.ZodString;
1260
+ fromAmount: z.ZodString;
1261
+ feeCosts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1262
+ name: z.ZodString;
1263
+ description: z.ZodOptional<z.ZodString>;
1264
+ token: z.ZodObject<{
1265
+ address: z.ZodString;
1266
+ chainId: z.ZodNumber;
1267
+ symbol: z.ZodString;
1268
+ decimals: z.ZodNumber;
1269
+ name: z.ZodString;
1270
+ coinKey: z.ZodOptional<z.ZodString>;
1271
+ logoURI: z.ZodOptional<z.ZodString>;
1272
+ priceUSD: z.ZodOptional<z.ZodString>;
1273
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1274
+ verificationStatus: z.ZodOptional<z.ZodString>;
1275
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1276
+ }, "strip", z.ZodTypeAny, {
1277
+ symbol: string;
1278
+ name: string;
1279
+ address: string;
1280
+ decimals: number;
1281
+ chainId: number;
1282
+ tags?: string[] | undefined;
1283
+ coinKey?: string | undefined;
1284
+ logoURI?: string | undefined;
1285
+ priceUSD?: string | undefined;
1286
+ verificationStatus?: string | undefined;
1287
+ verificationStatusBreakdown?: unknown[] | undefined;
1288
+ }, {
1289
+ symbol: string;
1290
+ name: string;
1291
+ address: string;
1292
+ decimals: number;
1293
+ chainId: number;
1294
+ tags?: string[] | undefined;
1295
+ coinKey?: string | undefined;
1296
+ logoURI?: string | undefined;
1297
+ priceUSD?: string | undefined;
1298
+ verificationStatus?: string | undefined;
1299
+ verificationStatusBreakdown?: unknown[] | undefined;
1300
+ }>;
1301
+ amount: z.ZodString;
1302
+ amountUSD: z.ZodString;
1303
+ percentage: z.ZodString;
1304
+ included: z.ZodBoolean;
1305
+ feeSplit: z.ZodOptional<z.ZodObject<{
1306
+ integratorFee: z.ZodString;
1307
+ lifiFee: z.ZodString;
1308
+ }, "strip", z.ZodTypeAny, {
1309
+ integratorFee: string;
1310
+ lifiFee: string;
1311
+ }, {
1312
+ integratorFee: string;
1313
+ lifiFee: string;
1314
+ }>>;
1315
+ }, "strip", z.ZodTypeAny, {
1316
+ name: string;
1317
+ token: {
1318
+ symbol: string;
1319
+ name: string;
1320
+ address: string;
1321
+ decimals: number;
1322
+ chainId: number;
1323
+ tags?: string[] | undefined;
1324
+ coinKey?: string | undefined;
1325
+ logoURI?: string | undefined;
1326
+ priceUSD?: string | undefined;
1327
+ verificationStatus?: string | undefined;
1328
+ verificationStatusBreakdown?: unknown[] | undefined;
1329
+ };
1330
+ amount: string;
1331
+ amountUSD: string;
1332
+ percentage: string;
1333
+ included: boolean;
1334
+ description?: string | undefined;
1335
+ feeSplit?: {
1336
+ integratorFee: string;
1337
+ lifiFee: string;
1338
+ } | undefined;
1339
+ }, {
1340
+ name: string;
1341
+ token: {
1342
+ symbol: string;
1343
+ name: string;
1344
+ address: string;
1345
+ decimals: number;
1346
+ chainId: number;
1347
+ tags?: string[] | undefined;
1348
+ coinKey?: string | undefined;
1349
+ logoURI?: string | undefined;
1350
+ priceUSD?: string | undefined;
1351
+ verificationStatus?: string | undefined;
1352
+ verificationStatusBreakdown?: unknown[] | undefined;
1353
+ };
1354
+ amount: string;
1355
+ amountUSD: string;
1356
+ percentage: string;
1357
+ included: boolean;
1358
+ description?: string | undefined;
1359
+ feeSplit?: {
1360
+ integratorFee: string;
1361
+ lifiFee: string;
1362
+ } | undefined;
1363
+ }>, "many">>;
1364
+ gasCosts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1365
+ type: z.ZodString;
1366
+ price: z.ZodOptional<z.ZodString>;
1367
+ estimate: z.ZodOptional<z.ZodString>;
1368
+ limit: z.ZodOptional<z.ZodString>;
1369
+ amount: z.ZodString;
1370
+ amountUSD: z.ZodString;
1371
+ token: z.ZodObject<{
1372
+ address: z.ZodString;
1373
+ chainId: z.ZodNumber;
1374
+ symbol: z.ZodString;
1375
+ decimals: z.ZodNumber;
1376
+ name: z.ZodString;
1377
+ coinKey: z.ZodOptional<z.ZodString>;
1378
+ logoURI: z.ZodOptional<z.ZodString>;
1379
+ priceUSD: z.ZodOptional<z.ZodString>;
1380
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1381
+ verificationStatus: z.ZodOptional<z.ZodString>;
1382
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1383
+ }, "strip", z.ZodTypeAny, {
1384
+ symbol: string;
1385
+ name: string;
1386
+ address: string;
1387
+ decimals: number;
1388
+ chainId: number;
1389
+ tags?: string[] | undefined;
1390
+ coinKey?: string | undefined;
1391
+ logoURI?: string | undefined;
1392
+ priceUSD?: string | undefined;
1393
+ verificationStatus?: string | undefined;
1394
+ verificationStatusBreakdown?: unknown[] | undefined;
1395
+ }, {
1396
+ symbol: string;
1397
+ name: string;
1398
+ address: string;
1399
+ decimals: number;
1400
+ chainId: number;
1401
+ tags?: string[] | undefined;
1402
+ coinKey?: string | undefined;
1403
+ logoURI?: string | undefined;
1404
+ priceUSD?: string | undefined;
1405
+ verificationStatus?: string | undefined;
1406
+ verificationStatusBreakdown?: unknown[] | undefined;
1407
+ }>;
1408
+ }, "strip", z.ZodTypeAny, {
1409
+ type: string;
1410
+ token: {
1411
+ symbol: string;
1412
+ name: string;
1413
+ address: string;
1414
+ decimals: number;
1415
+ chainId: number;
1416
+ tags?: string[] | undefined;
1417
+ coinKey?: string | undefined;
1418
+ logoURI?: string | undefined;
1419
+ priceUSD?: string | undefined;
1420
+ verificationStatus?: string | undefined;
1421
+ verificationStatusBreakdown?: unknown[] | undefined;
1422
+ };
1423
+ amount: string;
1424
+ amountUSD: string;
1425
+ price?: string | undefined;
1426
+ estimate?: string | undefined;
1427
+ limit?: string | undefined;
1428
+ }, {
1429
+ type: string;
1430
+ token: {
1431
+ symbol: string;
1432
+ name: string;
1433
+ address: string;
1434
+ decimals: number;
1435
+ chainId: number;
1436
+ tags?: string[] | undefined;
1437
+ coinKey?: string | undefined;
1438
+ logoURI?: string | undefined;
1439
+ priceUSD?: string | undefined;
1440
+ verificationStatus?: string | undefined;
1441
+ verificationStatusBreakdown?: unknown[] | undefined;
1442
+ };
1443
+ amount: string;
1444
+ amountUSD: string;
1445
+ price?: string | undefined;
1446
+ estimate?: string | undefined;
1447
+ limit?: string | undefined;
1448
+ }>, "many">>;
1449
+ executionDuration: z.ZodNumber;
1450
+ fromAmountUSD: z.ZodOptional<z.ZodString>;
1451
+ toAmountUSD: z.ZodOptional<z.ZodString>;
1452
+ }, "strip", z.ZodTypeAny, {
1453
+ fromAmount: string;
1454
+ tool: string;
1455
+ toAmountMin: string;
1456
+ toAmount: string;
1457
+ executionDuration: number;
1458
+ approvalAddress?: string | undefined;
1459
+ feeCosts?: {
1460
+ name: string;
1461
+ token: {
1462
+ symbol: string;
1463
+ name: string;
1464
+ address: string;
1465
+ decimals: number;
1466
+ chainId: number;
1467
+ tags?: string[] | undefined;
1468
+ coinKey?: string | undefined;
1469
+ logoURI?: string | undefined;
1470
+ priceUSD?: string | undefined;
1471
+ verificationStatus?: string | undefined;
1472
+ verificationStatusBreakdown?: unknown[] | undefined;
1473
+ };
1474
+ amount: string;
1475
+ amountUSD: string;
1476
+ percentage: string;
1477
+ included: boolean;
1478
+ description?: string | undefined;
1479
+ feeSplit?: {
1480
+ integratorFee: string;
1481
+ lifiFee: string;
1482
+ } | undefined;
1483
+ }[] | undefined;
1484
+ gasCosts?: {
1485
+ type: string;
1486
+ token: {
1487
+ symbol: string;
1488
+ name: string;
1489
+ address: string;
1490
+ decimals: number;
1491
+ chainId: number;
1492
+ tags?: string[] | undefined;
1493
+ coinKey?: string | undefined;
1494
+ logoURI?: string | undefined;
1495
+ priceUSD?: string | undefined;
1496
+ verificationStatus?: string | undefined;
1497
+ verificationStatusBreakdown?: unknown[] | undefined;
1498
+ };
1499
+ amount: string;
1500
+ amountUSD: string;
1501
+ price?: string | undefined;
1502
+ estimate?: string | undefined;
1503
+ limit?: string | undefined;
1504
+ }[] | undefined;
1505
+ fromAmountUSD?: string | undefined;
1506
+ toAmountUSD?: string | undefined;
1507
+ }, {
1508
+ fromAmount: string;
1509
+ tool: string;
1510
+ toAmountMin: string;
1511
+ toAmount: string;
1512
+ executionDuration: number;
1513
+ approvalAddress?: string | undefined;
1514
+ feeCosts?: {
1515
+ name: string;
1516
+ token: {
1517
+ symbol: string;
1518
+ name: string;
1519
+ address: string;
1520
+ decimals: number;
1521
+ chainId: number;
1522
+ tags?: string[] | undefined;
1523
+ coinKey?: string | undefined;
1524
+ logoURI?: string | undefined;
1525
+ priceUSD?: string | undefined;
1526
+ verificationStatus?: string | undefined;
1527
+ verificationStatusBreakdown?: unknown[] | undefined;
1528
+ };
1529
+ amount: string;
1530
+ amountUSD: string;
1531
+ percentage: string;
1532
+ included: boolean;
1533
+ description?: string | undefined;
1534
+ feeSplit?: {
1535
+ integratorFee: string;
1536
+ lifiFee: string;
1537
+ } | undefined;
1538
+ }[] | undefined;
1539
+ gasCosts?: {
1540
+ type: string;
1541
+ token: {
1542
+ symbol: string;
1543
+ name: string;
1544
+ address: string;
1545
+ decimals: number;
1546
+ chainId: number;
1547
+ tags?: string[] | undefined;
1548
+ coinKey?: string | undefined;
1549
+ logoURI?: string | undefined;
1550
+ priceUSD?: string | undefined;
1551
+ verificationStatus?: string | undefined;
1552
+ verificationStatusBreakdown?: unknown[] | undefined;
1553
+ };
1554
+ amount: string;
1555
+ amountUSD: string;
1556
+ price?: string | undefined;
1557
+ estimate?: string | undefined;
1558
+ limit?: string | undefined;
1559
+ }[] | undefined;
1560
+ fromAmountUSD?: string | undefined;
1561
+ toAmountUSD?: string | undefined;
1562
+ }>;
1563
+ /** Transaction request — ready to sign */
1564
+ declare const TransactionRequestSchema: z.ZodObject<{
1565
+ to: z.ZodString;
1566
+ data: z.ZodString;
1567
+ value: z.ZodString;
1568
+ chainId: z.ZodNumber;
1569
+ gasPrice: z.ZodOptional<z.ZodString>;
1570
+ gasLimit: z.ZodOptional<z.ZodString>;
1571
+ from: z.ZodOptional<z.ZodString>;
1572
+ }, "strip", z.ZodTypeAny, {
1573
+ value: string;
1574
+ chainId: number;
1575
+ data: string;
1576
+ to: string;
1577
+ gasPrice?: string | undefined;
1578
+ gasLimit?: string | undefined;
1579
+ from?: string | undefined;
1580
+ }, {
1581
+ value: string;
1582
+ chainId: number;
1583
+ data: string;
1584
+ to: string;
1585
+ gasPrice?: string | undefined;
1586
+ gasLimit?: string | undefined;
1587
+ from?: string | undefined;
1588
+ }>;
1589
+ type TransactionRequest = z.infer<typeof TransactionRequestSchema>;
1590
+ /** Included step */
1591
+ declare const IncludedStepSchema: z.ZodObject<{
1592
+ id: z.ZodString;
1593
+ type: z.ZodString;
1594
+ tool: z.ZodString;
1595
+ toolDetails: z.ZodOptional<z.ZodObject<{
1596
+ key: z.ZodString;
1597
+ name: z.ZodString;
1598
+ logoURI: z.ZodOptional<z.ZodString>;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ name: string;
1601
+ key: string;
1602
+ logoURI?: string | undefined;
1603
+ }, {
1604
+ name: string;
1605
+ key: string;
1606
+ logoURI?: string | undefined;
1607
+ }>>;
1608
+ action: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1609
+ estimate: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1610
+ }, "strip", z.ZodTypeAny, {
1611
+ type: string;
1612
+ estimate: Record<string, unknown>;
1613
+ tool: string;
1614
+ id: string;
1615
+ action: Record<string, unknown>;
1616
+ toolDetails?: {
1617
+ name: string;
1618
+ key: string;
1619
+ logoURI?: string | undefined;
1620
+ } | undefined;
1621
+ }, {
1622
+ type: string;
1623
+ estimate: Record<string, unknown>;
1624
+ tool: string;
1625
+ id: string;
1626
+ action: Record<string, unknown>;
1627
+ toolDetails?: {
1628
+ name: string;
1629
+ key: string;
1630
+ logoURI?: string | undefined;
1631
+ } | undefined;
1632
+ }>;
1633
+ /** Full Composer quote response */
1634
+ declare const QuoteResponseSchema: z.ZodObject<{
1635
+ type: z.ZodString;
1636
+ id: z.ZodString;
1637
+ tool: z.ZodString;
1638
+ toolDetails: z.ZodOptional<z.ZodObject<{
1639
+ key: z.ZodString;
1640
+ name: z.ZodString;
1641
+ logoURI: z.ZodOptional<z.ZodString>;
1642
+ }, "strip", z.ZodTypeAny, {
1643
+ name: string;
1644
+ key: string;
1645
+ logoURI?: string | undefined;
1646
+ }, {
1647
+ name: string;
1648
+ key: string;
1649
+ logoURI?: string | undefined;
1650
+ }>>;
1651
+ action: z.ZodObject<{
1652
+ fromToken: z.ZodObject<{
1653
+ address: z.ZodString;
1654
+ chainId: z.ZodNumber;
1655
+ symbol: z.ZodString;
1656
+ decimals: z.ZodNumber;
1657
+ name: z.ZodString;
1658
+ coinKey: z.ZodOptional<z.ZodString>;
1659
+ logoURI: z.ZodOptional<z.ZodString>;
1660
+ priceUSD: z.ZodOptional<z.ZodString>;
1661
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1662
+ verificationStatus: z.ZodOptional<z.ZodString>;
1663
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1664
+ }, "strip", z.ZodTypeAny, {
1665
+ symbol: string;
1666
+ name: string;
1667
+ address: string;
1668
+ decimals: number;
1669
+ chainId: number;
1670
+ tags?: string[] | undefined;
1671
+ coinKey?: string | undefined;
1672
+ logoURI?: string | undefined;
1673
+ priceUSD?: string | undefined;
1674
+ verificationStatus?: string | undefined;
1675
+ verificationStatusBreakdown?: unknown[] | undefined;
1676
+ }, {
1677
+ symbol: string;
1678
+ name: string;
1679
+ address: string;
1680
+ decimals: number;
1681
+ chainId: number;
1682
+ tags?: string[] | undefined;
1683
+ coinKey?: string | undefined;
1684
+ logoURI?: string | undefined;
1685
+ priceUSD?: string | undefined;
1686
+ verificationStatus?: string | undefined;
1687
+ verificationStatusBreakdown?: unknown[] | undefined;
1688
+ }>;
1689
+ fromAmount: z.ZodString;
1690
+ toToken: z.ZodObject<{
1691
+ address: z.ZodString;
1692
+ chainId: z.ZodNumber;
1693
+ symbol: z.ZodString;
1694
+ decimals: z.ZodNumber;
1695
+ name: z.ZodString;
1696
+ coinKey: z.ZodOptional<z.ZodString>;
1697
+ logoURI: z.ZodOptional<z.ZodString>;
1698
+ priceUSD: z.ZodOptional<z.ZodString>;
1699
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1700
+ verificationStatus: z.ZodOptional<z.ZodString>;
1701
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1702
+ }, "strip", z.ZodTypeAny, {
1703
+ symbol: string;
1704
+ name: string;
1705
+ address: string;
1706
+ decimals: number;
1707
+ chainId: number;
1708
+ tags?: string[] | undefined;
1709
+ coinKey?: string | undefined;
1710
+ logoURI?: string | undefined;
1711
+ priceUSD?: string | undefined;
1712
+ verificationStatus?: string | undefined;
1713
+ verificationStatusBreakdown?: unknown[] | undefined;
1714
+ }, {
1715
+ symbol: string;
1716
+ name: string;
1717
+ address: string;
1718
+ decimals: number;
1719
+ chainId: number;
1720
+ tags?: string[] | undefined;
1721
+ coinKey?: string | undefined;
1722
+ logoURI?: string | undefined;
1723
+ priceUSD?: string | undefined;
1724
+ verificationStatus?: string | undefined;
1725
+ verificationStatusBreakdown?: unknown[] | undefined;
1726
+ }>;
1727
+ fromChainId: z.ZodNumber;
1728
+ toChainId: z.ZodNumber;
1729
+ slippage: z.ZodNumber;
1730
+ fromAddress: z.ZodString;
1731
+ toAddress: z.ZodString;
1732
+ }, "strip", z.ZodTypeAny, {
1733
+ fromToken: {
1734
+ symbol: string;
1735
+ name: string;
1736
+ address: string;
1737
+ decimals: number;
1738
+ chainId: number;
1739
+ tags?: string[] | undefined;
1740
+ coinKey?: string | undefined;
1741
+ logoURI?: string | undefined;
1742
+ priceUSD?: string | undefined;
1743
+ verificationStatus?: string | undefined;
1744
+ verificationStatusBreakdown?: unknown[] | undefined;
1745
+ };
1746
+ fromAmount: string;
1747
+ toToken: {
1748
+ symbol: string;
1749
+ name: string;
1750
+ address: string;
1751
+ decimals: number;
1752
+ chainId: number;
1753
+ tags?: string[] | undefined;
1754
+ coinKey?: string | undefined;
1755
+ logoURI?: string | undefined;
1756
+ priceUSD?: string | undefined;
1757
+ verificationStatus?: string | undefined;
1758
+ verificationStatusBreakdown?: unknown[] | undefined;
1759
+ };
1760
+ fromChainId: number;
1761
+ toChainId: number;
1762
+ slippage: number;
1763
+ fromAddress: string;
1764
+ toAddress: string;
1765
+ }, {
1766
+ fromToken: {
1767
+ symbol: string;
1768
+ name: string;
1769
+ address: string;
1770
+ decimals: number;
1771
+ chainId: number;
1772
+ tags?: string[] | undefined;
1773
+ coinKey?: string | undefined;
1774
+ logoURI?: string | undefined;
1775
+ priceUSD?: string | undefined;
1776
+ verificationStatus?: string | undefined;
1777
+ verificationStatusBreakdown?: unknown[] | undefined;
1778
+ };
1779
+ fromAmount: string;
1780
+ toToken: {
1781
+ symbol: string;
1782
+ name: string;
1783
+ address: string;
1784
+ decimals: number;
1785
+ chainId: number;
1786
+ tags?: string[] | undefined;
1787
+ coinKey?: string | undefined;
1788
+ logoURI?: string | undefined;
1789
+ priceUSD?: string | undefined;
1790
+ verificationStatus?: string | undefined;
1791
+ verificationStatusBreakdown?: unknown[] | undefined;
1792
+ };
1793
+ fromChainId: number;
1794
+ toChainId: number;
1795
+ slippage: number;
1796
+ fromAddress: string;
1797
+ toAddress: string;
1798
+ }>;
1799
+ estimate: z.ZodObject<{
1800
+ tool: z.ZodString;
1801
+ approvalAddress: z.ZodOptional<z.ZodString>;
1802
+ toAmountMin: z.ZodString;
1803
+ toAmount: z.ZodString;
1804
+ fromAmount: z.ZodString;
1805
+ feeCosts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1806
+ name: z.ZodString;
1807
+ description: z.ZodOptional<z.ZodString>;
1808
+ token: z.ZodObject<{
1809
+ address: z.ZodString;
1810
+ chainId: z.ZodNumber;
1811
+ symbol: z.ZodString;
1812
+ decimals: z.ZodNumber;
1813
+ name: z.ZodString;
1814
+ coinKey: z.ZodOptional<z.ZodString>;
1815
+ logoURI: z.ZodOptional<z.ZodString>;
1816
+ priceUSD: z.ZodOptional<z.ZodString>;
1817
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1818
+ verificationStatus: z.ZodOptional<z.ZodString>;
1819
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1820
+ }, "strip", z.ZodTypeAny, {
1821
+ symbol: string;
1822
+ name: string;
1823
+ address: string;
1824
+ decimals: number;
1825
+ chainId: number;
1826
+ tags?: string[] | undefined;
1827
+ coinKey?: string | undefined;
1828
+ logoURI?: string | undefined;
1829
+ priceUSD?: string | undefined;
1830
+ verificationStatus?: string | undefined;
1831
+ verificationStatusBreakdown?: unknown[] | undefined;
1832
+ }, {
1833
+ symbol: string;
1834
+ name: string;
1835
+ address: string;
1836
+ decimals: number;
1837
+ chainId: number;
1838
+ tags?: string[] | undefined;
1839
+ coinKey?: string | undefined;
1840
+ logoURI?: string | undefined;
1841
+ priceUSD?: string | undefined;
1842
+ verificationStatus?: string | undefined;
1843
+ verificationStatusBreakdown?: unknown[] | undefined;
1844
+ }>;
1845
+ amount: z.ZodString;
1846
+ amountUSD: z.ZodString;
1847
+ percentage: z.ZodString;
1848
+ included: z.ZodBoolean;
1849
+ feeSplit: z.ZodOptional<z.ZodObject<{
1850
+ integratorFee: z.ZodString;
1851
+ lifiFee: z.ZodString;
1852
+ }, "strip", z.ZodTypeAny, {
1853
+ integratorFee: string;
1854
+ lifiFee: string;
1855
+ }, {
1856
+ integratorFee: string;
1857
+ lifiFee: string;
1858
+ }>>;
1859
+ }, "strip", z.ZodTypeAny, {
1860
+ name: string;
1861
+ token: {
1862
+ symbol: string;
1863
+ name: string;
1864
+ address: string;
1865
+ decimals: number;
1866
+ chainId: number;
1867
+ tags?: string[] | undefined;
1868
+ coinKey?: string | undefined;
1869
+ logoURI?: string | undefined;
1870
+ priceUSD?: string | undefined;
1871
+ verificationStatus?: string | undefined;
1872
+ verificationStatusBreakdown?: unknown[] | undefined;
1873
+ };
1874
+ amount: string;
1875
+ amountUSD: string;
1876
+ percentage: string;
1877
+ included: boolean;
1878
+ description?: string | undefined;
1879
+ feeSplit?: {
1880
+ integratorFee: string;
1881
+ lifiFee: string;
1882
+ } | undefined;
1883
+ }, {
1884
+ name: string;
1885
+ token: {
1886
+ symbol: string;
1887
+ name: string;
1888
+ address: string;
1889
+ decimals: number;
1890
+ chainId: number;
1891
+ tags?: string[] | undefined;
1892
+ coinKey?: string | undefined;
1893
+ logoURI?: string | undefined;
1894
+ priceUSD?: string | undefined;
1895
+ verificationStatus?: string | undefined;
1896
+ verificationStatusBreakdown?: unknown[] | undefined;
1897
+ };
1898
+ amount: string;
1899
+ amountUSD: string;
1900
+ percentage: string;
1901
+ included: boolean;
1902
+ description?: string | undefined;
1903
+ feeSplit?: {
1904
+ integratorFee: string;
1905
+ lifiFee: string;
1906
+ } | undefined;
1907
+ }>, "many">>;
1908
+ gasCosts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1909
+ type: z.ZodString;
1910
+ price: z.ZodOptional<z.ZodString>;
1911
+ estimate: z.ZodOptional<z.ZodString>;
1912
+ limit: z.ZodOptional<z.ZodString>;
1913
+ amount: z.ZodString;
1914
+ amountUSD: z.ZodString;
1915
+ token: z.ZodObject<{
1916
+ address: z.ZodString;
1917
+ chainId: z.ZodNumber;
1918
+ symbol: z.ZodString;
1919
+ decimals: z.ZodNumber;
1920
+ name: z.ZodString;
1921
+ coinKey: z.ZodOptional<z.ZodString>;
1922
+ logoURI: z.ZodOptional<z.ZodString>;
1923
+ priceUSD: z.ZodOptional<z.ZodString>;
1924
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1925
+ verificationStatus: z.ZodOptional<z.ZodString>;
1926
+ verificationStatusBreakdown: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1927
+ }, "strip", z.ZodTypeAny, {
1928
+ symbol: string;
1929
+ name: string;
1930
+ address: string;
1931
+ decimals: number;
1932
+ chainId: number;
1933
+ tags?: string[] | undefined;
1934
+ coinKey?: string | undefined;
1935
+ logoURI?: string | undefined;
1936
+ priceUSD?: string | undefined;
1937
+ verificationStatus?: string | undefined;
1938
+ verificationStatusBreakdown?: unknown[] | undefined;
1939
+ }, {
1940
+ symbol: string;
1941
+ name: string;
1942
+ address: string;
1943
+ decimals: number;
1944
+ chainId: number;
1945
+ tags?: string[] | undefined;
1946
+ coinKey?: string | undefined;
1947
+ logoURI?: string | undefined;
1948
+ priceUSD?: string | undefined;
1949
+ verificationStatus?: string | undefined;
1950
+ verificationStatusBreakdown?: unknown[] | undefined;
1951
+ }>;
1952
+ }, "strip", z.ZodTypeAny, {
1953
+ type: string;
1954
+ token: {
1955
+ symbol: string;
1956
+ name: string;
1957
+ address: string;
1958
+ decimals: number;
1959
+ chainId: number;
1960
+ tags?: string[] | undefined;
1961
+ coinKey?: string | undefined;
1962
+ logoURI?: string | undefined;
1963
+ priceUSD?: string | undefined;
1964
+ verificationStatus?: string | undefined;
1965
+ verificationStatusBreakdown?: unknown[] | undefined;
1966
+ };
1967
+ amount: string;
1968
+ amountUSD: string;
1969
+ price?: string | undefined;
1970
+ estimate?: string | undefined;
1971
+ limit?: string | undefined;
1972
+ }, {
1973
+ type: string;
1974
+ token: {
1975
+ symbol: string;
1976
+ name: string;
1977
+ address: string;
1978
+ decimals: number;
1979
+ chainId: number;
1980
+ tags?: string[] | undefined;
1981
+ coinKey?: string | undefined;
1982
+ logoURI?: string | undefined;
1983
+ priceUSD?: string | undefined;
1984
+ verificationStatus?: string | undefined;
1985
+ verificationStatusBreakdown?: unknown[] | undefined;
1986
+ };
1987
+ amount: string;
1988
+ amountUSD: string;
1989
+ price?: string | undefined;
1990
+ estimate?: string | undefined;
1991
+ limit?: string | undefined;
1992
+ }>, "many">>;
1993
+ executionDuration: z.ZodNumber;
1994
+ fromAmountUSD: z.ZodOptional<z.ZodString>;
1995
+ toAmountUSD: z.ZodOptional<z.ZodString>;
1996
+ }, "strip", z.ZodTypeAny, {
1997
+ fromAmount: string;
1998
+ tool: string;
1999
+ toAmountMin: string;
2000
+ toAmount: string;
2001
+ executionDuration: number;
2002
+ approvalAddress?: string | undefined;
2003
+ feeCosts?: {
2004
+ name: string;
2005
+ token: {
2006
+ symbol: string;
2007
+ name: string;
2008
+ address: string;
2009
+ decimals: number;
2010
+ chainId: number;
2011
+ tags?: string[] | undefined;
2012
+ coinKey?: string | undefined;
2013
+ logoURI?: string | undefined;
2014
+ priceUSD?: string | undefined;
2015
+ verificationStatus?: string | undefined;
2016
+ verificationStatusBreakdown?: unknown[] | undefined;
2017
+ };
2018
+ amount: string;
2019
+ amountUSD: string;
2020
+ percentage: string;
2021
+ included: boolean;
2022
+ description?: string | undefined;
2023
+ feeSplit?: {
2024
+ integratorFee: string;
2025
+ lifiFee: string;
2026
+ } | undefined;
2027
+ }[] | undefined;
2028
+ gasCosts?: {
2029
+ type: string;
2030
+ token: {
2031
+ symbol: string;
2032
+ name: string;
2033
+ address: string;
2034
+ decimals: number;
2035
+ chainId: number;
2036
+ tags?: string[] | undefined;
2037
+ coinKey?: string | undefined;
2038
+ logoURI?: string | undefined;
2039
+ priceUSD?: string | undefined;
2040
+ verificationStatus?: string | undefined;
2041
+ verificationStatusBreakdown?: unknown[] | undefined;
2042
+ };
2043
+ amount: string;
2044
+ amountUSD: string;
2045
+ price?: string | undefined;
2046
+ estimate?: string | undefined;
2047
+ limit?: string | undefined;
2048
+ }[] | undefined;
2049
+ fromAmountUSD?: string | undefined;
2050
+ toAmountUSD?: string | undefined;
2051
+ }, {
2052
+ fromAmount: string;
2053
+ tool: string;
2054
+ toAmountMin: string;
2055
+ toAmount: string;
2056
+ executionDuration: number;
2057
+ approvalAddress?: string | undefined;
2058
+ feeCosts?: {
2059
+ name: string;
2060
+ token: {
2061
+ symbol: string;
2062
+ name: string;
2063
+ address: string;
2064
+ decimals: number;
2065
+ chainId: number;
2066
+ tags?: string[] | undefined;
2067
+ coinKey?: string | undefined;
2068
+ logoURI?: string | undefined;
2069
+ priceUSD?: string | undefined;
2070
+ verificationStatus?: string | undefined;
2071
+ verificationStatusBreakdown?: unknown[] | undefined;
2072
+ };
2073
+ amount: string;
2074
+ amountUSD: string;
2075
+ percentage: string;
2076
+ included: boolean;
2077
+ description?: string | undefined;
2078
+ feeSplit?: {
2079
+ integratorFee: string;
2080
+ lifiFee: string;
2081
+ } | undefined;
2082
+ }[] | undefined;
2083
+ gasCosts?: {
2084
+ type: string;
2085
+ token: {
2086
+ symbol: string;
2087
+ name: string;
2088
+ address: string;
2089
+ decimals: number;
2090
+ chainId: number;
2091
+ tags?: string[] | undefined;
2092
+ coinKey?: string | undefined;
2093
+ logoURI?: string | undefined;
2094
+ priceUSD?: string | undefined;
2095
+ verificationStatus?: string | undefined;
2096
+ verificationStatusBreakdown?: unknown[] | undefined;
2097
+ };
2098
+ amount: string;
2099
+ amountUSD: string;
2100
+ price?: string | undefined;
2101
+ estimate?: string | undefined;
2102
+ limit?: string | undefined;
2103
+ }[] | undefined;
2104
+ fromAmountUSD?: string | undefined;
2105
+ toAmountUSD?: string | undefined;
2106
+ }>;
2107
+ includedSteps: z.ZodOptional<z.ZodArray<z.ZodObject<{
2108
+ id: z.ZodString;
2109
+ type: z.ZodString;
2110
+ tool: z.ZodString;
2111
+ toolDetails: z.ZodOptional<z.ZodObject<{
2112
+ key: z.ZodString;
2113
+ name: z.ZodString;
2114
+ logoURI: z.ZodOptional<z.ZodString>;
2115
+ }, "strip", z.ZodTypeAny, {
2116
+ name: string;
2117
+ key: string;
2118
+ logoURI?: string | undefined;
2119
+ }, {
2120
+ name: string;
2121
+ key: string;
2122
+ logoURI?: string | undefined;
2123
+ }>>;
2124
+ action: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2125
+ estimate: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2126
+ }, "strip", z.ZodTypeAny, {
2127
+ type: string;
2128
+ estimate: Record<string, unknown>;
2129
+ tool: string;
2130
+ id: string;
2131
+ action: Record<string, unknown>;
2132
+ toolDetails?: {
2133
+ name: string;
2134
+ key: string;
2135
+ logoURI?: string | undefined;
2136
+ } | undefined;
2137
+ }, {
2138
+ type: string;
2139
+ estimate: Record<string, unknown>;
2140
+ tool: string;
2141
+ id: string;
2142
+ action: Record<string, unknown>;
2143
+ toolDetails?: {
2144
+ name: string;
2145
+ key: string;
2146
+ logoURI?: string | undefined;
2147
+ } | undefined;
2148
+ }>, "many">>;
2149
+ integrator: z.ZodOptional<z.ZodString>;
2150
+ transactionRequest: z.ZodObject<{
2151
+ to: z.ZodString;
2152
+ data: z.ZodString;
2153
+ value: z.ZodString;
2154
+ chainId: z.ZodNumber;
2155
+ gasPrice: z.ZodOptional<z.ZodString>;
2156
+ gasLimit: z.ZodOptional<z.ZodString>;
2157
+ from: z.ZodOptional<z.ZodString>;
2158
+ }, "strip", z.ZodTypeAny, {
2159
+ value: string;
2160
+ chainId: number;
2161
+ data: string;
2162
+ to: string;
2163
+ gasPrice?: string | undefined;
2164
+ gasLimit?: string | undefined;
2165
+ from?: string | undefined;
2166
+ }, {
2167
+ value: string;
2168
+ chainId: number;
2169
+ data: string;
2170
+ to: string;
2171
+ gasPrice?: string | undefined;
2172
+ gasLimit?: string | undefined;
2173
+ from?: string | undefined;
2174
+ }>;
2175
+ transactionId: z.ZodOptional<z.ZodString>;
2176
+ }, "strip", z.ZodTypeAny, {
2177
+ type: string;
2178
+ estimate: {
2179
+ fromAmount: string;
2180
+ tool: string;
2181
+ toAmountMin: string;
2182
+ toAmount: string;
2183
+ executionDuration: number;
2184
+ approvalAddress?: string | undefined;
2185
+ feeCosts?: {
2186
+ name: string;
2187
+ token: {
2188
+ symbol: string;
2189
+ name: string;
2190
+ address: string;
2191
+ decimals: number;
2192
+ chainId: number;
2193
+ tags?: string[] | undefined;
2194
+ coinKey?: string | undefined;
2195
+ logoURI?: string | undefined;
2196
+ priceUSD?: string | undefined;
2197
+ verificationStatus?: string | undefined;
2198
+ verificationStatusBreakdown?: unknown[] | undefined;
2199
+ };
2200
+ amount: string;
2201
+ amountUSD: string;
2202
+ percentage: string;
2203
+ included: boolean;
2204
+ description?: string | undefined;
2205
+ feeSplit?: {
2206
+ integratorFee: string;
2207
+ lifiFee: string;
2208
+ } | undefined;
2209
+ }[] | undefined;
2210
+ gasCosts?: {
2211
+ type: string;
2212
+ token: {
2213
+ symbol: string;
2214
+ name: string;
2215
+ address: string;
2216
+ decimals: number;
2217
+ chainId: number;
2218
+ tags?: string[] | undefined;
2219
+ coinKey?: string | undefined;
2220
+ logoURI?: string | undefined;
2221
+ priceUSD?: string | undefined;
2222
+ verificationStatus?: string | undefined;
2223
+ verificationStatusBreakdown?: unknown[] | undefined;
2224
+ };
2225
+ amount: string;
2226
+ amountUSD: string;
2227
+ price?: string | undefined;
2228
+ estimate?: string | undefined;
2229
+ limit?: string | undefined;
2230
+ }[] | undefined;
2231
+ fromAmountUSD?: string | undefined;
2232
+ toAmountUSD?: string | undefined;
2233
+ };
2234
+ tool: string;
2235
+ id: string;
2236
+ action: {
2237
+ fromToken: {
2238
+ symbol: string;
2239
+ name: string;
2240
+ address: string;
2241
+ decimals: number;
2242
+ chainId: number;
2243
+ tags?: string[] | undefined;
2244
+ coinKey?: string | undefined;
2245
+ logoURI?: string | undefined;
2246
+ priceUSD?: string | undefined;
2247
+ verificationStatus?: string | undefined;
2248
+ verificationStatusBreakdown?: unknown[] | undefined;
2249
+ };
2250
+ fromAmount: string;
2251
+ toToken: {
2252
+ symbol: string;
2253
+ name: string;
2254
+ address: string;
2255
+ decimals: number;
2256
+ chainId: number;
2257
+ tags?: string[] | undefined;
2258
+ coinKey?: string | undefined;
2259
+ logoURI?: string | undefined;
2260
+ priceUSD?: string | undefined;
2261
+ verificationStatus?: string | undefined;
2262
+ verificationStatusBreakdown?: unknown[] | undefined;
2263
+ };
2264
+ fromChainId: number;
2265
+ toChainId: number;
2266
+ slippage: number;
2267
+ fromAddress: string;
2268
+ toAddress: string;
2269
+ };
2270
+ transactionRequest: {
2271
+ value: string;
2272
+ chainId: number;
2273
+ data: string;
2274
+ to: string;
2275
+ gasPrice?: string | undefined;
2276
+ gasLimit?: string | undefined;
2277
+ from?: string | undefined;
2278
+ };
2279
+ toolDetails?: {
2280
+ name: string;
2281
+ key: string;
2282
+ logoURI?: string | undefined;
2283
+ } | undefined;
2284
+ includedSteps?: {
2285
+ type: string;
2286
+ estimate: Record<string, unknown>;
2287
+ tool: string;
2288
+ id: string;
2289
+ action: Record<string, unknown>;
2290
+ toolDetails?: {
2291
+ name: string;
2292
+ key: string;
2293
+ logoURI?: string | undefined;
2294
+ } | undefined;
2295
+ }[] | undefined;
2296
+ integrator?: string | undefined;
2297
+ transactionId?: string | undefined;
2298
+ }, {
2299
+ type: string;
2300
+ estimate: {
2301
+ fromAmount: string;
2302
+ tool: string;
2303
+ toAmountMin: string;
2304
+ toAmount: string;
2305
+ executionDuration: number;
2306
+ approvalAddress?: string | undefined;
2307
+ feeCosts?: {
2308
+ name: string;
2309
+ token: {
2310
+ symbol: string;
2311
+ name: string;
2312
+ address: string;
2313
+ decimals: number;
2314
+ chainId: number;
2315
+ tags?: string[] | undefined;
2316
+ coinKey?: string | undefined;
2317
+ logoURI?: string | undefined;
2318
+ priceUSD?: string | undefined;
2319
+ verificationStatus?: string | undefined;
2320
+ verificationStatusBreakdown?: unknown[] | undefined;
2321
+ };
2322
+ amount: string;
2323
+ amountUSD: string;
2324
+ percentage: string;
2325
+ included: boolean;
2326
+ description?: string | undefined;
2327
+ feeSplit?: {
2328
+ integratorFee: string;
2329
+ lifiFee: string;
2330
+ } | undefined;
2331
+ }[] | undefined;
2332
+ gasCosts?: {
2333
+ type: string;
2334
+ token: {
2335
+ symbol: string;
2336
+ name: string;
2337
+ address: string;
2338
+ decimals: number;
2339
+ chainId: number;
2340
+ tags?: string[] | undefined;
2341
+ coinKey?: string | undefined;
2342
+ logoURI?: string | undefined;
2343
+ priceUSD?: string | undefined;
2344
+ verificationStatus?: string | undefined;
2345
+ verificationStatusBreakdown?: unknown[] | undefined;
2346
+ };
2347
+ amount: string;
2348
+ amountUSD: string;
2349
+ price?: string | undefined;
2350
+ estimate?: string | undefined;
2351
+ limit?: string | undefined;
2352
+ }[] | undefined;
2353
+ fromAmountUSD?: string | undefined;
2354
+ toAmountUSD?: string | undefined;
2355
+ };
2356
+ tool: string;
2357
+ id: string;
2358
+ action: {
2359
+ fromToken: {
2360
+ symbol: string;
2361
+ name: string;
2362
+ address: string;
2363
+ decimals: number;
2364
+ chainId: number;
2365
+ tags?: string[] | undefined;
2366
+ coinKey?: string | undefined;
2367
+ logoURI?: string | undefined;
2368
+ priceUSD?: string | undefined;
2369
+ verificationStatus?: string | undefined;
2370
+ verificationStatusBreakdown?: unknown[] | undefined;
2371
+ };
2372
+ fromAmount: string;
2373
+ toToken: {
2374
+ symbol: string;
2375
+ name: string;
2376
+ address: string;
2377
+ decimals: number;
2378
+ chainId: number;
2379
+ tags?: string[] | undefined;
2380
+ coinKey?: string | undefined;
2381
+ logoURI?: string | undefined;
2382
+ priceUSD?: string | undefined;
2383
+ verificationStatus?: string | undefined;
2384
+ verificationStatusBreakdown?: unknown[] | undefined;
2385
+ };
2386
+ fromChainId: number;
2387
+ toChainId: number;
2388
+ slippage: number;
2389
+ fromAddress: string;
2390
+ toAddress: string;
2391
+ };
2392
+ transactionRequest: {
2393
+ value: string;
2394
+ chainId: number;
2395
+ data: string;
2396
+ to: string;
2397
+ gasPrice?: string | undefined;
2398
+ gasLimit?: string | undefined;
2399
+ from?: string | undefined;
2400
+ };
2401
+ toolDetails?: {
2402
+ name: string;
2403
+ key: string;
2404
+ logoURI?: string | undefined;
2405
+ } | undefined;
2406
+ includedSteps?: {
2407
+ type: string;
2408
+ estimate: Record<string, unknown>;
2409
+ tool: string;
2410
+ id: string;
2411
+ action: Record<string, unknown>;
2412
+ toolDetails?: {
2413
+ name: string;
2414
+ key: string;
2415
+ logoURI?: string | undefined;
2416
+ } | undefined;
2417
+ }[] | undefined;
2418
+ integrator?: string | undefined;
2419
+ transactionId?: string | undefined;
2420
+ }>;
2421
+ type QuoteResponse = z.infer<typeof QuoteResponseSchema>;
2422
+ //#endregion
2423
+ //#region src/clients/earn-data-client.d.ts
2424
+ interface EarnDataClientOptions {
2425
+ baseUrl?: string;
2426
+ cache?: {
2427
+ ttl?: number;
2428
+ maxSize?: number;
2429
+ };
2430
+ rateLimiter?: {
2431
+ maxPerMinute?: number;
2432
+ };
2433
+ retry?: RetryOptions;
2434
+ }
2435
+ interface VaultListParams {
2436
+ chainId?: number;
2437
+ asset?: string;
2438
+ minTvl?: number;
2439
+ sortBy?: string;
2440
+ cursor?: string;
2441
+ }
2442
+ declare class EarnDataClient {
2443
+ private readonly baseUrl;
2444
+ private readonly cache;
2445
+ private readonly rateLimiter;
2446
+ private readonly retryOpts;
2447
+ constructor(options?: EarnDataClientOptions);
2448
+ /**
2449
+ * Low-level fetch with rate limiting, caching, retry.
2450
+ * No auth header — Earn Data API is public (Pitfall #2).
2451
+ */
2452
+ private fetch;
2453
+ /** Fetch a single page of vaults */
2454
+ listVaults(params?: VaultListParams): Promise<VaultListResponse>;
2455
+ /**
2456
+ * Async iterator for all vaults with auto-pagination via nextCursor.
2457
+ * Page size is 50 (API default).
2458
+ * (Pitfall #6)
2459
+ */
2460
+ listAllVaults(params?: Omit<VaultListParams, 'cursor'>): AsyncIterable<Vault>;
2461
+ /**
2462
+ * Get a single vault by chainId + address.
2463
+ * chainId MUST be a number, not chain name (Pitfall — /vaults/Base/0x... returns 400).
2464
+ */
2465
+ getVault(chainId: number, address: string): Promise<Vault>;
2466
+ /** Get a vault by slug (e.g., "8453-0xbeef...") */
2467
+ getVaultBySlug(slug: string): Promise<Vault>;
2468
+ /** List supported chains */
2469
+ listChains(): Promise<Chain[]>;
2470
+ /** List supported protocols */
2471
+ listProtocols(): Promise<ProtocolDetail[]>;
2472
+ /** Get portfolio positions for a wallet */
2473
+ getPortfolio(walletAddress: string): Promise<PortfolioResponse>;
2474
+ /** Rate limiter remaining tokens */
2475
+ get rateLimitRemaining(): number;
2476
+ /** Clear cache */
2477
+ clearCache(): void;
2478
+ }
2479
+ //#endregion
2480
+ //#region src/clients/composer-client.d.ts
2481
+ interface ComposerClientOptions {
2482
+ apiKey: string;
2483
+ baseUrl?: string;
2484
+ retry?: RetryOptions;
2485
+ }
2486
+ interface QuoteParams {
2487
+ fromChain: number;
2488
+ toChain: number;
2489
+ fromToken: string;
2490
+ toToken: string;
2491
+ fromAddress: string;
2492
+ toAddress: string;
2493
+ fromAmount: string;
2494
+ slippage?: number;
2495
+ fromAmountForGas?: string;
2496
+ }
2497
+ declare class ComposerClient {
2498
+ private readonly baseUrl;
2499
+ private readonly apiKey;
2500
+ private readonly retryOpts;
2501
+ constructor(options: ComposerClientOptions);
2502
+ /**
2503
+ * Get a deposit/swap/bridge quote.
2504
+ * Uses GET, not POST (Pitfall #4).
2505
+ * Sends x-lifi-api-key header (Pitfall #3).
2506
+ */
2507
+ getQuote(params: QuoteParams): Promise<QuoteResponse>;
2508
+ }
2509
+ //#endregion
2510
+ //#region src/build-deposit-quote.d.ts
2511
+ interface DepositQuoteOptions {
2512
+ fromAmount: string;
2513
+ wallet: string;
2514
+ fromToken?: string;
2515
+ fromChain?: number;
2516
+ slippage?: number;
2517
+ fromAmountForGas?: string;
2518
+ }
2519
+ interface DepositQuoteResult {
2520
+ quote: QuoteResponse;
2521
+ vault: Vault;
2522
+ humanAmount: string;
2523
+ rawAmount: string;
2524
+ decimals: number;
2525
+ }
2526
+ /**
2527
+ * Build a deposit quote with all 18 pitfalls handled:
2528
+ *
2529
+ * - toToken = vault.address (Pitfall #5)
2530
+ * - Uses correct decimals from underlyingTokens (Pitfall #9)
2531
+ * - Validates isTransactional (Pitfall #13)
2532
+ * - Validates underlyingTokens is non-empty (Pitfall #15)
2533
+ * - GET request via ComposerClient (Pitfall #4)
2534
+ * - API key in header via ComposerClient (Pitfall #3)
2535
+ */
2536
+ declare function buildDepositQuote(vault: Vault, options: DepositQuoteOptions, composer: ComposerClient): Promise<DepositQuoteResult>;
2537
+ /**
2538
+ * Convert a human-readable amount to the smallest unit.
2539
+ * e.g., "1" with 6 decimals → "1000000" (Pitfall #9)
2540
+ */
2541
+ declare function toSmallestUnit(amount: string, decimals: number): string;
2542
+ /**
2543
+ * Convert smallest unit to human-readable amount.
2544
+ */
2545
+ declare function fromSmallestUnit(rawAmount: string, decimals: number): string;
2546
+ //#endregion
2547
+ //#region src/build-redeem-quote.d.ts
2548
+ interface RedeemQuoteOptions {
2549
+ /** Amount of vault tokens to redeem (human-readable) */
2550
+ fromAmount: string;
2551
+ wallet: string;
2552
+ /** Token to receive. Defaults to underlying token on vault chain. */
2553
+ toToken?: string;
2554
+ /** Destination chain. Defaults to vault chain. */
2555
+ toChain?: number;
2556
+ slippage?: number;
2557
+ }
2558
+ interface RedeemQuoteResult {
2559
+ quote: QuoteResponse;
2560
+ vault: Vault;
2561
+ humanAmount: string;
2562
+ rawAmount: string;
2563
+ }
2564
+ /**
2565
+ * Build a withdrawal/redeem quote.
2566
+ *
2567
+ * Withdrawal is the reverse of deposit:
2568
+ * - fromToken = vault.address (the vault share token)
2569
+ * - toToken = underlying token address (what you get back)
2570
+ *
2571
+ * Uses the same Composer /v1/quote endpoint — just swapped tokens.
2572
+ */
2573
+ declare function buildRedeemQuote(vault: Vault, options: RedeemQuoteOptions, composer: ComposerClient): Promise<RedeemQuoteResult>;
2574
+ //#endregion
2575
+ //#region src/errors.d.ts
2576
+ declare class EarnForgeError extends Error {
2577
+ readonly code: string;
2578
+ constructor(message: string, code: string);
2579
+ }
2580
+ declare class EarnApiError extends EarnForgeError {
2581
+ readonly status: number;
2582
+ readonly url: string;
2583
+ constructor(message: string, status: number, url: string);
2584
+ }
2585
+ declare class ComposerError extends EarnForgeError {
2586
+ readonly status: number;
2587
+ constructor(message: string, status: number);
2588
+ }
2589
+ declare class PreflightError extends EarnForgeError {
2590
+ readonly issues: PreflightIssue[];
2591
+ constructor(message: string, issues: PreflightIssue[]);
2592
+ }
2593
+ declare class RateLimitError extends EarnForgeError {
2594
+ readonly retryAfter: number;
2595
+ constructor(retryAfter: number);
2596
+ }
2597
+ interface PreflightIssue {
2598
+ code: string;
2599
+ message: string;
2600
+ severity: 'error' | 'warning';
2601
+ }
2602
+ //#endregion
2603
+ //#region src/rate-limiter.d.ts
2604
+ /**
2605
+ * Token-bucket rate limiter with queued async acquisition.
2606
+ * Default: 100 requests per minute for Earn Data API (Pitfall #14).
2607
+ */
2608
+ declare class TokenBucketRateLimiter {
2609
+ private tokens;
2610
+ private lastRefill;
2611
+ private readonly maxTokens;
2612
+ private readonly refillRate;
2613
+ private _queue;
2614
+ constructor(maxRequestsPerMinute?: number);
2615
+ private refill;
2616
+ acquire(): void;
2617
+ /**
2618
+ * Queued async acquire — serializes concurrent callers to prevent
2619
+ * race conditions where multiple callers pass the token check simultaneously.
2620
+ */
2621
+ acquireAsync(): Promise<void>;
2622
+ private _acquireInternal;
2623
+ get remaining(): number;
2624
+ }
2625
+ //#endregion
2626
+ //#region src/cache.d.ts
2627
+ /**
2628
+ * In-memory LRU cache with configurable TTL.
2629
+ * Evicts least-recently-used entries when capacity is reached.
2630
+ */
2631
+ declare class LRUCache<T> {
2632
+ private readonly map;
2633
+ private readonly maxSize;
2634
+ private readonly ttl;
2635
+ constructor(options?: {
2636
+ maxSize?: number;
2637
+ ttl?: number;
2638
+ });
2639
+ get(key: string): T | undefined;
2640
+ set(key: string, value: T): void;
2641
+ has(key: string): boolean;
2642
+ clear(): void;
2643
+ get size(): number;
2644
+ }
2645
+ //#endregion
2646
+ //#region src/preflight.d.ts
2647
+ interface PreflightReport {
2648
+ ok: boolean;
2649
+ issues: PreflightIssue[];
2650
+ vault: Vault;
2651
+ wallet: string;
2652
+ }
2653
+ interface PreflightOptions {
2654
+ walletChainId?: number;
2655
+ nativeBalance?: bigint;
2656
+ tokenBalance?: bigint;
2657
+ tokenDecimals?: number;
2658
+ depositAmount?: string;
2659
+ /** If true, cross-chain deposit is intended — skip chain mismatch error */
2660
+ crossChain?: boolean;
2661
+ }
2662
+ /**
2663
+ * Run preflight checks before a deposit:
2664
+ * - isTransactional check (Pitfall #13)
2665
+ * - Chain mismatch check (Pitfall #12) — warning for cross-chain, error for same-chain
2666
+ * - Gas token balance check (Pitfall #11)
2667
+ * - Token balance check (uses string-based toSmallestUnit to avoid float precision loss)
2668
+ * - underlyingTokens existence (Pitfall #15)
2669
+ * - isRedeemable warning
2670
+ */
2671
+ declare function preflight(vault: Vault, wallet: string, options?: PreflightOptions): PreflightReport;
2672
+ //#endregion
2673
+ //#region src/risk-scorer.d.ts
2674
+ interface RiskBreakdown {
2675
+ tvl: number;
2676
+ apyStability: number;
2677
+ protocol: number;
2678
+ redeemability: number;
2679
+ assetType: number;
2680
+ }
2681
+ interface RiskScore {
2682
+ score: number;
2683
+ breakdown: RiskBreakdown;
2684
+ label: 'low' | 'medium' | 'high';
2685
+ }
2686
+ /**
2687
+ * Compute a composite 0–10 risk score for a vault.
2688
+ *
2689
+ * Dimensions:
2690
+ * - TVL magnitude: higher TVL = lower risk
2691
+ * - APY stability: small divergence between apy1d/apy30d/total = more stable
2692
+ * - Protocol maturity: known blue-chip protocols score higher
2693
+ * - Redeemability: non-redeemable = liquidity risk
2694
+ * - Asset type: stablecoin tag = lower asset risk
2695
+ */
2696
+ declare function riskScore(vault: Vault): RiskScore;
2697
+ //#endregion
2698
+ //#region src/strategies.d.ts
2699
+ type StrategyPreset = 'conservative' | 'max-apy' | 'diversified' | 'risk-adjusted';
2700
+ interface StrategyConfig {
2701
+ name: StrategyPreset;
2702
+ description: string;
2703
+ filters: Partial<VaultListParams> & {
2704
+ minTvlUsd?: number;
2705
+ tags?: string[];
2706
+ protocols?: string[];
2707
+ minRiskScore?: number;
2708
+ };
2709
+ sort: 'apy' | 'tvl' | 'risk';
2710
+ sortDirection: 'asc' | 'desc';
2711
+ }
2712
+ declare const STRATEGIES: Record<StrategyPreset, StrategyConfig>;
2713
+ declare function getStrategy(preset: StrategyPreset): StrategyConfig;
2714
+ //#endregion
2715
+ //#region src/suggest.d.ts
2716
+ interface SuggestParams {
2717
+ amount: number;
2718
+ asset?: string;
2719
+ maxChains?: number;
2720
+ strategy?: StrategyPreset;
2721
+ maxVaults?: number;
2722
+ }
2723
+ interface Allocation {
2724
+ vault: Vault;
2725
+ risk: RiskScore;
2726
+ percentage: number;
2727
+ amount: number;
2728
+ apy: number;
2729
+ }
2730
+ interface SuggestResult {
2731
+ totalAmount: number;
2732
+ expectedApy: number;
2733
+ allocations: Allocation[];
2734
+ }
2735
+ /**
2736
+ * Portfolio allocation engine.
2737
+ * Uses a risk-adjusted score: score = apy / (11 - riskScore)
2738
+ * to weight allocations proportionally.
2739
+ * Enforces maxChains diversification constraint.
2740
+ */
2741
+ declare function suggest(vaults: Vault[], params: SuggestParams): SuggestResult;
2742
+ //#endregion
2743
+ //#region src/gas-optimizer.d.ts
2744
+ interface GasRoute {
2745
+ fromChain: number;
2746
+ fromChainName: string;
2747
+ quote: QuoteResponse;
2748
+ totalCostUsd: number;
2749
+ gasCostUsd: number;
2750
+ feeCostUsd: number;
2751
+ executionDuration: number;
2752
+ }
2753
+ interface GasOptimizeOptions {
2754
+ fromAmount: string;
2755
+ wallet: string;
2756
+ /** Token address on the vault's chain (used for same-chain route) */
2757
+ fromToken?: string;
2758
+ /** Map of chainId → token address for cross-chain routes */
2759
+ fromTokens?: Record<number, string>;
2760
+ fromChains?: number[];
2761
+ fromAmountForGas?: string;
2762
+ }
2763
+ /**
2764
+ * Compare deposit routes from multiple source chains.
2765
+ * Returns routes sorted by total cost (cheapest first).
2766
+ * Integrates LI.Fuel via fromAmountForGas parameter.
2767
+ */
2768
+ declare function optimizeGasRoutes(vault: Vault, composer: ComposerClient, options: GasOptimizeOptions): Promise<GasRoute[]>;
2769
+ //#endregion
2770
+ //#region src/watch.d.ts
2771
+ interface WatchOptions {
2772
+ apyDropPercent?: number;
2773
+ tvlDropPercent?: number;
2774
+ interval?: number;
2775
+ /** AbortSignal to cancel the watcher */
2776
+ signal?: AbortSignal;
2777
+ /** Maximum number of iterations (0 = unlimited) */
2778
+ maxIterations?: number;
2779
+ }
2780
+ type WatchEventType = 'apy-drop' | 'tvl-drop' | 'update';
2781
+ interface WatchEvent {
2782
+ type: WatchEventType;
2783
+ vault: Vault;
2784
+ previous: {
2785
+ apy: number;
2786
+ tvlUsd: number;
2787
+ } | null;
2788
+ current: {
2789
+ apy: number;
2790
+ tvlUsd: number;
2791
+ };
2792
+ timestamp: Date;
2793
+ }
2794
+ /**
2795
+ * Watch a vault for APY/TVL changes.
2796
+ * Returns an AsyncGenerator that yields events.
2797
+ * Supports cancellation via AbortSignal and maxIterations.
2798
+ */
2799
+ declare function watch(client: EarnDataClient, vaultSlug: string, options?: WatchOptions): AsyncGenerator<WatchEvent>;
2800
+ //#endregion
2801
+ //#region src/apy-history.d.ts
2802
+ interface ApyDataPoint {
2803
+ timestamp: string;
2804
+ apy: number;
2805
+ tvlUsd: number;
2806
+ }
2807
+ /**
2808
+ * Fetch 30-day APY history from DeFiLlama's free yields API.
2809
+ *
2810
+ * Properly matches LI.FI vaults to DeFiLlama pools using:
2811
+ * project name + chain + underlying tokens + symbol + TVL proximity.
2812
+ *
2813
+ * Caches the 10MB+ pools list for 1 hour to avoid repeated fetches.
2814
+ */
2815
+ declare function getApyHistory(vault: Vault): Promise<ApyDataPoint[]>;
2816
+ declare function getApyHistory(vaultAddress: string, chainId: number): Promise<ApyDataPoint[]>;
2817
+ //#endregion
2818
+ //#region src/allowance.d.ts
2819
+ /**
2820
+ * ERC-20 allowance checking and approval transaction building.
2821
+ *
2822
+ * Uses the standard ERC-20 ABI for allowance() and approve().
2823
+ * Works with any EVM JSON-RPC provider via raw fetch — no viem dependency required.
2824
+ * The approval address comes from the Composer quote's estimate.approvalAddress.
2825
+ */
2826
+ interface AllowanceResult {
2827
+ allowance: bigint;
2828
+ sufficient: boolean;
2829
+ requiredAmount: bigint;
2830
+ }
2831
+ interface ApprovalTx {
2832
+ to: string;
2833
+ data: string;
2834
+ value: '0x0';
2835
+ chainId: number;
2836
+ }
2837
+ /**
2838
+ * Check the ERC-20 allowance for a token.
2839
+ *
2840
+ * @param rpcUrl - JSON-RPC endpoint for the chain
2841
+ * @param tokenAddress - ERC-20 token contract address
2842
+ * @param owner - Wallet address (token holder)
2843
+ * @param spender - Address to check allowance for (from quote.estimate.approvalAddress)
2844
+ * @param requiredAmount - Amount needed in smallest unit
2845
+ */
2846
+ declare function checkAllowance(rpcUrl: string, tokenAddress: string, owner: string, spender: string, requiredAmount: bigint): Promise<AllowanceResult>;
2847
+ /**
2848
+ * Build an ERC-20 approve transaction.
2849
+ *
2850
+ * @param tokenAddress - ERC-20 token contract
2851
+ * @param spender - Address to approve (from quote.estimate.approvalAddress)
2852
+ * @param amount - Amount to approve in smallest unit (use MaxUint256 for unlimited)
2853
+ * @param chainId - Chain ID for the transaction
2854
+ */
2855
+ declare function buildApprovalTx(tokenAddress: string, spender: string, amount: bigint, chainId: number): ApprovalTx;
2856
+ /** MaxUint256 for unlimited approval */
2857
+ declare const MAX_UINT256: bigint;
2858
+ //#endregion
2859
+ //#region src/index.d.ts
2860
+ interface EarnForgeOptions {
2861
+ composerApiKey?: string;
2862
+ earnData?: EarnDataClientOptions;
2863
+ composerBaseUrl?: string;
2864
+ cache?: {
2865
+ ttl?: number;
2866
+ maxSize?: number;
2867
+ };
2868
+ }
2869
+ interface EarnForge {
2870
+ vaults: {
2871
+ list: (params?: VaultListQueryParams) => Promise<VaultListResponse>;
2872
+ listAll: (params?: Omit<VaultListQueryParams, 'cursor'>) => AsyncIterable<Vault>;
2873
+ get: (slug: string) => Promise<Vault>;
2874
+ top: (params?: TopVaultsParams) => Promise<Vault[]>;
2875
+ };
2876
+ chains: {
2877
+ list: () => Promise<Chain[]>;
2878
+ };
2879
+ protocols: {
2880
+ list: () => Promise<ProtocolDetail[]>;
2881
+ };
2882
+ portfolio: {
2883
+ get: (wallet: string) => Promise<PortfolioResponse>;
2884
+ };
2885
+ buildDepositQuote: (vault: Vault, options: DepositQuoteOptions) => Promise<DepositQuoteResult>;
2886
+ buildRedeemQuote: (vault: Vault, options: RedeemQuoteOptions) => Promise<RedeemQuoteResult>;
2887
+ preflight: (vault: Vault, wallet: string, options?: PreflightOptions) => PreflightReport;
2888
+ riskScore: (vault: Vault) => RiskScore;
2889
+ suggest: (params: SuggestParams & {
2890
+ vaults?: Vault[];
2891
+ }) => Promise<SuggestResult>;
2892
+ optimizeGasRoutes: (vault: Vault, options: GasOptimizeOptions) => Promise<GasRoute[]>;
2893
+ watch: (vaultSlug: string, options?: WatchOptions) => AsyncGenerator<WatchEvent>;
2894
+ getApyHistory: {
2895
+ (vault: Vault): Promise<ApyDataPoint[]>;
2896
+ (vaultAddress: string, chainId: number): Promise<ApyDataPoint[]>;
2897
+ };
2898
+ earnDataClient: EarnDataClient;
2899
+ composerClient: ComposerClient | null;
2900
+ }
2901
+ interface VaultListQueryParams {
2902
+ chainId?: number;
2903
+ asset?: string;
2904
+ minTvl?: number;
2905
+ sortBy?: string;
2906
+ cursor?: string;
2907
+ strategy?: StrategyPreset;
2908
+ }
2909
+ interface TopVaultsParams {
2910
+ asset?: string;
2911
+ chainId?: number;
2912
+ limit?: number;
2913
+ strategy?: StrategyPreset;
2914
+ minTvl?: number;
2915
+ }
2916
+ /**
2917
+ * Create an EarnForge instance — the main entry point.
2918
+ *
2919
+ * ```ts
2920
+ * const forge = createEarnForge({ composerApiKey: process.env.LIFI_API_KEY });
2921
+ * for await (const vault of forge.vaults.listAll({ chainId: 8453 })) {
2922
+ * console.log(vault.name, vault.analytics.apy.total);
2923
+ * }
2924
+ * ```
2925
+ */
2926
+ declare function createEarnForge(options?: EarnForgeOptions): EarnForge;
2927
+ //#endregion
2928
+ export { type Allocation, type AllowanceResult, AnalyticsSchema, type ApprovalTx, type ApyDataPoint, ApySchema, Chain, ChainListResponseSchema, ChainSchema, ComposerClient, type ComposerClientOptions, ComposerError, ComposerTokenSchema, type DepositQuoteOptions, type DepositQuoteResult, EarnApiError, EarnDataClient, type EarnDataClientOptions, EarnForge, EarnForgeError, EarnForgeOptions, FeeCostSchema, FeeSplitSchema, GasCostSchema, type GasOptimizeOptions, type GasRoute, IncludedStepSchema, LRUCache, MAX_UINT256, PackSchema, PortfolioResponse, PortfolioResponseSchema, Position, PositionAssetSchema, PositionSchema, PreflightError, PreflightIssue, type PreflightOptions, type PreflightReport, ProtocolDetail, ProtocolDetailSchema, ProtocolListResponseSchema, ProtocolSchema, QuoteActionSchema, QuoteEstimateSchema, type QuoteParams, QuoteResponse, QuoteResponseSchema, RateLimitError, type RedeemQuoteOptions, type RedeemQuoteResult, RetryOptions, type RiskBreakdown, type RiskScore, STRATEGIES, type StrategyConfig, type StrategyPreset, type SuggestParams, type SuggestResult, TokenBucketRateLimiter, ToolDetailsSchema, TransactionRequest, TransactionRequestSchema, type TvlParsed, TvlSchema, UnderlyingTokenSchema, Vault, type VaultListParams, VaultListResponse, VaultListResponseSchema, VaultSchema, type WatchEvent, type WatchEventType, type WatchOptions, buildApprovalTx, buildDepositQuote, buildRedeemQuote, checkAllowance, createEarnForge, fromSmallestUnit, getApyHistory, getBestApy, getStrategy, isRetryable, optimizeGasRoutes, parseTvl, preflight, riskScore, suggest, toSmallestUnit, watch, withRetry };
2929
+ //# sourceMappingURL=index.d.mts.map