@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,1172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AGGToken_json = exports.AGGToken_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * AGGToken_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.AGGToken_jsonAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "string",
15
+ "name": "_name",
16
+ "type": "string"
17
+ },
18
+ {
19
+ "internalType": "string",
20
+ "name": "_symbol",
21
+ "type": "string"
22
+ }
23
+ ],
24
+ "stateMutability": "nonpayable",
25
+ "type": "constructor"
26
+ },
27
+ {
28
+ "anonymous": false,
29
+ "inputs": [
30
+ {
31
+ "indexed": true,
32
+ "internalType": "address",
33
+ "name": "owner",
34
+ "type": "address"
35
+ },
36
+ {
37
+ "indexed": true,
38
+ "internalType": "address",
39
+ "name": "spender",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "indexed": false,
44
+ "internalType": "uint256",
45
+ "name": "value",
46
+ "type": "uint256"
47
+ }
48
+ ],
49
+ "name": "Approval",
50
+ "type": "event"
51
+ },
52
+ {
53
+ "anonymous": false,
54
+ "inputs": [
55
+ {
56
+ "indexed": false,
57
+ "internalType": "address",
58
+ "name": "account",
59
+ "type": "address"
60
+ }
61
+ ],
62
+ "name": "Paused",
63
+ "type": "event"
64
+ },
65
+ {
66
+ "anonymous": false,
67
+ "inputs": [
68
+ {
69
+ "indexed": true,
70
+ "internalType": "bytes32",
71
+ "name": "role",
72
+ "type": "bytes32"
73
+ },
74
+ {
75
+ "indexed": true,
76
+ "internalType": "bytes32",
77
+ "name": "previousAdminRole",
78
+ "type": "bytes32"
79
+ },
80
+ {
81
+ "indexed": true,
82
+ "internalType": "bytes32",
83
+ "name": "newAdminRole",
84
+ "type": "bytes32"
85
+ }
86
+ ],
87
+ "name": "RoleAdminChanged",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": true,
95
+ "internalType": "bytes32",
96
+ "name": "role",
97
+ "type": "bytes32"
98
+ },
99
+ {
100
+ "indexed": true,
101
+ "internalType": "address",
102
+ "name": "account",
103
+ "type": "address"
104
+ },
105
+ {
106
+ "indexed": true,
107
+ "internalType": "address",
108
+ "name": "sender",
109
+ "type": "address"
110
+ }
111
+ ],
112
+ "name": "RoleGranted",
113
+ "type": "event"
114
+ },
115
+ {
116
+ "anonymous": false,
117
+ "inputs": [
118
+ {
119
+ "indexed": true,
120
+ "internalType": "bytes32",
121
+ "name": "role",
122
+ "type": "bytes32"
123
+ },
124
+ {
125
+ "indexed": true,
126
+ "internalType": "address",
127
+ "name": "account",
128
+ "type": "address"
129
+ },
130
+ {
131
+ "indexed": true,
132
+ "internalType": "address",
133
+ "name": "sender",
134
+ "type": "address"
135
+ }
136
+ ],
137
+ "name": "RoleRevoked",
138
+ "type": "event"
139
+ },
140
+ {
141
+ "anonymous": false,
142
+ "inputs": [
143
+ {
144
+ "indexed": true,
145
+ "internalType": "address",
146
+ "name": "from",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "indexed": true,
151
+ "internalType": "address",
152
+ "name": "to",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "indexed": false,
157
+ "internalType": "uint256",
158
+ "name": "value",
159
+ "type": "uint256"
160
+ }
161
+ ],
162
+ "name": "Transfer",
163
+ "type": "event"
164
+ },
165
+ {
166
+ "anonymous": false,
167
+ "inputs": [
168
+ {
169
+ "indexed": false,
170
+ "internalType": "address",
171
+ "name": "account",
172
+ "type": "address"
173
+ }
174
+ ],
175
+ "name": "Unpaused",
176
+ "type": "event"
177
+ },
178
+ {
179
+ "inputs": [],
180
+ "name": "BURNER_ROLE",
181
+ "outputs": [
182
+ {
183
+ "internalType": "bytes32",
184
+ "name": "",
185
+ "type": "bytes32"
186
+ }
187
+ ],
188
+ "stateMutability": "view",
189
+ "type": "function"
190
+ },
191
+ {
192
+ "inputs": [],
193
+ "name": "DEFAULT_ADMIN_ROLE",
194
+ "outputs": [
195
+ {
196
+ "internalType": "bytes32",
197
+ "name": "",
198
+ "type": "bytes32"
199
+ }
200
+ ],
201
+ "stateMutability": "view",
202
+ "type": "function"
203
+ },
204
+ {
205
+ "inputs": [],
206
+ "name": "MAX_SUPPLY",
207
+ "outputs": [
208
+ {
209
+ "internalType": "uint256",
210
+ "name": "",
211
+ "type": "uint256"
212
+ }
213
+ ],
214
+ "stateMutability": "view",
215
+ "type": "function"
216
+ },
217
+ {
218
+ "inputs": [],
219
+ "name": "MINTER_ROLE",
220
+ "outputs": [
221
+ {
222
+ "internalType": "bytes32",
223
+ "name": "",
224
+ "type": "bytes32"
225
+ }
226
+ ],
227
+ "stateMutability": "view",
228
+ "type": "function"
229
+ },
230
+ {
231
+ "inputs": [
232
+ {
233
+ "internalType": "address",
234
+ "name": "owner",
235
+ "type": "address"
236
+ },
237
+ {
238
+ "internalType": "address",
239
+ "name": "spender",
240
+ "type": "address"
241
+ }
242
+ ],
243
+ "name": "allowance",
244
+ "outputs": [
245
+ {
246
+ "internalType": "uint256",
247
+ "name": "",
248
+ "type": "uint256"
249
+ }
250
+ ],
251
+ "stateMutability": "view",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [
256
+ {
257
+ "internalType": "address",
258
+ "name": "spender",
259
+ "type": "address"
260
+ },
261
+ {
262
+ "internalType": "uint256",
263
+ "name": "amount",
264
+ "type": "uint256"
265
+ }
266
+ ],
267
+ "name": "approve",
268
+ "outputs": [
269
+ {
270
+ "internalType": "bool",
271
+ "name": "",
272
+ "type": "bool"
273
+ }
274
+ ],
275
+ "stateMutability": "nonpayable",
276
+ "type": "function"
277
+ },
278
+ {
279
+ "inputs": [
280
+ {
281
+ "internalType": "address",
282
+ "name": "account",
283
+ "type": "address"
284
+ }
285
+ ],
286
+ "name": "balanceOf",
287
+ "outputs": [
288
+ {
289
+ "internalType": "uint256",
290
+ "name": "",
291
+ "type": "uint256"
292
+ }
293
+ ],
294
+ "stateMutability": "view",
295
+ "type": "function"
296
+ },
297
+ {
298
+ "inputs": [
299
+ {
300
+ "internalType": "uint256",
301
+ "name": "_amount",
302
+ "type": "uint256"
303
+ }
304
+ ],
305
+ "name": "burn",
306
+ "outputs": [],
307
+ "stateMutability": "nonpayable",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "inputs": [],
312
+ "name": "decimals",
313
+ "outputs": [
314
+ {
315
+ "internalType": "uint8",
316
+ "name": "",
317
+ "type": "uint8"
318
+ }
319
+ ],
320
+ "stateMutability": "view",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [
325
+ {
326
+ "internalType": "address",
327
+ "name": "spender",
328
+ "type": "address"
329
+ },
330
+ {
331
+ "internalType": "uint256",
332
+ "name": "subtractedValue",
333
+ "type": "uint256"
334
+ }
335
+ ],
336
+ "name": "decreaseAllowance",
337
+ "outputs": [
338
+ {
339
+ "internalType": "bool",
340
+ "name": "",
341
+ "type": "bool"
342
+ }
343
+ ],
344
+ "stateMutability": "nonpayable",
345
+ "type": "function"
346
+ },
347
+ {
348
+ "inputs": [
349
+ {
350
+ "internalType": "bytes32",
351
+ "name": "role",
352
+ "type": "bytes32"
353
+ }
354
+ ],
355
+ "name": "getRoleAdmin",
356
+ "outputs": [
357
+ {
358
+ "internalType": "bytes32",
359
+ "name": "",
360
+ "type": "bytes32"
361
+ }
362
+ ],
363
+ "stateMutability": "view",
364
+ "type": "function"
365
+ },
366
+ {
367
+ "inputs": [
368
+ {
369
+ "internalType": "bytes32",
370
+ "name": "role",
371
+ "type": "bytes32"
372
+ },
373
+ {
374
+ "internalType": "address",
375
+ "name": "account",
376
+ "type": "address"
377
+ }
378
+ ],
379
+ "name": "grantRole",
380
+ "outputs": [],
381
+ "stateMutability": "nonpayable",
382
+ "type": "function"
383
+ },
384
+ {
385
+ "inputs": [
386
+ {
387
+ "internalType": "bytes32",
388
+ "name": "role",
389
+ "type": "bytes32"
390
+ },
391
+ {
392
+ "internalType": "address",
393
+ "name": "account",
394
+ "type": "address"
395
+ }
396
+ ],
397
+ "name": "hasRole",
398
+ "outputs": [
399
+ {
400
+ "internalType": "bool",
401
+ "name": "",
402
+ "type": "bool"
403
+ }
404
+ ],
405
+ "stateMutability": "view",
406
+ "type": "function"
407
+ },
408
+ {
409
+ "inputs": [
410
+ {
411
+ "internalType": "address",
412
+ "name": "spender",
413
+ "type": "address"
414
+ },
415
+ {
416
+ "internalType": "uint256",
417
+ "name": "addedValue",
418
+ "type": "uint256"
419
+ }
420
+ ],
421
+ "name": "increaseAllowance",
422
+ "outputs": [
423
+ {
424
+ "internalType": "bool",
425
+ "name": "",
426
+ "type": "bool"
427
+ }
428
+ ],
429
+ "stateMutability": "nonpayable",
430
+ "type": "function"
431
+ },
432
+ {
433
+ "inputs": [
434
+ {
435
+ "internalType": "address",
436
+ "name": "to",
437
+ "type": "address"
438
+ },
439
+ {
440
+ "internalType": "uint256",
441
+ "name": "amount",
442
+ "type": "uint256"
443
+ }
444
+ ],
445
+ "name": "mint",
446
+ "outputs": [],
447
+ "stateMutability": "nonpayable",
448
+ "type": "function"
449
+ },
450
+ {
451
+ "inputs": [],
452
+ "name": "name",
453
+ "outputs": [
454
+ {
455
+ "internalType": "string",
456
+ "name": "",
457
+ "type": "string"
458
+ }
459
+ ],
460
+ "stateMutability": "view",
461
+ "type": "function"
462
+ },
463
+ {
464
+ "inputs": [],
465
+ "name": "pause",
466
+ "outputs": [],
467
+ "stateMutability": "nonpayable",
468
+ "type": "function"
469
+ },
470
+ {
471
+ "inputs": [],
472
+ "name": "paused",
473
+ "outputs": [
474
+ {
475
+ "internalType": "bool",
476
+ "name": "",
477
+ "type": "bool"
478
+ }
479
+ ],
480
+ "stateMutability": "view",
481
+ "type": "function"
482
+ },
483
+ {
484
+ "inputs": [
485
+ {
486
+ "internalType": "bytes32",
487
+ "name": "role",
488
+ "type": "bytes32"
489
+ },
490
+ {
491
+ "internalType": "address",
492
+ "name": "account",
493
+ "type": "address"
494
+ }
495
+ ],
496
+ "name": "renounceRole",
497
+ "outputs": [],
498
+ "stateMutability": "nonpayable",
499
+ "type": "function"
500
+ },
501
+ {
502
+ "inputs": [
503
+ {
504
+ "internalType": "bytes32",
505
+ "name": "role",
506
+ "type": "bytes32"
507
+ },
508
+ {
509
+ "internalType": "address",
510
+ "name": "account",
511
+ "type": "address"
512
+ }
513
+ ],
514
+ "name": "revokeRole",
515
+ "outputs": [],
516
+ "stateMutability": "nonpayable",
517
+ "type": "function"
518
+ },
519
+ {
520
+ "inputs": [
521
+ {
522
+ "internalType": "bytes4",
523
+ "name": "interfaceId",
524
+ "type": "bytes4"
525
+ }
526
+ ],
527
+ "name": "supportsInterface",
528
+ "outputs": [
529
+ {
530
+ "internalType": "bool",
531
+ "name": "",
532
+ "type": "bool"
533
+ }
534
+ ],
535
+ "stateMutability": "view",
536
+ "type": "function"
537
+ },
538
+ {
539
+ "inputs": [],
540
+ "name": "symbol",
541
+ "outputs": [
542
+ {
543
+ "internalType": "string",
544
+ "name": "",
545
+ "type": "string"
546
+ }
547
+ ],
548
+ "stateMutability": "view",
549
+ "type": "function"
550
+ },
551
+ {
552
+ "inputs": [],
553
+ "name": "totalSupply",
554
+ "outputs": [
555
+ {
556
+ "internalType": "uint256",
557
+ "name": "",
558
+ "type": "uint256"
559
+ }
560
+ ],
561
+ "stateMutability": "view",
562
+ "type": "function"
563
+ },
564
+ {
565
+ "inputs": [
566
+ {
567
+ "internalType": "address",
568
+ "name": "to",
569
+ "type": "address"
570
+ },
571
+ {
572
+ "internalType": "uint256",
573
+ "name": "amount",
574
+ "type": "uint256"
575
+ }
576
+ ],
577
+ "name": "transfer",
578
+ "outputs": [
579
+ {
580
+ "internalType": "bool",
581
+ "name": "",
582
+ "type": "bool"
583
+ }
584
+ ],
585
+ "stateMutability": "nonpayable",
586
+ "type": "function"
587
+ },
588
+ {
589
+ "inputs": [
590
+ {
591
+ "internalType": "address",
592
+ "name": "from",
593
+ "type": "address"
594
+ },
595
+ {
596
+ "internalType": "address",
597
+ "name": "to",
598
+ "type": "address"
599
+ },
600
+ {
601
+ "internalType": "uint256",
602
+ "name": "amount",
603
+ "type": "uint256"
604
+ }
605
+ ],
606
+ "name": "transferFrom",
607
+ "outputs": [
608
+ {
609
+ "internalType": "bool",
610
+ "name": "",
611
+ "type": "bool"
612
+ }
613
+ ],
614
+ "stateMutability": "nonpayable",
615
+ "type": "function"
616
+ },
617
+ {
618
+ "inputs": [],
619
+ "name": "unpause",
620
+ "outputs": [],
621
+ "stateMutability": "nonpayable",
622
+ "type": "function"
623
+ }
624
+ ];
625
+ /**
626
+ * AGGToken_json Contract Class
627
+ *
628
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
629
+ *
630
+ * @example
631
+ * ```typescript
632
+ * import { createPublicClient, createWalletClient, http } from 'viem';
633
+ * import { mainnet } from 'viem/chains';
634
+ * import { AGGToken_json } from 'AGGToken_json';
635
+ *
636
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
637
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
638
+ *
639
+ * const contract = new AGGToken_json('0x...', { publicClient, walletClient });
640
+ *
641
+ * // Read functions
642
+ * const result = await contract.balanceOf('0x...');
643
+ *
644
+ * // Write functions
645
+ * const hash = await contract.transfer('0x...', 1000n);
646
+ *
647
+ * // Simulate transactions (dry-run)
648
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
649
+ * console.log('Gas estimate:', simulation.request.gas);
650
+ *
651
+ * // Watch events
652
+ * const unwatch = contract.watch.Transfer((event) => {
653
+ * console.log('Transfer event:', event);
654
+ * });
655
+ * ```
656
+ */
657
+ class AGGToken_json {
658
+ constructor(address, clients) {
659
+ this.contractAddress = address;
660
+ this.publicClient = clients.publicClient;
661
+ this.contract = (0, viem_1.getContract)({
662
+ address,
663
+ abi: exports.AGGToken_jsonAbi,
664
+ client: {
665
+ public: clients.publicClient,
666
+ wallet: clients.walletClient,
667
+ },
668
+ });
669
+ }
670
+ /**
671
+ * Get the contract address
672
+ */
673
+ get address() {
674
+ return this.contractAddress;
675
+ }
676
+ /**
677
+ * Get the underlying viem contract instance
678
+ */
679
+ getContract() {
680
+ return this.contract;
681
+ }
682
+ /**
683
+ * BURNER_ROLE
684
+ * view
685
+ */
686
+ async BURNER_ROLE() {
687
+ return this.contract.read.BURNER_ROLE();
688
+ }
689
+ /**
690
+ * DEFAULT_ADMIN_ROLE
691
+ * view
692
+ */
693
+ async DEFAULT_ADMIN_ROLE() {
694
+ return this.contract.read.DEFAULT_ADMIN_ROLE();
695
+ }
696
+ /**
697
+ * MAX_SUPPLY
698
+ * view
699
+ */
700
+ async MAX_SUPPLY() {
701
+ return this.contract.read.MAX_SUPPLY();
702
+ }
703
+ /**
704
+ * MINTER_ROLE
705
+ * view
706
+ */
707
+ async MINTER_ROLE() {
708
+ return this.contract.read.MINTER_ROLE();
709
+ }
710
+ /**
711
+ * allowance
712
+ * view
713
+ */
714
+ async allowance(owner, spender) {
715
+ return this.contract.read.allowance([owner, spender]);
716
+ }
717
+ /**
718
+ * balanceOf
719
+ * view
720
+ */
721
+ async balanceOf(account) {
722
+ return this.contract.read.balanceOf([account]);
723
+ }
724
+ /**
725
+ * decimals
726
+ * view
727
+ */
728
+ async decimals() {
729
+ return this.contract.read.decimals();
730
+ }
731
+ /**
732
+ * getRoleAdmin
733
+ * view
734
+ */
735
+ async getRoleAdmin(role) {
736
+ return this.contract.read.getRoleAdmin([role]);
737
+ }
738
+ /**
739
+ * hasRole
740
+ * view
741
+ */
742
+ async hasRole(role, account) {
743
+ return this.contract.read.hasRole([role, account]);
744
+ }
745
+ /**
746
+ * name
747
+ * view
748
+ */
749
+ async name() {
750
+ return this.contract.read.name();
751
+ }
752
+ /**
753
+ * paused
754
+ * view
755
+ */
756
+ async paused() {
757
+ return this.contract.read.paused();
758
+ }
759
+ /**
760
+ * supportsInterface
761
+ * view
762
+ */
763
+ async supportsInterface(interfaceId) {
764
+ return this.contract.read.supportsInterface([interfaceId]);
765
+ }
766
+ /**
767
+ * symbol
768
+ * view
769
+ */
770
+ async symbol() {
771
+ return this.contract.read.symbol();
772
+ }
773
+ /**
774
+ * totalSupply
775
+ * view
776
+ */
777
+ async totalSupply() {
778
+ return this.contract.read.totalSupply();
779
+ }
780
+ /**
781
+ * approve
782
+ * nonpayable
783
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
784
+ */
785
+ async approve(spender, amount, options) {
786
+ if (!this.contract.write) {
787
+ throw new Error('Wallet client is required for write operations');
788
+ }
789
+ return this.contract.write.approve([spender, amount], options);
790
+ }
791
+ /**
792
+ * burn
793
+ * nonpayable
794
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
795
+ */
796
+ async burn(_amount, options) {
797
+ if (!this.contract.write) {
798
+ throw new Error('Wallet client is required for write operations');
799
+ }
800
+ return this.contract.write.burn([_amount], options);
801
+ }
802
+ /**
803
+ * decreaseAllowance
804
+ * nonpayable
805
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
806
+ */
807
+ async decreaseAllowance(spender, subtractedValue, options) {
808
+ if (!this.contract.write) {
809
+ throw new Error('Wallet client is required for write operations');
810
+ }
811
+ return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
812
+ }
813
+ /**
814
+ * grantRole
815
+ * nonpayable
816
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
817
+ */
818
+ async grantRole(role, account, options) {
819
+ if (!this.contract.write) {
820
+ throw new Error('Wallet client is required for write operations');
821
+ }
822
+ return this.contract.write.grantRole([role, account], options);
823
+ }
824
+ /**
825
+ * increaseAllowance
826
+ * nonpayable
827
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
828
+ */
829
+ async increaseAllowance(spender, addedValue, options) {
830
+ if (!this.contract.write) {
831
+ throw new Error('Wallet client is required for write operations');
832
+ }
833
+ return this.contract.write.increaseAllowance([spender, addedValue], options);
834
+ }
835
+ /**
836
+ * mint
837
+ * nonpayable
838
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
839
+ */
840
+ async mint(to, amount, options) {
841
+ if (!this.contract.write) {
842
+ throw new Error('Wallet client is required for write operations');
843
+ }
844
+ return this.contract.write.mint([to, amount], options);
845
+ }
846
+ /**
847
+ * pause
848
+ * nonpayable
849
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
850
+ */
851
+ async pause(options) {
852
+ if (!this.contract.write) {
853
+ throw new Error('Wallet client is required for write operations');
854
+ }
855
+ return this.contract.write.pause(options);
856
+ }
857
+ /**
858
+ * renounceRole
859
+ * nonpayable
860
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
861
+ */
862
+ async renounceRole(role, account, options) {
863
+ if (!this.contract.write) {
864
+ throw new Error('Wallet client is required for write operations');
865
+ }
866
+ return this.contract.write.renounceRole([role, account], options);
867
+ }
868
+ /**
869
+ * revokeRole
870
+ * nonpayable
871
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
872
+ */
873
+ async revokeRole(role, account, options) {
874
+ if (!this.contract.write) {
875
+ throw new Error('Wallet client is required for write operations');
876
+ }
877
+ return this.contract.write.revokeRole([role, account], options);
878
+ }
879
+ /**
880
+ * transfer
881
+ * nonpayable
882
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
883
+ */
884
+ async transfer(to, amount, options) {
885
+ if (!this.contract.write) {
886
+ throw new Error('Wallet client is required for write operations');
887
+ }
888
+ return this.contract.write.transfer([to, amount], options);
889
+ }
890
+ /**
891
+ * transferFrom
892
+ * nonpayable
893
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
894
+ */
895
+ async transferFrom(from, to, amount, options) {
896
+ if (!this.contract.write) {
897
+ throw new Error('Wallet client is required for write operations');
898
+ }
899
+ return this.contract.write.transferFrom([from, to, amount], options);
900
+ }
901
+ /**
902
+ * unpause
903
+ * nonpayable
904
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
905
+ */
906
+ async unpause(options) {
907
+ if (!this.contract.write) {
908
+ throw new Error('Wallet client is required for write operations');
909
+ }
910
+ return this.contract.write.unpause(options);
911
+ }
912
+ /**
913
+ * Simulate contract write operations (dry-run without sending transaction)
914
+ *
915
+ * @example
916
+ * const result = await contract.simulate.transfer('0x...', 1000n);
917
+ * console.log('Gas estimate:', result.request.gas);
918
+ * console.log('Would succeed:', result.result);
919
+ */
920
+ get simulate() {
921
+ const contract = this.contract;
922
+ if (!contract.simulate) {
923
+ throw new Error('Public client is required for simulation');
924
+ }
925
+ return {
926
+ /**
927
+ * Simulate approve
928
+ * Returns gas estimate and result without sending transaction
929
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
930
+ */
931
+ async approve(spender, amount, options) {
932
+ return contract.simulate.approve([spender, amount], options);
933
+ },
934
+ /**
935
+ * Simulate burn
936
+ * Returns gas estimate and result without sending transaction
937
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
938
+ */
939
+ async burn(_amount, options) {
940
+ return contract.simulate.burn([_amount], options);
941
+ },
942
+ /**
943
+ * Simulate decreaseAllowance
944
+ * Returns gas estimate and result without sending transaction
945
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
946
+ */
947
+ async decreaseAllowance(spender, subtractedValue, options) {
948
+ return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
949
+ },
950
+ /**
951
+ * Simulate grantRole
952
+ * Returns gas estimate and result without sending transaction
953
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
954
+ */
955
+ async grantRole(role, account, options) {
956
+ return contract.simulate.grantRole([role, account], options);
957
+ },
958
+ /**
959
+ * Simulate increaseAllowance
960
+ * Returns gas estimate and result without sending transaction
961
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
962
+ */
963
+ async increaseAllowance(spender, addedValue, options) {
964
+ return contract.simulate.increaseAllowance([spender, addedValue], options);
965
+ },
966
+ /**
967
+ * Simulate mint
968
+ * Returns gas estimate and result without sending transaction
969
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
970
+ */
971
+ async mint(to, amount, options) {
972
+ return contract.simulate.mint([to, amount], options);
973
+ },
974
+ /**
975
+ * Simulate pause
976
+ * Returns gas estimate and result without sending transaction
977
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
978
+ */
979
+ async pause(options) {
980
+ return contract.simulate.pause(options);
981
+ },
982
+ /**
983
+ * Simulate renounceRole
984
+ * Returns gas estimate and result without sending transaction
985
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
986
+ */
987
+ async renounceRole(role, account, options) {
988
+ return contract.simulate.renounceRole([role, account], options);
989
+ },
990
+ /**
991
+ * Simulate revokeRole
992
+ * Returns gas estimate and result without sending transaction
993
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
994
+ */
995
+ async revokeRole(role, account, options) {
996
+ return contract.simulate.revokeRole([role, account], options);
997
+ },
998
+ /**
999
+ * Simulate transfer
1000
+ * Returns gas estimate and result without sending transaction
1001
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1002
+ */
1003
+ async transfer(to, amount, options) {
1004
+ return contract.simulate.transfer([to, amount], options);
1005
+ },
1006
+ /**
1007
+ * Simulate transferFrom
1008
+ * Returns gas estimate and result without sending transaction
1009
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1010
+ */
1011
+ async transferFrom(from, to, amount, options) {
1012
+ return contract.simulate.transferFrom([from, to, amount], options);
1013
+ },
1014
+ /**
1015
+ * Simulate unpause
1016
+ * Returns gas estimate and result without sending transaction
1017
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1018
+ */
1019
+ async unpause(options) {
1020
+ return contract.simulate.unpause(options);
1021
+ }
1022
+ };
1023
+ }
1024
+ /**
1025
+ * Watch contract events
1026
+ *
1027
+ * @example
1028
+ * // Watch all Transfer events
1029
+ * const unwatch = contract.watch.Transfer((event) => {
1030
+ * console.log('Transfer:', event);
1031
+ * });
1032
+ *
1033
+ * // Stop watching
1034
+ * unwatch();
1035
+ */
1036
+ get watch() {
1037
+ return {
1038
+ /**
1039
+ * Watch Approval events
1040
+ * @param callback Function to call when event is emitted
1041
+ * @param filter Optional filter for indexed parameters
1042
+ * @returns Unwatch function to stop listening
1043
+ */
1044
+ Approval: (callback, filter) => {
1045
+ return this.publicClient.watchContractEvent({
1046
+ address: this.contractAddress,
1047
+ abi: exports.AGGToken_jsonAbi,
1048
+ eventName: 'Approval',
1049
+ args: filter,
1050
+ onLogs: (logs) => {
1051
+ logs.forEach((log) => {
1052
+ callback(log.args);
1053
+ });
1054
+ },
1055
+ });
1056
+ },
1057
+ /**
1058
+ * Watch Paused events
1059
+ * @param callback Function to call when event is emitted
1060
+ * @param filter Optional filter for indexed parameters
1061
+ * @returns Unwatch function to stop listening
1062
+ */
1063
+ Paused: (callback) => {
1064
+ return this.publicClient.watchContractEvent({
1065
+ address: this.contractAddress,
1066
+ abi: exports.AGGToken_jsonAbi,
1067
+ eventName: 'Paused',
1068
+ onLogs: (logs) => {
1069
+ logs.forEach((log) => {
1070
+ callback(log.args);
1071
+ });
1072
+ },
1073
+ });
1074
+ },
1075
+ /**
1076
+ * Watch RoleAdminChanged events
1077
+ * @param callback Function to call when event is emitted
1078
+ * @param filter Optional filter for indexed parameters
1079
+ * @returns Unwatch function to stop listening
1080
+ */
1081
+ RoleAdminChanged: (callback, filter) => {
1082
+ return this.publicClient.watchContractEvent({
1083
+ address: this.contractAddress,
1084
+ abi: exports.AGGToken_jsonAbi,
1085
+ eventName: 'RoleAdminChanged',
1086
+ args: filter,
1087
+ onLogs: (logs) => {
1088
+ logs.forEach((log) => {
1089
+ callback(log.args);
1090
+ });
1091
+ },
1092
+ });
1093
+ },
1094
+ /**
1095
+ * Watch RoleGranted events
1096
+ * @param callback Function to call when event is emitted
1097
+ * @param filter Optional filter for indexed parameters
1098
+ * @returns Unwatch function to stop listening
1099
+ */
1100
+ RoleGranted: (callback, filter) => {
1101
+ return this.publicClient.watchContractEvent({
1102
+ address: this.contractAddress,
1103
+ abi: exports.AGGToken_jsonAbi,
1104
+ eventName: 'RoleGranted',
1105
+ args: filter,
1106
+ onLogs: (logs) => {
1107
+ logs.forEach((log) => {
1108
+ callback(log.args);
1109
+ });
1110
+ },
1111
+ });
1112
+ },
1113
+ /**
1114
+ * Watch RoleRevoked events
1115
+ * @param callback Function to call when event is emitted
1116
+ * @param filter Optional filter for indexed parameters
1117
+ * @returns Unwatch function to stop listening
1118
+ */
1119
+ RoleRevoked: (callback, filter) => {
1120
+ return this.publicClient.watchContractEvent({
1121
+ address: this.contractAddress,
1122
+ abi: exports.AGGToken_jsonAbi,
1123
+ eventName: 'RoleRevoked',
1124
+ args: filter,
1125
+ onLogs: (logs) => {
1126
+ logs.forEach((log) => {
1127
+ callback(log.args);
1128
+ });
1129
+ },
1130
+ });
1131
+ },
1132
+ /**
1133
+ * Watch Transfer events
1134
+ * @param callback Function to call when event is emitted
1135
+ * @param filter Optional filter for indexed parameters
1136
+ * @returns Unwatch function to stop listening
1137
+ */
1138
+ Transfer: (callback, filter) => {
1139
+ return this.publicClient.watchContractEvent({
1140
+ address: this.contractAddress,
1141
+ abi: exports.AGGToken_jsonAbi,
1142
+ eventName: 'Transfer',
1143
+ args: filter,
1144
+ onLogs: (logs) => {
1145
+ logs.forEach((log) => {
1146
+ callback(log.args);
1147
+ });
1148
+ },
1149
+ });
1150
+ },
1151
+ /**
1152
+ * Watch Unpaused events
1153
+ * @param callback Function to call when event is emitted
1154
+ * @param filter Optional filter for indexed parameters
1155
+ * @returns Unwatch function to stop listening
1156
+ */
1157
+ Unpaused: (callback) => {
1158
+ return this.publicClient.watchContractEvent({
1159
+ address: this.contractAddress,
1160
+ abi: exports.AGGToken_jsonAbi,
1161
+ eventName: 'Unpaused',
1162
+ onLogs: (logs) => {
1163
+ logs.forEach((log) => {
1164
+ callback(log.args);
1165
+ });
1166
+ },
1167
+ });
1168
+ }
1169
+ };
1170
+ }
1171
+ }
1172
+ exports.AGGToken_json = AGGToken_json;