@gitmyabi-stg/crclon 0.0.1

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