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