@gitmyabi/root 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,1614 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * RootToken ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const RootTokenAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "manager",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "multisig",
20
+ "type": "address"
21
+ }
22
+ ],
23
+ "stateMutability": "nonpayable",
24
+ "type": "constructor"
25
+ },
26
+ {
27
+ "anonymous": false,
28
+ "inputs": [
29
+ {
30
+ "indexed": true,
31
+ "internalType": "address",
32
+ "name": "owner",
33
+ "type": "address"
34
+ },
35
+ {
36
+ "indexed": true,
37
+ "internalType": "address",
38
+ "name": "spender",
39
+ "type": "address"
40
+ },
41
+ {
42
+ "indexed": false,
43
+ "internalType": "uint256",
44
+ "name": "value",
45
+ "type": "uint256"
46
+ }
47
+ ],
48
+ "name": "Approval",
49
+ "type": "event"
50
+ },
51
+ {
52
+ "anonymous": false,
53
+ "inputs": [
54
+ {
55
+ "indexed": false,
56
+ "internalType": "address",
57
+ "name": "account",
58
+ "type": "address"
59
+ }
60
+ ],
61
+ "name": "Paused",
62
+ "type": "event"
63
+ },
64
+ {
65
+ "anonymous": false,
66
+ "inputs": [
67
+ {
68
+ "indexed": true,
69
+ "internalType": "bytes32",
70
+ "name": "role",
71
+ "type": "bytes32"
72
+ },
73
+ {
74
+ "indexed": true,
75
+ "internalType": "bytes32",
76
+ "name": "previousAdminRole",
77
+ "type": "bytes32"
78
+ },
79
+ {
80
+ "indexed": true,
81
+ "internalType": "bytes32",
82
+ "name": "newAdminRole",
83
+ "type": "bytes32"
84
+ }
85
+ ],
86
+ "name": "RoleAdminChanged",
87
+ "type": "event"
88
+ },
89
+ {
90
+ "anonymous": false,
91
+ "inputs": [
92
+ {
93
+ "indexed": true,
94
+ "internalType": "bytes32",
95
+ "name": "role",
96
+ "type": "bytes32"
97
+ },
98
+ {
99
+ "indexed": true,
100
+ "internalType": "address",
101
+ "name": "account",
102
+ "type": "address"
103
+ },
104
+ {
105
+ "indexed": true,
106
+ "internalType": "address",
107
+ "name": "sender",
108
+ "type": "address"
109
+ }
110
+ ],
111
+ "name": "RoleGranted",
112
+ "type": "event"
113
+ },
114
+ {
115
+ "anonymous": false,
116
+ "inputs": [
117
+ {
118
+ "indexed": true,
119
+ "internalType": "bytes32",
120
+ "name": "role",
121
+ "type": "bytes32"
122
+ },
123
+ {
124
+ "indexed": true,
125
+ "internalType": "address",
126
+ "name": "account",
127
+ "type": "address"
128
+ },
129
+ {
130
+ "indexed": true,
131
+ "internalType": "address",
132
+ "name": "sender",
133
+ "type": "address"
134
+ }
135
+ ],
136
+ "name": "RoleRevoked",
137
+ "type": "event"
138
+ },
139
+ {
140
+ "anonymous": false,
141
+ "inputs": [
142
+ {
143
+ "indexed": true,
144
+ "internalType": "address",
145
+ "name": "from",
146
+ "type": "address"
147
+ },
148
+ {
149
+ "indexed": true,
150
+ "internalType": "address",
151
+ "name": "to",
152
+ "type": "address"
153
+ },
154
+ {
155
+ "indexed": false,
156
+ "internalType": "uint256",
157
+ "name": "value",
158
+ "type": "uint256"
159
+ }
160
+ ],
161
+ "name": "Transfer",
162
+ "type": "event"
163
+ },
164
+ {
165
+ "anonymous": false,
166
+ "inputs": [
167
+ {
168
+ "indexed": false,
169
+ "internalType": "address",
170
+ "name": "account",
171
+ "type": "address"
172
+ }
173
+ ],
174
+ "name": "Unpaused",
175
+ "type": "event"
176
+ },
177
+ {
178
+ "inputs": [],
179
+ "name": "DEFAULT_ADMIN_ROLE",
180
+ "outputs": [
181
+ {
182
+ "internalType": "bytes32",
183
+ "name": "",
184
+ "type": "bytes32"
185
+ }
186
+ ],
187
+ "stateMutability": "view",
188
+ "type": "function"
189
+ },
190
+ {
191
+ "inputs": [
192
+ {
193
+ "internalType": "address",
194
+ "name": "addr",
195
+ "type": "address"
196
+ }
197
+ ],
198
+ "name": "addManager",
199
+ "outputs": [],
200
+ "stateMutability": "nonpayable",
201
+ "type": "function"
202
+ },
203
+ {
204
+ "inputs": [
205
+ {
206
+ "internalType": "address",
207
+ "name": "owner",
208
+ "type": "address"
209
+ },
210
+ {
211
+ "internalType": "address",
212
+ "name": "spender",
213
+ "type": "address"
214
+ }
215
+ ],
216
+ "name": "allowance",
217
+ "outputs": [
218
+ {
219
+ "internalType": "uint256",
220
+ "name": "",
221
+ "type": "uint256"
222
+ }
223
+ ],
224
+ "stateMutability": "view",
225
+ "type": "function"
226
+ },
227
+ {
228
+ "inputs": [
229
+ {
230
+ "internalType": "address",
231
+ "name": "spender",
232
+ "type": "address"
233
+ },
234
+ {
235
+ "internalType": "uint256",
236
+ "name": "amount",
237
+ "type": "uint256"
238
+ }
239
+ ],
240
+ "name": "approve",
241
+ "outputs": [
242
+ {
243
+ "internalType": "bool",
244
+ "name": "",
245
+ "type": "bool"
246
+ }
247
+ ],
248
+ "stateMutability": "nonpayable",
249
+ "type": "function"
250
+ },
251
+ {
252
+ "inputs": [
253
+ {
254
+ "internalType": "address",
255
+ "name": "account",
256
+ "type": "address"
257
+ }
258
+ ],
259
+ "name": "balanceOf",
260
+ "outputs": [
261
+ {
262
+ "internalType": "uint256",
263
+ "name": "",
264
+ "type": "uint256"
265
+ }
266
+ ],
267
+ "stateMutability": "view",
268
+ "type": "function"
269
+ },
270
+ {
271
+ "inputs": [
272
+ {
273
+ "internalType": "uint128",
274
+ "name": "_amount",
275
+ "type": "uint128"
276
+ }
277
+ ],
278
+ "name": "burn",
279
+ "outputs": [],
280
+ "stateMutability": "nonpayable",
281
+ "type": "function"
282
+ },
283
+ {
284
+ "inputs": [],
285
+ "name": "cap",
286
+ "outputs": [
287
+ {
288
+ "internalType": "uint256",
289
+ "name": "",
290
+ "type": "uint256"
291
+ }
292
+ ],
293
+ "stateMutability": "view",
294
+ "type": "function"
295
+ },
296
+ {
297
+ "inputs": [],
298
+ "name": "decimals",
299
+ "outputs": [
300
+ {
301
+ "internalType": "uint8",
302
+ "name": "",
303
+ "type": "uint8"
304
+ }
305
+ ],
306
+ "stateMutability": "view",
307
+ "type": "function"
308
+ },
309
+ {
310
+ "inputs": [
311
+ {
312
+ "internalType": "address",
313
+ "name": "spender",
314
+ "type": "address"
315
+ },
316
+ {
317
+ "internalType": "uint256",
318
+ "name": "subtractedValue",
319
+ "type": "uint256"
320
+ }
321
+ ],
322
+ "name": "decreaseAllowance",
323
+ "outputs": [
324
+ {
325
+ "internalType": "bool",
326
+ "name": "",
327
+ "type": "bool"
328
+ }
329
+ ],
330
+ "stateMutability": "nonpayable",
331
+ "type": "function"
332
+ },
333
+ {
334
+ "inputs": [
335
+ {
336
+ "internalType": "bytes32",
337
+ "name": "role",
338
+ "type": "bytes32"
339
+ }
340
+ ],
341
+ "name": "getRoleAdmin",
342
+ "outputs": [
343
+ {
344
+ "internalType": "bytes32",
345
+ "name": "",
346
+ "type": "bytes32"
347
+ }
348
+ ],
349
+ "stateMutability": "view",
350
+ "type": "function"
351
+ },
352
+ {
353
+ "inputs": [
354
+ {
355
+ "internalType": "bytes32",
356
+ "name": "role",
357
+ "type": "bytes32"
358
+ },
359
+ {
360
+ "internalType": "address",
361
+ "name": "account",
362
+ "type": "address"
363
+ }
364
+ ],
365
+ "name": "grantRole",
366
+ "outputs": [],
367
+ "stateMutability": "nonpayable",
368
+ "type": "function"
369
+ },
370
+ {
371
+ "inputs": [
372
+ {
373
+ "internalType": "bytes32",
374
+ "name": "role",
375
+ "type": "bytes32"
376
+ },
377
+ {
378
+ "internalType": "address",
379
+ "name": "account",
380
+ "type": "address"
381
+ }
382
+ ],
383
+ "name": "hasRole",
384
+ "outputs": [
385
+ {
386
+ "internalType": "bool",
387
+ "name": "",
388
+ "type": "bool"
389
+ }
390
+ ],
391
+ "stateMutability": "view",
392
+ "type": "function"
393
+ },
394
+ {
395
+ "inputs": [
396
+ {
397
+ "internalType": "address",
398
+ "name": "spender",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "internalType": "uint256",
403
+ "name": "addedValue",
404
+ "type": "uint256"
405
+ }
406
+ ],
407
+ "name": "increaseAllowance",
408
+ "outputs": [
409
+ {
410
+ "internalType": "bool",
411
+ "name": "",
412
+ "type": "bool"
413
+ }
414
+ ],
415
+ "stateMutability": "nonpayable",
416
+ "type": "function"
417
+ },
418
+ {
419
+ "inputs": [
420
+ {
421
+ "internalType": "address",
422
+ "name": "_peg",
423
+ "type": "address"
424
+ }
425
+ ],
426
+ "name": "init",
427
+ "outputs": [],
428
+ "stateMutability": "nonpayable",
429
+ "type": "function"
430
+ },
431
+ {
432
+ "inputs": [
433
+ {
434
+ "internalType": "address",
435
+ "name": "to",
436
+ "type": "address"
437
+ },
438
+ {
439
+ "internalType": "uint128",
440
+ "name": "_amount",
441
+ "type": "uint128"
442
+ }
443
+ ],
444
+ "name": "mint",
445
+ "outputs": [],
446
+ "stateMutability": "nonpayable",
447
+ "type": "function"
448
+ },
449
+ {
450
+ "inputs": [],
451
+ "name": "name",
452
+ "outputs": [
453
+ {
454
+ "internalType": "string",
455
+ "name": "",
456
+ "type": "string"
457
+ }
458
+ ],
459
+ "stateMutability": "view",
460
+ "type": "function"
461
+ },
462
+ {
463
+ "inputs": [],
464
+ "name": "pause",
465
+ "outputs": [],
466
+ "stateMutability": "nonpayable",
467
+ "type": "function"
468
+ },
469
+ {
470
+ "inputs": [],
471
+ "name": "paused",
472
+ "outputs": [
473
+ {
474
+ "internalType": "bool",
475
+ "name": "",
476
+ "type": "bool"
477
+ }
478
+ ],
479
+ "stateMutability": "view",
480
+ "type": "function"
481
+ },
482
+ {
483
+ "inputs": [
484
+ {
485
+ "internalType": "address",
486
+ "name": "addr",
487
+ "type": "address"
488
+ }
489
+ ],
490
+ "name": "removeManager",
491
+ "outputs": [],
492
+ "stateMutability": "nonpayable",
493
+ "type": "function"
494
+ },
495
+ {
496
+ "inputs": [
497
+ {
498
+ "internalType": "bytes32",
499
+ "name": "role",
500
+ "type": "bytes32"
501
+ },
502
+ {
503
+ "internalType": "address",
504
+ "name": "account",
505
+ "type": "address"
506
+ }
507
+ ],
508
+ "name": "renounceRole",
509
+ "outputs": [],
510
+ "stateMutability": "nonpayable",
511
+ "type": "function"
512
+ },
513
+ {
514
+ "inputs": [
515
+ {
516
+ "internalType": "bytes32",
517
+ "name": "role",
518
+ "type": "bytes32"
519
+ },
520
+ {
521
+ "internalType": "address",
522
+ "name": "account",
523
+ "type": "address"
524
+ }
525
+ ],
526
+ "name": "revokeRole",
527
+ "outputs": [],
528
+ "stateMutability": "nonpayable",
529
+ "type": "function"
530
+ },
531
+ {
532
+ "inputs": [
533
+ {
534
+ "internalType": "bytes4",
535
+ "name": "interfaceId",
536
+ "type": "bytes4"
537
+ }
538
+ ],
539
+ "name": "supportsInterface",
540
+ "outputs": [
541
+ {
542
+ "internalType": "bool",
543
+ "name": "",
544
+ "type": "bool"
545
+ }
546
+ ],
547
+ "stateMutability": "view",
548
+ "type": "function"
549
+ },
550
+ {
551
+ "inputs": [],
552
+ "name": "symbol",
553
+ "outputs": [
554
+ {
555
+ "internalType": "string",
556
+ "name": "",
557
+ "type": "string"
558
+ }
559
+ ],
560
+ "stateMutability": "view",
561
+ "type": "function"
562
+ },
563
+ {
564
+ "inputs": [],
565
+ "name": "totalSupply",
566
+ "outputs": [
567
+ {
568
+ "internalType": "uint256",
569
+ "name": "",
570
+ "type": "uint256"
571
+ }
572
+ ],
573
+ "stateMutability": "view",
574
+ "type": "function"
575
+ },
576
+ {
577
+ "inputs": [
578
+ {
579
+ "internalType": "address",
580
+ "name": "to",
581
+ "type": "address"
582
+ },
583
+ {
584
+ "internalType": "uint256",
585
+ "name": "amount",
586
+ "type": "uint256"
587
+ }
588
+ ],
589
+ "name": "transfer",
590
+ "outputs": [
591
+ {
592
+ "internalType": "bool",
593
+ "name": "",
594
+ "type": "bool"
595
+ }
596
+ ],
597
+ "stateMutability": "nonpayable",
598
+ "type": "function"
599
+ },
600
+ {
601
+ "inputs": [
602
+ {
603
+ "internalType": "address",
604
+ "name": "from",
605
+ "type": "address"
606
+ },
607
+ {
608
+ "internalType": "address",
609
+ "name": "to",
610
+ "type": "address"
611
+ },
612
+ {
613
+ "internalType": "uint256",
614
+ "name": "amount",
615
+ "type": "uint256"
616
+ }
617
+ ],
618
+ "name": "transferFrom",
619
+ "outputs": [
620
+ {
621
+ "internalType": "bool",
622
+ "name": "",
623
+ "type": "bool"
624
+ }
625
+ ],
626
+ "stateMutability": "nonpayable",
627
+ "type": "function"
628
+ },
629
+ {
630
+ "inputs": [],
631
+ "name": "unpause",
632
+ "outputs": [],
633
+ "stateMutability": "nonpayable",
634
+ "type": "function"
635
+ }
636
+ ] as const satisfies Abi;
637
+
638
+ /**
639
+ * Type-safe ABI for RootToken
640
+ */
641
+ export type RootTokenAbi = typeof RootTokenAbi;
642
+
643
+ /**
644
+ * Contract instance type for RootToken
645
+ */
646
+ // Use any for contract type to avoid complex viem type issues
647
+ // The runtime behavior is type-safe through viem's ABI typing
648
+ export type RootTokenContract = any;
649
+
650
+ /**
651
+ * RootToken Contract Class
652
+ *
653
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
654
+ *
655
+ * @example
656
+ * ```typescript
657
+ * import { createPublicClient, createWalletClient, http } from 'viem';
658
+ * import { mainnet } from 'viem/chains';
659
+ * import { RootToken } from 'RootToken';
660
+ *
661
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
662
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
663
+ *
664
+ * const contract = new RootToken('0x...', { publicClient, walletClient });
665
+ *
666
+ * // Read functions
667
+ * const result = await contract.balanceOf('0x...');
668
+ *
669
+ * // Write functions
670
+ * const hash = await contract.transfer('0x...', 1000n);
671
+ *
672
+ * // Simulate transactions (dry-run)
673
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
674
+ * console.log('Gas estimate:', simulation.request.gas);
675
+ *
676
+ * // Watch events
677
+ * const unwatch = contract.watch.Transfer((event) => {
678
+ * console.log('Transfer event:', event);
679
+ * });
680
+ * ```
681
+ */
682
+ export class RootToken {
683
+ private contract: RootTokenContract;
684
+ private contractAddress: Address;
685
+ private publicClient: PublicClient;
686
+
687
+ constructor(
688
+ address: Address,
689
+ clients: {
690
+ publicClient: PublicClient;
691
+ walletClient?: WalletClient;
692
+ }
693
+ ) {
694
+ this.contractAddress = address;
695
+ this.publicClient = clients.publicClient;
696
+ this.contract = getContract({
697
+ address,
698
+ abi: RootTokenAbi,
699
+ client: {
700
+ public: clients.publicClient,
701
+ wallet: clients.walletClient,
702
+ },
703
+ });
704
+ }
705
+
706
+ /**
707
+ * Get the contract address
708
+ */
709
+ get address(): Address {
710
+ return this.contractAddress;
711
+ }
712
+
713
+ /**
714
+ * Get the underlying viem contract instance.
715
+ */
716
+ getContract(): RootTokenContract {
717
+ return this.contract;
718
+ }
719
+
720
+ /**
721
+ * DEFAULT_ADMIN_ROLE
722
+ * view
723
+ */
724
+ async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
725
+ return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
726
+ }
727
+
728
+ /**
729
+ * allowance
730
+ * view
731
+ */
732
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
733
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
734
+ }
735
+
736
+ /**
737
+ * balanceOf
738
+ * view
739
+ */
740
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
741
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
742
+ }
743
+
744
+ /**
745
+ * cap
746
+ * view
747
+ */
748
+ async cap(): Promise<bigint> {
749
+ return this.contract.read.cap() as Promise<bigint>;
750
+ }
751
+
752
+ /**
753
+ * decimals
754
+ * view
755
+ */
756
+ async decimals(): Promise<bigint> {
757
+ return this.contract.read.decimals() as Promise<bigint>;
758
+ }
759
+
760
+ /**
761
+ * getRoleAdmin
762
+ * view
763
+ */
764
+ async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
765
+ return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
766
+ }
767
+
768
+ /**
769
+ * hasRole
770
+ * view
771
+ */
772
+ async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
773
+ return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
774
+ }
775
+
776
+ /**
777
+ * name
778
+ * view
779
+ */
780
+ async name(): Promise<string> {
781
+ return this.contract.read.name() as Promise<string>;
782
+ }
783
+
784
+ /**
785
+ * paused
786
+ * view
787
+ */
788
+ async paused(): Promise<boolean> {
789
+ return this.contract.read.paused() as Promise<boolean>;
790
+ }
791
+
792
+ /**
793
+ * supportsInterface
794
+ * view
795
+ */
796
+ async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
797
+ return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
798
+ }
799
+
800
+ /**
801
+ * symbol
802
+ * view
803
+ */
804
+ async symbol(): Promise<string> {
805
+ return this.contract.read.symbol() as Promise<string>;
806
+ }
807
+
808
+ /**
809
+ * totalSupply
810
+ * view
811
+ */
812
+ async totalSupply(): Promise<bigint> {
813
+ return this.contract.read.totalSupply() as Promise<bigint>;
814
+ }
815
+
816
+ /**
817
+ * addManager
818
+ * nonpayable
819
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
820
+ */
821
+ async addManager(addr: `0x${string}`, options?: {
822
+ accessList?: import('viem').AccessList;
823
+ authorizationList?: import('viem').AuthorizationList;
824
+ chain?: import('viem').Chain | null;
825
+ dataSuffix?: `0x${string}`;
826
+ gas?: bigint;
827
+ gasPrice?: bigint;
828
+ maxFeePerGas?: bigint;
829
+ maxPriorityFeePerGas?: bigint;
830
+ nonce?: number;
831
+ value?: bigint;
832
+ }): Promise<`0x${string}`> {
833
+ if (!this.contract.write) {
834
+ throw new Error('Wallet client is required for write operations');
835
+ }
836
+ return this.contract.write.addManager([addr] as const, options) as Promise<`0x${string}`>;
837
+ }
838
+
839
+ /**
840
+ * approve
841
+ * nonpayable
842
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
843
+ */
844
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
845
+ accessList?: import('viem').AccessList;
846
+ authorizationList?: import('viem').AuthorizationList;
847
+ chain?: import('viem').Chain | null;
848
+ dataSuffix?: `0x${string}`;
849
+ gas?: bigint;
850
+ gasPrice?: bigint;
851
+ maxFeePerGas?: bigint;
852
+ maxPriorityFeePerGas?: bigint;
853
+ nonce?: number;
854
+ value?: bigint;
855
+ }): Promise<`0x${string}`> {
856
+ if (!this.contract.write) {
857
+ throw new Error('Wallet client is required for write operations');
858
+ }
859
+ return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
860
+ }
861
+
862
+ /**
863
+ * burn
864
+ * nonpayable
865
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
866
+ */
867
+ async burn(_amount: bigint, options?: {
868
+ accessList?: import('viem').AccessList;
869
+ authorizationList?: import('viem').AuthorizationList;
870
+ chain?: import('viem').Chain | null;
871
+ dataSuffix?: `0x${string}`;
872
+ gas?: bigint;
873
+ gasPrice?: bigint;
874
+ maxFeePerGas?: bigint;
875
+ maxPriorityFeePerGas?: bigint;
876
+ nonce?: number;
877
+ value?: bigint;
878
+ }): Promise<`0x${string}`> {
879
+ if (!this.contract.write) {
880
+ throw new Error('Wallet client is required for write operations');
881
+ }
882
+ return this.contract.write.burn([_amount] as const, options) as Promise<`0x${string}`>;
883
+ }
884
+
885
+ /**
886
+ * decreaseAllowance
887
+ * nonpayable
888
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
889
+ */
890
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
891
+ accessList?: import('viem').AccessList;
892
+ authorizationList?: import('viem').AuthorizationList;
893
+ chain?: import('viem').Chain | null;
894
+ dataSuffix?: `0x${string}`;
895
+ gas?: bigint;
896
+ gasPrice?: bigint;
897
+ maxFeePerGas?: bigint;
898
+ maxPriorityFeePerGas?: bigint;
899
+ nonce?: number;
900
+ value?: bigint;
901
+ }): Promise<`0x${string}`> {
902
+ if (!this.contract.write) {
903
+ throw new Error('Wallet client is required for write operations');
904
+ }
905
+ return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
906
+ }
907
+
908
+ /**
909
+ * grantRole
910
+ * nonpayable
911
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
912
+ */
913
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
914
+ accessList?: import('viem').AccessList;
915
+ authorizationList?: import('viem').AuthorizationList;
916
+ chain?: import('viem').Chain | null;
917
+ dataSuffix?: `0x${string}`;
918
+ gas?: bigint;
919
+ gasPrice?: bigint;
920
+ maxFeePerGas?: bigint;
921
+ maxPriorityFeePerGas?: bigint;
922
+ nonce?: number;
923
+ value?: bigint;
924
+ }): Promise<`0x${string}`> {
925
+ if (!this.contract.write) {
926
+ throw new Error('Wallet client is required for write operations');
927
+ }
928
+ return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
929
+ }
930
+
931
+ /**
932
+ * increaseAllowance
933
+ * nonpayable
934
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
935
+ */
936
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
937
+ accessList?: import('viem').AccessList;
938
+ authorizationList?: import('viem').AuthorizationList;
939
+ chain?: import('viem').Chain | null;
940
+ dataSuffix?: `0x${string}`;
941
+ gas?: bigint;
942
+ gasPrice?: bigint;
943
+ maxFeePerGas?: bigint;
944
+ maxPriorityFeePerGas?: bigint;
945
+ nonce?: number;
946
+ value?: bigint;
947
+ }): Promise<`0x${string}`> {
948
+ if (!this.contract.write) {
949
+ throw new Error('Wallet client is required for write operations');
950
+ }
951
+ return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
952
+ }
953
+
954
+ /**
955
+ * init
956
+ * nonpayable
957
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
958
+ */
959
+ async init(_peg: `0x${string}`, options?: {
960
+ accessList?: import('viem').AccessList;
961
+ authorizationList?: import('viem').AuthorizationList;
962
+ chain?: import('viem').Chain | null;
963
+ dataSuffix?: `0x${string}`;
964
+ gas?: bigint;
965
+ gasPrice?: bigint;
966
+ maxFeePerGas?: bigint;
967
+ maxPriorityFeePerGas?: bigint;
968
+ nonce?: number;
969
+ value?: bigint;
970
+ }): Promise<`0x${string}`> {
971
+ if (!this.contract.write) {
972
+ throw new Error('Wallet client is required for write operations');
973
+ }
974
+ return this.contract.write.init([_peg] as const, options) as Promise<`0x${string}`>;
975
+ }
976
+
977
+ /**
978
+ * mint
979
+ * nonpayable
980
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
981
+ */
982
+ async mint(to: `0x${string}`, _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<`0x${string}`> {
994
+ if (!this.contract.write) {
995
+ throw new Error('Wallet client is required for write operations');
996
+ }
997
+ return this.contract.write.mint([to, _amount] as const, options) as Promise<`0x${string}`>;
998
+ }
999
+
1000
+ /**
1001
+ * pause
1002
+ * nonpayable
1003
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1004
+ */
1005
+ async pause(options?: {
1006
+ accessList?: import('viem').AccessList;
1007
+ authorizationList?: import('viem').AuthorizationList;
1008
+ chain?: import('viem').Chain | null;
1009
+ dataSuffix?: `0x${string}`;
1010
+ gas?: bigint;
1011
+ gasPrice?: bigint;
1012
+ maxFeePerGas?: bigint;
1013
+ maxPriorityFeePerGas?: bigint;
1014
+ nonce?: number;
1015
+ value?: bigint;
1016
+ }): Promise<`0x${string}`> {
1017
+ if (!this.contract.write) {
1018
+ throw new Error('Wallet client is required for write operations');
1019
+ }
1020
+ return this.contract.write.pause(options) as Promise<`0x${string}`>;
1021
+ }
1022
+
1023
+ /**
1024
+ * removeManager
1025
+ * nonpayable
1026
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1027
+ */
1028
+ async removeManager(addr: `0x${string}`, options?: {
1029
+ accessList?: import('viem').AccessList;
1030
+ authorizationList?: import('viem').AuthorizationList;
1031
+ chain?: import('viem').Chain | null;
1032
+ dataSuffix?: `0x${string}`;
1033
+ gas?: bigint;
1034
+ gasPrice?: bigint;
1035
+ maxFeePerGas?: bigint;
1036
+ maxPriorityFeePerGas?: bigint;
1037
+ nonce?: number;
1038
+ value?: bigint;
1039
+ }): Promise<`0x${string}`> {
1040
+ if (!this.contract.write) {
1041
+ throw new Error('Wallet client is required for write operations');
1042
+ }
1043
+ return this.contract.write.removeManager([addr] as const, options) as Promise<`0x${string}`>;
1044
+ }
1045
+
1046
+ /**
1047
+ * renounceRole
1048
+ * nonpayable
1049
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1050
+ */
1051
+ async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
1052
+ accessList?: import('viem').AccessList;
1053
+ authorizationList?: import('viem').AuthorizationList;
1054
+ chain?: import('viem').Chain | null;
1055
+ dataSuffix?: `0x${string}`;
1056
+ gas?: bigint;
1057
+ gasPrice?: bigint;
1058
+ maxFeePerGas?: bigint;
1059
+ maxPriorityFeePerGas?: bigint;
1060
+ nonce?: number;
1061
+ value?: bigint;
1062
+ }): Promise<`0x${string}`> {
1063
+ if (!this.contract.write) {
1064
+ throw new Error('Wallet client is required for write operations');
1065
+ }
1066
+ return this.contract.write.renounceRole([role, account] as const, options) as Promise<`0x${string}`>;
1067
+ }
1068
+
1069
+ /**
1070
+ * revokeRole
1071
+ * nonpayable
1072
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1073
+ */
1074
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
1075
+ accessList?: import('viem').AccessList;
1076
+ authorizationList?: import('viem').AuthorizationList;
1077
+ chain?: import('viem').Chain | null;
1078
+ dataSuffix?: `0x${string}`;
1079
+ gas?: bigint;
1080
+ gasPrice?: bigint;
1081
+ maxFeePerGas?: bigint;
1082
+ maxPriorityFeePerGas?: bigint;
1083
+ nonce?: number;
1084
+ value?: bigint;
1085
+ }): Promise<`0x${string}`> {
1086
+ if (!this.contract.write) {
1087
+ throw new Error('Wallet client is required for write operations');
1088
+ }
1089
+ return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
1090
+ }
1091
+
1092
+ /**
1093
+ * transfer
1094
+ * nonpayable
1095
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1096
+ */
1097
+ async transfer(to: `0x${string}`, amount: bigint, options?: {
1098
+ accessList?: import('viem').AccessList;
1099
+ authorizationList?: import('viem').AuthorizationList;
1100
+ chain?: import('viem').Chain | null;
1101
+ dataSuffix?: `0x${string}`;
1102
+ gas?: bigint;
1103
+ gasPrice?: bigint;
1104
+ maxFeePerGas?: bigint;
1105
+ maxPriorityFeePerGas?: bigint;
1106
+ nonce?: number;
1107
+ value?: bigint;
1108
+ }): Promise<`0x${string}`> {
1109
+ if (!this.contract.write) {
1110
+ throw new Error('Wallet client is required for write operations');
1111
+ }
1112
+ return this.contract.write.transfer([to, amount] as const, options) as Promise<`0x${string}`>;
1113
+ }
1114
+
1115
+ /**
1116
+ * transferFrom
1117
+ * nonpayable
1118
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1119
+ */
1120
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
1121
+ accessList?: import('viem').AccessList;
1122
+ authorizationList?: import('viem').AuthorizationList;
1123
+ chain?: import('viem').Chain | null;
1124
+ dataSuffix?: `0x${string}`;
1125
+ gas?: bigint;
1126
+ gasPrice?: bigint;
1127
+ maxFeePerGas?: bigint;
1128
+ maxPriorityFeePerGas?: bigint;
1129
+ nonce?: number;
1130
+ value?: bigint;
1131
+ }): Promise<`0x${string}`> {
1132
+ if (!this.contract.write) {
1133
+ throw new Error('Wallet client is required for write operations');
1134
+ }
1135
+ return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
1136
+ }
1137
+
1138
+ /**
1139
+ * unpause
1140
+ * nonpayable
1141
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1142
+ */
1143
+ async unpause(options?: {
1144
+ accessList?: import('viem').AccessList;
1145
+ authorizationList?: import('viem').AuthorizationList;
1146
+ chain?: import('viem').Chain | null;
1147
+ dataSuffix?: `0x${string}`;
1148
+ gas?: bigint;
1149
+ gasPrice?: bigint;
1150
+ maxFeePerGas?: bigint;
1151
+ maxPriorityFeePerGas?: bigint;
1152
+ nonce?: number;
1153
+ value?: bigint;
1154
+ }): Promise<`0x${string}`> {
1155
+ if (!this.contract.write) {
1156
+ throw new Error('Wallet client is required for write operations');
1157
+ }
1158
+ return this.contract.write.unpause(options) as Promise<`0x${string}`>;
1159
+ }
1160
+
1161
+
1162
+
1163
+ /**
1164
+ * Simulate contract write operations (dry-run without sending transaction)
1165
+ *
1166
+ * @example
1167
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1168
+ * console.log('Gas estimate:', result.request.gas);
1169
+ * console.log('Would succeed:', result.result);
1170
+ */
1171
+ get simulate() {
1172
+ const contract = this.contract;
1173
+ if (!contract.simulate) {
1174
+ throw new Error('Public client is required for simulation');
1175
+ }
1176
+ return {
1177
+ /**
1178
+ * Simulate addManager
1179
+ * Returns gas estimate and result without sending transaction
1180
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1181
+ */
1182
+ async addManager(addr: `0x${string}`, options?: {
1183
+ accessList?: import('viem').AccessList;
1184
+ authorizationList?: import('viem').AuthorizationList;
1185
+ chain?: import('viem').Chain | null;
1186
+ dataSuffix?: `0x${string}`;
1187
+ gas?: bigint;
1188
+ gasPrice?: bigint;
1189
+ maxFeePerGas?: bigint;
1190
+ maxPriorityFeePerGas?: bigint;
1191
+ nonce?: number;
1192
+ value?: bigint;
1193
+ }): Promise<void> {
1194
+ return contract.simulate.addManager([addr] as const, options) as Promise<void>;
1195
+ },
1196
+ /**
1197
+ * Simulate approve
1198
+ * Returns gas estimate and result without sending transaction
1199
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1200
+ */
1201
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
1202
+ accessList?: import('viem').AccessList;
1203
+ authorizationList?: import('viem').AuthorizationList;
1204
+ chain?: import('viem').Chain | null;
1205
+ dataSuffix?: `0x${string}`;
1206
+ gas?: bigint;
1207
+ gasPrice?: bigint;
1208
+ maxFeePerGas?: bigint;
1209
+ maxPriorityFeePerGas?: bigint;
1210
+ nonce?: number;
1211
+ value?: bigint;
1212
+ }): Promise<boolean> {
1213
+ return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
1214
+ },
1215
+ /**
1216
+ * Simulate burn
1217
+ * Returns gas estimate and result without sending transaction
1218
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1219
+ */
1220
+ async burn(_amount: bigint, options?: {
1221
+ accessList?: import('viem').AccessList;
1222
+ authorizationList?: import('viem').AuthorizationList;
1223
+ chain?: import('viem').Chain | null;
1224
+ dataSuffix?: `0x${string}`;
1225
+ gas?: bigint;
1226
+ gasPrice?: bigint;
1227
+ maxFeePerGas?: bigint;
1228
+ maxPriorityFeePerGas?: bigint;
1229
+ nonce?: number;
1230
+ value?: bigint;
1231
+ }): Promise<void> {
1232
+ return contract.simulate.burn([_amount] as const, options) as Promise<void>;
1233
+ },
1234
+ /**
1235
+ * Simulate decreaseAllowance
1236
+ * Returns gas estimate and result without sending transaction
1237
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1238
+ */
1239
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
1240
+ accessList?: import('viem').AccessList;
1241
+ authorizationList?: import('viem').AuthorizationList;
1242
+ chain?: import('viem').Chain | null;
1243
+ dataSuffix?: `0x${string}`;
1244
+ gas?: bigint;
1245
+ gasPrice?: bigint;
1246
+ maxFeePerGas?: bigint;
1247
+ maxPriorityFeePerGas?: bigint;
1248
+ nonce?: number;
1249
+ value?: bigint;
1250
+ }): Promise<boolean> {
1251
+ return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
1252
+ },
1253
+ /**
1254
+ * Simulate grantRole
1255
+ * Returns gas estimate and result without sending transaction
1256
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1257
+ */
1258
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
1259
+ accessList?: import('viem').AccessList;
1260
+ authorizationList?: import('viem').AuthorizationList;
1261
+ chain?: import('viem').Chain | null;
1262
+ dataSuffix?: `0x${string}`;
1263
+ gas?: bigint;
1264
+ gasPrice?: bigint;
1265
+ maxFeePerGas?: bigint;
1266
+ maxPriorityFeePerGas?: bigint;
1267
+ nonce?: number;
1268
+ value?: bigint;
1269
+ }): Promise<void> {
1270
+ return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
1271
+ },
1272
+ /**
1273
+ * Simulate increaseAllowance
1274
+ * Returns gas estimate and result without sending transaction
1275
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1276
+ */
1277
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
1278
+ accessList?: import('viem').AccessList;
1279
+ authorizationList?: import('viem').AuthorizationList;
1280
+ chain?: import('viem').Chain | null;
1281
+ dataSuffix?: `0x${string}`;
1282
+ gas?: bigint;
1283
+ gasPrice?: bigint;
1284
+ maxFeePerGas?: bigint;
1285
+ maxPriorityFeePerGas?: bigint;
1286
+ nonce?: number;
1287
+ value?: bigint;
1288
+ }): Promise<boolean> {
1289
+ return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
1290
+ },
1291
+ /**
1292
+ * Simulate init
1293
+ * Returns gas estimate and result without sending transaction
1294
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1295
+ */
1296
+ async init(_peg: `0x${string}`, options?: {
1297
+ accessList?: import('viem').AccessList;
1298
+ authorizationList?: import('viem').AuthorizationList;
1299
+ chain?: import('viem').Chain | null;
1300
+ dataSuffix?: `0x${string}`;
1301
+ gas?: bigint;
1302
+ gasPrice?: bigint;
1303
+ maxFeePerGas?: bigint;
1304
+ maxPriorityFeePerGas?: bigint;
1305
+ nonce?: number;
1306
+ value?: bigint;
1307
+ }): Promise<void> {
1308
+ return contract.simulate.init([_peg] as const, options) as Promise<void>;
1309
+ },
1310
+ /**
1311
+ * Simulate mint
1312
+ * Returns gas estimate and result without sending transaction
1313
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1314
+ */
1315
+ async mint(to: `0x${string}`, _amount: bigint, options?: {
1316
+ accessList?: import('viem').AccessList;
1317
+ authorizationList?: import('viem').AuthorizationList;
1318
+ chain?: import('viem').Chain | null;
1319
+ dataSuffix?: `0x${string}`;
1320
+ gas?: bigint;
1321
+ gasPrice?: bigint;
1322
+ maxFeePerGas?: bigint;
1323
+ maxPriorityFeePerGas?: bigint;
1324
+ nonce?: number;
1325
+ value?: bigint;
1326
+ }): Promise<void> {
1327
+ return contract.simulate.mint([to, _amount] as const, options) as Promise<void>;
1328
+ },
1329
+ /**
1330
+ * Simulate pause
1331
+ * Returns gas estimate and result without sending transaction
1332
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1333
+ */
1334
+ async pause(options?: {
1335
+ accessList?: import('viem').AccessList;
1336
+ authorizationList?: import('viem').AuthorizationList;
1337
+ chain?: import('viem').Chain | null;
1338
+ dataSuffix?: `0x${string}`;
1339
+ gas?: bigint;
1340
+ gasPrice?: bigint;
1341
+ maxFeePerGas?: bigint;
1342
+ maxPriorityFeePerGas?: bigint;
1343
+ nonce?: number;
1344
+ value?: bigint;
1345
+ }): Promise<void> {
1346
+ return contract.simulate.pause(options) as Promise<void>;
1347
+ },
1348
+ /**
1349
+ * Simulate removeManager
1350
+ * Returns gas estimate and result without sending transaction
1351
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1352
+ */
1353
+ async removeManager(addr: `0x${string}`, options?: {
1354
+ accessList?: import('viem').AccessList;
1355
+ authorizationList?: import('viem').AuthorizationList;
1356
+ chain?: import('viem').Chain | null;
1357
+ dataSuffix?: `0x${string}`;
1358
+ gas?: bigint;
1359
+ gasPrice?: bigint;
1360
+ maxFeePerGas?: bigint;
1361
+ maxPriorityFeePerGas?: bigint;
1362
+ nonce?: number;
1363
+ value?: bigint;
1364
+ }): Promise<void> {
1365
+ return contract.simulate.removeManager([addr] as const, options) as Promise<void>;
1366
+ },
1367
+ /**
1368
+ * Simulate renounceRole
1369
+ * Returns gas estimate and result without sending transaction
1370
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1371
+ */
1372
+ async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
1373
+ accessList?: import('viem').AccessList;
1374
+ authorizationList?: import('viem').AuthorizationList;
1375
+ chain?: import('viem').Chain | null;
1376
+ dataSuffix?: `0x${string}`;
1377
+ gas?: bigint;
1378
+ gasPrice?: bigint;
1379
+ maxFeePerGas?: bigint;
1380
+ maxPriorityFeePerGas?: bigint;
1381
+ nonce?: number;
1382
+ value?: bigint;
1383
+ }): Promise<void> {
1384
+ return contract.simulate.renounceRole([role, account] as const, options) as Promise<void>;
1385
+ },
1386
+ /**
1387
+ * Simulate revokeRole
1388
+ * Returns gas estimate and result without sending transaction
1389
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1390
+ */
1391
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
1392
+ accessList?: import('viem').AccessList;
1393
+ authorizationList?: import('viem').AuthorizationList;
1394
+ chain?: import('viem').Chain | null;
1395
+ dataSuffix?: `0x${string}`;
1396
+ gas?: bigint;
1397
+ gasPrice?: bigint;
1398
+ maxFeePerGas?: bigint;
1399
+ maxPriorityFeePerGas?: bigint;
1400
+ nonce?: number;
1401
+ value?: bigint;
1402
+ }): Promise<void> {
1403
+ return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
1404
+ },
1405
+ /**
1406
+ * Simulate transfer
1407
+ * Returns gas estimate and result without sending transaction
1408
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1409
+ */
1410
+ async transfer(to: `0x${string}`, amount: bigint, options?: {
1411
+ accessList?: import('viem').AccessList;
1412
+ authorizationList?: import('viem').AuthorizationList;
1413
+ chain?: import('viem').Chain | null;
1414
+ dataSuffix?: `0x${string}`;
1415
+ gas?: bigint;
1416
+ gasPrice?: bigint;
1417
+ maxFeePerGas?: bigint;
1418
+ maxPriorityFeePerGas?: bigint;
1419
+ nonce?: number;
1420
+ value?: bigint;
1421
+ }): Promise<boolean> {
1422
+ return contract.simulate.transfer([to, amount] as const, options) as Promise<boolean>;
1423
+ },
1424
+ /**
1425
+ * Simulate transferFrom
1426
+ * Returns gas estimate and result without sending transaction
1427
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1428
+ */
1429
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
1430
+ accessList?: import('viem').AccessList;
1431
+ authorizationList?: import('viem').AuthorizationList;
1432
+ chain?: import('viem').Chain | null;
1433
+ dataSuffix?: `0x${string}`;
1434
+ gas?: bigint;
1435
+ gasPrice?: bigint;
1436
+ maxFeePerGas?: bigint;
1437
+ maxPriorityFeePerGas?: bigint;
1438
+ nonce?: number;
1439
+ value?: bigint;
1440
+ }): Promise<boolean> {
1441
+ return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
1442
+ },
1443
+ /**
1444
+ * Simulate unpause
1445
+ * Returns gas estimate and result without sending transaction
1446
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1447
+ */
1448
+ async unpause(options?: {
1449
+ accessList?: import('viem').AccessList;
1450
+ authorizationList?: import('viem').AuthorizationList;
1451
+ chain?: import('viem').Chain | null;
1452
+ dataSuffix?: `0x${string}`;
1453
+ gas?: bigint;
1454
+ gasPrice?: bigint;
1455
+ maxFeePerGas?: bigint;
1456
+ maxPriorityFeePerGas?: bigint;
1457
+ nonce?: number;
1458
+ value?: bigint;
1459
+ }): Promise<void> {
1460
+ return contract.simulate.unpause(options) as Promise<void>;
1461
+ }
1462
+ };
1463
+ }
1464
+
1465
+ /**
1466
+ * Watch contract events
1467
+ *
1468
+ * @example
1469
+ * // Watch all Transfer events
1470
+ * const unwatch = contract.watch.Transfer((event) => {
1471
+ * console.log('Transfer:', event);
1472
+ * });
1473
+ *
1474
+ * // Stop watching
1475
+ * unwatch();
1476
+ */
1477
+ get watch() {
1478
+ return {
1479
+ /**
1480
+ * Watch Approval events
1481
+ * @param callback Function to call when event is emitted
1482
+ * @param filter Optional filter for indexed parameters
1483
+ * @returns Unwatch function to stop listening
1484
+ */
1485
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
1486
+ return this.publicClient.watchContractEvent({
1487
+ address: this.contractAddress,
1488
+ abi: RootTokenAbi,
1489
+ eventName: 'Approval',
1490
+ args: filter as any,
1491
+ onLogs: (logs: any[]) => {
1492
+ logs.forEach((log: any) => {
1493
+ callback(log.args as any);
1494
+ });
1495
+ },
1496
+ }) as () => void;
1497
+ },
1498
+ /**
1499
+ * Watch Paused events
1500
+ * @param callback Function to call when event is emitted
1501
+ * @param filter Optional filter for indexed parameters
1502
+ * @returns Unwatch function to stop listening
1503
+ */
1504
+ Paused: (callback: (event: { account: `0x${string}` }) => void) => {
1505
+ return this.publicClient.watchContractEvent({
1506
+ address: this.contractAddress,
1507
+ abi: RootTokenAbi,
1508
+ eventName: 'Paused',
1509
+
1510
+ onLogs: (logs: any[]) => {
1511
+ logs.forEach((log: any) => {
1512
+ callback(log.args as any);
1513
+ });
1514
+ },
1515
+ }) as () => void;
1516
+ },
1517
+ /**
1518
+ * Watch RoleAdminChanged events
1519
+ * @param callback Function to call when event is emitted
1520
+ * @param filter Optional filter for indexed parameters
1521
+ * @returns Unwatch function to stop listening
1522
+ */
1523
+ RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; previousAdminRole?: `0x${string}` | `0x${string}`[] | null; newAdminRole?: `0x${string}` | `0x${string}`[] | null }) => {
1524
+ return this.publicClient.watchContractEvent({
1525
+ address: this.contractAddress,
1526
+ abi: RootTokenAbi,
1527
+ eventName: 'RoleAdminChanged',
1528
+ args: filter as any,
1529
+ onLogs: (logs: any[]) => {
1530
+ logs.forEach((log: any) => {
1531
+ callback(log.args as any);
1532
+ });
1533
+ },
1534
+ }) as () => void;
1535
+ },
1536
+ /**
1537
+ * Watch RoleGranted events
1538
+ * @param callback Function to call when event is emitted
1539
+ * @param filter Optional filter for indexed parameters
1540
+ * @returns Unwatch function to stop listening
1541
+ */
1542
+ RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
1543
+ return this.publicClient.watchContractEvent({
1544
+ address: this.contractAddress,
1545
+ abi: RootTokenAbi,
1546
+ eventName: 'RoleGranted',
1547
+ args: filter as any,
1548
+ onLogs: (logs: any[]) => {
1549
+ logs.forEach((log: any) => {
1550
+ callback(log.args as any);
1551
+ });
1552
+ },
1553
+ }) as () => void;
1554
+ },
1555
+ /**
1556
+ * Watch RoleRevoked events
1557
+ * @param callback Function to call when event is emitted
1558
+ * @param filter Optional filter for indexed parameters
1559
+ * @returns Unwatch function to stop listening
1560
+ */
1561
+ RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
1562
+ return this.publicClient.watchContractEvent({
1563
+ address: this.contractAddress,
1564
+ abi: RootTokenAbi,
1565
+ eventName: 'RoleRevoked',
1566
+ args: filter as any,
1567
+ onLogs: (logs: any[]) => {
1568
+ logs.forEach((log: any) => {
1569
+ callback(log.args as any);
1570
+ });
1571
+ },
1572
+ }) as () => void;
1573
+ },
1574
+ /**
1575
+ * Watch Transfer events
1576
+ * @param callback Function to call when event is emitted
1577
+ * @param filter Optional filter for indexed parameters
1578
+ * @returns Unwatch function to stop listening
1579
+ */
1580
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
1581
+ return this.publicClient.watchContractEvent({
1582
+ address: this.contractAddress,
1583
+ abi: RootTokenAbi,
1584
+ eventName: 'Transfer',
1585
+ args: filter as any,
1586
+ onLogs: (logs: any[]) => {
1587
+ logs.forEach((log: any) => {
1588
+ callback(log.args as any);
1589
+ });
1590
+ },
1591
+ }) as () => void;
1592
+ },
1593
+ /**
1594
+ * Watch Unpaused events
1595
+ * @param callback Function to call when event is emitted
1596
+ * @param filter Optional filter for indexed parameters
1597
+ * @returns Unwatch function to stop listening
1598
+ */
1599
+ Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
1600
+ return this.publicClient.watchContractEvent({
1601
+ address: this.contractAddress,
1602
+ abi: RootTokenAbi,
1603
+ eventName: 'Unpaused',
1604
+
1605
+ onLogs: (logs: any[]) => {
1606
+ logs.forEach((log: any) => {
1607
+ callback(log.args as any);
1608
+ });
1609
+ },
1610
+ }) as () => void;
1611
+ }
1612
+ };
1613
+ }
1614
+ }