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