@nexusmutual/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 (44) hide show
  1. package/.github/workflows/merge-master.yml +124 -0
  2. package/.github/workflows/pull_request.yml +62 -0
  3. package/README.md +32 -0
  4. package/dist/contracts/abis/Assessment.json +700 -0
  5. package/dist/contracts/abis/Cover.json +1258 -0
  6. package/dist/contracts/abis/CoverMigrator.json +189 -0
  7. package/dist/contracts/abis/CoverNFT.json +498 -0
  8. package/dist/contracts/abis/CoverNFTDescriptor.json +200 -0
  9. package/dist/contracts/abis/CoverViewer.json +124 -0
  10. package/dist/contracts/abis/EACAggregatorProxy.json +58 -0
  11. package/dist/contracts/abis/ERC20.json +364 -0
  12. package/dist/contracts/abis/Governance.json +975 -0
  13. package/dist/contracts/abis/IndividualClaims.json +528 -0
  14. package/dist/contracts/abis/LegacyClaimProofs.json +64 -0
  15. package/dist/contracts/abis/LegacyClaimsData.json +1912 -0
  16. package/dist/contracts/abis/LegacyClaimsReward.json +179 -0
  17. package/dist/contracts/abis/LegacyGateway.json +542 -0
  18. package/dist/contracts/abis/LegacyPooledStaking.json +1320 -0
  19. package/dist/contracts/abis/LegacyQuotationData.json +1121 -0
  20. package/dist/contracts/abis/MCR.json +326 -0
  21. package/dist/contracts/abis/MemberRoles.json +681 -0
  22. package/dist/contracts/abis/NXMToken.json +498 -0
  23. package/dist/contracts/abis/NXMaster.json +501 -0
  24. package/dist/contracts/abis/Pool.json +928 -0
  25. package/dist/contracts/abis/PriceFeedOracle.json +122 -0
  26. package/dist/contracts/abis/ProductsV1.json +21 -0
  27. package/dist/contracts/abis/ProposalCategory.json +550 -0
  28. package/dist/contracts/abis/StakingNFT.json +569 -0
  29. package/dist/contracts/abis/StakingNFTDescriptor.json +222 -0
  30. package/dist/contracts/abis/StakingPool.json +1433 -0
  31. package/dist/contracts/abis/StakingPoolFactory.json +108 -0
  32. package/dist/contracts/abis/StakingProducts.json +885 -0
  33. package/dist/contracts/abis/StakingViewer.json +777 -0
  34. package/dist/contracts/abis/SwapOperator.json +754 -0
  35. package/dist/contracts/abis/TokenController.json +1024 -0
  36. package/dist/contracts/abis/YieldTokenIncidents.json +438 -0
  37. package/dist/contracts/abis/index.js +69 -0
  38. package/dist/contracts/addresses.json +35 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +13 -0
  41. package/dist/products/product-logos.json +103 -0
  42. package/dist/products/product-types.json +58 -0
  43. package/dist/products/products.json +1414 -0
  44. package/package.json +50 -0
@@ -0,0 +1,885 @@
1
+ [
2
+ {
3
+ "type": "constructor",
4
+ "payable": false,
5
+ "inputs": [
6
+ {
7
+ "type": "address",
8
+ "name": "_coverContract"
9
+ },
10
+ {
11
+ "type": "address",
12
+ "name": "_stakingPoolFactory"
13
+ }
14
+ ]
15
+ },
16
+ {
17
+ "type": "error",
18
+ "name": "MustRecalculateEffectiveWeight",
19
+ "inputs": []
20
+ },
21
+ {
22
+ "type": "error",
23
+ "name": "MustSetPriceForNewProducts",
24
+ "inputs": []
25
+ },
26
+ {
27
+ "type": "error",
28
+ "name": "MustSetWeightForNewProducts",
29
+ "inputs": []
30
+ },
31
+ {
32
+ "type": "error",
33
+ "name": "OnlyCoverContract",
34
+ "inputs": []
35
+ },
36
+ {
37
+ "type": "error",
38
+ "name": "OnlyManager",
39
+ "inputs": []
40
+ },
41
+ {
42
+ "type": "error",
43
+ "name": "OnlyStakingPool",
44
+ "inputs": []
45
+ },
46
+ {
47
+ "type": "error",
48
+ "name": "PoolNotAllowedForThisProduct",
49
+ "inputs": []
50
+ },
51
+ {
52
+ "type": "error",
53
+ "name": "RevertedWithoutReason",
54
+ "inputs": [
55
+ {
56
+ "type": "uint256",
57
+ "name": "index"
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ "type": "error",
63
+ "name": "TargetPriceBelowMin",
64
+ "inputs": []
65
+ },
66
+ {
67
+ "type": "error",
68
+ "name": "TargetPriceTooHigh",
69
+ "inputs": []
70
+ },
71
+ {
72
+ "type": "error",
73
+ "name": "TargetWeightTooHigh",
74
+ "inputs": []
75
+ },
76
+ {
77
+ "type": "error",
78
+ "name": "TotalEffectiveWeightExceeded",
79
+ "inputs": []
80
+ },
81
+ {
82
+ "type": "error",
83
+ "name": "TotalTargetWeightExceeded",
84
+ "inputs": []
85
+ },
86
+ {
87
+ "type": "event",
88
+ "anonymous": false,
89
+ "name": "ProductUpdated",
90
+ "inputs": [
91
+ {
92
+ "type": "uint256",
93
+ "name": "productId",
94
+ "indexed": false
95
+ },
96
+ {
97
+ "type": "uint8",
98
+ "name": "targetWeight",
99
+ "indexed": false
100
+ },
101
+ {
102
+ "type": "uint96",
103
+ "name": "targetPrice",
104
+ "indexed": false
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "type": "function",
110
+ "name": "INITIAL_PRICE_DENOMINATOR",
111
+ "constant": true,
112
+ "stateMutability": "view",
113
+ "payable": false,
114
+
115
+ "inputs": [],
116
+ "outputs": [
117
+ {
118
+ "type": "uint256"
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ "type": "function",
124
+ "name": "MAX_ACTIVE_TRANCHES",
125
+ "constant": true,
126
+ "stateMutability": "view",
127
+ "payable": false,
128
+
129
+ "inputs": [],
130
+ "outputs": [
131
+ {
132
+ "type": "uint256"
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "type": "function",
138
+ "name": "MAX_TOTAL_WEIGHT",
139
+ "constant": true,
140
+ "stateMutability": "view",
141
+ "payable": false,
142
+
143
+ "inputs": [],
144
+ "outputs": [
145
+ {
146
+ "type": "uint256"
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ "type": "function",
152
+ "name": "PRICE_BUMP_RATIO",
153
+ "constant": true,
154
+ "stateMutability": "view",
155
+ "payable": false,
156
+
157
+ "inputs": [],
158
+ "outputs": [
159
+ {
160
+ "type": "uint256"
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ "type": "function",
166
+ "name": "PRICE_CHANGE_PER_DAY",
167
+ "constant": true,
168
+ "stateMutability": "view",
169
+ "payable": false,
170
+
171
+ "inputs": [],
172
+ "outputs": [
173
+ {
174
+ "type": "uint256"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "type": "function",
180
+ "name": "SURGE_PRICE_RATIO",
181
+ "constant": true,
182
+ "stateMutability": "view",
183
+ "payable": false,
184
+
185
+ "inputs": [],
186
+ "outputs": [
187
+ {
188
+ "type": "uint256"
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "type": "function",
194
+ "name": "SURGE_THRESHOLD_DENOMINATOR",
195
+ "constant": true,
196
+ "stateMutability": "view",
197
+ "payable": false,
198
+
199
+ "inputs": [],
200
+ "outputs": [
201
+ {
202
+ "type": "uint256"
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "type": "function",
208
+ "name": "SURGE_THRESHOLD_RATIO",
209
+ "constant": true,
210
+ "stateMutability": "view",
211
+ "payable": false,
212
+
213
+ "inputs": [],
214
+ "outputs": [
215
+ {
216
+ "type": "uint256"
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ "type": "function",
222
+ "name": "TARGET_PRICE_DENOMINATOR",
223
+ "constant": true,
224
+ "stateMutability": "view",
225
+ "payable": false,
226
+
227
+ "inputs": [],
228
+ "outputs": [
229
+ {
230
+ "type": "uint256"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "type": "function",
236
+ "name": "TRANCHE_DURATION",
237
+ "constant": true,
238
+ "stateMutability": "view",
239
+ "payable": false,
240
+
241
+ "inputs": [],
242
+ "outputs": [
243
+ {
244
+ "type": "uint256"
245
+ }
246
+ ]
247
+ },
248
+ {
249
+ "type": "function",
250
+ "name": "WEIGHT_DENOMINATOR",
251
+ "constant": true,
252
+ "stateMutability": "view",
253
+ "payable": false,
254
+
255
+ "inputs": [],
256
+ "outputs": [
257
+ {
258
+ "type": "uint256"
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "type": "function",
264
+ "name": "calculateFixedPricePremium",
265
+ "constant": true,
266
+ "stateMutability": "pure",
267
+ "payable": false,
268
+
269
+ "inputs": [
270
+ {
271
+ "type": "uint256",
272
+ "name": "coverAmount"
273
+ },
274
+ {
275
+ "type": "uint256",
276
+ "name": "period"
277
+ },
278
+ {
279
+ "type": "uint256",
280
+ "name": "fixedPrice"
281
+ },
282
+ {
283
+ "type": "uint256",
284
+ "name": "nxmPerAllocationUnit"
285
+ },
286
+ {
287
+ "type": "uint256",
288
+ "name": "targetPriceDenominator"
289
+ }
290
+ ],
291
+ "outputs": [
292
+ {
293
+ "type": "uint256"
294
+ }
295
+ ]
296
+ },
297
+ {
298
+ "type": "function",
299
+ "name": "calculatePremium",
300
+ "constant": true,
301
+ "stateMutability": "pure",
302
+ "payable": false,
303
+
304
+ "inputs": [
305
+ {
306
+ "type": "tuple",
307
+ "name": "product",
308
+ "components": [
309
+ {
310
+ "type": "uint16",
311
+ "name": "lastEffectiveWeight"
312
+ },
313
+ {
314
+ "type": "uint8",
315
+ "name": "targetWeight"
316
+ },
317
+ {
318
+ "type": "uint96",
319
+ "name": "targetPrice"
320
+ },
321
+ {
322
+ "type": "uint96",
323
+ "name": "bumpedPrice"
324
+ },
325
+ {
326
+ "type": "uint32",
327
+ "name": "bumpedPriceUpdateTime"
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ "type": "uint256",
333
+ "name": "period"
334
+ },
335
+ {
336
+ "type": "uint256",
337
+ "name": "coverAmount"
338
+ },
339
+ {
340
+ "type": "uint256",
341
+ "name": "initialCapacityUsed"
342
+ },
343
+ {
344
+ "type": "uint256",
345
+ "name": "totalCapacity"
346
+ },
347
+ {
348
+ "type": "uint256",
349
+ "name": "targetPrice"
350
+ },
351
+ {
352
+ "type": "uint256",
353
+ "name": "currentBlockTimestamp"
354
+ },
355
+ {
356
+ "type": "uint256",
357
+ "name": "nxmPerAllocationUnit"
358
+ },
359
+ {
360
+ "type": "uint256",
361
+ "name": "allocationUnitsPerNxm"
362
+ },
363
+ {
364
+ "type": "uint256",
365
+ "name": "targetPriceDenominator"
366
+ }
367
+ ],
368
+ "outputs": [
369
+ {
370
+ "type": "uint256",
371
+ "name": "premium"
372
+ },
373
+ {
374
+ "type": "tuple",
375
+ "components": [
376
+ {
377
+ "type": "uint16",
378
+ "name": "lastEffectiveWeight"
379
+ },
380
+ {
381
+ "type": "uint8",
382
+ "name": "targetWeight"
383
+ },
384
+ {
385
+ "type": "uint96",
386
+ "name": "targetPrice"
387
+ },
388
+ {
389
+ "type": "uint96",
390
+ "name": "bumpedPrice"
391
+ },
392
+ {
393
+ "type": "uint32",
394
+ "name": "bumpedPriceUpdateTime"
395
+ }
396
+ ]
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "type": "function",
402
+ "name": "calculatePremiumPerYear",
403
+ "constant": true,
404
+ "stateMutability": "pure",
405
+ "payable": false,
406
+
407
+ "inputs": [
408
+ {
409
+ "type": "uint256",
410
+ "name": "basePrice"
411
+ },
412
+ {
413
+ "type": "uint256",
414
+ "name": "coverAmount"
415
+ },
416
+ {
417
+ "type": "uint256",
418
+ "name": "initialCapacityUsed"
419
+ },
420
+ {
421
+ "type": "uint256",
422
+ "name": "totalCapacity"
423
+ },
424
+ {
425
+ "type": "uint256",
426
+ "name": "nxmPerAllocationUnit"
427
+ },
428
+ {
429
+ "type": "uint256",
430
+ "name": "allocationUnitsPerNxm"
431
+ },
432
+ {
433
+ "type": "uint256",
434
+ "name": "targetPriceDenominator"
435
+ }
436
+ ],
437
+ "outputs": [
438
+ {
439
+ "type": "uint256"
440
+ }
441
+ ]
442
+ },
443
+ {
444
+ "type": "function",
445
+ "name": "calculateSurgePremium",
446
+ "constant": true,
447
+ "stateMutability": "pure",
448
+ "payable": false,
449
+
450
+ "inputs": [
451
+ {
452
+ "type": "uint256",
453
+ "name": "amountOnSurge"
454
+ },
455
+ {
456
+ "type": "uint256",
457
+ "name": "totalCapacity"
458
+ },
459
+ {
460
+ "type": "uint256",
461
+ "name": "allocationUnitsPerNxm"
462
+ }
463
+ ],
464
+ "outputs": [
465
+ {
466
+ "type": "uint256"
467
+ }
468
+ ]
469
+ },
470
+ {
471
+ "type": "function",
472
+ "name": "changeDependentContractAddress",
473
+ "constant": false,
474
+ "payable": false,
475
+
476
+ "inputs": [],
477
+ "outputs": []
478
+ },
479
+ {
480
+ "type": "function",
481
+ "name": "changeMasterAddress",
482
+ "constant": false,
483
+ "payable": false,
484
+
485
+ "inputs": [
486
+ {
487
+ "type": "address",
488
+ "name": "masterAddress"
489
+ }
490
+ ],
491
+ "outputs": []
492
+ },
493
+ {
494
+ "type": "function",
495
+ "name": "coverContract",
496
+ "constant": true,
497
+ "stateMutability": "view",
498
+ "payable": false,
499
+
500
+ "inputs": [],
501
+ "outputs": [
502
+ {
503
+ "type": "address"
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ "type": "function",
509
+ "name": "getEffectiveWeight",
510
+ "constant": true,
511
+ "stateMutability": "view",
512
+ "payable": false,
513
+
514
+ "inputs": [
515
+ {
516
+ "type": "uint256",
517
+ "name": "poolId"
518
+ },
519
+ {
520
+ "type": "uint256",
521
+ "name": "productId"
522
+ },
523
+ {
524
+ "type": "uint256",
525
+ "name": "targetWeight"
526
+ },
527
+ {
528
+ "type": "uint256",
529
+ "name": "globalCapacityRatio"
530
+ },
531
+ {
532
+ "type": "uint256",
533
+ "name": "capacityReductionRatio"
534
+ }
535
+ ],
536
+ "outputs": [
537
+ {
538
+ "type": "uint256",
539
+ "name": "effectiveWeight"
540
+ }
541
+ ]
542
+ },
543
+ {
544
+ "type": "function",
545
+ "name": "getPremium",
546
+ "constant": false,
547
+ "payable": false,
548
+
549
+ "inputs": [
550
+ {
551
+ "type": "uint256",
552
+ "name": "poolId"
553
+ },
554
+ {
555
+ "type": "uint256",
556
+ "name": "productId"
557
+ },
558
+ {
559
+ "type": "uint256",
560
+ "name": "period"
561
+ },
562
+ {
563
+ "type": "uint256",
564
+ "name": "coverAmount"
565
+ },
566
+ {
567
+ "type": "uint256",
568
+ "name": "initialCapacityUsed"
569
+ },
570
+ {
571
+ "type": "uint256",
572
+ "name": "totalCapacity"
573
+ },
574
+ {
575
+ "type": "uint256",
576
+ "name": "globalMinPrice"
577
+ },
578
+ {
579
+ "type": "bool",
580
+ "name": "useFixedPrice"
581
+ },
582
+ {
583
+ "type": "uint256",
584
+ "name": "nxmPerAllocationUnit"
585
+ },
586
+ {
587
+ "type": "uint256",
588
+ "name": "allocationUnitsPerNXM"
589
+ }
590
+ ],
591
+ "outputs": [
592
+ {
593
+ "type": "uint256",
594
+ "name": "premium"
595
+ }
596
+ ]
597
+ },
598
+ {
599
+ "type": "function",
600
+ "name": "getProduct",
601
+ "constant": true,
602
+ "stateMutability": "view",
603
+ "payable": false,
604
+
605
+ "inputs": [
606
+ {
607
+ "type": "uint256",
608
+ "name": "poolId"
609
+ },
610
+ {
611
+ "type": "uint256",
612
+ "name": "productId"
613
+ }
614
+ ],
615
+ "outputs": [
616
+ {
617
+ "type": "uint256",
618
+ "name": "lastEffectiveWeight"
619
+ },
620
+ {
621
+ "type": "uint256",
622
+ "name": "targetWeight"
623
+ },
624
+ {
625
+ "type": "uint256",
626
+ "name": "targetPrice"
627
+ },
628
+ {
629
+ "type": "uint256",
630
+ "name": "bumpedPrice"
631
+ },
632
+ {
633
+ "type": "uint256",
634
+ "name": "bumpedPriceUpdateTime"
635
+ }
636
+ ]
637
+ },
638
+ {
639
+ "type": "function",
640
+ "name": "getProductTargetWeight",
641
+ "constant": true,
642
+ "stateMutability": "view",
643
+ "payable": false,
644
+
645
+ "inputs": [
646
+ {
647
+ "type": "uint256",
648
+ "name": "poolId"
649
+ },
650
+ {
651
+ "type": "uint256",
652
+ "name": "productId"
653
+ }
654
+ ],
655
+ "outputs": [
656
+ {
657
+ "type": "uint256"
658
+ }
659
+ ]
660
+ },
661
+ {
662
+ "type": "function",
663
+ "name": "getTotalEffectiveWeight",
664
+ "constant": true,
665
+ "stateMutability": "view",
666
+ "payable": false,
667
+
668
+ "inputs": [
669
+ {
670
+ "type": "uint256",
671
+ "name": "poolId"
672
+ }
673
+ ],
674
+ "outputs": [
675
+ {
676
+ "type": "uint256"
677
+ }
678
+ ]
679
+ },
680
+ {
681
+ "type": "function",
682
+ "name": "getTotalTargetWeight",
683
+ "constant": true,
684
+ "stateMutability": "view",
685
+ "payable": false,
686
+
687
+ "inputs": [
688
+ {
689
+ "type": "uint256",
690
+ "name": "poolId"
691
+ }
692
+ ],
693
+ "outputs": [
694
+ {
695
+ "type": "uint256"
696
+ }
697
+ ]
698
+ },
699
+ {
700
+ "type": "function",
701
+ "name": "internalContracts",
702
+ "constant": true,
703
+ "stateMutability": "view",
704
+ "payable": false,
705
+
706
+ "inputs": [
707
+ {
708
+ "type": "uint256"
709
+ }
710
+ ],
711
+ "outputs": [
712
+ {
713
+ "type": "address"
714
+ }
715
+ ]
716
+ },
717
+ {
718
+ "type": "function",
719
+ "name": "master",
720
+ "constant": true,
721
+ "stateMutability": "view",
722
+ "payable": false,
723
+
724
+ "inputs": [],
725
+ "outputs": [
726
+ {
727
+ "type": "address"
728
+ }
729
+ ]
730
+ },
731
+ {
732
+ "type": "function",
733
+ "name": "multicall",
734
+ "constant": false,
735
+ "payable": false,
736
+
737
+ "inputs": [
738
+ {
739
+ "type": "bytes[]",
740
+ "name": "data"
741
+ }
742
+ ],
743
+ "outputs": [
744
+ {
745
+ "type": "bytes[]",
746
+ "name": "results"
747
+ }
748
+ ]
749
+ },
750
+ {
751
+ "type": "function",
752
+ "name": "recalculateEffectiveWeights",
753
+ "constant": false,
754
+ "payable": false,
755
+
756
+ "inputs": [
757
+ {
758
+ "type": "uint256",
759
+ "name": "poolId"
760
+ },
761
+ {
762
+ "type": "uint256[]",
763
+ "name": "productIds"
764
+ }
765
+ ],
766
+ "outputs": []
767
+ },
768
+ {
769
+ "type": "function",
770
+ "name": "setInitialProducts",
771
+ "constant": false,
772
+ "payable": false,
773
+
774
+ "inputs": [
775
+ {
776
+ "type": "uint256",
777
+ "name": "poolId"
778
+ },
779
+ {
780
+ "type": "tuple[]",
781
+ "name": "params",
782
+ "components": [
783
+ {
784
+ "type": "uint256",
785
+ "name": "productId"
786
+ },
787
+ {
788
+ "type": "uint8",
789
+ "name": "weight"
790
+ },
791
+ {
792
+ "type": "uint96",
793
+ "name": "initialPrice"
794
+ },
795
+ {
796
+ "type": "uint96",
797
+ "name": "targetPrice"
798
+ }
799
+ ]
800
+ }
801
+ ],
802
+ "outputs": []
803
+ },
804
+ {
805
+ "type": "function",
806
+ "name": "setProducts",
807
+ "constant": false,
808
+ "payable": false,
809
+
810
+ "inputs": [
811
+ {
812
+ "type": "uint256",
813
+ "name": "poolId"
814
+ },
815
+ {
816
+ "type": "tuple[]",
817
+ "name": "params",
818
+ "components": [
819
+ {
820
+ "type": "uint256",
821
+ "name": "productId"
822
+ },
823
+ {
824
+ "type": "bool",
825
+ "name": "recalculateEffectiveWeight"
826
+ },
827
+ {
828
+ "type": "bool",
829
+ "name": "setTargetWeight"
830
+ },
831
+ {
832
+ "type": "uint8",
833
+ "name": "targetWeight"
834
+ },
835
+ {
836
+ "type": "bool",
837
+ "name": "setTargetPrice"
838
+ },
839
+ {
840
+ "type": "uint96",
841
+ "name": "targetPrice"
842
+ }
843
+ ]
844
+ }
845
+ ],
846
+ "outputs": []
847
+ },
848
+ {
849
+ "type": "function",
850
+ "name": "stakingPoolFactory",
851
+ "constant": true,
852
+ "stateMutability": "view",
853
+ "payable": false,
854
+
855
+ "inputs": [],
856
+ "outputs": [
857
+ {
858
+ "type": "address"
859
+ }
860
+ ]
861
+ },
862
+ {
863
+ "type": "function",
864
+ "name": "weights",
865
+ "constant": true,
866
+ "stateMutability": "view",
867
+ "payable": false,
868
+
869
+ "inputs": [
870
+ {
871
+ "type": "uint256"
872
+ }
873
+ ],
874
+ "outputs": [
875
+ {
876
+ "type": "uint32",
877
+ "name": "totalEffectiveWeight"
878
+ },
879
+ {
880
+ "type": "uint32",
881
+ "name": "totalTargetWeight"
882
+ }
883
+ ]
884
+ }
885
+ ]