@underscore-finance/sdk 0.0.1

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 (84) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +131 -0
  3. package/dist/contracts/AddyRegistry.d.ts +471 -0
  4. package/dist/contracts/AddyRegistry.d.ts.map +1 -0
  5. package/dist/contracts/AddyRegistry.js +592 -0
  6. package/dist/contracts/AgentFactory.d.ts +966 -0
  7. package/dist/contracts/AgentFactory.d.ts.map +1 -0
  8. package/dist/contracts/AgentFactory.js +1227 -0
  9. package/dist/contracts/AgentTemplate.d.ts +2629 -0
  10. package/dist/contracts/AgentTemplate.d.ts.map +1 -0
  11. package/dist/contracts/AgentTemplate.js +3370 -0
  12. package/dist/contracts/ChainlinkFeeds.d.ts +567 -0
  13. package/dist/contracts/ChainlinkFeeds.d.ts.map +1 -0
  14. package/dist/contracts/ChainlinkFeeds.js +735 -0
  15. package/dist/contracts/LegoAaveV3.d.ts +894 -0
  16. package/dist/contracts/LegoAaveV3.d.ts.map +1 -0
  17. package/dist/contracts/LegoAaveV3.js +1165 -0
  18. package/dist/contracts/LegoAeroClassic.d.ts +1065 -0
  19. package/dist/contracts/LegoAeroClassic.d.ts.map +1 -0
  20. package/dist/contracts/LegoAeroClassic.js +1381 -0
  21. package/dist/contracts/LegoAeroSlipstream.d.ts +1161 -0
  22. package/dist/contracts/LegoAeroSlipstream.d.ts.map +1 -0
  23. package/dist/contracts/LegoAeroSlipstream.js +1506 -0
  24. package/dist/contracts/LegoCompoundV3.d.ts +921 -0
  25. package/dist/contracts/LegoCompoundV3.d.ts.map +1 -0
  26. package/dist/contracts/LegoCompoundV3.js +1200 -0
  27. package/dist/contracts/LegoCurve.d.ts +1050 -0
  28. package/dist/contracts/LegoCurve.d.ts.map +1 -0
  29. package/dist/contracts/LegoCurve.js +1354 -0
  30. package/dist/contracts/LegoEuler.d.ts +935 -0
  31. package/dist/contracts/LegoEuler.d.ts.map +1 -0
  32. package/dist/contracts/LegoEuler.js +1218 -0
  33. package/dist/contracts/LegoFluid.d.ts +875 -0
  34. package/dist/contracts/LegoFluid.d.ts.map +1 -0
  35. package/dist/contracts/LegoFluid.js +1141 -0
  36. package/dist/contracts/LegoHelper.d.ts +1555 -0
  37. package/dist/contracts/LegoHelper.d.ts.map +1 -0
  38. package/dist/contracts/LegoHelper.js +1945 -0
  39. package/dist/contracts/LegoMoonwell.d.ts +903 -0
  40. package/dist/contracts/LegoMoonwell.d.ts.map +1 -0
  41. package/dist/contracts/LegoMoonwell.js +1177 -0
  42. package/dist/contracts/LegoMorpho.d.ts +935 -0
  43. package/dist/contracts/LegoMorpho.d.ts.map +1 -0
  44. package/dist/contracts/LegoMorpho.js +1218 -0
  45. package/dist/contracts/LegoRegistry.d.ts +589 -0
  46. package/dist/contracts/LegoRegistry.d.ts.map +1 -0
  47. package/dist/contracts/LegoRegistry.js +746 -0
  48. package/dist/contracts/LegoSky.d.ts +784 -0
  49. package/dist/contracts/LegoSky.d.ts.map +1 -0
  50. package/dist/contracts/LegoSky.js +1015 -0
  51. package/dist/contracts/LegoUniswapV2.d.ts +1065 -0
  52. package/dist/contracts/LegoUniswapV2.d.ts.map +1 -0
  53. package/dist/contracts/LegoUniswapV2.js +1381 -0
  54. package/dist/contracts/LegoUniswapV3.d.ts +1199 -0
  55. package/dist/contracts/LegoUniswapV3.d.ts.map +1 -0
  56. package/dist/contracts/LegoUniswapV3.js +1553 -0
  57. package/dist/contracts/OracleRegistry.d.ts +811 -0
  58. package/dist/contracts/OracleRegistry.d.ts.map +1 -0
  59. package/dist/contracts/OracleRegistry.js +1049 -0
  60. package/dist/contracts/PriceSheets.d.ts +1053 -0
  61. package/dist/contracts/PriceSheets.d.ts.map +1 -0
  62. package/dist/contracts/PriceSheets.js +1296 -0
  63. package/dist/contracts/PythFeeds.d.ts +501 -0
  64. package/dist/contracts/PythFeeds.d.ts.map +1 -0
  65. package/dist/contracts/PythFeeds.js +648 -0
  66. package/dist/contracts/StorkFeeds.d.ts +501 -0
  67. package/dist/contracts/StorkFeeds.d.ts.map +1 -0
  68. package/dist/contracts/StorkFeeds.js +648 -0
  69. package/dist/contracts/WalletConfig.d.ts +1398 -0
  70. package/dist/contracts/WalletConfig.d.ts.map +1 -0
  71. package/dist/contracts/WalletConfig.js +1674 -0
  72. package/dist/contracts/WalletFunds.d.ts +1978 -0
  73. package/dist/contracts/WalletFunds.d.ts.map +1 -0
  74. package/dist/contracts/WalletFunds.js +2579 -0
  75. package/dist/contracts/index.d.ts +25 -0
  76. package/dist/contracts/index.d.ts.map +1 -0
  77. package/dist/contracts/index.js +28 -0
  78. package/dist/contracts/sdk.d.ts +53 -0
  79. package/dist/contracts/sdk.d.ts.map +1 -0
  80. package/dist/contracts/sdk.js +56 -0
  81. package/dist/index.d.ts +15 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +16 -0
  84. package/package.json +31 -0
@@ -0,0 +1,1165 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ export const abi = [
7
+ {
8
+ "anonymous": false,
9
+ "inputs": [
10
+ {
11
+ "indexed": true,
12
+ "name": "sender",
13
+ "type": "address"
14
+ },
15
+ {
16
+ "indexed": true,
17
+ "name": "asset",
18
+ "type": "address"
19
+ },
20
+ {
21
+ "indexed": true,
22
+ "name": "vaultToken",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "indexed": false,
27
+ "name": "assetAmountDeposited",
28
+ "type": "uint256"
29
+ },
30
+ {
31
+ "indexed": false,
32
+ "name": "usdValue",
33
+ "type": "uint256"
34
+ },
35
+ {
36
+ "indexed": false,
37
+ "name": "vaultTokenAmountReceived",
38
+ "type": "uint256"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "name": "recipient",
43
+ "type": "address"
44
+ }
45
+ ],
46
+ "name": "AaveV3Deposit",
47
+ "type": "event"
48
+ },
49
+ {
50
+ "anonymous": false,
51
+ "inputs": [
52
+ {
53
+ "indexed": true,
54
+ "name": "sender",
55
+ "type": "address"
56
+ },
57
+ {
58
+ "indexed": true,
59
+ "name": "asset",
60
+ "type": "address"
61
+ },
62
+ {
63
+ "indexed": true,
64
+ "name": "vaultToken",
65
+ "type": "address"
66
+ },
67
+ {
68
+ "indexed": false,
69
+ "name": "assetAmountReceived",
70
+ "type": "uint256"
71
+ },
72
+ {
73
+ "indexed": false,
74
+ "name": "usdValue",
75
+ "type": "uint256"
76
+ },
77
+ {
78
+ "indexed": false,
79
+ "name": "vaultTokenAmountBurned",
80
+ "type": "uint256"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "name": "recipient",
85
+ "type": "address"
86
+ }
87
+ ],
88
+ "name": "AaveV3Withdrawal",
89
+ "type": "event"
90
+ },
91
+ {
92
+ "anonymous": false,
93
+ "inputs": [
94
+ {
95
+ "indexed": true,
96
+ "name": "asset",
97
+ "type": "address"
98
+ },
99
+ {
100
+ "indexed": true,
101
+ "name": "recipient",
102
+ "type": "address"
103
+ },
104
+ {
105
+ "indexed": false,
106
+ "name": "amount",
107
+ "type": "uint256"
108
+ }
109
+ ],
110
+ "name": "AaveV3FundsRecovered",
111
+ "type": "event"
112
+ },
113
+ {
114
+ "anonymous": false,
115
+ "inputs": [
116
+ {
117
+ "indexed": false,
118
+ "name": "legoId",
119
+ "type": "uint256"
120
+ }
121
+ ],
122
+ "name": "AaveV3LegoIdSet",
123
+ "type": "event"
124
+ },
125
+ {
126
+ "anonymous": false,
127
+ "inputs": [
128
+ {
129
+ "indexed": false,
130
+ "name": "isActivated",
131
+ "type": "bool"
132
+ }
133
+ ],
134
+ "name": "AaveV3Activated",
135
+ "type": "event"
136
+ },
137
+ {
138
+ "anonymous": false,
139
+ "inputs": [
140
+ {
141
+ "indexed": true,
142
+ "name": "addr",
143
+ "type": "address"
144
+ }
145
+ ],
146
+ "name": "LocalGovernorSet",
147
+ "type": "event"
148
+ },
149
+ {
150
+ "anonymous": false,
151
+ "inputs": [
152
+ {
153
+ "indexed": true,
154
+ "name": "asset",
155
+ "type": "address"
156
+ },
157
+ {
158
+ "indexed": true,
159
+ "name": "vaultToken",
160
+ "type": "address"
161
+ }
162
+ ],
163
+ "name": "AssetOpportunityAdded",
164
+ "type": "event"
165
+ },
166
+ {
167
+ "anonymous": false,
168
+ "inputs": [
169
+ {
170
+ "indexed": true,
171
+ "name": "asset",
172
+ "type": "address"
173
+ },
174
+ {
175
+ "indexed": true,
176
+ "name": "vaultToken",
177
+ "type": "address"
178
+ }
179
+ ],
180
+ "name": "AssetOpportunityRemoved",
181
+ "type": "event"
182
+ },
183
+ {
184
+ "inputs": [
185
+ {
186
+ "name": "_asset",
187
+ "type": "address"
188
+ }
189
+ ],
190
+ "name": "getAssetOpportunities",
191
+ "outputs": [
192
+ {
193
+ "name": "",
194
+ "type": "address[]"
195
+ }
196
+ ],
197
+ "stateMutability": "view",
198
+ "type": "function"
199
+ },
200
+ {
201
+ "inputs": [],
202
+ "name": "getAssets",
203
+ "outputs": [
204
+ {
205
+ "name": "",
206
+ "type": "address[]"
207
+ }
208
+ ],
209
+ "stateMutability": "view",
210
+ "type": "function"
211
+ },
212
+ {
213
+ "inputs": [
214
+ {
215
+ "name": "arg0",
216
+ "type": "address"
217
+ },
218
+ {
219
+ "name": "arg1",
220
+ "type": "uint256"
221
+ }
222
+ ],
223
+ "name": "assetOpportunities",
224
+ "outputs": [
225
+ {
226
+ "name": "",
227
+ "type": "address"
228
+ }
229
+ ],
230
+ "stateMutability": "view",
231
+ "type": "function"
232
+ },
233
+ {
234
+ "inputs": [
235
+ {
236
+ "name": "arg0",
237
+ "type": "address"
238
+ },
239
+ {
240
+ "name": "arg1",
241
+ "type": "address"
242
+ }
243
+ ],
244
+ "name": "indexOfAssetOpportunity",
245
+ "outputs": [
246
+ {
247
+ "name": "",
248
+ "type": "uint256"
249
+ }
250
+ ],
251
+ "stateMutability": "view",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [
256
+ {
257
+ "name": "arg0",
258
+ "type": "address"
259
+ }
260
+ ],
261
+ "name": "numAssetOpportunities",
262
+ "outputs": [
263
+ {
264
+ "name": "",
265
+ "type": "uint256"
266
+ }
267
+ ],
268
+ "stateMutability": "view",
269
+ "type": "function"
270
+ },
271
+ {
272
+ "inputs": [
273
+ {
274
+ "name": "arg0",
275
+ "type": "address"
276
+ }
277
+ ],
278
+ "name": "vaultToAsset",
279
+ "outputs": [
280
+ {
281
+ "name": "",
282
+ "type": "address"
283
+ }
284
+ ],
285
+ "stateMutability": "view",
286
+ "type": "function"
287
+ },
288
+ {
289
+ "inputs": [
290
+ {
291
+ "name": "arg0",
292
+ "type": "uint256"
293
+ }
294
+ ],
295
+ "name": "assets",
296
+ "outputs": [
297
+ {
298
+ "name": "",
299
+ "type": "address"
300
+ }
301
+ ],
302
+ "stateMutability": "view",
303
+ "type": "function"
304
+ },
305
+ {
306
+ "inputs": [
307
+ {
308
+ "name": "arg0",
309
+ "type": "address"
310
+ }
311
+ ],
312
+ "name": "indexOfAsset",
313
+ "outputs": [
314
+ {
315
+ "name": "",
316
+ "type": "uint256"
317
+ }
318
+ ],
319
+ "stateMutability": "view",
320
+ "type": "function"
321
+ },
322
+ {
323
+ "inputs": [],
324
+ "name": "numAssets",
325
+ "outputs": [
326
+ {
327
+ "name": "",
328
+ "type": "uint256"
329
+ }
330
+ ],
331
+ "stateMutability": "view",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [
336
+ {
337
+ "name": "_address",
338
+ "type": "address"
339
+ }
340
+ ],
341
+ "name": "isGovernor",
342
+ "outputs": [
343
+ {
344
+ "name": "",
345
+ "type": "bool"
346
+ }
347
+ ],
348
+ "stateMutability": "view",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [
353
+ {
354
+ "name": "_newGovernor",
355
+ "type": "address"
356
+ }
357
+ ],
358
+ "name": "isValidLocalGovernor",
359
+ "outputs": [
360
+ {
361
+ "name": "",
362
+ "type": "bool"
363
+ }
364
+ ],
365
+ "stateMutability": "view",
366
+ "type": "function"
367
+ },
368
+ {
369
+ "inputs": [
370
+ {
371
+ "name": "_newGovernor",
372
+ "type": "address"
373
+ }
374
+ ],
375
+ "name": "setLocalGovernor",
376
+ "outputs": [
377
+ {
378
+ "name": "",
379
+ "type": "bool"
380
+ }
381
+ ],
382
+ "stateMutability": "nonpayable",
383
+ "type": "function"
384
+ },
385
+ {
386
+ "inputs": [],
387
+ "name": "localGovernor",
388
+ "outputs": [
389
+ {
390
+ "name": "",
391
+ "type": "address"
392
+ }
393
+ ],
394
+ "stateMutability": "view",
395
+ "type": "function"
396
+ },
397
+ {
398
+ "inputs": [],
399
+ "name": "getRegistries",
400
+ "outputs": [
401
+ {
402
+ "name": "",
403
+ "type": "address[]"
404
+ }
405
+ ],
406
+ "stateMutability": "view",
407
+ "type": "function"
408
+ },
409
+ {
410
+ "inputs": [
411
+ {
412
+ "name": "_user",
413
+ "type": "address"
414
+ }
415
+ ],
416
+ "name": "getAccessForLego",
417
+ "outputs": [
418
+ {
419
+ "name": "",
420
+ "type": "address"
421
+ },
422
+ {
423
+ "name": "",
424
+ "type": "string"
425
+ },
426
+ {
427
+ "name": "",
428
+ "type": "uint256"
429
+ }
430
+ ],
431
+ "stateMutability": "view",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ {
437
+ "name": "_vaultToken",
438
+ "type": "address"
439
+ }
440
+ ],
441
+ "name": "isVaultToken",
442
+ "outputs": [
443
+ {
444
+ "name": "",
445
+ "type": "bool"
446
+ }
447
+ ],
448
+ "stateMutability": "view",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [
453
+ {
454
+ "name": "_vaultToken",
455
+ "type": "address"
456
+ }
457
+ ],
458
+ "name": "getUnderlyingAsset",
459
+ "outputs": [
460
+ {
461
+ "name": "",
462
+ "type": "address"
463
+ }
464
+ ],
465
+ "stateMutability": "view",
466
+ "type": "function"
467
+ },
468
+ {
469
+ "inputs": [
470
+ {
471
+ "name": "_vaultToken",
472
+ "type": "address"
473
+ },
474
+ {
475
+ "name": "_vaultTokenAmount",
476
+ "type": "uint256"
477
+ }
478
+ ],
479
+ "name": "getUnderlyingAmount",
480
+ "outputs": [
481
+ {
482
+ "name": "",
483
+ "type": "uint256"
484
+ }
485
+ ],
486
+ "stateMutability": "view",
487
+ "type": "function"
488
+ },
489
+ {
490
+ "inputs": [
491
+ {
492
+ "name": "_asset",
493
+ "type": "address"
494
+ },
495
+ {
496
+ "name": "_assetAmount",
497
+ "type": "uint256"
498
+ },
499
+ {
500
+ "name": "_vaultToken",
501
+ "type": "address"
502
+ }
503
+ ],
504
+ "name": "getVaultTokenAmount",
505
+ "outputs": [
506
+ {
507
+ "name": "",
508
+ "type": "uint256"
509
+ }
510
+ ],
511
+ "stateMutability": "view",
512
+ "type": "function"
513
+ },
514
+ {
515
+ "inputs": [
516
+ {
517
+ "name": "_vaultToken",
518
+ "type": "address"
519
+ },
520
+ {
521
+ "name": "_vaultTokenAmount",
522
+ "type": "uint256"
523
+ }
524
+ ],
525
+ "name": "getUsdValueOfVaultToken",
526
+ "outputs": [
527
+ {
528
+ "name": "",
529
+ "type": "uint256"
530
+ }
531
+ ],
532
+ "stateMutability": "view",
533
+ "type": "function"
534
+ },
535
+ {
536
+ "inputs": [
537
+ {
538
+ "name": "_vaultToken",
539
+ "type": "address"
540
+ },
541
+ {
542
+ "name": "_vaultTokenAmount",
543
+ "type": "uint256"
544
+ },
545
+ {
546
+ "name": "_oracleRegistry",
547
+ "type": "address"
548
+ }
549
+ ],
550
+ "name": "getUsdValueOfVaultToken",
551
+ "outputs": [
552
+ {
553
+ "name": "",
554
+ "type": "uint256"
555
+ }
556
+ ],
557
+ "stateMutability": "view",
558
+ "type": "function"
559
+ },
560
+ {
561
+ "inputs": [
562
+ {
563
+ "name": "_vaultToken",
564
+ "type": "address"
565
+ },
566
+ {
567
+ "name": "_vaultTokenAmount",
568
+ "type": "uint256"
569
+ }
570
+ ],
571
+ "name": "getUnderlyingData",
572
+ "outputs": [
573
+ {
574
+ "name": "",
575
+ "type": "address"
576
+ },
577
+ {
578
+ "name": "",
579
+ "type": "uint256"
580
+ },
581
+ {
582
+ "name": "",
583
+ "type": "uint256"
584
+ }
585
+ ],
586
+ "stateMutability": "view",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [
591
+ {
592
+ "name": "_vaultToken",
593
+ "type": "address"
594
+ },
595
+ {
596
+ "name": "_vaultTokenAmount",
597
+ "type": "uint256"
598
+ },
599
+ {
600
+ "name": "_oracleRegistry",
601
+ "type": "address"
602
+ }
603
+ ],
604
+ "name": "getUnderlyingData",
605
+ "outputs": [
606
+ {
607
+ "name": "",
608
+ "type": "address"
609
+ },
610
+ {
611
+ "name": "",
612
+ "type": "uint256"
613
+ },
614
+ {
615
+ "name": "",
616
+ "type": "uint256"
617
+ }
618
+ ],
619
+ "stateMutability": "view",
620
+ "type": "function"
621
+ },
622
+ {
623
+ "inputs": [
624
+ {
625
+ "name": "_vaultToken",
626
+ "type": "address"
627
+ }
628
+ ],
629
+ "name": "totalAssets",
630
+ "outputs": [
631
+ {
632
+ "name": "",
633
+ "type": "uint256"
634
+ }
635
+ ],
636
+ "stateMutability": "view",
637
+ "type": "function"
638
+ },
639
+ {
640
+ "inputs": [
641
+ {
642
+ "name": "_vaultToken",
643
+ "type": "address"
644
+ }
645
+ ],
646
+ "name": "totalBorrows",
647
+ "outputs": [
648
+ {
649
+ "name": "",
650
+ "type": "uint256"
651
+ }
652
+ ],
653
+ "stateMutability": "view",
654
+ "type": "function"
655
+ },
656
+ {
657
+ "inputs": [
658
+ {
659
+ "name": "_asset",
660
+ "type": "address"
661
+ },
662
+ {
663
+ "name": "_amount",
664
+ "type": "uint256"
665
+ },
666
+ {
667
+ "name": "_vault",
668
+ "type": "address"
669
+ },
670
+ {
671
+ "name": "_recipient",
672
+ "type": "address"
673
+ }
674
+ ],
675
+ "name": "depositTokens",
676
+ "outputs": [
677
+ {
678
+ "name": "",
679
+ "type": "uint256"
680
+ },
681
+ {
682
+ "name": "",
683
+ "type": "address"
684
+ },
685
+ {
686
+ "name": "",
687
+ "type": "uint256"
688
+ },
689
+ {
690
+ "name": "",
691
+ "type": "uint256"
692
+ },
693
+ {
694
+ "name": "",
695
+ "type": "uint256"
696
+ }
697
+ ],
698
+ "stateMutability": "nonpayable",
699
+ "type": "function"
700
+ },
701
+ {
702
+ "inputs": [
703
+ {
704
+ "name": "_asset",
705
+ "type": "address"
706
+ },
707
+ {
708
+ "name": "_amount",
709
+ "type": "uint256"
710
+ },
711
+ {
712
+ "name": "_vault",
713
+ "type": "address"
714
+ },
715
+ {
716
+ "name": "_recipient",
717
+ "type": "address"
718
+ },
719
+ {
720
+ "name": "_oracleRegistry",
721
+ "type": "address"
722
+ }
723
+ ],
724
+ "name": "depositTokens",
725
+ "outputs": [
726
+ {
727
+ "name": "",
728
+ "type": "uint256"
729
+ },
730
+ {
731
+ "name": "",
732
+ "type": "address"
733
+ },
734
+ {
735
+ "name": "",
736
+ "type": "uint256"
737
+ },
738
+ {
739
+ "name": "",
740
+ "type": "uint256"
741
+ },
742
+ {
743
+ "name": "",
744
+ "type": "uint256"
745
+ }
746
+ ],
747
+ "stateMutability": "nonpayable",
748
+ "type": "function"
749
+ },
750
+ {
751
+ "inputs": [
752
+ {
753
+ "name": "_asset",
754
+ "type": "address"
755
+ },
756
+ {
757
+ "name": "_amount",
758
+ "type": "uint256"
759
+ },
760
+ {
761
+ "name": "_vaultToken",
762
+ "type": "address"
763
+ },
764
+ {
765
+ "name": "_recipient",
766
+ "type": "address"
767
+ }
768
+ ],
769
+ "name": "withdrawTokens",
770
+ "outputs": [
771
+ {
772
+ "name": "",
773
+ "type": "uint256"
774
+ },
775
+ {
776
+ "name": "",
777
+ "type": "uint256"
778
+ },
779
+ {
780
+ "name": "",
781
+ "type": "uint256"
782
+ },
783
+ {
784
+ "name": "",
785
+ "type": "uint256"
786
+ }
787
+ ],
788
+ "stateMutability": "nonpayable",
789
+ "type": "function"
790
+ },
791
+ {
792
+ "inputs": [
793
+ {
794
+ "name": "_asset",
795
+ "type": "address"
796
+ },
797
+ {
798
+ "name": "_amount",
799
+ "type": "uint256"
800
+ },
801
+ {
802
+ "name": "_vaultToken",
803
+ "type": "address"
804
+ },
805
+ {
806
+ "name": "_recipient",
807
+ "type": "address"
808
+ },
809
+ {
810
+ "name": "_oracleRegistry",
811
+ "type": "address"
812
+ }
813
+ ],
814
+ "name": "withdrawTokens",
815
+ "outputs": [
816
+ {
817
+ "name": "",
818
+ "type": "uint256"
819
+ },
820
+ {
821
+ "name": "",
822
+ "type": "uint256"
823
+ },
824
+ {
825
+ "name": "",
826
+ "type": "uint256"
827
+ },
828
+ {
829
+ "name": "",
830
+ "type": "uint256"
831
+ }
832
+ ],
833
+ "stateMutability": "nonpayable",
834
+ "type": "function"
835
+ },
836
+ {
837
+ "inputs": [
838
+ {
839
+ "name": "_user",
840
+ "type": "address"
841
+ },
842
+ {
843
+ "name": "_market",
844
+ "type": "address"
845
+ },
846
+ {
847
+ "name": "_rewardToken",
848
+ "type": "address"
849
+ },
850
+ {
851
+ "name": "_rewardAmount",
852
+ "type": "uint256"
853
+ },
854
+ {
855
+ "name": "_proof",
856
+ "type": "bytes32"
857
+ }
858
+ ],
859
+ "name": "claimRewards",
860
+ "outputs": [],
861
+ "stateMutability": "nonpayable",
862
+ "type": "function"
863
+ },
864
+ {
865
+ "inputs": [
866
+ {
867
+ "name": "_user",
868
+ "type": "address"
869
+ }
870
+ ],
871
+ "name": "hasClaimableRewards",
872
+ "outputs": [
873
+ {
874
+ "name": "",
875
+ "type": "bool"
876
+ }
877
+ ],
878
+ "stateMutability": "view",
879
+ "type": "function"
880
+ },
881
+ {
882
+ "inputs": [
883
+ {
884
+ "name": "_asset",
885
+ "type": "address"
886
+ }
887
+ ],
888
+ "name": "addAssetOpportunity",
889
+ "outputs": [
890
+ {
891
+ "name": "",
892
+ "type": "bool"
893
+ }
894
+ ],
895
+ "stateMutability": "nonpayable",
896
+ "type": "function"
897
+ },
898
+ {
899
+ "inputs": [
900
+ {
901
+ "name": "_asset",
902
+ "type": "address"
903
+ }
904
+ ],
905
+ "name": "removeAssetOpportunity",
906
+ "outputs": [
907
+ {
908
+ "name": "",
909
+ "type": "bool"
910
+ }
911
+ ],
912
+ "stateMutability": "nonpayable",
913
+ "type": "function"
914
+ },
915
+ {
916
+ "inputs": [
917
+ {
918
+ "name": "_asset",
919
+ "type": "address"
920
+ },
921
+ {
922
+ "name": "_recipient",
923
+ "type": "address"
924
+ }
925
+ ],
926
+ "name": "recoverFunds",
927
+ "outputs": [
928
+ {
929
+ "name": "",
930
+ "type": "bool"
931
+ }
932
+ ],
933
+ "stateMutability": "nonpayable",
934
+ "type": "function"
935
+ },
936
+ {
937
+ "inputs": [
938
+ {
939
+ "name": "_legoId",
940
+ "type": "uint256"
941
+ }
942
+ ],
943
+ "name": "setLegoId",
944
+ "outputs": [
945
+ {
946
+ "name": "",
947
+ "type": "bool"
948
+ }
949
+ ],
950
+ "stateMutability": "nonpayable",
951
+ "type": "function"
952
+ },
953
+ {
954
+ "inputs": [
955
+ {
956
+ "name": "_shouldActivate",
957
+ "type": "bool"
958
+ }
959
+ ],
960
+ "name": "activate",
961
+ "outputs": [],
962
+ "stateMutability": "nonpayable",
963
+ "type": "function"
964
+ },
965
+ {
966
+ "inputs": [],
967
+ "name": "AAVE_V3_POOL",
968
+ "outputs": [
969
+ {
970
+ "name": "",
971
+ "type": "address"
972
+ }
973
+ ],
974
+ "stateMutability": "view",
975
+ "type": "function"
976
+ },
977
+ {
978
+ "inputs": [],
979
+ "name": "AAVE_V3_ADDRESS_PROVIDER",
980
+ "outputs": [
981
+ {
982
+ "name": "",
983
+ "type": "address"
984
+ }
985
+ ],
986
+ "stateMutability": "view",
987
+ "type": "function"
988
+ },
989
+ {
990
+ "inputs": [],
991
+ "name": "legoId",
992
+ "outputs": [
993
+ {
994
+ "name": "",
995
+ "type": "uint256"
996
+ }
997
+ ],
998
+ "stateMutability": "view",
999
+ "type": "function"
1000
+ },
1001
+ {
1002
+ "inputs": [],
1003
+ "name": "isActivated",
1004
+ "outputs": [
1005
+ {
1006
+ "name": "",
1007
+ "type": "bool"
1008
+ }
1009
+ ],
1010
+ "stateMutability": "view",
1011
+ "type": "function"
1012
+ },
1013
+ {
1014
+ "inputs": [],
1015
+ "name": "ADDY_REGISTRY",
1016
+ "outputs": [
1017
+ {
1018
+ "name": "",
1019
+ "type": "address"
1020
+ }
1021
+ ],
1022
+ "stateMutability": "view",
1023
+ "type": "function"
1024
+ },
1025
+ {
1026
+ "inputs": [
1027
+ {
1028
+ "name": "_aaveV3",
1029
+ "type": "address"
1030
+ },
1031
+ {
1032
+ "name": "_addressProvider",
1033
+ "type": "address"
1034
+ },
1035
+ {
1036
+ "name": "_addyRegistry",
1037
+ "type": "address"
1038
+ }
1039
+ ],
1040
+ "outputs": [],
1041
+ "stateMutability": "nonpayable",
1042
+ "type": "constructor"
1043
+ }
1044
+ ];
1045
+ export const deployAddress = undefined;
1046
+ function getRequest(method, args, contractAddressOrOptions) {
1047
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
1048
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
1049
+ const call = {
1050
+ contractName: 'LegoAaveV3',
1051
+ method,
1052
+ args,
1053
+ address,
1054
+ deployAddress,
1055
+ defaultValue,
1056
+ getAbi: () => abi,
1057
+ with: (options) => {
1058
+ call.address = options.contractAddress;
1059
+ call.defaultValue = options.defaultValue;
1060
+ return call;
1061
+ },
1062
+ defaultTo: (defaultValue) => {
1063
+ call.defaultValue = defaultValue;
1064
+ return call;
1065
+ },
1066
+ at: (address) => {
1067
+ call.address = address;
1068
+ return call;
1069
+ },
1070
+ };
1071
+ return call;
1072
+ }
1073
+ export const call = {
1074
+ getAssetOpportunities: (...args) => getRequest('getAssetOpportunities', args),
1075
+ getAssets: (...args) => getRequest('getAssets', args),
1076
+ assetOpportunities: (...args) => getRequest('assetOpportunities', args),
1077
+ indexOfAssetOpportunity: (...args) => getRequest('indexOfAssetOpportunity', args),
1078
+ numAssetOpportunities: (...args) => getRequest('numAssetOpportunities', args),
1079
+ vaultToAsset: (...args) => getRequest('vaultToAsset', args),
1080
+ assets: (...args) => getRequest('assets', args),
1081
+ indexOfAsset: (...args) => getRequest('indexOfAsset', args),
1082
+ numAssets: (...args) => getRequest('numAssets', args),
1083
+ isGovernor: (...args) => getRequest('isGovernor', args),
1084
+ isValidLocalGovernor: (...args) => getRequest('isValidLocalGovernor', args),
1085
+ localGovernor: (...args) => getRequest('localGovernor', args),
1086
+ getRegistries: (...args) => getRequest('getRegistries', args),
1087
+ getAccessForLego: (...args) => getRequest('getAccessForLego', args),
1088
+ isVaultToken: (...args) => getRequest('isVaultToken', args),
1089
+ getUnderlyingAsset: (...args) => getRequest('getUnderlyingAsset', args),
1090
+ getUnderlyingAmount: (...args) => getRequest('getUnderlyingAmount', args),
1091
+ getVaultTokenAmount: (...args) => getRequest('getVaultTokenAmount', args),
1092
+ getUsdValueOfVaultToken: (...args) => getRequest('getUsdValueOfVaultToken', args),
1093
+ getUnderlyingData: (...args) => getRequest('getUnderlyingData', args),
1094
+ totalAssets: (...args) => getRequest('totalAssets', args),
1095
+ totalBorrows: (...args) => getRequest('totalBorrows', args),
1096
+ hasClaimableRewards: (...args) => getRequest('hasClaimableRewards', args),
1097
+ AAVE_V3_POOL: (...args) => getRequest('AAVE_V3_POOL', args),
1098
+ AAVE_V3_ADDRESS_PROVIDER: (...args) => getRequest('AAVE_V3_ADDRESS_PROVIDER', args),
1099
+ legoId: (...args) => getRequest('legoId', args),
1100
+ isActivated: (...args) => getRequest('isActivated', args),
1101
+ ADDY_REGISTRY: (...args) => getRequest('ADDY_REGISTRY', args),
1102
+ };
1103
+ function getMutation(functionName) {
1104
+ return {
1105
+ contractName: 'LegoAaveV3',
1106
+ functionName,
1107
+ deployAddress,
1108
+ argsType: undefined,
1109
+ getAbi: () => abi,
1110
+ };
1111
+ }
1112
+ export const mutation = {
1113
+ setLocalGovernor: getMutation('setLocalGovernor'),
1114
+ depositTokens: getMutation('depositTokens'),
1115
+ withdrawTokens: getMutation('withdrawTokens'),
1116
+ claimRewards: getMutation('claimRewards'),
1117
+ addAssetOpportunity: getMutation('addAssetOpportunity'),
1118
+ removeAssetOpportunity: getMutation('removeAssetOpportunity'),
1119
+ recoverFunds: getMutation('recoverFunds'),
1120
+ setLegoId: getMutation('setLegoId'),
1121
+ activate: getMutation('activate'),
1122
+ };
1123
+ export function toSdk(publicClient, walletClient) {
1124
+ return {
1125
+ // Queries
1126
+ getAssetOpportunities: (...args) => singleQuery(publicClient, call.getAssetOpportunities(...args)),
1127
+ getAssets: (...args) => singleQuery(publicClient, call.getAssets(...args)),
1128
+ assetOpportunities: (...args) => singleQuery(publicClient, call.assetOpportunities(...args)),
1129
+ indexOfAssetOpportunity: (...args) => singleQuery(publicClient, call.indexOfAssetOpportunity(...args)),
1130
+ numAssetOpportunities: (...args) => singleQuery(publicClient, call.numAssetOpportunities(...args)),
1131
+ vaultToAsset: (...args) => singleQuery(publicClient, call.vaultToAsset(...args)),
1132
+ assets: (...args) => singleQuery(publicClient, call.assets(...args)),
1133
+ indexOfAsset: (...args) => singleQuery(publicClient, call.indexOfAsset(...args)),
1134
+ numAssets: (...args) => singleQuery(publicClient, call.numAssets(...args)),
1135
+ isGovernor: (...args) => singleQuery(publicClient, call.isGovernor(...args)),
1136
+ isValidLocalGovernor: (...args) => singleQuery(publicClient, call.isValidLocalGovernor(...args)),
1137
+ localGovernor: (...args) => singleQuery(publicClient, call.localGovernor(...args)),
1138
+ getRegistries: (...args) => singleQuery(publicClient, call.getRegistries(...args)),
1139
+ getAccessForLego: (...args) => singleQuery(publicClient, call.getAccessForLego(...args)),
1140
+ isVaultToken: (...args) => singleQuery(publicClient, call.isVaultToken(...args)),
1141
+ getUnderlyingAsset: (...args) => singleQuery(publicClient, call.getUnderlyingAsset(...args)),
1142
+ getUnderlyingAmount: (...args) => singleQuery(publicClient, call.getUnderlyingAmount(...args)),
1143
+ getVaultTokenAmount: (...args) => singleQuery(publicClient, call.getVaultTokenAmount(...args)),
1144
+ getUsdValueOfVaultToken: (...args) => singleQuery(publicClient, call.getUsdValueOfVaultToken(...args)),
1145
+ getUnderlyingData: (...args) => singleQuery(publicClient, call.getUnderlyingData(...args)),
1146
+ totalAssets: (...args) => singleQuery(publicClient, call.totalAssets(...args)),
1147
+ totalBorrows: (...args) => singleQuery(publicClient, call.totalBorrows(...args)),
1148
+ hasClaimableRewards: (...args) => singleQuery(publicClient, call.hasClaimableRewards(...args)),
1149
+ AAVE_V3_POOL: (...args) => singleQuery(publicClient, call.AAVE_V3_POOL(...args)),
1150
+ AAVE_V3_ADDRESS_PROVIDER: (...args) => singleQuery(publicClient, call.AAVE_V3_ADDRESS_PROVIDER(...args)),
1151
+ legoId: (...args) => singleQuery(publicClient, call.legoId(...args)),
1152
+ isActivated: (...args) => singleQuery(publicClient, call.isActivated(...args)),
1153
+ ADDY_REGISTRY: (...args) => singleQuery(publicClient, call.ADDY_REGISTRY(...args)),
1154
+ // Mutations
1155
+ setLocalGovernor: (...args) => mutate(walletClient, mutation.setLocalGovernor)(...args),
1156
+ depositTokens: (...args) => mutate(walletClient, mutation.depositTokens)(...args),
1157
+ withdrawTokens: (...args) => mutate(walletClient, mutation.withdrawTokens)(...args),
1158
+ claimRewards: (...args) => mutate(walletClient, mutation.claimRewards)(...args),
1159
+ addAssetOpportunity: (...args) => mutate(walletClient, mutation.addAssetOpportunity)(...args),
1160
+ removeAssetOpportunity: (...args) => mutate(walletClient, mutation.removeAssetOpportunity)(...args),
1161
+ recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds)(...args),
1162
+ setLegoId: (...args) => mutate(walletClient, mutation.setLegoId)(...args),
1163
+ activate: (...args) => mutate(walletClient, mutation.activate)(...args),
1164
+ };
1165
+ }