@varla/sdk 2.3.1 → 2.5.0

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 (42) hide show
  1. package/AGENTS.md +7 -7
  2. package/CHANGELOG.md +17 -0
  3. package/README.md +47 -0
  4. package/dist/abi/full/PolymarketNegRiskMergeAdapter.d.ts +248 -0
  5. package/dist/abi/full/PolymarketNegRiskMergeAdapter.d.ts.map +1 -0
  6. package/dist/abi/full/PolymarketNegRiskMergeAdapter.js +326 -0
  7. package/dist/abi/full/PolymarketNegRiskMergeAdapter.js.map +1 -0
  8. package/dist/abi/full/VarlaMergeLiquidator.d.ts +39 -0
  9. package/dist/abi/full/VarlaMergeLiquidator.d.ts.map +1 -1
  10. package/dist/abi/full/VarlaMergeLiquidator.js +50 -0
  11. package/dist/abi/full/VarlaMergeLiquidator.js.map +1 -1
  12. package/dist/abi/full/VarlaStaking.d.ts +640 -0
  13. package/dist/abi/full/VarlaStaking.d.ts.map +1 -0
  14. package/dist/abi/full/VarlaStaking.js +842 -0
  15. package/dist/abi/full/VarlaStaking.js.map +1 -0
  16. package/dist/abi/index.d.ts +2 -0
  17. package/dist/abi/index.d.ts.map +1 -1
  18. package/dist/abi/index.js +2 -0
  19. package/dist/abi/index.js.map +1 -1
  20. package/dist/contracts.d.ts +3 -1
  21. package/dist/contracts.d.ts.map +1 -1
  22. package/dist/contracts.js +16 -0
  23. package/dist/contracts.js.map +1 -1
  24. package/dist/generated.d.ts +960 -35
  25. package/dist/generated.d.ts.map +1 -1
  26. package/dist/generated.js +2 -0
  27. package/dist/generated.js.map +1 -1
  28. package/dist/types.d.ts +2 -0
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/views/core.d.ts +45 -1
  31. package/dist/views/core.d.ts.map +1 -1
  32. package/dist/views/core.js +66 -3
  33. package/dist/views/core.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/abi/full/PolymarketNegRiskMergeAdapter.ts +330 -0
  36. package/src/abi/full/VarlaMergeLiquidator.ts +50 -0
  37. package/src/abi/full/VarlaStaking.ts +846 -0
  38. package/src/abi/index.ts +2 -0
  39. package/src/contracts.ts +22 -0
  40. package/src/generated.ts +2 -0
  41. package/src/types.ts +2 -0
  42. package/src/views/core.ts +108 -5
@@ -0,0 +1,846 @@
1
+ // Auto-generated by varla-protocol/scripts/export-abi.ts
2
+ // Do not edit manually.
3
+ import type { Abi } from "viem";
4
+
5
+ export const VARLASTAKING_ABI = [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "authority",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "internalType": "address",
15
+ "name": "vrla_",
16
+ "type": "address"
17
+ }
18
+ ],
19
+ "stateMutability": "nonpayable",
20
+ "type": "constructor"
21
+ },
22
+ {
23
+ "inputs": [
24
+ {
25
+ "internalType": "address",
26
+ "name": "authority",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "AccessManagedInvalidAuthority",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [
35
+ {
36
+ "internalType": "address",
37
+ "name": "caller",
38
+ "type": "address"
39
+ },
40
+ {
41
+ "internalType": "uint32",
42
+ "name": "delay",
43
+ "type": "uint32"
44
+ }
45
+ ],
46
+ "name": "AccessManagedRequiredDelay",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "inputs": [
51
+ {
52
+ "internalType": "address",
53
+ "name": "caller",
54
+ "type": "address"
55
+ }
56
+ ],
57
+ "name": "AccessManagedUnauthorized",
58
+ "type": "error"
59
+ },
60
+ {
61
+ "inputs": [],
62
+ "name": "ArrayLengthMismatch",
63
+ "type": "error"
64
+ },
65
+ {
66
+ "inputs": [
67
+ {
68
+ "internalType": "uint256",
69
+ "name": "value",
70
+ "type": "uint256"
71
+ }
72
+ ],
73
+ "name": "BelowMinStake",
74
+ "type": "error"
75
+ },
76
+ {
77
+ "inputs": [
78
+ {
79
+ "internalType": "uint256",
80
+ "name": "unlockAt",
81
+ "type": "uint256"
82
+ }
83
+ ],
84
+ "name": "CooldownNotElapsed",
85
+ "type": "error"
86
+ },
87
+ {
88
+ "inputs": [
89
+ {
90
+ "internalType": "uint256",
91
+ "name": "have",
92
+ "type": "uint256"
93
+ },
94
+ {
95
+ "internalType": "uint256",
96
+ "name": "need",
97
+ "type": "uint256"
98
+ }
99
+ ],
100
+ "name": "InsufficientActiveStake",
101
+ "type": "error"
102
+ },
103
+ {
104
+ "inputs": [
105
+ {
106
+ "internalType": "uint256",
107
+ "name": "have",
108
+ "type": "uint256"
109
+ },
110
+ {
111
+ "internalType": "uint256",
112
+ "name": "need",
113
+ "type": "uint256"
114
+ }
115
+ ],
116
+ "name": "InsufficientPendingUnstake",
117
+ "type": "error"
118
+ },
119
+ {
120
+ "inputs": [
121
+ {
122
+ "internalType": "uint256",
123
+ "name": "bps",
124
+ "type": "uint256"
125
+ }
126
+ ],
127
+ "name": "InvalidBps",
128
+ "type": "error"
129
+ },
130
+ {
131
+ "inputs": [
132
+ {
133
+ "internalType": "uint256",
134
+ "name": "value",
135
+ "type": "uint256"
136
+ }
137
+ ],
138
+ "name": "InvalidUnstakeCooldown",
139
+ "type": "error"
140
+ },
141
+ {
142
+ "inputs": [
143
+ {
144
+ "internalType": "address",
145
+ "name": "token",
146
+ "type": "address"
147
+ }
148
+ ],
149
+ "name": "SafeERC20FailedOperation",
150
+ "type": "error"
151
+ },
152
+ {
153
+ "inputs": [],
154
+ "name": "ZeroAmount",
155
+ "type": "error"
156
+ },
157
+ {
158
+ "anonymous": false,
159
+ "inputs": [
160
+ {
161
+ "indexed": false,
162
+ "internalType": "address",
163
+ "name": "authority",
164
+ "type": "address"
165
+ }
166
+ ],
167
+ "name": "AuthorityUpdated",
168
+ "type": "event"
169
+ },
170
+ {
171
+ "anonymous": false,
172
+ "inputs": [
173
+ {
174
+ "indexed": false,
175
+ "internalType": "uint256",
176
+ "name": "count",
177
+ "type": "uint256"
178
+ }
179
+ ],
180
+ "name": "RebateTiersUpdated",
181
+ "type": "event"
182
+ },
183
+ {
184
+ "anonymous": false,
185
+ "inputs": [
186
+ {
187
+ "indexed": true,
188
+ "internalType": "address",
189
+ "name": "user",
190
+ "type": "address"
191
+ },
192
+ {
193
+ "indexed": true,
194
+ "internalType": "address",
195
+ "name": "token",
196
+ "type": "address"
197
+ },
198
+ {
199
+ "indexed": false,
200
+ "internalType": "uint256",
201
+ "name": "amount",
202
+ "type": "uint256"
203
+ },
204
+ {
205
+ "indexed": true,
206
+ "internalType": "address",
207
+ "name": "to",
208
+ "type": "address"
209
+ }
210
+ ],
211
+ "name": "RewardClaimed",
212
+ "type": "event"
213
+ },
214
+ {
215
+ "anonymous": false,
216
+ "inputs": [
217
+ {
218
+ "indexed": true,
219
+ "internalType": "address",
220
+ "name": "token",
221
+ "type": "address"
222
+ },
223
+ {
224
+ "indexed": false,
225
+ "internalType": "uint256",
226
+ "name": "amount",
227
+ "type": "uint256"
228
+ }
229
+ ],
230
+ "name": "RewardNotified",
231
+ "type": "event"
232
+ },
233
+ {
234
+ "anonymous": false,
235
+ "inputs": [
236
+ {
237
+ "indexed": true,
238
+ "internalType": "address",
239
+ "name": "user",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "indexed": false,
244
+ "internalType": "uint256",
245
+ "name": "amount",
246
+ "type": "uint256"
247
+ }
248
+ ],
249
+ "name": "Staked",
250
+ "type": "event"
251
+ },
252
+ {
253
+ "anonymous": false,
254
+ "inputs": [
255
+ {
256
+ "indexed": false,
257
+ "internalType": "uint256",
258
+ "name": "oldCooldown",
259
+ "type": "uint256"
260
+ },
261
+ {
262
+ "indexed": false,
263
+ "internalType": "uint256",
264
+ "name": "newCooldown",
265
+ "type": "uint256"
266
+ }
267
+ ],
268
+ "name": "UnstakeCooldownUpdated",
269
+ "type": "event"
270
+ },
271
+ {
272
+ "anonymous": false,
273
+ "inputs": [
274
+ {
275
+ "indexed": true,
276
+ "internalType": "address",
277
+ "name": "user",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "indexed": false,
282
+ "internalType": "uint256",
283
+ "name": "amount",
284
+ "type": "uint256"
285
+ },
286
+ {
287
+ "indexed": true,
288
+ "internalType": "address",
289
+ "name": "to",
290
+ "type": "address"
291
+ }
292
+ ],
293
+ "name": "UnstakeExecuted",
294
+ "type": "event"
295
+ },
296
+ {
297
+ "anonymous": false,
298
+ "inputs": [
299
+ {
300
+ "indexed": true,
301
+ "internalType": "address",
302
+ "name": "user",
303
+ "type": "address"
304
+ },
305
+ {
306
+ "indexed": false,
307
+ "internalType": "uint256",
308
+ "name": "amount",
309
+ "type": "uint256"
310
+ },
311
+ {
312
+ "indexed": false,
313
+ "internalType": "uint256",
314
+ "name": "unlockAt",
315
+ "type": "uint256"
316
+ }
317
+ ],
318
+ "name": "UnstakeRequested",
319
+ "type": "event"
320
+ },
321
+ {
322
+ "inputs": [],
323
+ "name": "BPS",
324
+ "outputs": [
325
+ {
326
+ "internalType": "uint256",
327
+ "name": "",
328
+ "type": "uint256"
329
+ }
330
+ ],
331
+ "stateMutability": "view",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [],
336
+ "name": "DEFAULT_UNSTAKE_COOLDOWN",
337
+ "outputs": [
338
+ {
339
+ "internalType": "uint256",
340
+ "name": "",
341
+ "type": "uint256"
342
+ }
343
+ ],
344
+ "stateMutability": "view",
345
+ "type": "function"
346
+ },
347
+ {
348
+ "inputs": [],
349
+ "name": "MAX_UNSTAKE_COOLDOWN",
350
+ "outputs": [
351
+ {
352
+ "internalType": "uint256",
353
+ "name": "",
354
+ "type": "uint256"
355
+ }
356
+ ],
357
+ "stateMutability": "view",
358
+ "type": "function"
359
+ },
360
+ {
361
+ "inputs": [],
362
+ "name": "MIN_STAKE",
363
+ "outputs": [
364
+ {
365
+ "internalType": "uint256",
366
+ "name": "",
367
+ "type": "uint256"
368
+ }
369
+ ],
370
+ "stateMutability": "view",
371
+ "type": "function"
372
+ },
373
+ {
374
+ "inputs": [],
375
+ "name": "UNSTAKE_COOLDOWN",
376
+ "outputs": [
377
+ {
378
+ "internalType": "uint256",
379
+ "name": "",
380
+ "type": "uint256"
381
+ }
382
+ ],
383
+ "stateMutability": "view",
384
+ "type": "function"
385
+ },
386
+ {
387
+ "inputs": [
388
+ {
389
+ "internalType": "address",
390
+ "name": "",
391
+ "type": "address"
392
+ }
393
+ ],
394
+ "name": "activeStake",
395
+ "outputs": [
396
+ {
397
+ "internalType": "uint256",
398
+ "name": "",
399
+ "type": "uint256"
400
+ }
401
+ ],
402
+ "stateMutability": "view",
403
+ "type": "function"
404
+ },
405
+ {
406
+ "inputs": [],
407
+ "name": "authority",
408
+ "outputs": [
409
+ {
410
+ "internalType": "address",
411
+ "name": "",
412
+ "type": "address"
413
+ }
414
+ ],
415
+ "stateMutability": "view",
416
+ "type": "function"
417
+ },
418
+ {
419
+ "inputs": [
420
+ {
421
+ "internalType": "address",
422
+ "name": "token",
423
+ "type": "address"
424
+ },
425
+ {
426
+ "internalType": "address",
427
+ "name": "to",
428
+ "type": "address"
429
+ }
430
+ ],
431
+ "name": "claim",
432
+ "outputs": [
433
+ {
434
+ "internalType": "uint256",
435
+ "name": "claimed",
436
+ "type": "uint256"
437
+ }
438
+ ],
439
+ "stateMutability": "nonpayable",
440
+ "type": "function"
441
+ },
442
+ {
443
+ "inputs": [
444
+ {
445
+ "internalType": "uint256",
446
+ "name": "amount",
447
+ "type": "uint256"
448
+ },
449
+ {
450
+ "internalType": "address",
451
+ "name": "to",
452
+ "type": "address"
453
+ }
454
+ ],
455
+ "name": "executeUnstake",
456
+ "outputs": [],
457
+ "stateMutability": "nonpayable",
458
+ "type": "function"
459
+ },
460
+ {
461
+ "inputs": [],
462
+ "name": "isConsumingScheduledOp",
463
+ "outputs": [
464
+ {
465
+ "internalType": "bytes4",
466
+ "name": "",
467
+ "type": "bytes4"
468
+ }
469
+ ],
470
+ "stateMutability": "view",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [
475
+ {
476
+ "internalType": "address",
477
+ "name": "",
478
+ "type": "address"
479
+ }
480
+ ],
481
+ "name": "isRewardToken",
482
+ "outputs": [
483
+ {
484
+ "internalType": "bool",
485
+ "name": "",
486
+ "type": "bool"
487
+ }
488
+ ],
489
+ "stateMutability": "view",
490
+ "type": "function"
491
+ },
492
+ {
493
+ "inputs": [
494
+ {
495
+ "internalType": "address",
496
+ "name": "user",
497
+ "type": "address"
498
+ }
499
+ ],
500
+ "name": "liquidationFeeRebateBps",
501
+ "outputs": [
502
+ {
503
+ "internalType": "uint256",
504
+ "name": "",
505
+ "type": "uint256"
506
+ }
507
+ ],
508
+ "stateMutability": "view",
509
+ "type": "function"
510
+ },
511
+ {
512
+ "inputs": [
513
+ {
514
+ "internalType": "address",
515
+ "name": "token",
516
+ "type": "address"
517
+ },
518
+ {
519
+ "internalType": "uint256",
520
+ "name": "amount",
521
+ "type": "uint256"
522
+ }
523
+ ],
524
+ "name": "notifyRewardAmount",
525
+ "outputs": [],
526
+ "stateMutability": "nonpayable",
527
+ "type": "function"
528
+ },
529
+ {
530
+ "inputs": [
531
+ {
532
+ "internalType": "address",
533
+ "name": "",
534
+ "type": "address"
535
+ }
536
+ ],
537
+ "name": "pendingUnstake",
538
+ "outputs": [
539
+ {
540
+ "internalType": "uint256",
541
+ "name": "",
542
+ "type": "uint256"
543
+ }
544
+ ],
545
+ "stateMutability": "view",
546
+ "type": "function"
547
+ },
548
+ {
549
+ "inputs": [
550
+ {
551
+ "internalType": "uint256",
552
+ "name": "",
553
+ "type": "uint256"
554
+ }
555
+ ],
556
+ "name": "rebateBps",
557
+ "outputs": [
558
+ {
559
+ "internalType": "uint256",
560
+ "name": "",
561
+ "type": "uint256"
562
+ }
563
+ ],
564
+ "stateMutability": "view",
565
+ "type": "function"
566
+ },
567
+ {
568
+ "inputs": [
569
+ {
570
+ "internalType": "uint256",
571
+ "name": "",
572
+ "type": "uint256"
573
+ }
574
+ ],
575
+ "name": "rebateThresholds",
576
+ "outputs": [
577
+ {
578
+ "internalType": "uint256",
579
+ "name": "",
580
+ "type": "uint256"
581
+ }
582
+ ],
583
+ "stateMutability": "view",
584
+ "type": "function"
585
+ },
586
+ {
587
+ "inputs": [],
588
+ "name": "rebateTiersLength",
589
+ "outputs": [
590
+ {
591
+ "internalType": "uint256",
592
+ "name": "",
593
+ "type": "uint256"
594
+ }
595
+ ],
596
+ "stateMutability": "view",
597
+ "type": "function"
598
+ },
599
+ {
600
+ "inputs": [
601
+ {
602
+ "internalType": "uint256",
603
+ "name": "amount",
604
+ "type": "uint256"
605
+ }
606
+ ],
607
+ "name": "requestUnstake",
608
+ "outputs": [],
609
+ "stateMutability": "nonpayable",
610
+ "type": "function"
611
+ },
612
+ {
613
+ "inputs": [
614
+ {
615
+ "internalType": "address",
616
+ "name": "",
617
+ "type": "address"
618
+ }
619
+ ],
620
+ "name": "rewardPerTokenStored",
621
+ "outputs": [
622
+ {
623
+ "internalType": "uint256",
624
+ "name": "",
625
+ "type": "uint256"
626
+ }
627
+ ],
628
+ "stateMutability": "view",
629
+ "type": "function"
630
+ },
631
+ {
632
+ "inputs": [
633
+ {
634
+ "internalType": "uint256",
635
+ "name": "",
636
+ "type": "uint256"
637
+ }
638
+ ],
639
+ "name": "rewardTokens",
640
+ "outputs": [
641
+ {
642
+ "internalType": "address",
643
+ "name": "",
644
+ "type": "address"
645
+ }
646
+ ],
647
+ "stateMutability": "view",
648
+ "type": "function"
649
+ },
650
+ {
651
+ "inputs": [],
652
+ "name": "rewardTokensLength",
653
+ "outputs": [
654
+ {
655
+ "internalType": "uint256",
656
+ "name": "",
657
+ "type": "uint256"
658
+ }
659
+ ],
660
+ "stateMutability": "view",
661
+ "type": "function"
662
+ },
663
+ {
664
+ "inputs": [
665
+ {
666
+ "internalType": "address",
667
+ "name": "",
668
+ "type": "address"
669
+ },
670
+ {
671
+ "internalType": "address",
672
+ "name": "",
673
+ "type": "address"
674
+ }
675
+ ],
676
+ "name": "rewards",
677
+ "outputs": [
678
+ {
679
+ "internalType": "uint256",
680
+ "name": "",
681
+ "type": "uint256"
682
+ }
683
+ ],
684
+ "stateMutability": "view",
685
+ "type": "function"
686
+ },
687
+ {
688
+ "inputs": [
689
+ {
690
+ "internalType": "address",
691
+ "name": "newAuthority",
692
+ "type": "address"
693
+ }
694
+ ],
695
+ "name": "setAuthority",
696
+ "outputs": [],
697
+ "stateMutability": "nonpayable",
698
+ "type": "function"
699
+ },
700
+ {
701
+ "inputs": [
702
+ {
703
+ "internalType": "uint256[]",
704
+ "name": "thresholds",
705
+ "type": "uint256[]"
706
+ },
707
+ {
708
+ "internalType": "uint256[]",
709
+ "name": "bps",
710
+ "type": "uint256[]"
711
+ }
712
+ ],
713
+ "name": "setRebateTiers",
714
+ "outputs": [],
715
+ "stateMutability": "nonpayable",
716
+ "type": "function"
717
+ },
718
+ {
719
+ "inputs": [
720
+ {
721
+ "internalType": "uint256",
722
+ "name": "newCooldown",
723
+ "type": "uint256"
724
+ }
725
+ ],
726
+ "name": "setUnstakeCooldown",
727
+ "outputs": [],
728
+ "stateMutability": "nonpayable",
729
+ "type": "function"
730
+ },
731
+ {
732
+ "inputs": [
733
+ {
734
+ "internalType": "uint256",
735
+ "name": "amount",
736
+ "type": "uint256"
737
+ }
738
+ ],
739
+ "name": "stake",
740
+ "outputs": [],
741
+ "stateMutability": "nonpayable",
742
+ "type": "function"
743
+ },
744
+ {
745
+ "inputs": [],
746
+ "name": "totalActiveStake",
747
+ "outputs": [
748
+ {
749
+ "internalType": "uint256",
750
+ "name": "",
751
+ "type": "uint256"
752
+ }
753
+ ],
754
+ "stateMutability": "view",
755
+ "type": "function"
756
+ },
757
+ {
758
+ "inputs": [
759
+ {
760
+ "internalType": "address",
761
+ "name": "",
762
+ "type": "address"
763
+ }
764
+ ],
765
+ "name": "unallocatedRewards",
766
+ "outputs": [
767
+ {
768
+ "internalType": "uint256",
769
+ "name": "",
770
+ "type": "uint256"
771
+ }
772
+ ],
773
+ "stateMutability": "view",
774
+ "type": "function"
775
+ },
776
+ {
777
+ "inputs": [],
778
+ "name": "unstakeCooldown",
779
+ "outputs": [
780
+ {
781
+ "internalType": "uint256",
782
+ "name": "",
783
+ "type": "uint256"
784
+ }
785
+ ],
786
+ "stateMutability": "view",
787
+ "type": "function"
788
+ },
789
+ {
790
+ "inputs": [
791
+ {
792
+ "internalType": "address",
793
+ "name": "",
794
+ "type": "address"
795
+ }
796
+ ],
797
+ "name": "unstakeUnlockAt",
798
+ "outputs": [
799
+ {
800
+ "internalType": "uint256",
801
+ "name": "",
802
+ "type": "uint256"
803
+ }
804
+ ],
805
+ "stateMutability": "view",
806
+ "type": "function"
807
+ },
808
+ {
809
+ "inputs": [
810
+ {
811
+ "internalType": "address",
812
+ "name": "",
813
+ "type": "address"
814
+ },
815
+ {
816
+ "internalType": "address",
817
+ "name": "",
818
+ "type": "address"
819
+ }
820
+ ],
821
+ "name": "userRewardPerTokenPaid",
822
+ "outputs": [
823
+ {
824
+ "internalType": "uint256",
825
+ "name": "",
826
+ "type": "uint256"
827
+ }
828
+ ],
829
+ "stateMutability": "view",
830
+ "type": "function"
831
+ },
832
+ {
833
+ "inputs": [],
834
+ "name": "vrla",
835
+ "outputs": [
836
+ {
837
+ "internalType": "contract IERC20",
838
+ "name": "",
839
+ "type": "address"
840
+ }
841
+ ],
842
+ "stateMutability": "view",
843
+ "type": "function"
844
+ }
845
+ ] as const satisfies Abi;
846
+