@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,1141 @@
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": "FluidDeposit",
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": "FluidWithdrawal",
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": "FluidFundsRecovered",
111
+ "type": "event"
112
+ },
113
+ {
114
+ "anonymous": false,
115
+ "inputs": [
116
+ {
117
+ "indexed": false,
118
+ "name": "legoId",
119
+ "type": "uint256"
120
+ }
121
+ ],
122
+ "name": "FluidLegoIdSet",
123
+ "type": "event"
124
+ },
125
+ {
126
+ "anonymous": false,
127
+ "inputs": [
128
+ {
129
+ "indexed": false,
130
+ "name": "isActivated",
131
+ "type": "bool"
132
+ }
133
+ ],
134
+ "name": "FluidActivated",
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": "_vault",
889
+ "type": "address"
890
+ }
891
+ ],
892
+ "name": "addAssetOpportunity",
893
+ "outputs": [
894
+ {
895
+ "name": "",
896
+ "type": "bool"
897
+ }
898
+ ],
899
+ "stateMutability": "nonpayable",
900
+ "type": "function"
901
+ },
902
+ {
903
+ "inputs": [
904
+ {
905
+ "name": "_asset",
906
+ "type": "address"
907
+ },
908
+ {
909
+ "name": "_vault",
910
+ "type": "address"
911
+ }
912
+ ],
913
+ "name": "removeAssetOpportunity",
914
+ "outputs": [
915
+ {
916
+ "name": "",
917
+ "type": "bool"
918
+ }
919
+ ],
920
+ "stateMutability": "nonpayable",
921
+ "type": "function"
922
+ },
923
+ {
924
+ "inputs": [
925
+ {
926
+ "name": "_asset",
927
+ "type": "address"
928
+ },
929
+ {
930
+ "name": "_recipient",
931
+ "type": "address"
932
+ }
933
+ ],
934
+ "name": "recoverFunds",
935
+ "outputs": [
936
+ {
937
+ "name": "",
938
+ "type": "bool"
939
+ }
940
+ ],
941
+ "stateMutability": "nonpayable",
942
+ "type": "function"
943
+ },
944
+ {
945
+ "inputs": [
946
+ {
947
+ "name": "_legoId",
948
+ "type": "uint256"
949
+ }
950
+ ],
951
+ "name": "setLegoId",
952
+ "outputs": [
953
+ {
954
+ "name": "",
955
+ "type": "bool"
956
+ }
957
+ ],
958
+ "stateMutability": "nonpayable",
959
+ "type": "function"
960
+ },
961
+ {
962
+ "inputs": [],
963
+ "name": "FLUID_RESOLVER",
964
+ "outputs": [
965
+ {
966
+ "name": "",
967
+ "type": "address"
968
+ }
969
+ ],
970
+ "stateMutability": "view",
971
+ "type": "function"
972
+ },
973
+ {
974
+ "inputs": [],
975
+ "name": "legoId",
976
+ "outputs": [
977
+ {
978
+ "name": "",
979
+ "type": "uint256"
980
+ }
981
+ ],
982
+ "stateMutability": "view",
983
+ "type": "function"
984
+ },
985
+ {
986
+ "inputs": [],
987
+ "name": "isActivated",
988
+ "outputs": [
989
+ {
990
+ "name": "",
991
+ "type": "bool"
992
+ }
993
+ ],
994
+ "stateMutability": "view",
995
+ "type": "function"
996
+ },
997
+ {
998
+ "inputs": [],
999
+ "name": "ADDY_REGISTRY",
1000
+ "outputs": [
1001
+ {
1002
+ "name": "",
1003
+ "type": "address"
1004
+ }
1005
+ ],
1006
+ "stateMutability": "view",
1007
+ "type": "function"
1008
+ },
1009
+ {
1010
+ "inputs": [
1011
+ {
1012
+ "name": "_fluidResolver",
1013
+ "type": "address"
1014
+ },
1015
+ {
1016
+ "name": "_addyRegistry",
1017
+ "type": "address"
1018
+ }
1019
+ ],
1020
+ "outputs": [],
1021
+ "stateMutability": "nonpayable",
1022
+ "type": "constructor"
1023
+ }
1024
+ ];
1025
+ export const deployAddress = undefined;
1026
+ function getRequest(method, args, contractAddressOrOptions) {
1027
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
1028
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
1029
+ const call = {
1030
+ contractName: 'LegoFluid',
1031
+ method,
1032
+ args,
1033
+ address,
1034
+ deployAddress,
1035
+ defaultValue,
1036
+ getAbi: () => abi,
1037
+ with: (options) => {
1038
+ call.address = options.contractAddress;
1039
+ call.defaultValue = options.defaultValue;
1040
+ return call;
1041
+ },
1042
+ defaultTo: (defaultValue) => {
1043
+ call.defaultValue = defaultValue;
1044
+ return call;
1045
+ },
1046
+ at: (address) => {
1047
+ call.address = address;
1048
+ return call;
1049
+ },
1050
+ };
1051
+ return call;
1052
+ }
1053
+ export const call = {
1054
+ getAssetOpportunities: (...args) => getRequest('getAssetOpportunities', args),
1055
+ getAssets: (...args) => getRequest('getAssets', args),
1056
+ assetOpportunities: (...args) => getRequest('assetOpportunities', args),
1057
+ indexOfAssetOpportunity: (...args) => getRequest('indexOfAssetOpportunity', args),
1058
+ numAssetOpportunities: (...args) => getRequest('numAssetOpportunities', args),
1059
+ vaultToAsset: (...args) => getRequest('vaultToAsset', args),
1060
+ assets: (...args) => getRequest('assets', args),
1061
+ indexOfAsset: (...args) => getRequest('indexOfAsset', args),
1062
+ numAssets: (...args) => getRequest('numAssets', args),
1063
+ isGovernor: (...args) => getRequest('isGovernor', args),
1064
+ isValidLocalGovernor: (...args) => getRequest('isValidLocalGovernor', args),
1065
+ localGovernor: (...args) => getRequest('localGovernor', args),
1066
+ getRegistries: (...args) => getRequest('getRegistries', args),
1067
+ getAccessForLego: (...args) => getRequest('getAccessForLego', args),
1068
+ isVaultToken: (...args) => getRequest('isVaultToken', args),
1069
+ getUnderlyingAsset: (...args) => getRequest('getUnderlyingAsset', args),
1070
+ getUnderlyingAmount: (...args) => getRequest('getUnderlyingAmount', args),
1071
+ getVaultTokenAmount: (...args) => getRequest('getVaultTokenAmount', args),
1072
+ getUsdValueOfVaultToken: (...args) => getRequest('getUsdValueOfVaultToken', args),
1073
+ getUnderlyingData: (...args) => getRequest('getUnderlyingData', args),
1074
+ totalAssets: (...args) => getRequest('totalAssets', args),
1075
+ totalBorrows: (...args) => getRequest('totalBorrows', args),
1076
+ hasClaimableRewards: (...args) => getRequest('hasClaimableRewards', args),
1077
+ FLUID_RESOLVER: (...args) => getRequest('FLUID_RESOLVER', args),
1078
+ legoId: (...args) => getRequest('legoId', args),
1079
+ isActivated: (...args) => getRequest('isActivated', args),
1080
+ ADDY_REGISTRY: (...args) => getRequest('ADDY_REGISTRY', args),
1081
+ };
1082
+ function getMutation(functionName) {
1083
+ return {
1084
+ contractName: 'LegoFluid',
1085
+ functionName,
1086
+ deployAddress,
1087
+ argsType: undefined,
1088
+ getAbi: () => abi,
1089
+ };
1090
+ }
1091
+ export const mutation = {
1092
+ setLocalGovernor: getMutation('setLocalGovernor'),
1093
+ depositTokens: getMutation('depositTokens'),
1094
+ withdrawTokens: getMutation('withdrawTokens'),
1095
+ claimRewards: getMutation('claimRewards'),
1096
+ addAssetOpportunity: getMutation('addAssetOpportunity'),
1097
+ removeAssetOpportunity: getMutation('removeAssetOpportunity'),
1098
+ recoverFunds: getMutation('recoverFunds'),
1099
+ setLegoId: getMutation('setLegoId'),
1100
+ };
1101
+ export function toSdk(publicClient, walletClient) {
1102
+ return {
1103
+ // Queries
1104
+ getAssetOpportunities: (...args) => singleQuery(publicClient, call.getAssetOpportunities(...args)),
1105
+ getAssets: (...args) => singleQuery(publicClient, call.getAssets(...args)),
1106
+ assetOpportunities: (...args) => singleQuery(publicClient, call.assetOpportunities(...args)),
1107
+ indexOfAssetOpportunity: (...args) => singleQuery(publicClient, call.indexOfAssetOpportunity(...args)),
1108
+ numAssetOpportunities: (...args) => singleQuery(publicClient, call.numAssetOpportunities(...args)),
1109
+ vaultToAsset: (...args) => singleQuery(publicClient, call.vaultToAsset(...args)),
1110
+ assets: (...args) => singleQuery(publicClient, call.assets(...args)),
1111
+ indexOfAsset: (...args) => singleQuery(publicClient, call.indexOfAsset(...args)),
1112
+ numAssets: (...args) => singleQuery(publicClient, call.numAssets(...args)),
1113
+ isGovernor: (...args) => singleQuery(publicClient, call.isGovernor(...args)),
1114
+ isValidLocalGovernor: (...args) => singleQuery(publicClient, call.isValidLocalGovernor(...args)),
1115
+ localGovernor: (...args) => singleQuery(publicClient, call.localGovernor(...args)),
1116
+ getRegistries: (...args) => singleQuery(publicClient, call.getRegistries(...args)),
1117
+ getAccessForLego: (...args) => singleQuery(publicClient, call.getAccessForLego(...args)),
1118
+ isVaultToken: (...args) => singleQuery(publicClient, call.isVaultToken(...args)),
1119
+ getUnderlyingAsset: (...args) => singleQuery(publicClient, call.getUnderlyingAsset(...args)),
1120
+ getUnderlyingAmount: (...args) => singleQuery(publicClient, call.getUnderlyingAmount(...args)),
1121
+ getVaultTokenAmount: (...args) => singleQuery(publicClient, call.getVaultTokenAmount(...args)),
1122
+ getUsdValueOfVaultToken: (...args) => singleQuery(publicClient, call.getUsdValueOfVaultToken(...args)),
1123
+ getUnderlyingData: (...args) => singleQuery(publicClient, call.getUnderlyingData(...args)),
1124
+ totalAssets: (...args) => singleQuery(publicClient, call.totalAssets(...args)),
1125
+ totalBorrows: (...args) => singleQuery(publicClient, call.totalBorrows(...args)),
1126
+ hasClaimableRewards: (...args) => singleQuery(publicClient, call.hasClaimableRewards(...args)),
1127
+ FLUID_RESOLVER: (...args) => singleQuery(publicClient, call.FLUID_RESOLVER(...args)),
1128
+ legoId: (...args) => singleQuery(publicClient, call.legoId(...args)),
1129
+ isActivated: (...args) => singleQuery(publicClient, call.isActivated(...args)),
1130
+ ADDY_REGISTRY: (...args) => singleQuery(publicClient, call.ADDY_REGISTRY(...args)),
1131
+ // Mutations
1132
+ setLocalGovernor: (...args) => mutate(walletClient, mutation.setLocalGovernor)(...args),
1133
+ depositTokens: (...args) => mutate(walletClient, mutation.depositTokens)(...args),
1134
+ withdrawTokens: (...args) => mutate(walletClient, mutation.withdrawTokens)(...args),
1135
+ claimRewards: (...args) => mutate(walletClient, mutation.claimRewards)(...args),
1136
+ addAssetOpportunity: (...args) => mutate(walletClient, mutation.addAssetOpportunity)(...args),
1137
+ removeAssetOpportunity: (...args) => mutate(walletClient, mutation.removeAssetOpportunity)(...args),
1138
+ recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds)(...args),
1139
+ setLegoId: (...args) => mutate(walletClient, mutation.setLegoId)(...args),
1140
+ };
1141
+ }