@gitmyabi-stg/usdt 0.0.2

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