@underscore-finance/sdk 1.2.20-next.0 → 1.2.20-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/AGENTS.md +28 -18
  2. package/abis.json +23476 -12295
  3. package/dist/contracts/Addys.d.ts +124 -0
  4. package/dist/contracts/Addys.d.ts.map +1 -0
  5. package/dist/contracts/Addys.js +134 -0
  6. package/dist/contracts/AgentSenderGeneric.d.ts +795 -153
  7. package/dist/contracts/AgentSenderGeneric.d.ts.map +1 -1
  8. package/dist/contracts/AgentSenderGeneric.js +892 -97
  9. package/dist/contracts/AgentSenderSpecial.d.ts +127 -0
  10. package/dist/contracts/AgentSenderSpecial.d.ts.map +1 -1
  11. package/dist/contracts/AgentSenderSpecial.js +139 -0
  12. package/dist/contracts/AgentSenderSpecialAdmin.d.ts +984 -0
  13. package/dist/contracts/AgentSenderSpecialAdmin.d.ts.map +1 -0
  14. package/dist/contracts/AgentSenderSpecialAdmin.js +1185 -0
  15. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +1010 -75
  16. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +1 -1
  17. package/dist/contracts/AgentSenderSpecialSigHelper.js +1240 -0
  18. package/dist/contracts/AgentWrapper.d.ts +164 -6
  19. package/dist/contracts/AgentWrapper.d.ts.map +1 -1
  20. package/dist/contracts/AgentWrapper.js +219 -6
  21. package/dist/contracts/ChequeBook.d.ts +360 -204
  22. package/dist/contracts/ChequeBook.d.ts.map +1 -1
  23. package/dist/contracts/ChequeBook.js +507 -298
  24. package/dist/contracts/DefaultsLocal.d.ts +320 -0
  25. package/dist/contracts/DefaultsLocal.d.ts.map +1 -0
  26. package/dist/contracts/DefaultsLocal.js +350 -0
  27. package/dist/contracts/ERC20.d.ts +552 -27
  28. package/dist/contracts/ERC20.d.ts.map +1 -1
  29. package/dist/contracts/ERC20.js +713 -66
  30. package/dist/contracts/EarnVault.d.ts +284 -255
  31. package/dist/contracts/EarnVault.d.ts.map +1 -1
  32. package/dist/contracts/EarnVault.js +488 -456
  33. package/dist/contracts/EarnVaultAgent.d.ts +127 -0
  34. package/dist/contracts/EarnVaultAgent.d.ts.map +1 -1
  35. package/dist/contracts/EarnVaultAgent.js +139 -0
  36. package/dist/contracts/EarnVaultWallet.d.ts +777 -0
  37. package/dist/contracts/EarnVaultWallet.d.ts.map +1 -0
  38. package/dist/contracts/EarnVaultWallet.js +987 -0
  39. package/dist/contracts/Erc20Token.d.ts +813 -0
  40. package/dist/contracts/Erc20Token.d.ts.map +1 -0
  41. package/dist/contracts/Erc20Token.js +1006 -0
  42. package/dist/contracts/HighCommand.d.ts +40 -0
  43. package/dist/contracts/HighCommand.d.ts.map +1 -1
  44. package/dist/contracts/HighCommand.js +45 -0
  45. package/dist/contracts/Kernel.d.ts +4 -0
  46. package/dist/contracts/Kernel.d.ts.map +1 -1
  47. package/dist/contracts/Kernel.js +4 -0
  48. package/dist/contracts/Ledger.d.ts +4 -75
  49. package/dist/contracts/Ledger.d.ts.map +1 -1
  50. package/dist/contracts/Ledger.js +4 -99
  51. package/dist/contracts/LevgVault.d.ts +299 -299
  52. package/dist/contracts/LevgVault.d.ts.map +1 -1
  53. package/dist/contracts/LevgVault.js +530 -530
  54. package/dist/contracts/LevgVaultAgent.d.ts +127 -69
  55. package/dist/contracts/LevgVaultAgent.d.ts.map +1 -1
  56. package/dist/contracts/LevgVaultAgent.js +134 -79
  57. package/dist/contracts/LevgVaultWallet.d.ts +1119 -0
  58. package/dist/contracts/LevgVaultWallet.d.ts.map +1 -0
  59. package/dist/contracts/LevgVaultWallet.js +1439 -0
  60. package/dist/contracts/LocalGov.d.ts +427 -0
  61. package/dist/contracts/LocalGov.d.ts.map +1 -0
  62. package/dist/contracts/LocalGov.js +507 -0
  63. package/dist/contracts/Migrator.d.ts +160 -0
  64. package/dist/contracts/Migrator.d.ts.map +1 -1
  65. package/dist/contracts/Migrator.js +187 -0
  66. package/dist/contracts/Ownership.d.ts +414 -0
  67. package/dist/contracts/Ownership.d.ts.map +1 -0
  68. package/dist/contracts/Ownership.js +472 -0
  69. package/dist/contracts/Paymaster.d.ts +119 -322
  70. package/dist/contracts/Paymaster.d.ts.map +1 -1
  71. package/dist/contracts/Paymaster.js +118 -404
  72. package/dist/contracts/Sentinel.d.ts +9 -6
  73. package/dist/contracts/Sentinel.d.ts.map +1 -1
  74. package/dist/contracts/Sentinel.js +8 -4
  75. package/dist/contracts/UndyToken.d.ts +821 -0
  76. package/dist/contracts/UndyToken.d.ts.map +1 -0
  77. package/dist/contracts/UndyToken.js +1017 -0
  78. package/dist/contracts/UserWalletConfig.d.ts +334 -317
  79. package/dist/contracts/UserWalletConfig.d.ts.map +1 -1
  80. package/dist/contracts/UserWalletConfig.js +391 -371
  81. package/dist/contracts/UserWalletSignatureHelper.d.ts +1520 -514
  82. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +1 -1
  83. package/dist/contracts/UserWalletSignatureHelper.js +1906 -549
  84. package/dist/contracts/VaultErc20Token.d.ts +522 -0
  85. package/dist/contracts/VaultErc20Token.d.ts.map +1 -0
  86. package/dist/contracts/VaultErc20Token.js +658 -0
  87. package/dist/contracts/index.d.ts +10 -0
  88. package/dist/contracts/index.d.ts.map +1 -1
  89. package/dist/contracts/index.js +10 -0
  90. package/dist/contracts/sdk.d.ts +20 -0
  91. package/dist/contracts/sdk.d.ts.map +1 -1
  92. package/dist/contracts/sdk.js +20 -0
  93. package/package.json +1 -1
@@ -0,0 +1,1439 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ import { encodeEventTopics, parseEventLogs } from 'viem';
7
+ export const abi = [
8
+ {
9
+ "name": "LevgVaultAction",
10
+ "inputs": [
11
+ {
12
+ "name": "op",
13
+ "type": "uint8",
14
+ "indexed": false
15
+ },
16
+ {
17
+ "name": "asset1",
18
+ "type": "address",
19
+ "indexed": true
20
+ },
21
+ {
22
+ "name": "asset2",
23
+ "type": "address",
24
+ "indexed": true
25
+ },
26
+ {
27
+ "name": "amount1",
28
+ "type": "uint256",
29
+ "indexed": false
30
+ },
31
+ {
32
+ "name": "amount2",
33
+ "type": "uint256",
34
+ "indexed": false
35
+ },
36
+ {
37
+ "name": "usdValue",
38
+ "type": "uint256",
39
+ "indexed": false
40
+ },
41
+ {
42
+ "name": "legoId",
43
+ "type": "uint256",
44
+ "indexed": false
45
+ },
46
+ {
47
+ "name": "signer",
48
+ "type": "address",
49
+ "indexed": true
50
+ }
51
+ ],
52
+ "anonymous": false,
53
+ "type": "event"
54
+ },
55
+ {
56
+ "name": "CollateralVaultTokenSet",
57
+ "inputs": [
58
+ {
59
+ "name": "collateralVaultToken",
60
+ "type": "address",
61
+ "indexed": true
62
+ },
63
+ {
64
+ "name": "legoId",
65
+ "type": "uint256",
66
+ "indexed": false
67
+ },
68
+ {
69
+ "name": "ripeVaultId",
70
+ "type": "uint256",
71
+ "indexed": false
72
+ }
73
+ ],
74
+ "anonymous": false,
75
+ "type": "event"
76
+ },
77
+ {
78
+ "name": "LeverageVaultTokenSet",
79
+ "inputs": [
80
+ {
81
+ "name": "leverageVaultToken",
82
+ "type": "address",
83
+ "indexed": true
84
+ },
85
+ {
86
+ "name": "legoId",
87
+ "type": "uint256",
88
+ "indexed": false
89
+ },
90
+ {
91
+ "name": "ripeVaultId",
92
+ "type": "uint256",
93
+ "indexed": false
94
+ }
95
+ ],
96
+ "anonymous": false,
97
+ "type": "event"
98
+ },
99
+ {
100
+ "name": "SlippagesSet",
101
+ "inputs": [
102
+ {
103
+ "name": "usdcSlippage",
104
+ "type": "uint256",
105
+ "indexed": false
106
+ },
107
+ {
108
+ "name": "greenSlippage",
109
+ "type": "uint256",
110
+ "indexed": false
111
+ }
112
+ ],
113
+ "anonymous": false,
114
+ "type": "event"
115
+ },
116
+ {
117
+ "name": "LevgVaultHelperSet",
118
+ "inputs": [
119
+ {
120
+ "name": "levgVaultHelper",
121
+ "type": "address",
122
+ "indexed": true
123
+ }
124
+ ],
125
+ "anonymous": false,
126
+ "type": "event"
127
+ },
128
+ {
129
+ "name": "MaxDebtRatioSet",
130
+ "inputs": [
131
+ {
132
+ "name": "maxDebtRatio",
133
+ "type": "uint256",
134
+ "indexed": false
135
+ }
136
+ ],
137
+ "anonymous": false,
138
+ "type": "event"
139
+ },
140
+ {
141
+ "stateMutability": "nonpayable",
142
+ "type": "function",
143
+ "name": "depositForYield",
144
+ "inputs": [
145
+ {
146
+ "name": "_legoId",
147
+ "type": "uint256"
148
+ },
149
+ {
150
+ "name": "_asset",
151
+ "type": "address"
152
+ }
153
+ ],
154
+ "outputs": [
155
+ {
156
+ "name": "",
157
+ "type": "uint256"
158
+ },
159
+ {
160
+ "name": "",
161
+ "type": "address"
162
+ },
163
+ {
164
+ "name": "",
165
+ "type": "uint256"
166
+ },
167
+ {
168
+ "name": "",
169
+ "type": "uint256"
170
+ }
171
+ ]
172
+ },
173
+ {
174
+ "stateMutability": "nonpayable",
175
+ "type": "function",
176
+ "name": "depositForYield",
177
+ "inputs": [
178
+ {
179
+ "name": "_legoId",
180
+ "type": "uint256"
181
+ },
182
+ {
183
+ "name": "_asset",
184
+ "type": "address"
185
+ },
186
+ {
187
+ "name": "_vaultAddr",
188
+ "type": "address"
189
+ }
190
+ ],
191
+ "outputs": [
192
+ {
193
+ "name": "",
194
+ "type": "uint256"
195
+ },
196
+ {
197
+ "name": "",
198
+ "type": "address"
199
+ },
200
+ {
201
+ "name": "",
202
+ "type": "uint256"
203
+ },
204
+ {
205
+ "name": "",
206
+ "type": "uint256"
207
+ }
208
+ ]
209
+ },
210
+ {
211
+ "stateMutability": "nonpayable",
212
+ "type": "function",
213
+ "name": "depositForYield",
214
+ "inputs": [
215
+ {
216
+ "name": "_legoId",
217
+ "type": "uint256"
218
+ },
219
+ {
220
+ "name": "_asset",
221
+ "type": "address"
222
+ },
223
+ {
224
+ "name": "_vaultAddr",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "name": "_amount",
229
+ "type": "uint256"
230
+ }
231
+ ],
232
+ "outputs": [
233
+ {
234
+ "name": "",
235
+ "type": "uint256"
236
+ },
237
+ {
238
+ "name": "",
239
+ "type": "address"
240
+ },
241
+ {
242
+ "name": "",
243
+ "type": "uint256"
244
+ },
245
+ {
246
+ "name": "",
247
+ "type": "uint256"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "stateMutability": "nonpayable",
253
+ "type": "function",
254
+ "name": "depositForYield",
255
+ "inputs": [
256
+ {
257
+ "name": "_legoId",
258
+ "type": "uint256"
259
+ },
260
+ {
261
+ "name": "_asset",
262
+ "type": "address"
263
+ },
264
+ {
265
+ "name": "_vaultAddr",
266
+ "type": "address"
267
+ },
268
+ {
269
+ "name": "_amount",
270
+ "type": "uint256"
271
+ },
272
+ {
273
+ "name": "_extraData",
274
+ "type": "bytes32"
275
+ }
276
+ ],
277
+ "outputs": [
278
+ {
279
+ "name": "",
280
+ "type": "uint256"
281
+ },
282
+ {
283
+ "name": "",
284
+ "type": "address"
285
+ },
286
+ {
287
+ "name": "",
288
+ "type": "uint256"
289
+ },
290
+ {
291
+ "name": "",
292
+ "type": "uint256"
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "stateMutability": "nonpayable",
298
+ "type": "function",
299
+ "name": "withdrawFromYield",
300
+ "inputs": [
301
+ {
302
+ "name": "_legoId",
303
+ "type": "uint256"
304
+ },
305
+ {
306
+ "name": "_vaultToken",
307
+ "type": "address"
308
+ }
309
+ ],
310
+ "outputs": [
311
+ {
312
+ "name": "",
313
+ "type": "uint256"
314
+ },
315
+ {
316
+ "name": "",
317
+ "type": "address"
318
+ },
319
+ {
320
+ "name": "",
321
+ "type": "uint256"
322
+ },
323
+ {
324
+ "name": "",
325
+ "type": "uint256"
326
+ }
327
+ ]
328
+ },
329
+ {
330
+ "stateMutability": "nonpayable",
331
+ "type": "function",
332
+ "name": "withdrawFromYield",
333
+ "inputs": [
334
+ {
335
+ "name": "_legoId",
336
+ "type": "uint256"
337
+ },
338
+ {
339
+ "name": "_vaultToken",
340
+ "type": "address"
341
+ },
342
+ {
343
+ "name": "_amount",
344
+ "type": "uint256"
345
+ }
346
+ ],
347
+ "outputs": [
348
+ {
349
+ "name": "",
350
+ "type": "uint256"
351
+ },
352
+ {
353
+ "name": "",
354
+ "type": "address"
355
+ },
356
+ {
357
+ "name": "",
358
+ "type": "uint256"
359
+ },
360
+ {
361
+ "name": "",
362
+ "type": "uint256"
363
+ }
364
+ ]
365
+ },
366
+ {
367
+ "stateMutability": "nonpayable",
368
+ "type": "function",
369
+ "name": "withdrawFromYield",
370
+ "inputs": [
371
+ {
372
+ "name": "_legoId",
373
+ "type": "uint256"
374
+ },
375
+ {
376
+ "name": "_vaultToken",
377
+ "type": "address"
378
+ },
379
+ {
380
+ "name": "_amount",
381
+ "type": "uint256"
382
+ },
383
+ {
384
+ "name": "_extraData",
385
+ "type": "bytes32"
386
+ }
387
+ ],
388
+ "outputs": [
389
+ {
390
+ "name": "",
391
+ "type": "uint256"
392
+ },
393
+ {
394
+ "name": "",
395
+ "type": "address"
396
+ },
397
+ {
398
+ "name": "",
399
+ "type": "uint256"
400
+ },
401
+ {
402
+ "name": "",
403
+ "type": "uint256"
404
+ }
405
+ ]
406
+ },
407
+ {
408
+ "stateMutability": "nonpayable",
409
+ "type": "function",
410
+ "name": "withdrawFromYield",
411
+ "inputs": [
412
+ {
413
+ "name": "_legoId",
414
+ "type": "uint256"
415
+ },
416
+ {
417
+ "name": "_vaultToken",
418
+ "type": "address"
419
+ },
420
+ {
421
+ "name": "_amount",
422
+ "type": "uint256"
423
+ },
424
+ {
425
+ "name": "_extraData",
426
+ "type": "bytes32"
427
+ },
428
+ {
429
+ "name": "_isSpecialTx",
430
+ "type": "bool"
431
+ }
432
+ ],
433
+ "outputs": [
434
+ {
435
+ "name": "",
436
+ "type": "uint256"
437
+ },
438
+ {
439
+ "name": "",
440
+ "type": "address"
441
+ },
442
+ {
443
+ "name": "",
444
+ "type": "uint256"
445
+ },
446
+ {
447
+ "name": "",
448
+ "type": "uint256"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "stateMutability": "nonpayable",
454
+ "type": "function",
455
+ "name": "swapTokens",
456
+ "inputs": [
457
+ {
458
+ "name": "_instructions",
459
+ "type": "tuple[]",
460
+ "components": [
461
+ {
462
+ "name": "legoId",
463
+ "type": "uint256"
464
+ },
465
+ {
466
+ "name": "amountIn",
467
+ "type": "uint256"
468
+ },
469
+ {
470
+ "name": "minAmountOut",
471
+ "type": "uint256"
472
+ },
473
+ {
474
+ "name": "tokenPath",
475
+ "type": "address[]"
476
+ },
477
+ {
478
+ "name": "poolPath",
479
+ "type": "address[]"
480
+ }
481
+ ]
482
+ }
483
+ ],
484
+ "outputs": [
485
+ {
486
+ "name": "",
487
+ "type": "address"
488
+ },
489
+ {
490
+ "name": "",
491
+ "type": "uint256"
492
+ },
493
+ {
494
+ "name": "",
495
+ "type": "address"
496
+ },
497
+ {
498
+ "name": "",
499
+ "type": "uint256"
500
+ },
501
+ {
502
+ "name": "",
503
+ "type": "uint256"
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ "stateMutability": "nonpayable",
509
+ "type": "function",
510
+ "name": "addCollateral",
511
+ "inputs": [
512
+ {
513
+ "name": "_legoId",
514
+ "type": "uint256"
515
+ },
516
+ {
517
+ "name": "_asset",
518
+ "type": "address"
519
+ }
520
+ ],
521
+ "outputs": [
522
+ {
523
+ "name": "",
524
+ "type": "uint256"
525
+ },
526
+ {
527
+ "name": "",
528
+ "type": "uint256"
529
+ }
530
+ ]
531
+ },
532
+ {
533
+ "stateMutability": "nonpayable",
534
+ "type": "function",
535
+ "name": "addCollateral",
536
+ "inputs": [
537
+ {
538
+ "name": "_legoId",
539
+ "type": "uint256"
540
+ },
541
+ {
542
+ "name": "_asset",
543
+ "type": "address"
544
+ },
545
+ {
546
+ "name": "_amount",
547
+ "type": "uint256"
548
+ }
549
+ ],
550
+ "outputs": [
551
+ {
552
+ "name": "",
553
+ "type": "uint256"
554
+ },
555
+ {
556
+ "name": "",
557
+ "type": "uint256"
558
+ }
559
+ ]
560
+ },
561
+ {
562
+ "stateMutability": "nonpayable",
563
+ "type": "function",
564
+ "name": "addCollateral",
565
+ "inputs": [
566
+ {
567
+ "name": "_legoId",
568
+ "type": "uint256"
569
+ },
570
+ {
571
+ "name": "_asset",
572
+ "type": "address"
573
+ },
574
+ {
575
+ "name": "_amount",
576
+ "type": "uint256"
577
+ },
578
+ {
579
+ "name": "_extraData",
580
+ "type": "bytes32"
581
+ }
582
+ ],
583
+ "outputs": [
584
+ {
585
+ "name": "",
586
+ "type": "uint256"
587
+ },
588
+ {
589
+ "name": "",
590
+ "type": "uint256"
591
+ }
592
+ ]
593
+ },
594
+ {
595
+ "stateMutability": "nonpayable",
596
+ "type": "function",
597
+ "name": "removeCollateral",
598
+ "inputs": [
599
+ {
600
+ "name": "_legoId",
601
+ "type": "uint256"
602
+ },
603
+ {
604
+ "name": "_asset",
605
+ "type": "address"
606
+ }
607
+ ],
608
+ "outputs": [
609
+ {
610
+ "name": "",
611
+ "type": "uint256"
612
+ },
613
+ {
614
+ "name": "",
615
+ "type": "uint256"
616
+ }
617
+ ]
618
+ },
619
+ {
620
+ "stateMutability": "nonpayable",
621
+ "type": "function",
622
+ "name": "removeCollateral",
623
+ "inputs": [
624
+ {
625
+ "name": "_legoId",
626
+ "type": "uint256"
627
+ },
628
+ {
629
+ "name": "_asset",
630
+ "type": "address"
631
+ },
632
+ {
633
+ "name": "_amount",
634
+ "type": "uint256"
635
+ }
636
+ ],
637
+ "outputs": [
638
+ {
639
+ "name": "",
640
+ "type": "uint256"
641
+ },
642
+ {
643
+ "name": "",
644
+ "type": "uint256"
645
+ }
646
+ ]
647
+ },
648
+ {
649
+ "stateMutability": "nonpayable",
650
+ "type": "function",
651
+ "name": "removeCollateral",
652
+ "inputs": [
653
+ {
654
+ "name": "_legoId",
655
+ "type": "uint256"
656
+ },
657
+ {
658
+ "name": "_asset",
659
+ "type": "address"
660
+ },
661
+ {
662
+ "name": "_amount",
663
+ "type": "uint256"
664
+ },
665
+ {
666
+ "name": "_extraData",
667
+ "type": "bytes32"
668
+ }
669
+ ],
670
+ "outputs": [
671
+ {
672
+ "name": "",
673
+ "type": "uint256"
674
+ },
675
+ {
676
+ "name": "",
677
+ "type": "uint256"
678
+ }
679
+ ]
680
+ },
681
+ {
682
+ "stateMutability": "nonpayable",
683
+ "type": "function",
684
+ "name": "borrow",
685
+ "inputs": [
686
+ {
687
+ "name": "_legoId",
688
+ "type": "uint256"
689
+ },
690
+ {
691
+ "name": "_borrowAsset",
692
+ "type": "address"
693
+ }
694
+ ],
695
+ "outputs": [
696
+ {
697
+ "name": "",
698
+ "type": "uint256"
699
+ },
700
+ {
701
+ "name": "",
702
+ "type": "uint256"
703
+ }
704
+ ]
705
+ },
706
+ {
707
+ "stateMutability": "nonpayable",
708
+ "type": "function",
709
+ "name": "borrow",
710
+ "inputs": [
711
+ {
712
+ "name": "_legoId",
713
+ "type": "uint256"
714
+ },
715
+ {
716
+ "name": "_borrowAsset",
717
+ "type": "address"
718
+ },
719
+ {
720
+ "name": "_amount",
721
+ "type": "uint256"
722
+ }
723
+ ],
724
+ "outputs": [
725
+ {
726
+ "name": "",
727
+ "type": "uint256"
728
+ },
729
+ {
730
+ "name": "",
731
+ "type": "uint256"
732
+ }
733
+ ]
734
+ },
735
+ {
736
+ "stateMutability": "nonpayable",
737
+ "type": "function",
738
+ "name": "borrow",
739
+ "inputs": [
740
+ {
741
+ "name": "_legoId",
742
+ "type": "uint256"
743
+ },
744
+ {
745
+ "name": "_borrowAsset",
746
+ "type": "address"
747
+ },
748
+ {
749
+ "name": "_amount",
750
+ "type": "uint256"
751
+ },
752
+ {
753
+ "name": "_extraData",
754
+ "type": "bytes32"
755
+ }
756
+ ],
757
+ "outputs": [
758
+ {
759
+ "name": "",
760
+ "type": "uint256"
761
+ },
762
+ {
763
+ "name": "",
764
+ "type": "uint256"
765
+ }
766
+ ]
767
+ },
768
+ {
769
+ "stateMutability": "nonpayable",
770
+ "type": "function",
771
+ "name": "repayDebt",
772
+ "inputs": [
773
+ {
774
+ "name": "_legoId",
775
+ "type": "uint256"
776
+ },
777
+ {
778
+ "name": "_paymentAsset",
779
+ "type": "address"
780
+ }
781
+ ],
782
+ "outputs": [
783
+ {
784
+ "name": "",
785
+ "type": "uint256"
786
+ },
787
+ {
788
+ "name": "",
789
+ "type": "uint256"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "stateMutability": "nonpayable",
795
+ "type": "function",
796
+ "name": "repayDebt",
797
+ "inputs": [
798
+ {
799
+ "name": "_legoId",
800
+ "type": "uint256"
801
+ },
802
+ {
803
+ "name": "_paymentAsset",
804
+ "type": "address"
805
+ },
806
+ {
807
+ "name": "_paymentAmount",
808
+ "type": "uint256"
809
+ }
810
+ ],
811
+ "outputs": [
812
+ {
813
+ "name": "",
814
+ "type": "uint256"
815
+ },
816
+ {
817
+ "name": "",
818
+ "type": "uint256"
819
+ }
820
+ ]
821
+ },
822
+ {
823
+ "stateMutability": "nonpayable",
824
+ "type": "function",
825
+ "name": "repayDebt",
826
+ "inputs": [
827
+ {
828
+ "name": "_legoId",
829
+ "type": "uint256"
830
+ },
831
+ {
832
+ "name": "_paymentAsset",
833
+ "type": "address"
834
+ },
835
+ {
836
+ "name": "_paymentAmount",
837
+ "type": "uint256"
838
+ },
839
+ {
840
+ "name": "_extraData",
841
+ "type": "bytes32"
842
+ }
843
+ ],
844
+ "outputs": [
845
+ {
846
+ "name": "",
847
+ "type": "uint256"
848
+ },
849
+ {
850
+ "name": "",
851
+ "type": "uint256"
852
+ }
853
+ ]
854
+ },
855
+ {
856
+ "stateMutability": "nonpayable",
857
+ "type": "function",
858
+ "name": "claimIncentives",
859
+ "inputs": [
860
+ {
861
+ "name": "_legoId",
862
+ "type": "uint256"
863
+ }
864
+ ],
865
+ "outputs": [
866
+ {
867
+ "name": "",
868
+ "type": "uint256"
869
+ },
870
+ {
871
+ "name": "",
872
+ "type": "uint256"
873
+ }
874
+ ]
875
+ },
876
+ {
877
+ "stateMutability": "nonpayable",
878
+ "type": "function",
879
+ "name": "claimIncentives",
880
+ "inputs": [
881
+ {
882
+ "name": "_legoId",
883
+ "type": "uint256"
884
+ },
885
+ {
886
+ "name": "_rewardToken",
887
+ "type": "address"
888
+ }
889
+ ],
890
+ "outputs": [
891
+ {
892
+ "name": "",
893
+ "type": "uint256"
894
+ },
895
+ {
896
+ "name": "",
897
+ "type": "uint256"
898
+ }
899
+ ]
900
+ },
901
+ {
902
+ "stateMutability": "nonpayable",
903
+ "type": "function",
904
+ "name": "claimIncentives",
905
+ "inputs": [
906
+ {
907
+ "name": "_legoId",
908
+ "type": "uint256"
909
+ },
910
+ {
911
+ "name": "_rewardToken",
912
+ "type": "address"
913
+ },
914
+ {
915
+ "name": "_rewardAmount",
916
+ "type": "uint256"
917
+ }
918
+ ],
919
+ "outputs": [
920
+ {
921
+ "name": "",
922
+ "type": "uint256"
923
+ },
924
+ {
925
+ "name": "",
926
+ "type": "uint256"
927
+ }
928
+ ]
929
+ },
930
+ {
931
+ "stateMutability": "nonpayable",
932
+ "type": "function",
933
+ "name": "claimIncentives",
934
+ "inputs": [
935
+ {
936
+ "name": "_legoId",
937
+ "type": "uint256"
938
+ },
939
+ {
940
+ "name": "_rewardToken",
941
+ "type": "address"
942
+ },
943
+ {
944
+ "name": "_rewardAmount",
945
+ "type": "uint256"
946
+ },
947
+ {
948
+ "name": "_proofs",
949
+ "type": "bytes32[]"
950
+ }
951
+ ],
952
+ "outputs": [
953
+ {
954
+ "name": "",
955
+ "type": "uint256"
956
+ },
957
+ {
958
+ "name": "",
959
+ "type": "uint256"
960
+ }
961
+ ]
962
+ },
963
+ {
964
+ "stateMutability": "nonpayable",
965
+ "type": "function",
966
+ "name": "setCollateralVault",
967
+ "inputs": [
968
+ {
969
+ "name": "_vaultToken",
970
+ "type": "address"
971
+ },
972
+ {
973
+ "name": "_legoId",
974
+ "type": "uint256"
975
+ },
976
+ {
977
+ "name": "_ripeVaultId",
978
+ "type": "uint256"
979
+ },
980
+ {
981
+ "name": "_shouldMaxWithdraw",
982
+ "type": "bool"
983
+ }
984
+ ],
985
+ "outputs": []
986
+ },
987
+ {
988
+ "stateMutability": "nonpayable",
989
+ "type": "function",
990
+ "name": "setLeverageVault",
991
+ "inputs": [
992
+ {
993
+ "name": "_vaultToken",
994
+ "type": "address"
995
+ },
996
+ {
997
+ "name": "_legoId",
998
+ "type": "uint256"
999
+ },
1000
+ {
1001
+ "name": "_ripeVaultId",
1002
+ "type": "uint256"
1003
+ },
1004
+ {
1005
+ "name": "_shouldMaxWithdraw",
1006
+ "type": "bool"
1007
+ }
1008
+ ],
1009
+ "outputs": []
1010
+ },
1011
+ {
1012
+ "stateMutability": "nonpayable",
1013
+ "type": "function",
1014
+ "name": "setSlippagesAllowed",
1015
+ "inputs": [
1016
+ {
1017
+ "name": "_usdcSlippage",
1018
+ "type": "uint256"
1019
+ },
1020
+ {
1021
+ "name": "_greenSlippage",
1022
+ "type": "uint256"
1023
+ }
1024
+ ],
1025
+ "outputs": []
1026
+ },
1027
+ {
1028
+ "stateMutability": "nonpayable",
1029
+ "type": "function",
1030
+ "name": "setLevgVaultHelper",
1031
+ "inputs": [
1032
+ {
1033
+ "name": "_levgVaultHelper",
1034
+ "type": "address"
1035
+ }
1036
+ ],
1037
+ "outputs": []
1038
+ },
1039
+ {
1040
+ "stateMutability": "nonpayable",
1041
+ "type": "function",
1042
+ "name": "setMaxDebtRatio",
1043
+ "inputs": [
1044
+ {
1045
+ "name": "_ratio",
1046
+ "type": "uint256"
1047
+ }
1048
+ ],
1049
+ "outputs": []
1050
+ },
1051
+ {
1052
+ "stateMutability": "nonpayable",
1053
+ "type": "function",
1054
+ "name": "addManager",
1055
+ "inputs": [
1056
+ {
1057
+ "name": "_manager",
1058
+ "type": "address"
1059
+ }
1060
+ ],
1061
+ "outputs": []
1062
+ },
1063
+ {
1064
+ "stateMutability": "nonpayable",
1065
+ "type": "function",
1066
+ "name": "removeManager",
1067
+ "inputs": [
1068
+ {
1069
+ "name": "_manager",
1070
+ "type": "address"
1071
+ }
1072
+ ],
1073
+ "outputs": []
1074
+ },
1075
+ {
1076
+ "stateMutability": "view",
1077
+ "type": "function",
1078
+ "name": "vaultToLegoId",
1079
+ "inputs": [
1080
+ {
1081
+ "name": "arg0",
1082
+ "type": "address"
1083
+ }
1084
+ ],
1085
+ "outputs": [
1086
+ {
1087
+ "name": "",
1088
+ "type": "uint256"
1089
+ }
1090
+ ]
1091
+ },
1092
+ {
1093
+ "stateMutability": "view",
1094
+ "type": "function",
1095
+ "name": "levgVaultHelper",
1096
+ "inputs": [],
1097
+ "outputs": [
1098
+ {
1099
+ "name": "",
1100
+ "type": "address"
1101
+ }
1102
+ ]
1103
+ },
1104
+ {
1105
+ "stateMutability": "view",
1106
+ "type": "function",
1107
+ "name": "collateralAsset",
1108
+ "inputs": [],
1109
+ "outputs": [
1110
+ {
1111
+ "name": "",
1112
+ "type": "tuple",
1113
+ "components": [
1114
+ {
1115
+ "name": "vaultToken",
1116
+ "type": "address"
1117
+ },
1118
+ {
1119
+ "name": "ripeVaultId",
1120
+ "type": "uint256"
1121
+ }
1122
+ ]
1123
+ }
1124
+ ]
1125
+ },
1126
+ {
1127
+ "stateMutability": "view",
1128
+ "type": "function",
1129
+ "name": "leverageAsset",
1130
+ "inputs": [],
1131
+ "outputs": [
1132
+ {
1133
+ "name": "",
1134
+ "type": "tuple",
1135
+ "components": [
1136
+ {
1137
+ "name": "vaultToken",
1138
+ "type": "address"
1139
+ },
1140
+ {
1141
+ "name": "ripeVaultId",
1142
+ "type": "uint256"
1143
+ }
1144
+ ]
1145
+ }
1146
+ ]
1147
+ },
1148
+ {
1149
+ "stateMutability": "view",
1150
+ "type": "function",
1151
+ "name": "isRawAssetCollateral",
1152
+ "inputs": [],
1153
+ "outputs": [
1154
+ {
1155
+ "name": "",
1156
+ "type": "bool"
1157
+ }
1158
+ ]
1159
+ },
1160
+ {
1161
+ "stateMutability": "view",
1162
+ "type": "function",
1163
+ "name": "managers",
1164
+ "inputs": [
1165
+ {
1166
+ "name": "arg0",
1167
+ "type": "uint256"
1168
+ }
1169
+ ],
1170
+ "outputs": [
1171
+ {
1172
+ "name": "",
1173
+ "type": "address"
1174
+ }
1175
+ ]
1176
+ },
1177
+ {
1178
+ "stateMutability": "view",
1179
+ "type": "function",
1180
+ "name": "indexOfManager",
1181
+ "inputs": [
1182
+ {
1183
+ "name": "arg0",
1184
+ "type": "address"
1185
+ }
1186
+ ],
1187
+ "outputs": [
1188
+ {
1189
+ "name": "",
1190
+ "type": "uint256"
1191
+ }
1192
+ ]
1193
+ },
1194
+ {
1195
+ "stateMutability": "view",
1196
+ "type": "function",
1197
+ "name": "numManagers",
1198
+ "inputs": [],
1199
+ "outputs": [
1200
+ {
1201
+ "name": "",
1202
+ "type": "uint256"
1203
+ }
1204
+ ]
1205
+ },
1206
+ {
1207
+ "stateMutability": "view",
1208
+ "type": "function",
1209
+ "name": "usdcSlippageAllowed",
1210
+ "inputs": [],
1211
+ "outputs": [
1212
+ {
1213
+ "name": "",
1214
+ "type": "uint256"
1215
+ }
1216
+ ]
1217
+ },
1218
+ {
1219
+ "stateMutability": "view",
1220
+ "type": "function",
1221
+ "name": "greenSlippageAllowed",
1222
+ "inputs": [],
1223
+ "outputs": [
1224
+ {
1225
+ "name": "",
1226
+ "type": "uint256"
1227
+ }
1228
+ ]
1229
+ },
1230
+ {
1231
+ "stateMutability": "view",
1232
+ "type": "function",
1233
+ "name": "maxDebtRatio",
1234
+ "inputs": [],
1235
+ "outputs": [
1236
+ {
1237
+ "name": "",
1238
+ "type": "uint256"
1239
+ }
1240
+ ]
1241
+ },
1242
+ {
1243
+ "stateMutability": "view",
1244
+ "type": "function",
1245
+ "name": "USDC",
1246
+ "inputs": [],
1247
+ "outputs": [
1248
+ {
1249
+ "name": "",
1250
+ "type": "address"
1251
+ }
1252
+ ]
1253
+ },
1254
+ {
1255
+ "stateMutability": "nonpayable",
1256
+ "type": "constructor",
1257
+ "inputs": [
1258
+ {
1259
+ "name": "_undyHq",
1260
+ "type": "address"
1261
+ },
1262
+ {
1263
+ "name": "_underlyingAsset",
1264
+ "type": "address"
1265
+ },
1266
+ {
1267
+ "name": "_collateralVaultToken",
1268
+ "type": "address"
1269
+ },
1270
+ {
1271
+ "name": "_collateralVaultTokenLegoId",
1272
+ "type": "uint256"
1273
+ },
1274
+ {
1275
+ "name": "_collateralVaultTokenRipeVaultId",
1276
+ "type": "uint256"
1277
+ },
1278
+ {
1279
+ "name": "_leverageVaultToken",
1280
+ "type": "address"
1281
+ },
1282
+ {
1283
+ "name": "_leverageVaultTokenLegoId",
1284
+ "type": "uint256"
1285
+ },
1286
+ {
1287
+ "name": "_leverageVaultTokenRipeVaultId",
1288
+ "type": "uint256"
1289
+ },
1290
+ {
1291
+ "name": "_usdc",
1292
+ "type": "address"
1293
+ },
1294
+ {
1295
+ "name": "_green",
1296
+ "type": "address"
1297
+ },
1298
+ {
1299
+ "name": "_savingsGreen",
1300
+ "type": "address"
1301
+ },
1302
+ {
1303
+ "name": "_startingAgent",
1304
+ "type": "address"
1305
+ },
1306
+ {
1307
+ "name": "_levgVaultHelper",
1308
+ "type": "address"
1309
+ }
1310
+ ],
1311
+ "outputs": []
1312
+ }
1313
+ ];
1314
+ export const deployAddress = undefined;
1315
+ function getRequest(method, args, contractAddressOrOptions) {
1316
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
1317
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
1318
+ const call = {
1319
+ contractName: 'LevgVaultWallet',
1320
+ method,
1321
+ args,
1322
+ address,
1323
+ deployAddress,
1324
+ defaultValue,
1325
+ getAbi: () => abi,
1326
+ with: (options) => {
1327
+ call.address = options.contractAddress;
1328
+ call.defaultValue = options.defaultValue;
1329
+ return call;
1330
+ },
1331
+ defaultTo: (defaultValue) => {
1332
+ call.defaultValue = defaultValue;
1333
+ return call;
1334
+ },
1335
+ at: (address) => {
1336
+ call.address = address;
1337
+ return call;
1338
+ },
1339
+ };
1340
+ return call;
1341
+ }
1342
+ export const call = {
1343
+ vaultToLegoId: (...args) => getRequest('vaultToLegoId', args),
1344
+ levgVaultHelper: (...args) => getRequest('levgVaultHelper', args),
1345
+ collateralAsset: (...args) => getRequest('collateralAsset', args),
1346
+ leverageAsset: (...args) => getRequest('leverageAsset', args),
1347
+ isRawAssetCollateral: (...args) => getRequest('isRawAssetCollateral', args),
1348
+ managers: (...args) => getRequest('managers', args),
1349
+ indexOfManager: (...args) => getRequest('indexOfManager', args),
1350
+ numManagers: (...args) => getRequest('numManagers', args),
1351
+ usdcSlippageAllowed: (...args) => getRequest('usdcSlippageAllowed', args),
1352
+ greenSlippageAllowed: (...args) => getRequest('greenSlippageAllowed', args),
1353
+ maxDebtRatio: (...args) => getRequest('maxDebtRatio', args),
1354
+ USDC: (...args) => getRequest('USDC', args),
1355
+ };
1356
+ function getMutation(functionName) {
1357
+ return {
1358
+ contractName: 'LevgVaultWallet',
1359
+ functionName,
1360
+ deployAddress,
1361
+ argsType: undefined,
1362
+ getAbi: () => abi,
1363
+ };
1364
+ }
1365
+ export const mutation = {
1366
+ depositForYield: getMutation('depositForYield'),
1367
+ withdrawFromYield: getMutation('withdrawFromYield'),
1368
+ swapTokens: getMutation('swapTokens'),
1369
+ addCollateral: getMutation('addCollateral'),
1370
+ removeCollateral: getMutation('removeCollateral'),
1371
+ borrow: getMutation('borrow'),
1372
+ repayDebt: getMutation('repayDebt'),
1373
+ claimIncentives: getMutation('claimIncentives'),
1374
+ setCollateralVault: getMutation('setCollateralVault'),
1375
+ setLeverageVault: getMutation('setLeverageVault'),
1376
+ setSlippagesAllowed: getMutation('setSlippagesAllowed'),
1377
+ setLevgVaultHelper: getMutation('setLevgVaultHelper'),
1378
+ setMaxDebtRatio: getMutation('setMaxDebtRatio'),
1379
+ addManager: getMutation('addManager'),
1380
+ removeManager: getMutation('removeManager'),
1381
+ };
1382
+ export function parseEvents(eventName, events) {
1383
+ return events.map((event) => {
1384
+ return {
1385
+ event,
1386
+ parsed: parseEventLogs({
1387
+ abi,
1388
+ eventName,
1389
+ logs: [event],
1390
+ }),
1391
+ };
1392
+ });
1393
+ }
1394
+ export function getEventTopic(eventName) {
1395
+ return encodeEventTopics({ abi, eventName })[0];
1396
+ }
1397
+ export function toSdk(deployAddress, publicClient, walletClient, addressResolver) {
1398
+ return {
1399
+ deployAddress,
1400
+ abi,
1401
+ events: {
1402
+ LevgVaultAction: { topic: getEventTopic('LevgVaultAction'), parse: (events) => parseEvents('LevgVaultAction', events) },
1403
+ CollateralVaultTokenSet: { topic: getEventTopic('CollateralVaultTokenSet'), parse: (events) => parseEvents('CollateralVaultTokenSet', events) },
1404
+ LeverageVaultTokenSet: { topic: getEventTopic('LeverageVaultTokenSet'), parse: (events) => parseEvents('LeverageVaultTokenSet', events) },
1405
+ SlippagesSet: { topic: getEventTopic('SlippagesSet'), parse: (events) => parseEvents('SlippagesSet', events) },
1406
+ LevgVaultHelperSet: { topic: getEventTopic('LevgVaultHelperSet'), parse: (events) => parseEvents('LevgVaultHelperSet', events) },
1407
+ MaxDebtRatioSet: { topic: getEventTopic('MaxDebtRatioSet'), parse: (events) => parseEvents('MaxDebtRatioSet', events) },
1408
+ },
1409
+ // Queries
1410
+ vaultToLegoId: (...args) => singleQuery(publicClient, call.vaultToLegoId(...args).at(deployAddress), {}, addressResolver),
1411
+ levgVaultHelper: (...args) => singleQuery(publicClient, call.levgVaultHelper(...args).at(deployAddress), {}, addressResolver),
1412
+ collateralAsset: (...args) => singleQuery(publicClient, call.collateralAsset(...args).at(deployAddress), {}, addressResolver),
1413
+ leverageAsset: (...args) => singleQuery(publicClient, call.leverageAsset(...args).at(deployAddress), {}, addressResolver),
1414
+ isRawAssetCollateral: (...args) => singleQuery(publicClient, call.isRawAssetCollateral(...args).at(deployAddress), {}, addressResolver),
1415
+ managers: (...args) => singleQuery(publicClient, call.managers(...args).at(deployAddress), {}, addressResolver),
1416
+ indexOfManager: (...args) => singleQuery(publicClient, call.indexOfManager(...args).at(deployAddress), {}, addressResolver),
1417
+ numManagers: (...args) => singleQuery(publicClient, call.numManagers(...args).at(deployAddress), {}, addressResolver),
1418
+ usdcSlippageAllowed: (...args) => singleQuery(publicClient, call.usdcSlippageAllowed(...args).at(deployAddress), {}, addressResolver),
1419
+ greenSlippageAllowed: (...args) => singleQuery(publicClient, call.greenSlippageAllowed(...args).at(deployAddress), {}, addressResolver),
1420
+ maxDebtRatio: (...args) => singleQuery(publicClient, call.maxDebtRatio(...args).at(deployAddress), {}, addressResolver),
1421
+ USDC: (...args) => singleQuery(publicClient, call.USDC(...args).at(deployAddress), {}, addressResolver),
1422
+ // Mutations
1423
+ depositForYield: (...args) => mutate(walletClient, mutation.depositForYield, { address: deployAddress, addressResolver })(...args),
1424
+ withdrawFromYield: (...args) => mutate(walletClient, mutation.withdrawFromYield, { address: deployAddress, addressResolver })(...args),
1425
+ swapTokens: (...args) => mutate(walletClient, mutation.swapTokens, { address: deployAddress, addressResolver })(...args),
1426
+ addCollateral: (...args) => mutate(walletClient, mutation.addCollateral, { address: deployAddress, addressResolver })(...args),
1427
+ removeCollateral: (...args) => mutate(walletClient, mutation.removeCollateral, { address: deployAddress, addressResolver })(...args),
1428
+ borrow: (...args) => mutate(walletClient, mutation.borrow, { address: deployAddress, addressResolver })(...args),
1429
+ repayDebt: (...args) => mutate(walletClient, mutation.repayDebt, { address: deployAddress, addressResolver })(...args),
1430
+ claimIncentives: (...args) => mutate(walletClient, mutation.claimIncentives, { address: deployAddress, addressResolver })(...args),
1431
+ setCollateralVault: (...args) => mutate(walletClient, mutation.setCollateralVault, { address: deployAddress, addressResolver })(...args),
1432
+ setLeverageVault: (...args) => mutate(walletClient, mutation.setLeverageVault, { address: deployAddress, addressResolver })(...args),
1433
+ setSlippagesAllowed: (...args) => mutate(walletClient, mutation.setSlippagesAllowed, { address: deployAddress, addressResolver })(...args),
1434
+ setLevgVaultHelper: (...args) => mutate(walletClient, mutation.setLevgVaultHelper, { address: deployAddress, addressResolver })(...args),
1435
+ setMaxDebtRatio: (...args) => mutate(walletClient, mutation.setMaxDebtRatio, { address: deployAddress, addressResolver })(...args),
1436
+ addManager: (...args) => mutate(walletClient, mutation.addManager, { address: deployAddress, addressResolver })(...args),
1437
+ removeManager: (...args) => mutate(walletClient, mutation.removeManager, { address: deployAddress, addressResolver })(...args),
1438
+ };
1439
+ }