@gitmyabi-stg/ath 0.0.1

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