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