@gitmyabi/bax 1.0.0

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