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