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