@gitmyabi/stakingmanager 1.0.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.
@@ -0,0 +1,1138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stakingManagerV2_json = exports.stakingManagerV2_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * stakingManagerV2_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.stakingManagerV2_jsonAbi = [
11
+ {
12
+ "inputs": [],
13
+ "stateMutability": "nonpayable",
14
+ "type": "constructor"
15
+ },
16
+ {
17
+ "anonymous": false,
18
+ "inputs": [
19
+ {
20
+ "indexed": true,
21
+ "internalType": "address",
22
+ "name": "user",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "indexed": false,
27
+ "internalType": "uint256",
28
+ "name": "amount",
29
+ "type": "uint256"
30
+ }
31
+ ],
32
+ "name": "Deposit",
33
+ "type": "event"
34
+ },
35
+ {
36
+ "anonymous": false,
37
+ "inputs": [
38
+ {
39
+ "indexed": true,
40
+ "internalType": "address",
41
+ "name": "user",
42
+ "type": "address"
43
+ },
44
+ {
45
+ "indexed": false,
46
+ "internalType": "uint256",
47
+ "name": "amount",
48
+ "type": "uint256"
49
+ }
50
+ ],
51
+ "name": "HarvestRewards",
52
+ "type": "event"
53
+ },
54
+ {
55
+ "anonymous": false,
56
+ "inputs": [
57
+ {
58
+ "indexed": false,
59
+ "internalType": "uint8",
60
+ "name": "version",
61
+ "type": "uint8"
62
+ }
63
+ ],
64
+ "name": "Initialized",
65
+ "type": "event"
66
+ },
67
+ {
68
+ "anonymous": false,
69
+ "inputs": [
70
+ {
71
+ "indexed": true,
72
+ "internalType": "address",
73
+ "name": "previousOwner",
74
+ "type": "address"
75
+ },
76
+ {
77
+ "indexed": true,
78
+ "internalType": "address",
79
+ "name": "newOwner",
80
+ "type": "address"
81
+ }
82
+ ],
83
+ "name": "OwnershipTransferred",
84
+ "type": "event"
85
+ },
86
+ {
87
+ "anonymous": false,
88
+ "inputs": [
89
+ {
90
+ "indexed": true,
91
+ "internalType": "address",
92
+ "name": "user",
93
+ "type": "address"
94
+ },
95
+ {
96
+ "indexed": false,
97
+ "internalType": "uint256",
98
+ "name": "amount",
99
+ "type": "uint256"
100
+ }
101
+ ],
102
+ "name": "Withdraw",
103
+ "type": "event"
104
+ },
105
+ {
106
+ "inputs": [
107
+ {
108
+ "internalType": "address",
109
+ "name": "_rewardTokenAddress",
110
+ "type": "address"
111
+ },
112
+ {
113
+ "internalType": "address",
114
+ "name": "_presale",
115
+ "type": "address"
116
+ },
117
+ {
118
+ "internalType": "uint256",
119
+ "name": "_rewardTokensPerBlock",
120
+ "type": "uint256"
121
+ },
122
+ {
123
+ "internalType": "uint256",
124
+ "name": "_lockTime",
125
+ "type": "uint256"
126
+ },
127
+ {
128
+ "internalType": "uint256",
129
+ "name": "_endBlock",
130
+ "type": "uint256"
131
+ }
132
+ ],
133
+ "name": "__stakingManager_init",
134
+ "outputs": [],
135
+ "stateMutability": "nonpayable",
136
+ "type": "function"
137
+ },
138
+ {
139
+ "inputs": [
140
+ {
141
+ "internalType": "address[]",
142
+ "name": "_usersToBlacklist",
143
+ "type": "address[]"
144
+ }
145
+ ],
146
+ "name": "blacklistUsers",
147
+ "outputs": [],
148
+ "stateMutability": "nonpayable",
149
+ "type": "function"
150
+ },
151
+ {
152
+ "inputs": [
153
+ {
154
+ "internalType": "uint256",
155
+ "name": "_rewardTokensPerBlock",
156
+ "type": "uint256"
157
+ },
158
+ {
159
+ "internalType": "uint256",
160
+ "name": "_endBlock",
161
+ "type": "uint256"
162
+ }
163
+ ],
164
+ "name": "changeRewardTokensPerBlock",
165
+ "outputs": [],
166
+ "stateMutability": "nonpayable",
167
+ "type": "function"
168
+ },
169
+ {
170
+ "inputs": [],
171
+ "name": "claimStart",
172
+ "outputs": [
173
+ {
174
+ "internalType": "uint256",
175
+ "name": "",
176
+ "type": "uint256"
177
+ }
178
+ ],
179
+ "stateMutability": "view",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "inputs": [
184
+ {
185
+ "internalType": "uint256",
186
+ "name": "_amount",
187
+ "type": "uint256"
188
+ }
189
+ ],
190
+ "name": "deposit",
191
+ "outputs": [],
192
+ "stateMutability": "nonpayable",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "inputs": [
197
+ {
198
+ "internalType": "address",
199
+ "name": "_user",
200
+ "type": "address"
201
+ },
202
+ {
203
+ "internalType": "uint256",
204
+ "name": "_amount",
205
+ "type": "uint256"
206
+ }
207
+ ],
208
+ "name": "depositByPresale",
209
+ "outputs": [],
210
+ "stateMutability": "nonpayable",
211
+ "type": "function"
212
+ },
213
+ {
214
+ "inputs": [],
215
+ "name": "endBlock",
216
+ "outputs": [
217
+ {
218
+ "internalType": "uint256",
219
+ "name": "",
220
+ "type": "uint256"
221
+ }
222
+ ],
223
+ "stateMutability": "view",
224
+ "type": "function"
225
+ },
226
+ {
227
+ "inputs": [
228
+ {
229
+ "internalType": "address",
230
+ "name": "_user",
231
+ "type": "address"
232
+ }
233
+ ],
234
+ "name": "getRewards",
235
+ "outputs": [
236
+ {
237
+ "internalType": "uint256",
238
+ "name": "",
239
+ "type": "uint256"
240
+ }
241
+ ],
242
+ "stateMutability": "view",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "inputs": [],
247
+ "name": "harvestLock",
248
+ "outputs": [
249
+ {
250
+ "internalType": "bool",
251
+ "name": "",
252
+ "type": "bool"
253
+ }
254
+ ],
255
+ "stateMutability": "view",
256
+ "type": "function"
257
+ },
258
+ {
259
+ "inputs": [],
260
+ "name": "harvestRewards",
261
+ "outputs": [],
262
+ "stateMutability": "nonpayable",
263
+ "type": "function"
264
+ },
265
+ {
266
+ "inputs": [
267
+ {
268
+ "internalType": "address",
269
+ "name": "",
270
+ "type": "address"
271
+ }
272
+ ],
273
+ "name": "isBlacklisted",
274
+ "outputs": [
275
+ {
276
+ "internalType": "bool",
277
+ "name": "",
278
+ "type": "bool"
279
+ }
280
+ ],
281
+ "stateMutability": "view",
282
+ "type": "function"
283
+ },
284
+ {
285
+ "inputs": [],
286
+ "name": "lockedTime",
287
+ "outputs": [
288
+ {
289
+ "internalType": "uint256",
290
+ "name": "",
291
+ "type": "uint256"
292
+ }
293
+ ],
294
+ "stateMutability": "view",
295
+ "type": "function"
296
+ },
297
+ {
298
+ "inputs": [],
299
+ "name": "owner",
300
+ "outputs": [
301
+ {
302
+ "internalType": "address",
303
+ "name": "",
304
+ "type": "address"
305
+ }
306
+ ],
307
+ "stateMutability": "view",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "inputs": [
312
+ {
313
+ "internalType": "address",
314
+ "name": "",
315
+ "type": "address"
316
+ }
317
+ ],
318
+ "name": "poolStakers",
319
+ "outputs": [
320
+ {
321
+ "internalType": "uint256",
322
+ "name": "amount",
323
+ "type": "uint256"
324
+ },
325
+ {
326
+ "internalType": "uint256",
327
+ "name": "stakedTime",
328
+ "type": "uint256"
329
+ },
330
+ {
331
+ "internalType": "uint256",
332
+ "name": "lastUpdatedBlock",
333
+ "type": "uint256"
334
+ },
335
+ {
336
+ "internalType": "uint256",
337
+ "name": "Harvestedrewards",
338
+ "type": "uint256"
339
+ },
340
+ {
341
+ "internalType": "uint256",
342
+ "name": "rewardDebt",
343
+ "type": "uint256"
344
+ }
345
+ ],
346
+ "stateMutability": "view",
347
+ "type": "function"
348
+ },
349
+ {
350
+ "inputs": [],
351
+ "name": "presaleContract",
352
+ "outputs": [
353
+ {
354
+ "internalType": "address",
355
+ "name": "",
356
+ "type": "address"
357
+ }
358
+ ],
359
+ "stateMutability": "view",
360
+ "type": "function"
361
+ },
362
+ {
363
+ "inputs": [
364
+ {
365
+ "internalType": "address[]",
366
+ "name": "_userToRemoveFromBlacklist",
367
+ "type": "address[]"
368
+ }
369
+ ],
370
+ "name": "removeFromBlacklist",
371
+ "outputs": [],
372
+ "stateMutability": "nonpayable",
373
+ "type": "function"
374
+ },
375
+ {
376
+ "inputs": [],
377
+ "name": "renounceOwnership",
378
+ "outputs": [],
379
+ "stateMutability": "nonpayable",
380
+ "type": "function"
381
+ },
382
+ {
383
+ "inputs": [],
384
+ "name": "rewardTokensPerBlock",
385
+ "outputs": [
386
+ {
387
+ "internalType": "uint256",
388
+ "name": "",
389
+ "type": "uint256"
390
+ }
391
+ ],
392
+ "stateMutability": "view",
393
+ "type": "function"
394
+ },
395
+ {
396
+ "inputs": [
397
+ {
398
+ "internalType": "uint256",
399
+ "name": "_claimStart",
400
+ "type": "uint256"
401
+ }
402
+ ],
403
+ "name": "setClaimStart",
404
+ "outputs": [],
405
+ "stateMutability": "nonpayable",
406
+ "type": "function"
407
+ },
408
+ {
409
+ "inputs": [
410
+ {
411
+ "internalType": "uint256",
412
+ "name": "_endBlock",
413
+ "type": "uint256"
414
+ }
415
+ ],
416
+ "name": "setEndBlock",
417
+ "outputs": [],
418
+ "stateMutability": "nonpayable",
419
+ "type": "function"
420
+ },
421
+ {
422
+ "inputs": [
423
+ {
424
+ "internalType": "bool",
425
+ "name": "_harvestlock",
426
+ "type": "bool"
427
+ }
428
+ ],
429
+ "name": "setHarvestLock",
430
+ "outputs": [],
431
+ "stateMutability": "nonpayable",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ {
437
+ "internalType": "uint256",
438
+ "name": "_time",
439
+ "type": "uint256"
440
+ }
441
+ ],
442
+ "name": "setLockedTime",
443
+ "outputs": [],
444
+ "stateMutability": "nonpayable",
445
+ "type": "function"
446
+ },
447
+ {
448
+ "inputs": [
449
+ {
450
+ "internalType": "address",
451
+ "name": "_presale",
452
+ "type": "address"
453
+ }
454
+ ],
455
+ "name": "setPresale",
456
+ "outputs": [],
457
+ "stateMutability": "nonpayable",
458
+ "type": "function"
459
+ },
460
+ {
461
+ "inputs": [
462
+ {
463
+ "internalType": "address",
464
+ "name": "_stakeToken",
465
+ "type": "address"
466
+ }
467
+ ],
468
+ "name": "setStakeToken",
469
+ "outputs": [],
470
+ "stateMutability": "nonpayable",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [],
475
+ "name": "stakeToken",
476
+ "outputs": [
477
+ {
478
+ "internalType": "contract IERC20Upgradeable",
479
+ "name": "",
480
+ "type": "address"
481
+ }
482
+ ],
483
+ "stateMutability": "view",
484
+ "type": "function"
485
+ },
486
+ {
487
+ "inputs": [],
488
+ "name": "tokensStaked",
489
+ "outputs": [
490
+ {
491
+ "internalType": "uint256",
492
+ "name": "",
493
+ "type": "uint256"
494
+ }
495
+ ],
496
+ "stateMutability": "view",
497
+ "type": "function"
498
+ },
499
+ {
500
+ "inputs": [],
501
+ "name": "tokensStakedByPresale",
502
+ "outputs": [
503
+ {
504
+ "internalType": "uint256",
505
+ "name": "",
506
+ "type": "uint256"
507
+ }
508
+ ],
509
+ "stateMutability": "view",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "address",
516
+ "name": "newOwner",
517
+ "type": "address"
518
+ }
519
+ ],
520
+ "name": "transferOwnership",
521
+ "outputs": [],
522
+ "stateMutability": "nonpayable",
523
+ "type": "function"
524
+ },
525
+ {
526
+ "inputs": [
527
+ {
528
+ "internalType": "address",
529
+ "name": "",
530
+ "type": "address"
531
+ }
532
+ ],
533
+ "name": "userLockedRewards",
534
+ "outputs": [
535
+ {
536
+ "internalType": "uint256",
537
+ "name": "",
538
+ "type": "uint256"
539
+ }
540
+ ],
541
+ "stateMutability": "view",
542
+ "type": "function"
543
+ },
544
+ {
545
+ "inputs": [],
546
+ "name": "withdraw",
547
+ "outputs": [],
548
+ "stateMutability": "nonpayable",
549
+ "type": "function"
550
+ }
551
+ ];
552
+ /**
553
+ * stakingManagerV2_json Contract Class
554
+ *
555
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
556
+ *
557
+ * @example
558
+ * ```typescript
559
+ * import { createPublicClient, createWalletClient, http } from 'viem';
560
+ * import { mainnet } from 'viem/chains';
561
+ * import { stakingManagerV2_json } from 'stakingManagerV2_json';
562
+ *
563
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
564
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
565
+ *
566
+ * const contract = new stakingManagerV2_json('0x...', { publicClient, walletClient });
567
+ *
568
+ * // Read functions
569
+ * const result = await contract.balanceOf('0x...');
570
+ *
571
+ * // Write functions
572
+ * const hash = await contract.transfer('0x...', 1000n);
573
+ *
574
+ * // Simulate transactions (dry-run)
575
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
576
+ * console.log('Gas estimate:', simulation.request.gas);
577
+ *
578
+ * // Watch events
579
+ * const unwatch = contract.watch.Transfer((event) => {
580
+ * console.log('Transfer event:', event);
581
+ * });
582
+ * ```
583
+ */
584
+ class stakingManagerV2_json {
585
+ constructor(address, clients) {
586
+ this.contractAddress = address;
587
+ this.publicClient = clients.publicClient;
588
+ this.contract = (0, viem_1.getContract)({
589
+ address,
590
+ abi: exports.stakingManagerV2_jsonAbi,
591
+ client: {
592
+ public: clients.publicClient,
593
+ wallet: clients.walletClient,
594
+ },
595
+ });
596
+ }
597
+ /**
598
+ * Get the contract address
599
+ */
600
+ get address() {
601
+ return this.contractAddress;
602
+ }
603
+ /**
604
+ * Get the underlying viem contract instance
605
+ */
606
+ getContract() {
607
+ return this.contract;
608
+ }
609
+ /**
610
+ * claimStart
611
+ * view
612
+ */
613
+ async claimStart() {
614
+ return this.contract.read.claimStart();
615
+ }
616
+ /**
617
+ * endBlock
618
+ * view
619
+ */
620
+ async endBlock() {
621
+ return this.contract.read.endBlock();
622
+ }
623
+ /**
624
+ * getRewards
625
+ * view
626
+ */
627
+ async getRewards(_user) {
628
+ return this.contract.read.getRewards([_user]);
629
+ }
630
+ /**
631
+ * harvestLock
632
+ * view
633
+ */
634
+ async harvestLock() {
635
+ return this.contract.read.harvestLock();
636
+ }
637
+ /**
638
+ * isBlacklisted
639
+ * view
640
+ */
641
+ async isBlacklisted(arg0) {
642
+ return this.contract.read.isBlacklisted([arg0]);
643
+ }
644
+ /**
645
+ * lockedTime
646
+ * view
647
+ */
648
+ async lockedTime() {
649
+ return this.contract.read.lockedTime();
650
+ }
651
+ /**
652
+ * owner
653
+ * view
654
+ */
655
+ async owner() {
656
+ return this.contract.read.owner();
657
+ }
658
+ /**
659
+ * poolStakers
660
+ * view
661
+ */
662
+ async poolStakers(arg0) {
663
+ return this.contract.read.poolStakers([arg0]);
664
+ }
665
+ /**
666
+ * presaleContract
667
+ * view
668
+ */
669
+ async presaleContract() {
670
+ return this.contract.read.presaleContract();
671
+ }
672
+ /**
673
+ * rewardTokensPerBlock
674
+ * view
675
+ */
676
+ async rewardTokensPerBlock() {
677
+ return this.contract.read.rewardTokensPerBlock();
678
+ }
679
+ /**
680
+ * stakeToken
681
+ * view
682
+ */
683
+ async stakeToken() {
684
+ return this.contract.read.stakeToken();
685
+ }
686
+ /**
687
+ * tokensStaked
688
+ * view
689
+ */
690
+ async tokensStaked() {
691
+ return this.contract.read.tokensStaked();
692
+ }
693
+ /**
694
+ * tokensStakedByPresale
695
+ * view
696
+ */
697
+ async tokensStakedByPresale() {
698
+ return this.contract.read.tokensStakedByPresale();
699
+ }
700
+ /**
701
+ * userLockedRewards
702
+ * view
703
+ */
704
+ async userLockedRewards(arg0) {
705
+ return this.contract.read.userLockedRewards([arg0]);
706
+ }
707
+ /**
708
+ * __stakingManager_init
709
+ * nonpayable
710
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
711
+ */
712
+ async __stakingManager_init(_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock, options) {
713
+ if (!this.contract.write) {
714
+ throw new Error('Wallet client is required for write operations');
715
+ }
716
+ return this.contract.write.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock], options);
717
+ }
718
+ /**
719
+ * blacklistUsers
720
+ * nonpayable
721
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
722
+ */
723
+ async blacklistUsers(_usersToBlacklist, options) {
724
+ if (!this.contract.write) {
725
+ throw new Error('Wallet client is required for write operations');
726
+ }
727
+ return this.contract.write.blacklistUsers([_usersToBlacklist], options);
728
+ }
729
+ /**
730
+ * changeRewardTokensPerBlock
731
+ * nonpayable
732
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
733
+ */
734
+ async changeRewardTokensPerBlock(_rewardTokensPerBlock, _endBlock, options) {
735
+ if (!this.contract.write) {
736
+ throw new Error('Wallet client is required for write operations');
737
+ }
738
+ return this.contract.write.changeRewardTokensPerBlock([_rewardTokensPerBlock, _endBlock], options);
739
+ }
740
+ /**
741
+ * deposit
742
+ * nonpayable
743
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
744
+ */
745
+ async deposit(_amount, options) {
746
+ if (!this.contract.write) {
747
+ throw new Error('Wallet client is required for write operations');
748
+ }
749
+ return this.contract.write.deposit([_amount], options);
750
+ }
751
+ /**
752
+ * depositByPresale
753
+ * nonpayable
754
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
755
+ */
756
+ async depositByPresale(_user, _amount, options) {
757
+ if (!this.contract.write) {
758
+ throw new Error('Wallet client is required for write operations');
759
+ }
760
+ return this.contract.write.depositByPresale([_user, _amount], options);
761
+ }
762
+ /**
763
+ * harvestRewards
764
+ * nonpayable
765
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
766
+ */
767
+ async harvestRewards(options) {
768
+ if (!this.contract.write) {
769
+ throw new Error('Wallet client is required for write operations');
770
+ }
771
+ return this.contract.write.harvestRewards(options);
772
+ }
773
+ /**
774
+ * removeFromBlacklist
775
+ * nonpayable
776
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
777
+ */
778
+ async removeFromBlacklist(_userToRemoveFromBlacklist, options) {
779
+ if (!this.contract.write) {
780
+ throw new Error('Wallet client is required for write operations');
781
+ }
782
+ return this.contract.write.removeFromBlacklist([_userToRemoveFromBlacklist], options);
783
+ }
784
+ /**
785
+ * renounceOwnership
786
+ * nonpayable
787
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
788
+ */
789
+ async renounceOwnership(options) {
790
+ if (!this.contract.write) {
791
+ throw new Error('Wallet client is required for write operations');
792
+ }
793
+ return this.contract.write.renounceOwnership(options);
794
+ }
795
+ /**
796
+ * setClaimStart
797
+ * nonpayable
798
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
799
+ */
800
+ async setClaimStart(_claimStart, options) {
801
+ if (!this.contract.write) {
802
+ throw new Error('Wallet client is required for write operations');
803
+ }
804
+ return this.contract.write.setClaimStart([_claimStart], options);
805
+ }
806
+ /**
807
+ * setEndBlock
808
+ * nonpayable
809
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
810
+ */
811
+ async setEndBlock(_endBlock, options) {
812
+ if (!this.contract.write) {
813
+ throw new Error('Wallet client is required for write operations');
814
+ }
815
+ return this.contract.write.setEndBlock([_endBlock], options);
816
+ }
817
+ /**
818
+ * setHarvestLock
819
+ * nonpayable
820
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
821
+ */
822
+ async setHarvestLock(_harvestlock, options) {
823
+ if (!this.contract.write) {
824
+ throw new Error('Wallet client is required for write operations');
825
+ }
826
+ return this.contract.write.setHarvestLock([_harvestlock], options);
827
+ }
828
+ /**
829
+ * setLockedTime
830
+ * nonpayable
831
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
832
+ */
833
+ async setLockedTime(_time, options) {
834
+ if (!this.contract.write) {
835
+ throw new Error('Wallet client is required for write operations');
836
+ }
837
+ return this.contract.write.setLockedTime([_time], options);
838
+ }
839
+ /**
840
+ * setPresale
841
+ * nonpayable
842
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
843
+ */
844
+ async setPresale(_presale, options) {
845
+ if (!this.contract.write) {
846
+ throw new Error('Wallet client is required for write operations');
847
+ }
848
+ return this.contract.write.setPresale([_presale], options);
849
+ }
850
+ /**
851
+ * setStakeToken
852
+ * nonpayable
853
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
854
+ */
855
+ async setStakeToken(_stakeToken, options) {
856
+ if (!this.contract.write) {
857
+ throw new Error('Wallet client is required for write operations');
858
+ }
859
+ return this.contract.write.setStakeToken([_stakeToken], options);
860
+ }
861
+ /**
862
+ * transferOwnership
863
+ * nonpayable
864
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
865
+ */
866
+ async transferOwnership(newOwner, options) {
867
+ if (!this.contract.write) {
868
+ throw new Error('Wallet client is required for write operations');
869
+ }
870
+ return this.contract.write.transferOwnership([newOwner], options);
871
+ }
872
+ /**
873
+ * withdraw
874
+ * nonpayable
875
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
876
+ */
877
+ async withdraw(options) {
878
+ if (!this.contract.write) {
879
+ throw new Error('Wallet client is required for write operations');
880
+ }
881
+ return this.contract.write.withdraw(options);
882
+ }
883
+ /**
884
+ * Simulate contract write operations (dry-run without sending transaction)
885
+ *
886
+ * @example
887
+ * const result = await contract.simulate.transfer('0x...', 1000n);
888
+ * console.log('Gas estimate:', result.request.gas);
889
+ * console.log('Would succeed:', result.result);
890
+ */
891
+ get simulate() {
892
+ const contract = this.contract;
893
+ if (!contract.simulate) {
894
+ throw new Error('Public client is required for simulation');
895
+ }
896
+ return {
897
+ /**
898
+ * Simulate __stakingManager_init
899
+ * Returns gas estimate and result without sending transaction
900
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
901
+ */
902
+ async __stakingManager_init(_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock, options) {
903
+ return contract.simulate.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock], options);
904
+ },
905
+ /**
906
+ * Simulate blacklistUsers
907
+ * Returns gas estimate and result without sending transaction
908
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
909
+ */
910
+ async blacklistUsers(_usersToBlacklist, options) {
911
+ return contract.simulate.blacklistUsers([_usersToBlacklist], options);
912
+ },
913
+ /**
914
+ * Simulate changeRewardTokensPerBlock
915
+ * Returns gas estimate and result without sending transaction
916
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
917
+ */
918
+ async changeRewardTokensPerBlock(_rewardTokensPerBlock, _endBlock, options) {
919
+ return contract.simulate.changeRewardTokensPerBlock([_rewardTokensPerBlock, _endBlock], options);
920
+ },
921
+ /**
922
+ * Simulate deposit
923
+ * Returns gas estimate and result without sending transaction
924
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
925
+ */
926
+ async deposit(_amount, options) {
927
+ return contract.simulate.deposit([_amount], options);
928
+ },
929
+ /**
930
+ * Simulate depositByPresale
931
+ * Returns gas estimate and result without sending transaction
932
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
933
+ */
934
+ async depositByPresale(_user, _amount, options) {
935
+ return contract.simulate.depositByPresale([_user, _amount], options);
936
+ },
937
+ /**
938
+ * Simulate harvestRewards
939
+ * Returns gas estimate and result without sending transaction
940
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
941
+ */
942
+ async harvestRewards(options) {
943
+ return contract.simulate.harvestRewards(options);
944
+ },
945
+ /**
946
+ * Simulate removeFromBlacklist
947
+ * Returns gas estimate and result without sending transaction
948
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
949
+ */
950
+ async removeFromBlacklist(_userToRemoveFromBlacklist, options) {
951
+ return contract.simulate.removeFromBlacklist([_userToRemoveFromBlacklist], options);
952
+ },
953
+ /**
954
+ * Simulate renounceOwnership
955
+ * Returns gas estimate and result without sending transaction
956
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
957
+ */
958
+ async renounceOwnership(options) {
959
+ return contract.simulate.renounceOwnership(options);
960
+ },
961
+ /**
962
+ * Simulate setClaimStart
963
+ * Returns gas estimate and result without sending transaction
964
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
965
+ */
966
+ async setClaimStart(_claimStart, options) {
967
+ return contract.simulate.setClaimStart([_claimStart], options);
968
+ },
969
+ /**
970
+ * Simulate setEndBlock
971
+ * Returns gas estimate and result without sending transaction
972
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
973
+ */
974
+ async setEndBlock(_endBlock, options) {
975
+ return contract.simulate.setEndBlock([_endBlock], options);
976
+ },
977
+ /**
978
+ * Simulate setHarvestLock
979
+ * Returns gas estimate and result without sending transaction
980
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
981
+ */
982
+ async setHarvestLock(_harvestlock, options) {
983
+ return contract.simulate.setHarvestLock([_harvestlock], options);
984
+ },
985
+ /**
986
+ * Simulate setLockedTime
987
+ * Returns gas estimate and result without sending transaction
988
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
989
+ */
990
+ async setLockedTime(_time, options) {
991
+ return contract.simulate.setLockedTime([_time], options);
992
+ },
993
+ /**
994
+ * Simulate setPresale
995
+ * Returns gas estimate and result without sending transaction
996
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
997
+ */
998
+ async setPresale(_presale, options) {
999
+ return contract.simulate.setPresale([_presale], options);
1000
+ },
1001
+ /**
1002
+ * Simulate setStakeToken
1003
+ * Returns gas estimate and result without sending transaction
1004
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1005
+ */
1006
+ async setStakeToken(_stakeToken, options) {
1007
+ return contract.simulate.setStakeToken([_stakeToken], options);
1008
+ },
1009
+ /**
1010
+ * Simulate transferOwnership
1011
+ * Returns gas estimate and result without sending transaction
1012
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1013
+ */
1014
+ async transferOwnership(newOwner, options) {
1015
+ return contract.simulate.transferOwnership([newOwner], options);
1016
+ },
1017
+ /**
1018
+ * Simulate withdraw
1019
+ * Returns gas estimate and result without sending transaction
1020
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1021
+ */
1022
+ async withdraw(options) {
1023
+ return contract.simulate.withdraw(options);
1024
+ }
1025
+ };
1026
+ }
1027
+ /**
1028
+ * Watch contract events
1029
+ *
1030
+ * @example
1031
+ * // Watch all Transfer events
1032
+ * const unwatch = contract.watch.Transfer((event) => {
1033
+ * console.log('Transfer:', event);
1034
+ * });
1035
+ *
1036
+ * // Stop watching
1037
+ * unwatch();
1038
+ */
1039
+ get watch() {
1040
+ return {
1041
+ /**
1042
+ * Watch Deposit events
1043
+ * @param callback Function to call when event is emitted
1044
+ * @param filter Optional filter for indexed parameters
1045
+ * @returns Unwatch function to stop listening
1046
+ */
1047
+ Deposit: (callback, filter) => {
1048
+ return this.publicClient.watchContractEvent({
1049
+ address: this.contractAddress,
1050
+ abi: exports.stakingManagerV2_jsonAbi,
1051
+ eventName: 'Deposit',
1052
+ args: filter,
1053
+ onLogs: (logs) => {
1054
+ logs.forEach((log) => {
1055
+ callback(log.args);
1056
+ });
1057
+ },
1058
+ });
1059
+ },
1060
+ /**
1061
+ * Watch HarvestRewards events
1062
+ * @param callback Function to call when event is emitted
1063
+ * @param filter Optional filter for indexed parameters
1064
+ * @returns Unwatch function to stop listening
1065
+ */
1066
+ HarvestRewards: (callback, filter) => {
1067
+ return this.publicClient.watchContractEvent({
1068
+ address: this.contractAddress,
1069
+ abi: exports.stakingManagerV2_jsonAbi,
1070
+ eventName: 'HarvestRewards',
1071
+ args: filter,
1072
+ onLogs: (logs) => {
1073
+ logs.forEach((log) => {
1074
+ callback(log.args);
1075
+ });
1076
+ },
1077
+ });
1078
+ },
1079
+ /**
1080
+ * Watch Initialized events
1081
+ * @param callback Function to call when event is emitted
1082
+ * @param filter Optional filter for indexed parameters
1083
+ * @returns Unwatch function to stop listening
1084
+ */
1085
+ Initialized: (callback) => {
1086
+ return this.publicClient.watchContractEvent({
1087
+ address: this.contractAddress,
1088
+ abi: exports.stakingManagerV2_jsonAbi,
1089
+ eventName: 'Initialized',
1090
+ onLogs: (logs) => {
1091
+ logs.forEach((log) => {
1092
+ callback(log.args);
1093
+ });
1094
+ },
1095
+ });
1096
+ },
1097
+ /**
1098
+ * Watch OwnershipTransferred events
1099
+ * @param callback Function to call when event is emitted
1100
+ * @param filter Optional filter for indexed parameters
1101
+ * @returns Unwatch function to stop listening
1102
+ */
1103
+ OwnershipTransferred: (callback, filter) => {
1104
+ return this.publicClient.watchContractEvent({
1105
+ address: this.contractAddress,
1106
+ abi: exports.stakingManagerV2_jsonAbi,
1107
+ eventName: 'OwnershipTransferred',
1108
+ args: filter,
1109
+ onLogs: (logs) => {
1110
+ logs.forEach((log) => {
1111
+ callback(log.args);
1112
+ });
1113
+ },
1114
+ });
1115
+ },
1116
+ /**
1117
+ * Watch Withdraw events
1118
+ * @param callback Function to call when event is emitted
1119
+ * @param filter Optional filter for indexed parameters
1120
+ * @returns Unwatch function to stop listening
1121
+ */
1122
+ Withdraw: (callback, filter) => {
1123
+ return this.publicClient.watchContractEvent({
1124
+ address: this.contractAddress,
1125
+ abi: exports.stakingManagerV2_jsonAbi,
1126
+ eventName: 'Withdraw',
1127
+ args: filter,
1128
+ onLogs: (logs) => {
1129
+ logs.forEach((log) => {
1130
+ callback(log.args);
1131
+ });
1132
+ },
1133
+ });
1134
+ }
1135
+ };
1136
+ }
1137
+ }
1138
+ exports.stakingManagerV2_json = stakingManagerV2_json;