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