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