@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,1381 @@
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": "tokenA",
18
+ "type": "address"
19
+ },
20
+ {
21
+ "indexed": true,
22
+ "name": "tokenB",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "indexed": false,
27
+ "name": "amountA",
28
+ "type": "uint256"
29
+ },
30
+ {
31
+ "indexed": false,
32
+ "name": "amountB",
33
+ "type": "uint256"
34
+ },
35
+ {
36
+ "indexed": false,
37
+ "name": "lpAmountReceived",
38
+ "type": "uint256"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "name": "usdValue",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "indexed": false,
47
+ "name": "recipient",
48
+ "type": "address"
49
+ }
50
+ ],
51
+ "name": "UniswapV2LiquidityAdded",
52
+ "type": "event"
53
+ },
54
+ {
55
+ "anonymous": false,
56
+ "inputs": [
57
+ {
58
+ "indexed": false,
59
+ "name": "sender",
60
+ "type": "address"
61
+ },
62
+ {
63
+ "indexed": true,
64
+ "name": "pool",
65
+ "type": "address"
66
+ },
67
+ {
68
+ "indexed": true,
69
+ "name": "tokenA",
70
+ "type": "address"
71
+ },
72
+ {
73
+ "indexed": true,
74
+ "name": "tokenB",
75
+ "type": "address"
76
+ },
77
+ {
78
+ "indexed": false,
79
+ "name": "amountA",
80
+ "type": "uint256"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "name": "amountB",
85
+ "type": "uint256"
86
+ },
87
+ {
88
+ "indexed": false,
89
+ "name": "lpToken",
90
+ "type": "address"
91
+ },
92
+ {
93
+ "indexed": false,
94
+ "name": "lpAmountBurned",
95
+ "type": "uint256"
96
+ },
97
+ {
98
+ "indexed": false,
99
+ "name": "usdValue",
100
+ "type": "uint256"
101
+ },
102
+ {
103
+ "indexed": false,
104
+ "name": "recipient",
105
+ "type": "address"
106
+ }
107
+ ],
108
+ "name": "UniswapV2LiquidityRemoved",
109
+ "type": "event"
110
+ },
111
+ {
112
+ "anonymous": false,
113
+ "inputs": [
114
+ {
115
+ "indexed": true,
116
+ "name": "sender",
117
+ "type": "address"
118
+ },
119
+ {
120
+ "indexed": true,
121
+ "name": "tokenIn",
122
+ "type": "address"
123
+ },
124
+ {
125
+ "indexed": true,
126
+ "name": "tokenOut",
127
+ "type": "address"
128
+ },
129
+ {
130
+ "indexed": false,
131
+ "name": "amountIn",
132
+ "type": "uint256"
133
+ },
134
+ {
135
+ "indexed": false,
136
+ "name": "amountOut",
137
+ "type": "uint256"
138
+ },
139
+ {
140
+ "indexed": false,
141
+ "name": "usdValue",
142
+ "type": "uint256"
143
+ },
144
+ {
145
+ "indexed": false,
146
+ "name": "numTokens",
147
+ "type": "uint256"
148
+ },
149
+ {
150
+ "indexed": false,
151
+ "name": "recipient",
152
+ "type": "address"
153
+ }
154
+ ],
155
+ "name": "UniswapV2Swap",
156
+ "type": "event"
157
+ },
158
+ {
159
+ "anonymous": false,
160
+ "inputs": [
161
+ {
162
+ "indexed": true,
163
+ "name": "pool",
164
+ "type": "address"
165
+ }
166
+ ],
167
+ "name": "UniV2WethCoreRouterPoolSet",
168
+ "type": "event"
169
+ },
170
+ {
171
+ "anonymous": false,
172
+ "inputs": [
173
+ {
174
+ "indexed": true,
175
+ "name": "asset",
176
+ "type": "address"
177
+ },
178
+ {
179
+ "indexed": true,
180
+ "name": "recipient",
181
+ "type": "address"
182
+ },
183
+ {
184
+ "indexed": false,
185
+ "name": "amount",
186
+ "type": "uint256"
187
+ }
188
+ ],
189
+ "name": "UniV2FundsRecovered",
190
+ "type": "event"
191
+ },
192
+ {
193
+ "anonymous": false,
194
+ "inputs": [
195
+ {
196
+ "indexed": false,
197
+ "name": "legoId",
198
+ "type": "uint256"
199
+ }
200
+ ],
201
+ "name": "UniswapV2LegoIdSet",
202
+ "type": "event"
203
+ },
204
+ {
205
+ "anonymous": false,
206
+ "inputs": [
207
+ {
208
+ "indexed": false,
209
+ "name": "isActivated",
210
+ "type": "bool"
211
+ }
212
+ ],
213
+ "name": "UniswapV2Activated",
214
+ "type": "event"
215
+ },
216
+ {
217
+ "anonymous": false,
218
+ "inputs": [
219
+ {
220
+ "indexed": true,
221
+ "name": "addr",
222
+ "type": "address"
223
+ }
224
+ ],
225
+ "name": "LocalGovernorSet",
226
+ "type": "event"
227
+ },
228
+ {
229
+ "inputs": [
230
+ {
231
+ "name": "_address",
232
+ "type": "address"
233
+ }
234
+ ],
235
+ "name": "isGovernor",
236
+ "outputs": [
237
+ {
238
+ "name": "",
239
+ "type": "bool"
240
+ }
241
+ ],
242
+ "stateMutability": "view",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "inputs": [
247
+ {
248
+ "name": "_newGovernor",
249
+ "type": "address"
250
+ }
251
+ ],
252
+ "name": "isValidLocalGovernor",
253
+ "outputs": [
254
+ {
255
+ "name": "",
256
+ "type": "bool"
257
+ }
258
+ ],
259
+ "stateMutability": "view",
260
+ "type": "function"
261
+ },
262
+ {
263
+ "inputs": [
264
+ {
265
+ "name": "_newGovernor",
266
+ "type": "address"
267
+ }
268
+ ],
269
+ "name": "setLocalGovernor",
270
+ "outputs": [
271
+ {
272
+ "name": "",
273
+ "type": "bool"
274
+ }
275
+ ],
276
+ "stateMutability": "nonpayable",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [],
281
+ "name": "localGovernor",
282
+ "outputs": [
283
+ {
284
+ "name": "",
285
+ "type": "address"
286
+ }
287
+ ],
288
+ "stateMutability": "view",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [],
293
+ "name": "getRegistries",
294
+ "outputs": [
295
+ {
296
+ "name": "",
297
+ "type": "address[]"
298
+ }
299
+ ],
300
+ "stateMutability": "view",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [
305
+ {
306
+ "name": "_user",
307
+ "type": "address"
308
+ }
309
+ ],
310
+ "name": "getAccessForLego",
311
+ "outputs": [
312
+ {
313
+ "name": "",
314
+ "type": "address"
315
+ },
316
+ {
317
+ "name": "",
318
+ "type": "string"
319
+ },
320
+ {
321
+ "name": "",
322
+ "type": "uint256"
323
+ }
324
+ ],
325
+ "stateMutability": "view",
326
+ "type": "function"
327
+ },
328
+ {
329
+ "inputs": [
330
+ {
331
+ "name": "_amountIn",
332
+ "type": "uint256"
333
+ },
334
+ {
335
+ "name": "_minAmountOut",
336
+ "type": "uint256"
337
+ },
338
+ {
339
+ "name": "_tokenPath",
340
+ "type": "address[]"
341
+ },
342
+ {
343
+ "name": "_poolPath",
344
+ "type": "address[]"
345
+ },
346
+ {
347
+ "name": "_recipient",
348
+ "type": "address"
349
+ }
350
+ ],
351
+ "name": "swapTokens",
352
+ "outputs": [
353
+ {
354
+ "name": "",
355
+ "type": "uint256"
356
+ },
357
+ {
358
+ "name": "",
359
+ "type": "uint256"
360
+ },
361
+ {
362
+ "name": "",
363
+ "type": "uint256"
364
+ },
365
+ {
366
+ "name": "",
367
+ "type": "uint256"
368
+ }
369
+ ],
370
+ "stateMutability": "nonpayable",
371
+ "type": "function"
372
+ },
373
+ {
374
+ "inputs": [
375
+ {
376
+ "name": "_amountIn",
377
+ "type": "uint256"
378
+ },
379
+ {
380
+ "name": "_minAmountOut",
381
+ "type": "uint256"
382
+ },
383
+ {
384
+ "name": "_tokenPath",
385
+ "type": "address[]"
386
+ },
387
+ {
388
+ "name": "_poolPath",
389
+ "type": "address[]"
390
+ },
391
+ {
392
+ "name": "_recipient",
393
+ "type": "address"
394
+ },
395
+ {
396
+ "name": "_oracleRegistry",
397
+ "type": "address"
398
+ }
399
+ ],
400
+ "name": "swapTokens",
401
+ "outputs": [
402
+ {
403
+ "name": "",
404
+ "type": "uint256"
405
+ },
406
+ {
407
+ "name": "",
408
+ "type": "uint256"
409
+ },
410
+ {
411
+ "name": "",
412
+ "type": "uint256"
413
+ },
414
+ {
415
+ "name": "",
416
+ "type": "uint256"
417
+ }
418
+ ],
419
+ "stateMutability": "nonpayable",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [
424
+ {
425
+ "name": "_nftTokenId",
426
+ "type": "uint256"
427
+ },
428
+ {
429
+ "name": "_pool",
430
+ "type": "address"
431
+ },
432
+ {
433
+ "name": "_tokenA",
434
+ "type": "address"
435
+ },
436
+ {
437
+ "name": "_tokenB",
438
+ "type": "address"
439
+ },
440
+ {
441
+ "name": "_tickLower",
442
+ "type": "int24"
443
+ },
444
+ {
445
+ "name": "_tickUpper",
446
+ "type": "int24"
447
+ },
448
+ {
449
+ "name": "_amountA",
450
+ "type": "uint256"
451
+ },
452
+ {
453
+ "name": "_amountB",
454
+ "type": "uint256"
455
+ },
456
+ {
457
+ "name": "_minAmountA",
458
+ "type": "uint256"
459
+ },
460
+ {
461
+ "name": "_minAmountB",
462
+ "type": "uint256"
463
+ },
464
+ {
465
+ "name": "_minLpAmount",
466
+ "type": "uint256"
467
+ },
468
+ {
469
+ "name": "_recipient",
470
+ "type": "address"
471
+ }
472
+ ],
473
+ "name": "addLiquidity",
474
+ "outputs": [
475
+ {
476
+ "name": "",
477
+ "type": "uint256"
478
+ },
479
+ {
480
+ "name": "",
481
+ "type": "uint256"
482
+ },
483
+ {
484
+ "name": "",
485
+ "type": "uint256"
486
+ },
487
+ {
488
+ "name": "",
489
+ "type": "uint256"
490
+ },
491
+ {
492
+ "name": "",
493
+ "type": "uint256"
494
+ },
495
+ {
496
+ "name": "",
497
+ "type": "uint256"
498
+ },
499
+ {
500
+ "name": "",
501
+ "type": "uint256"
502
+ }
503
+ ],
504
+ "stateMutability": "nonpayable",
505
+ "type": "function"
506
+ },
507
+ {
508
+ "inputs": [
509
+ {
510
+ "name": "_nftTokenId",
511
+ "type": "uint256"
512
+ },
513
+ {
514
+ "name": "_pool",
515
+ "type": "address"
516
+ },
517
+ {
518
+ "name": "_tokenA",
519
+ "type": "address"
520
+ },
521
+ {
522
+ "name": "_tokenB",
523
+ "type": "address"
524
+ },
525
+ {
526
+ "name": "_tickLower",
527
+ "type": "int24"
528
+ },
529
+ {
530
+ "name": "_tickUpper",
531
+ "type": "int24"
532
+ },
533
+ {
534
+ "name": "_amountA",
535
+ "type": "uint256"
536
+ },
537
+ {
538
+ "name": "_amountB",
539
+ "type": "uint256"
540
+ },
541
+ {
542
+ "name": "_minAmountA",
543
+ "type": "uint256"
544
+ },
545
+ {
546
+ "name": "_minAmountB",
547
+ "type": "uint256"
548
+ },
549
+ {
550
+ "name": "_minLpAmount",
551
+ "type": "uint256"
552
+ },
553
+ {
554
+ "name": "_recipient",
555
+ "type": "address"
556
+ },
557
+ {
558
+ "name": "_oracleRegistry",
559
+ "type": "address"
560
+ }
561
+ ],
562
+ "name": "addLiquidity",
563
+ "outputs": [
564
+ {
565
+ "name": "",
566
+ "type": "uint256"
567
+ },
568
+ {
569
+ "name": "",
570
+ "type": "uint256"
571
+ },
572
+ {
573
+ "name": "",
574
+ "type": "uint256"
575
+ },
576
+ {
577
+ "name": "",
578
+ "type": "uint256"
579
+ },
580
+ {
581
+ "name": "",
582
+ "type": "uint256"
583
+ },
584
+ {
585
+ "name": "",
586
+ "type": "uint256"
587
+ },
588
+ {
589
+ "name": "",
590
+ "type": "uint256"
591
+ }
592
+ ],
593
+ "stateMutability": "nonpayable",
594
+ "type": "function"
595
+ },
596
+ {
597
+ "inputs": [
598
+ {
599
+ "name": "_nftTokenId",
600
+ "type": "uint256"
601
+ },
602
+ {
603
+ "name": "_pool",
604
+ "type": "address"
605
+ },
606
+ {
607
+ "name": "_tokenA",
608
+ "type": "address"
609
+ },
610
+ {
611
+ "name": "_tokenB",
612
+ "type": "address"
613
+ },
614
+ {
615
+ "name": "_lpToken",
616
+ "type": "address"
617
+ },
618
+ {
619
+ "name": "_liqToRemove",
620
+ "type": "uint256"
621
+ },
622
+ {
623
+ "name": "_minAmountA",
624
+ "type": "uint256"
625
+ },
626
+ {
627
+ "name": "_minAmountB",
628
+ "type": "uint256"
629
+ },
630
+ {
631
+ "name": "_recipient",
632
+ "type": "address"
633
+ }
634
+ ],
635
+ "name": "removeLiquidity",
636
+ "outputs": [
637
+ {
638
+ "name": "",
639
+ "type": "uint256"
640
+ },
641
+ {
642
+ "name": "",
643
+ "type": "uint256"
644
+ },
645
+ {
646
+ "name": "",
647
+ "type": "uint256"
648
+ },
649
+ {
650
+ "name": "",
651
+ "type": "uint256"
652
+ },
653
+ {
654
+ "name": "",
655
+ "type": "uint256"
656
+ },
657
+ {
658
+ "name": "",
659
+ "type": "bool"
660
+ }
661
+ ],
662
+ "stateMutability": "nonpayable",
663
+ "type": "function"
664
+ },
665
+ {
666
+ "inputs": [
667
+ {
668
+ "name": "_nftTokenId",
669
+ "type": "uint256"
670
+ },
671
+ {
672
+ "name": "_pool",
673
+ "type": "address"
674
+ },
675
+ {
676
+ "name": "_tokenA",
677
+ "type": "address"
678
+ },
679
+ {
680
+ "name": "_tokenB",
681
+ "type": "address"
682
+ },
683
+ {
684
+ "name": "_lpToken",
685
+ "type": "address"
686
+ },
687
+ {
688
+ "name": "_liqToRemove",
689
+ "type": "uint256"
690
+ },
691
+ {
692
+ "name": "_minAmountA",
693
+ "type": "uint256"
694
+ },
695
+ {
696
+ "name": "_minAmountB",
697
+ "type": "uint256"
698
+ },
699
+ {
700
+ "name": "_recipient",
701
+ "type": "address"
702
+ },
703
+ {
704
+ "name": "_oracleRegistry",
705
+ "type": "address"
706
+ }
707
+ ],
708
+ "name": "removeLiquidity",
709
+ "outputs": [
710
+ {
711
+ "name": "",
712
+ "type": "uint256"
713
+ },
714
+ {
715
+ "name": "",
716
+ "type": "uint256"
717
+ },
718
+ {
719
+ "name": "",
720
+ "type": "uint256"
721
+ },
722
+ {
723
+ "name": "",
724
+ "type": "uint256"
725
+ },
726
+ {
727
+ "name": "",
728
+ "type": "uint256"
729
+ },
730
+ {
731
+ "name": "",
732
+ "type": "bool"
733
+ }
734
+ ],
735
+ "stateMutability": "nonpayable",
736
+ "type": "function"
737
+ },
738
+ {
739
+ "inputs": [
740
+ {
741
+ "name": "_user",
742
+ "type": "address"
743
+ },
744
+ {
745
+ "name": "_market",
746
+ "type": "address"
747
+ },
748
+ {
749
+ "name": "_rewardToken",
750
+ "type": "address"
751
+ },
752
+ {
753
+ "name": "_rewardAmount",
754
+ "type": "uint256"
755
+ },
756
+ {
757
+ "name": "_proof",
758
+ "type": "bytes32"
759
+ }
760
+ ],
761
+ "name": "claimRewards",
762
+ "outputs": [],
763
+ "stateMutability": "nonpayable",
764
+ "type": "function"
765
+ },
766
+ {
767
+ "inputs": [
768
+ {
769
+ "name": "_user",
770
+ "type": "address"
771
+ }
772
+ ],
773
+ "name": "hasClaimableRewards",
774
+ "outputs": [
775
+ {
776
+ "name": "",
777
+ "type": "bool"
778
+ }
779
+ ],
780
+ "stateMutability": "view",
781
+ "type": "function"
782
+ },
783
+ {
784
+ "inputs": [
785
+ {
786
+ "name": "_pool",
787
+ "type": "address"
788
+ }
789
+ ],
790
+ "name": "getLpToken",
791
+ "outputs": [
792
+ {
793
+ "name": "",
794
+ "type": "address"
795
+ }
796
+ ],
797
+ "stateMutability": "view",
798
+ "type": "function"
799
+ },
800
+ {
801
+ "inputs": [
802
+ {
803
+ "name": "_lpToken",
804
+ "type": "address"
805
+ }
806
+ ],
807
+ "name": "getPoolForLpToken",
808
+ "outputs": [
809
+ {
810
+ "name": "",
811
+ "type": "address"
812
+ }
813
+ ],
814
+ "stateMutability": "view",
815
+ "type": "function"
816
+ },
817
+ {
818
+ "inputs": [],
819
+ "name": "getCoreRouterPool",
820
+ "outputs": [
821
+ {
822
+ "name": "",
823
+ "type": "address"
824
+ }
825
+ ],
826
+ "stateMutability": "view",
827
+ "type": "function"
828
+ },
829
+ {
830
+ "inputs": [
831
+ {
832
+ "name": "_tokenA",
833
+ "type": "address"
834
+ },
835
+ {
836
+ "name": "_tokenB",
837
+ "type": "address"
838
+ }
839
+ ],
840
+ "name": "getDeepestLiqPool",
841
+ "outputs": [
842
+ {
843
+ "components": [
844
+ {
845
+ "name": "pool",
846
+ "type": "address"
847
+ },
848
+ {
849
+ "name": "fee",
850
+ "type": "uint256"
851
+ },
852
+ {
853
+ "name": "liquidity",
854
+ "type": "uint256"
855
+ },
856
+ {
857
+ "name": "numCoins",
858
+ "type": "uint256"
859
+ },
860
+ {
861
+ "name": "legoId",
862
+ "type": "uint256"
863
+ }
864
+ ],
865
+ "name": "",
866
+ "type": "tuple"
867
+ }
868
+ ],
869
+ "stateMutability": "view",
870
+ "type": "function"
871
+ },
872
+ {
873
+ "inputs": [
874
+ {
875
+ "name": "_tokenIn",
876
+ "type": "address"
877
+ },
878
+ {
879
+ "name": "_tokenOut",
880
+ "type": "address"
881
+ },
882
+ {
883
+ "name": "_amountIn",
884
+ "type": "uint256"
885
+ }
886
+ ],
887
+ "name": "getBestSwapAmountOut",
888
+ "outputs": [
889
+ {
890
+ "name": "",
891
+ "type": "address"
892
+ },
893
+ {
894
+ "name": "",
895
+ "type": "uint256"
896
+ }
897
+ ],
898
+ "stateMutability": "view",
899
+ "type": "function"
900
+ },
901
+ {
902
+ "inputs": [
903
+ {
904
+ "name": "_pool",
905
+ "type": "address"
906
+ },
907
+ {
908
+ "name": "_tokenIn",
909
+ "type": "address"
910
+ },
911
+ {
912
+ "name": "_tokenOut",
913
+ "type": "address"
914
+ },
915
+ {
916
+ "name": "_amountIn",
917
+ "type": "uint256"
918
+ }
919
+ ],
920
+ "name": "getSwapAmountOut",
921
+ "outputs": [
922
+ {
923
+ "name": "",
924
+ "type": "uint256"
925
+ }
926
+ ],
927
+ "stateMutability": "view",
928
+ "type": "function"
929
+ },
930
+ {
931
+ "inputs": [
932
+ {
933
+ "name": "_tokenIn",
934
+ "type": "address"
935
+ },
936
+ {
937
+ "name": "_tokenOut",
938
+ "type": "address"
939
+ },
940
+ {
941
+ "name": "_amountOut",
942
+ "type": "uint256"
943
+ }
944
+ ],
945
+ "name": "getBestSwapAmountIn",
946
+ "outputs": [
947
+ {
948
+ "name": "",
949
+ "type": "address"
950
+ },
951
+ {
952
+ "name": "",
953
+ "type": "uint256"
954
+ }
955
+ ],
956
+ "stateMutability": "view",
957
+ "type": "function"
958
+ },
959
+ {
960
+ "inputs": [
961
+ {
962
+ "name": "_pool",
963
+ "type": "address"
964
+ },
965
+ {
966
+ "name": "_tokenIn",
967
+ "type": "address"
968
+ },
969
+ {
970
+ "name": "_tokenOut",
971
+ "type": "address"
972
+ },
973
+ {
974
+ "name": "_amountOut",
975
+ "type": "uint256"
976
+ }
977
+ ],
978
+ "name": "getSwapAmountIn",
979
+ "outputs": [
980
+ {
981
+ "name": "",
982
+ "type": "uint256"
983
+ }
984
+ ],
985
+ "stateMutability": "view",
986
+ "type": "function"
987
+ },
988
+ {
989
+ "inputs": [
990
+ {
991
+ "name": "_pool",
992
+ "type": "address"
993
+ },
994
+ {
995
+ "name": "_tokenA",
996
+ "type": "address"
997
+ },
998
+ {
999
+ "name": "_tokenB",
1000
+ "type": "address"
1001
+ },
1002
+ {
1003
+ "name": "_availAmountA",
1004
+ "type": "uint256"
1005
+ },
1006
+ {
1007
+ "name": "_availAmountB",
1008
+ "type": "uint256"
1009
+ }
1010
+ ],
1011
+ "name": "getAddLiqAmountsIn",
1012
+ "outputs": [
1013
+ {
1014
+ "name": "",
1015
+ "type": "uint256"
1016
+ },
1017
+ {
1018
+ "name": "",
1019
+ "type": "uint256"
1020
+ },
1021
+ {
1022
+ "name": "",
1023
+ "type": "uint256"
1024
+ }
1025
+ ],
1026
+ "stateMutability": "view",
1027
+ "type": "function"
1028
+ },
1029
+ {
1030
+ "inputs": [
1031
+ {
1032
+ "name": "_pool",
1033
+ "type": "address"
1034
+ },
1035
+ {
1036
+ "name": "_tokenA",
1037
+ "type": "address"
1038
+ },
1039
+ {
1040
+ "name": "_tokenB",
1041
+ "type": "address"
1042
+ },
1043
+ {
1044
+ "name": "_lpAmount",
1045
+ "type": "uint256"
1046
+ }
1047
+ ],
1048
+ "name": "getRemoveLiqAmountsOut",
1049
+ "outputs": [
1050
+ {
1051
+ "name": "",
1052
+ "type": "uint256"
1053
+ },
1054
+ {
1055
+ "name": "",
1056
+ "type": "uint256"
1057
+ }
1058
+ ],
1059
+ "stateMutability": "view",
1060
+ "type": "function"
1061
+ },
1062
+ {
1063
+ "inputs": [
1064
+ {
1065
+ "name": "_pool",
1066
+ "type": "address"
1067
+ },
1068
+ {
1069
+ "name": "_targetToken",
1070
+ "type": "address"
1071
+ }
1072
+ ],
1073
+ "name": "getPriceUnsafe",
1074
+ "outputs": [
1075
+ {
1076
+ "name": "",
1077
+ "type": "uint256"
1078
+ }
1079
+ ],
1080
+ "stateMutability": "view",
1081
+ "type": "function"
1082
+ },
1083
+ {
1084
+ "inputs": [
1085
+ {
1086
+ "name": "_pool",
1087
+ "type": "address"
1088
+ },
1089
+ {
1090
+ "name": "_targetToken",
1091
+ "type": "address"
1092
+ },
1093
+ {
1094
+ "name": "_oracleRegistry",
1095
+ "type": "address"
1096
+ }
1097
+ ],
1098
+ "name": "getPriceUnsafe",
1099
+ "outputs": [
1100
+ {
1101
+ "name": "",
1102
+ "type": "uint256"
1103
+ }
1104
+ ],
1105
+ "stateMutability": "view",
1106
+ "type": "function"
1107
+ },
1108
+ {
1109
+ "inputs": [
1110
+ {
1111
+ "name": "_addr",
1112
+ "type": "address"
1113
+ }
1114
+ ],
1115
+ "name": "setCoreRouterPool",
1116
+ "outputs": [
1117
+ {
1118
+ "name": "",
1119
+ "type": "bool"
1120
+ }
1121
+ ],
1122
+ "stateMutability": "nonpayable",
1123
+ "type": "function"
1124
+ },
1125
+ {
1126
+ "inputs": [
1127
+ {
1128
+ "name": "_asset",
1129
+ "type": "address"
1130
+ },
1131
+ {
1132
+ "name": "_recipient",
1133
+ "type": "address"
1134
+ }
1135
+ ],
1136
+ "name": "recoverFunds",
1137
+ "outputs": [
1138
+ {
1139
+ "name": "",
1140
+ "type": "bool"
1141
+ }
1142
+ ],
1143
+ "stateMutability": "nonpayable",
1144
+ "type": "function"
1145
+ },
1146
+ {
1147
+ "inputs": [
1148
+ {
1149
+ "name": "_legoId",
1150
+ "type": "uint256"
1151
+ }
1152
+ ],
1153
+ "name": "setLegoId",
1154
+ "outputs": [
1155
+ {
1156
+ "name": "",
1157
+ "type": "bool"
1158
+ }
1159
+ ],
1160
+ "stateMutability": "nonpayable",
1161
+ "type": "function"
1162
+ },
1163
+ {
1164
+ "inputs": [
1165
+ {
1166
+ "name": "_shouldActivate",
1167
+ "type": "bool"
1168
+ }
1169
+ ],
1170
+ "name": "activate",
1171
+ "outputs": [],
1172
+ "stateMutability": "nonpayable",
1173
+ "type": "function"
1174
+ },
1175
+ {
1176
+ "inputs": [],
1177
+ "name": "coreRouterPool",
1178
+ "outputs": [
1179
+ {
1180
+ "name": "",
1181
+ "type": "address"
1182
+ }
1183
+ ],
1184
+ "stateMutability": "view",
1185
+ "type": "function"
1186
+ },
1187
+ {
1188
+ "inputs": [],
1189
+ "name": "UNISWAP_V2_FACTORY",
1190
+ "outputs": [
1191
+ {
1192
+ "name": "",
1193
+ "type": "address"
1194
+ }
1195
+ ],
1196
+ "stateMutability": "view",
1197
+ "type": "function"
1198
+ },
1199
+ {
1200
+ "inputs": [],
1201
+ "name": "UNISWAP_V2_ROUTER",
1202
+ "outputs": [
1203
+ {
1204
+ "name": "",
1205
+ "type": "address"
1206
+ }
1207
+ ],
1208
+ "stateMutability": "view",
1209
+ "type": "function"
1210
+ },
1211
+ {
1212
+ "inputs": [],
1213
+ "name": "legoId",
1214
+ "outputs": [
1215
+ {
1216
+ "name": "",
1217
+ "type": "uint256"
1218
+ }
1219
+ ],
1220
+ "stateMutability": "view",
1221
+ "type": "function"
1222
+ },
1223
+ {
1224
+ "inputs": [],
1225
+ "name": "isActivated",
1226
+ "outputs": [
1227
+ {
1228
+ "name": "",
1229
+ "type": "bool"
1230
+ }
1231
+ ],
1232
+ "stateMutability": "view",
1233
+ "type": "function"
1234
+ },
1235
+ {
1236
+ "inputs": [],
1237
+ "name": "ADDY_REGISTRY",
1238
+ "outputs": [
1239
+ {
1240
+ "name": "",
1241
+ "type": "address"
1242
+ }
1243
+ ],
1244
+ "stateMutability": "view",
1245
+ "type": "function"
1246
+ },
1247
+ {
1248
+ "inputs": [
1249
+ {
1250
+ "name": "_uniswapV2Factory",
1251
+ "type": "address"
1252
+ },
1253
+ {
1254
+ "name": "_uniswapV2Router",
1255
+ "type": "address"
1256
+ },
1257
+ {
1258
+ "name": "_addyRegistry",
1259
+ "type": "address"
1260
+ },
1261
+ {
1262
+ "name": "_coreRouterPool",
1263
+ "type": "address"
1264
+ }
1265
+ ],
1266
+ "outputs": [],
1267
+ "stateMutability": "nonpayable",
1268
+ "type": "constructor"
1269
+ }
1270
+ ];
1271
+ export const deployAddress = undefined;
1272
+ function getRequest(method, args, contractAddressOrOptions) {
1273
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
1274
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
1275
+ const call = {
1276
+ contractName: 'LegoUniswapV2',
1277
+ method,
1278
+ args,
1279
+ address,
1280
+ deployAddress,
1281
+ defaultValue,
1282
+ getAbi: () => abi,
1283
+ with: (options) => {
1284
+ call.address = options.contractAddress;
1285
+ call.defaultValue = options.defaultValue;
1286
+ return call;
1287
+ },
1288
+ defaultTo: (defaultValue) => {
1289
+ call.defaultValue = defaultValue;
1290
+ return call;
1291
+ },
1292
+ at: (address) => {
1293
+ call.address = address;
1294
+ return call;
1295
+ },
1296
+ };
1297
+ return call;
1298
+ }
1299
+ export const call = {
1300
+ isGovernor: (...args) => getRequest('isGovernor', args),
1301
+ isValidLocalGovernor: (...args) => getRequest('isValidLocalGovernor', args),
1302
+ localGovernor: (...args) => getRequest('localGovernor', args),
1303
+ getRegistries: (...args) => getRequest('getRegistries', args),
1304
+ getAccessForLego: (...args) => getRequest('getAccessForLego', args),
1305
+ hasClaimableRewards: (...args) => getRequest('hasClaimableRewards', args),
1306
+ getLpToken: (...args) => getRequest('getLpToken', args),
1307
+ getPoolForLpToken: (...args) => getRequest('getPoolForLpToken', args),
1308
+ getCoreRouterPool: (...args) => getRequest('getCoreRouterPool', args),
1309
+ getDeepestLiqPool: (...args) => getRequest('getDeepestLiqPool', args),
1310
+ getBestSwapAmountOut: (...args) => getRequest('getBestSwapAmountOut', args),
1311
+ getSwapAmountOut: (...args) => getRequest('getSwapAmountOut', args),
1312
+ getBestSwapAmountIn: (...args) => getRequest('getBestSwapAmountIn', args),
1313
+ getSwapAmountIn: (...args) => getRequest('getSwapAmountIn', args),
1314
+ getAddLiqAmountsIn: (...args) => getRequest('getAddLiqAmountsIn', args),
1315
+ getRemoveLiqAmountsOut: (...args) => getRequest('getRemoveLiqAmountsOut', args),
1316
+ getPriceUnsafe: (...args) => getRequest('getPriceUnsafe', args),
1317
+ coreRouterPool: (...args) => getRequest('coreRouterPool', args),
1318
+ UNISWAP_V2_FACTORY: (...args) => getRequest('UNISWAP_V2_FACTORY', args),
1319
+ UNISWAP_V2_ROUTER: (...args) => getRequest('UNISWAP_V2_ROUTER', args),
1320
+ legoId: (...args) => getRequest('legoId', args),
1321
+ isActivated: (...args) => getRequest('isActivated', args),
1322
+ ADDY_REGISTRY: (...args) => getRequest('ADDY_REGISTRY', args),
1323
+ };
1324
+ function getMutation(functionName) {
1325
+ return {
1326
+ contractName: 'LegoUniswapV2',
1327
+ functionName,
1328
+ deployAddress,
1329
+ argsType: undefined,
1330
+ getAbi: () => abi,
1331
+ };
1332
+ }
1333
+ export const mutation = {
1334
+ setLocalGovernor: getMutation('setLocalGovernor'),
1335
+ swapTokens: getMutation('swapTokens'),
1336
+ addLiquidity: getMutation('addLiquidity'),
1337
+ removeLiquidity: getMutation('removeLiquidity'),
1338
+ claimRewards: getMutation('claimRewards'),
1339
+ setCoreRouterPool: getMutation('setCoreRouterPool'),
1340
+ recoverFunds: getMutation('recoverFunds'),
1341
+ setLegoId: getMutation('setLegoId'),
1342
+ activate: getMutation('activate'),
1343
+ };
1344
+ export function toSdk(publicClient, walletClient) {
1345
+ return {
1346
+ // Queries
1347
+ isGovernor: (...args) => singleQuery(publicClient, call.isGovernor(...args)),
1348
+ isValidLocalGovernor: (...args) => singleQuery(publicClient, call.isValidLocalGovernor(...args)),
1349
+ localGovernor: (...args) => singleQuery(publicClient, call.localGovernor(...args)),
1350
+ getRegistries: (...args) => singleQuery(publicClient, call.getRegistries(...args)),
1351
+ getAccessForLego: (...args) => singleQuery(publicClient, call.getAccessForLego(...args)),
1352
+ hasClaimableRewards: (...args) => singleQuery(publicClient, call.hasClaimableRewards(...args)),
1353
+ getLpToken: (...args) => singleQuery(publicClient, call.getLpToken(...args)),
1354
+ getPoolForLpToken: (...args) => singleQuery(publicClient, call.getPoolForLpToken(...args)),
1355
+ getCoreRouterPool: (...args) => singleQuery(publicClient, call.getCoreRouterPool(...args)),
1356
+ getDeepestLiqPool: (...args) => singleQuery(publicClient, call.getDeepestLiqPool(...args)),
1357
+ getBestSwapAmountOut: (...args) => singleQuery(publicClient, call.getBestSwapAmountOut(...args)),
1358
+ getSwapAmountOut: (...args) => singleQuery(publicClient, call.getSwapAmountOut(...args)),
1359
+ getBestSwapAmountIn: (...args) => singleQuery(publicClient, call.getBestSwapAmountIn(...args)),
1360
+ getSwapAmountIn: (...args) => singleQuery(publicClient, call.getSwapAmountIn(...args)),
1361
+ getAddLiqAmountsIn: (...args) => singleQuery(publicClient, call.getAddLiqAmountsIn(...args)),
1362
+ getRemoveLiqAmountsOut: (...args) => singleQuery(publicClient, call.getRemoveLiqAmountsOut(...args)),
1363
+ getPriceUnsafe: (...args) => singleQuery(publicClient, call.getPriceUnsafe(...args)),
1364
+ coreRouterPool: (...args) => singleQuery(publicClient, call.coreRouterPool(...args)),
1365
+ UNISWAP_V2_FACTORY: (...args) => singleQuery(publicClient, call.UNISWAP_V2_FACTORY(...args)),
1366
+ UNISWAP_V2_ROUTER: (...args) => singleQuery(publicClient, call.UNISWAP_V2_ROUTER(...args)),
1367
+ legoId: (...args) => singleQuery(publicClient, call.legoId(...args)),
1368
+ isActivated: (...args) => singleQuery(publicClient, call.isActivated(...args)),
1369
+ ADDY_REGISTRY: (...args) => singleQuery(publicClient, call.ADDY_REGISTRY(...args)),
1370
+ // Mutations
1371
+ setLocalGovernor: (...args) => mutate(walletClient, mutation.setLocalGovernor)(...args),
1372
+ swapTokens: (...args) => mutate(walletClient, mutation.swapTokens)(...args),
1373
+ addLiquidity: (...args) => mutate(walletClient, mutation.addLiquidity)(...args),
1374
+ removeLiquidity: (...args) => mutate(walletClient, mutation.removeLiquidity)(...args),
1375
+ claimRewards: (...args) => mutate(walletClient, mutation.claimRewards)(...args),
1376
+ setCoreRouterPool: (...args) => mutate(walletClient, mutation.setCoreRouterPool)(...args),
1377
+ recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds)(...args),
1378
+ setLegoId: (...args) => mutate(walletClient, mutation.setLegoId)(...args),
1379
+ activate: (...args) => mutate(walletClient, mutation.activate)(...args),
1380
+ };
1381
+ }