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