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