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