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