@gitmyabi/usdt 1.0.3 → 1.0.4

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.
@@ -1,47 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TetherUSD_json = exports.TetherUSD_jsonAbi = void 0;
3
+ exports.USDToken_json = exports.USDToken_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * TetherUSD_json ABI
6
+ * USDToken_json ABI
7
7
  *
8
8
  * This ABI is typed using viem's type system for full type safety.
9
9
  */
10
- exports.TetherUSD_jsonAbi = [
10
+ exports.USDToken_jsonAbi = [
11
11
  {
12
- "inputs": [
13
- {
14
- "internalType": "string",
15
- "name": "name_",
16
- "type": "string"
17
- },
18
- {
19
- "internalType": "string",
20
- "name": "symbol_",
21
- "type": "string"
22
- },
23
- {
24
- "internalType": "uint256",
25
- "name": "decimals_",
26
- "type": "uint256"
27
- },
28
- {
29
- "internalType": "uint256",
30
- "name": "initialBalance_",
31
- "type": "uint256"
32
- },
33
- {
34
- "internalType": "address",
35
- "name": "tokenOwner",
36
- "type": "address"
37
- },
38
- {
39
- "internalType": "address payable",
40
- "name": "feeReceiver_",
41
- "type": "address"
42
- }
43
- ],
44
- "stateMutability": "payable",
12
+ "inputs": [],
13
+ "stateMutability": "nonpayable",
45
14
  "type": "constructor"
46
15
  },
47
16
  {
@@ -69,6 +38,19 @@ exports.TetherUSD_jsonAbi = [
69
38
  "name": "Approval",
70
39
  "type": "event"
71
40
  },
41
+ {
42
+ "anonymous": false,
43
+ "inputs": [
44
+ {
45
+ "indexed": false,
46
+ "internalType": "string",
47
+ "name": "newName",
48
+ "type": "string"
49
+ }
50
+ ],
51
+ "name": "NameChanged",
52
+ "type": "event"
53
+ },
72
54
  {
73
55
  "anonymous": false,
74
56
  "inputs": [
@@ -77,15 +59,22 @@ exports.TetherUSD_jsonAbi = [
77
59
  "internalType": "address",
78
60
  "name": "previousOwner",
79
61
  "type": "address"
80
- },
62
+ }
63
+ ],
64
+ "name": "OwnershipRenounced",
65
+ "type": "event"
66
+ },
67
+ {
68
+ "anonymous": false,
69
+ "inputs": [
81
70
  {
82
- "indexed": true,
83
- "internalType": "address",
84
- "name": "newOwner",
85
- "type": "address"
71
+ "indexed": false,
72
+ "internalType": "string",
73
+ "name": "newSymbol",
74
+ "type": "string"
86
75
  }
87
76
  ],
88
- "name": "OwnershipTransferred",
77
+ "name": "SymbolChanged",
89
78
  "type": "event"
90
79
  },
91
80
  {
@@ -113,42 +102,16 @@ exports.TetherUSD_jsonAbi = [
113
102
  "name": "Transfer",
114
103
  "type": "event"
115
104
  },
116
- {
117
- "inputs": [],
118
- "name": "Optimization",
119
- "outputs": [
120
- {
121
- "internalType": "uint256",
122
- "name": "",
123
- "type": "uint256"
124
- }
125
- ],
126
- "stateMutability": "view",
127
- "type": "function"
128
- },
129
- {
130
- "inputs": [],
131
- "name": "_owner",
132
- "outputs": [
133
- {
134
- "internalType": "address",
135
- "name": "",
136
- "type": "address"
137
- }
138
- ],
139
- "stateMutability": "view",
140
- "type": "function"
141
- },
142
105
  {
143
106
  "inputs": [
144
107
  {
145
108
  "internalType": "address",
146
- "name": "owner",
109
+ "name": "",
147
110
  "type": "address"
148
111
  },
149
112
  {
150
113
  "internalType": "address",
151
- "name": "spender",
114
+ "name": "",
152
115
  "type": "address"
153
116
  }
154
117
  ],
@@ -191,7 +154,7 @@ exports.TetherUSD_jsonAbi = [
191
154
  "inputs": [
192
155
  {
193
156
  "internalType": "address",
194
- "name": "account",
157
+ "name": "",
195
158
  "type": "address"
196
159
  }
197
160
  ],
@@ -211,9 +174,9 @@ exports.TetherUSD_jsonAbi = [
211
174
  "name": "decimals",
212
175
  "outputs": [
213
176
  {
214
- "internalType": "uint256",
177
+ "internalType": "uint8",
215
178
  "name": "",
216
- "type": "uint256"
179
+ "type": "uint8"
217
180
  }
218
181
  ],
219
182
  "stateMutability": "view",
@@ -268,21 +231,16 @@ exports.TetherUSD_jsonAbi = [
268
231
  "type": "function"
269
232
  },
270
233
  {
271
- "inputs": [
272
- {
273
- "internalType": "address",
274
- "name": "account",
275
- "type": "address"
276
- },
234
+ "inputs": [],
235
+ "name": "isRenounced",
236
+ "outputs": [
277
237
  {
278
- "internalType": "uint256",
279
- "name": "amount",
280
- "type": "uint256"
238
+ "internalType": "bool",
239
+ "name": "",
240
+ "type": "bool"
281
241
  }
282
242
  ],
283
- "name": "mint",
284
- "outputs": [],
285
- "stateMutability": "nonpayable",
243
+ "stateMutability": "view",
286
244
  "type": "function"
287
245
  },
288
246
  {
@@ -312,26 +270,47 @@ exports.TetherUSD_jsonAbi = [
312
270
  "type": "function"
313
271
  },
314
272
  {
315
- "inputs": [
273
+ "inputs": [],
274
+ "name": "renounceOwnership",
275
+ "outputs": [],
276
+ "stateMutability": "nonpayable",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [],
281
+ "name": "renounced",
282
+ "outputs": [
316
283
  {
317
- "internalType": "address",
318
- "name": "tokenAddress",
319
- "type": "address"
320
- },
284
+ "internalType": "bool",
285
+ "name": "",
286
+ "type": "bool"
287
+ }
288
+ ],
289
+ "stateMutability": "view",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "inputs": [
321
294
  {
322
- "internalType": "uint256",
323
- "name": "tokenAmount",
324
- "type": "uint256"
295
+ "internalType": "string",
296
+ "name": "newName",
297
+ "type": "string"
325
298
  }
326
299
  ],
327
- "name": "recoverERC20",
300
+ "name": "setName",
328
301
  "outputs": [],
329
302
  "stateMutability": "nonpayable",
330
303
  "type": "function"
331
304
  },
332
305
  {
333
- "inputs": [],
334
- "name": "renounceOwnership",
306
+ "inputs": [
307
+ {
308
+ "internalType": "string",
309
+ "name": "newSymbol",
310
+ "type": "string"
311
+ }
312
+ ],
313
+ "name": "setSymbol",
335
314
  "outputs": [],
336
315
  "stateMutability": "nonpayable",
337
316
  "type": "function"
@@ -349,6 +328,19 @@ exports.TetherUSD_jsonAbi = [
349
328
  "stateMutability": "view",
350
329
  "type": "function"
351
330
  },
331
+ {
332
+ "inputs": [],
333
+ "name": "tokenImage",
334
+ "outputs": [
335
+ {
336
+ "internalType": "string",
337
+ "name": "",
338
+ "type": "string"
339
+ }
340
+ ],
341
+ "stateMutability": "pure",
342
+ "type": "function"
343
+ },
352
344
  {
353
345
  "inputs": [],
354
346
  "name": "totalSupply",
@@ -366,7 +358,7 @@ exports.TetherUSD_jsonAbi = [
366
358
  "inputs": [
367
359
  {
368
360
  "internalType": "address",
369
- "name": "recipient",
361
+ "name": "to",
370
362
  "type": "address"
371
363
  },
372
364
  {
@@ -390,12 +382,12 @@ exports.TetherUSD_jsonAbi = [
390
382
  "inputs": [
391
383
  {
392
384
  "internalType": "address",
393
- "name": "sender",
385
+ "name": "from",
394
386
  "type": "address"
395
387
  },
396
388
  {
397
389
  "internalType": "address",
398
- "name": "recipient",
390
+ "name": "to",
399
391
  "type": "address"
400
392
  },
401
393
  {
@@ -414,23 +406,10 @@ exports.TetherUSD_jsonAbi = [
414
406
  ],
415
407
  "stateMutability": "nonpayable",
416
408
  "type": "function"
417
- },
418
- {
419
- "inputs": [
420
- {
421
- "internalType": "address",
422
- "name": "newOwner",
423
- "type": "address"
424
- }
425
- ],
426
- "name": "transferOwnership",
427
- "outputs": [],
428
- "stateMutability": "nonpayable",
429
- "type": "function"
430
409
  }
431
410
  ];
432
411
  /**
433
- * TetherUSD_json Contract Class
412
+ * USDToken_json Contract Class
434
413
  *
435
414
  * Provides a class-based API similar to TypeChain for interacting with the contract.
436
415
  *
@@ -438,12 +417,12 @@ exports.TetherUSD_jsonAbi = [
438
417
  * ```typescript
439
418
  * import { createPublicClient, createWalletClient, http } from 'viem';
440
419
  * import { mainnet } from 'viem/chains';
441
- * import { TetherUSD_json } from 'TetherUSD_json';
420
+ * import { USDToken_json } from 'USDToken_json';
442
421
  *
443
422
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
444
423
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
445
424
  *
446
- * const contract = new TetherUSD_json('0x...', { publicClient, walletClient });
425
+ * const contract = new USDToken_json('0x...', { publicClient, walletClient });
447
426
  *
448
427
  * // Read functions
449
428
  * const result = await contract.balanceOf('0x...');
@@ -461,13 +440,13 @@ exports.TetherUSD_jsonAbi = [
461
440
  * });
462
441
  * ```
463
442
  */
464
- class TetherUSD_json {
443
+ class USDToken_json {
465
444
  constructor(address, clients) {
466
445
  this.contractAddress = address;
467
446
  this.publicClient = clients.publicClient;
468
447
  this.contract = (0, viem_1.getContract)({
469
448
  address,
470
- abi: exports.TetherUSD_jsonAbi,
449
+ abi: exports.USDToken_jsonAbi,
471
450
  client: {
472
451
  public: clients.publicClient,
473
452
  wallet: clients.walletClient,
@@ -486,33 +465,19 @@ class TetherUSD_json {
486
465
  getContract() {
487
466
  return this.contract;
488
467
  }
489
- /**
490
- * Optimization
491
- * view
492
- */
493
- async Optimization() {
494
- return this.contract.read.Optimization();
495
- }
496
- /**
497
- * _owner
498
- * view
499
- */
500
- async _owner() {
501
- return this.contract.read._owner();
502
- }
503
468
  /**
504
469
  * allowance
505
470
  * view
506
471
  */
507
- async allowance(owner, spender) {
508
- return this.contract.read.allowance([owner, spender]);
472
+ async allowance(arg0, arg1) {
473
+ return this.contract.read.allowance([arg0, arg1]);
509
474
  }
510
475
  /**
511
476
  * balanceOf
512
477
  * view
513
478
  */
514
- async balanceOf(account) {
515
- return this.contract.read.balanceOf([account]);
479
+ async balanceOf(arg0) {
480
+ return this.contract.read.balanceOf([arg0]);
516
481
  }
517
482
  /**
518
483
  * decimals
@@ -521,6 +486,13 @@ class TetherUSD_json {
521
486
  async decimals() {
522
487
  return this.contract.read.decimals();
523
488
  }
489
+ /**
490
+ * isRenounced
491
+ * view
492
+ */
493
+ async isRenounced() {
494
+ return this.contract.read.isRenounced();
495
+ }
524
496
  /**
525
497
  * name
526
498
  * view
@@ -535,6 +507,13 @@ class TetherUSD_json {
535
507
  async owner() {
536
508
  return this.contract.read.owner();
537
509
  }
510
+ /**
511
+ * renounced
512
+ * view
513
+ */
514
+ async renounced() {
515
+ return this.contract.read.renounced();
516
+ }
538
517
  /**
539
518
  * symbol
540
519
  * view
@@ -542,6 +521,13 @@ class TetherUSD_json {
542
521
  async symbol() {
543
522
  return this.contract.read.symbol();
544
523
  }
524
+ /**
525
+ * tokenImage
526
+ * pure
527
+ */
528
+ async tokenImage() {
529
+ return this.contract.read.tokenImage();
530
+ }
545
531
  /**
546
532
  * totalSupply
547
533
  * view
@@ -583,70 +569,59 @@ class TetherUSD_json {
583
569
  return this.contract.write.increaseAllowance([spender, addedValue], options);
584
570
  }
585
571
  /**
586
- * mint
572
+ * renounceOwnership
587
573
  * nonpayable
588
574
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
589
575
  */
590
- async mint(account, amount, options) {
576
+ async renounceOwnership(options) {
591
577
  if (!this.contract.write) {
592
578
  throw new Error('Wallet client is required for write operations');
593
579
  }
594
- return this.contract.write.mint([account, amount], options);
580
+ return this.contract.write.renounceOwnership(options);
595
581
  }
596
582
  /**
597
- * recoverERC20
583
+ * setName
598
584
  * nonpayable
599
585
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
600
586
  */
601
- async recoverERC20(tokenAddress, tokenAmount, options) {
587
+ async setName(newName, options) {
602
588
  if (!this.contract.write) {
603
589
  throw new Error('Wallet client is required for write operations');
604
590
  }
605
- return this.contract.write.recoverERC20([tokenAddress, tokenAmount], options);
591
+ return this.contract.write.setName([newName], options);
606
592
  }
607
593
  /**
608
- * renounceOwnership
594
+ * setSymbol
609
595
  * nonpayable
610
596
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
611
597
  */
612
- async renounceOwnership(options) {
598
+ async setSymbol(newSymbol, options) {
613
599
  if (!this.contract.write) {
614
600
  throw new Error('Wallet client is required for write operations');
615
601
  }
616
- return this.contract.write.renounceOwnership(options);
602
+ return this.contract.write.setSymbol([newSymbol], options);
617
603
  }
618
604
  /**
619
605
  * transfer
620
606
  * nonpayable
621
607
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
622
608
  */
623
- async transfer(recipient, amount, options) {
609
+ async transfer(to, amount, options) {
624
610
  if (!this.contract.write) {
625
611
  throw new Error('Wallet client is required for write operations');
626
612
  }
627
- return this.contract.write.transfer([recipient, amount], options);
613
+ return this.contract.write.transfer([to, amount], options);
628
614
  }
629
615
  /**
630
616
  * transferFrom
631
617
  * nonpayable
632
618
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
633
619
  */
634
- async transferFrom(sender, recipient, amount, options) {
620
+ async transferFrom(from, to, amount, options) {
635
621
  if (!this.contract.write) {
636
622
  throw new Error('Wallet client is required for write operations');
637
623
  }
638
- return this.contract.write.transferFrom([sender, recipient, amount], options);
639
- }
640
- /**
641
- * transferOwnership
642
- * nonpayable
643
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
644
- */
645
- async transferOwnership(newOwner, options) {
646
- if (!this.contract.write) {
647
- throw new Error('Wallet client is required for write operations');
648
- }
649
- return this.contract.write.transferOwnership([newOwner], options);
624
+ return this.contract.write.transferFrom([from, to, amount], options);
650
625
  }
651
626
  /**
652
627
  * Simulate contract write operations (dry-run without sending transaction)
@@ -687,52 +662,44 @@ class TetherUSD_json {
687
662
  return contract.simulate.increaseAllowance([spender, addedValue], options);
688
663
  },
689
664
  /**
690
- * Simulate mint
665
+ * Simulate renounceOwnership
691
666
  * Returns gas estimate and result without sending transaction
692
667
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
693
668
  */
694
- async mint(account, amount, options) {
695
- return contract.simulate.mint([account, amount], options);
669
+ async renounceOwnership(options) {
670
+ return contract.simulate.renounceOwnership(options);
696
671
  },
697
672
  /**
698
- * Simulate recoverERC20
673
+ * Simulate setName
699
674
  * Returns gas estimate and result without sending transaction
700
675
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
701
676
  */
702
- async recoverERC20(tokenAddress, tokenAmount, options) {
703
- return contract.simulate.recoverERC20([tokenAddress, tokenAmount], options);
677
+ async setName(newName, options) {
678
+ return contract.simulate.setName([newName], options);
704
679
  },
705
680
  /**
706
- * Simulate renounceOwnership
681
+ * Simulate setSymbol
707
682
  * Returns gas estimate and result without sending transaction
708
683
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
709
684
  */
710
- async renounceOwnership(options) {
711
- return contract.simulate.renounceOwnership(options);
685
+ async setSymbol(newSymbol, options) {
686
+ return contract.simulate.setSymbol([newSymbol], options);
712
687
  },
713
688
  /**
714
689
  * Simulate transfer
715
690
  * Returns gas estimate and result without sending transaction
716
691
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
717
692
  */
718
- async transfer(recipient, amount, options) {
719
- return contract.simulate.transfer([recipient, amount], options);
693
+ async transfer(to, amount, options) {
694
+ return contract.simulate.transfer([to, amount], options);
720
695
  },
721
696
  /**
722
697
  * Simulate transferFrom
723
698
  * Returns gas estimate and result without sending transaction
724
699
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
725
700
  */
726
- async transferFrom(sender, recipient, amount, options) {
727
- return contract.simulate.transferFrom([sender, recipient, amount], options);
728
- },
729
- /**
730
- * Simulate transferOwnership
731
- * Returns gas estimate and result without sending transaction
732
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
733
- */
734
- async transferOwnership(newOwner, options) {
735
- return contract.simulate.transferOwnership([newOwner], options);
701
+ async transferFrom(from, to, amount, options) {
702
+ return contract.simulate.transferFrom([from, to, amount], options);
736
703
  }
737
704
  };
738
705
  }
@@ -759,7 +726,7 @@ class TetherUSD_json {
759
726
  Approval: (callback, filter) => {
760
727
  return this.publicClient.watchContractEvent({
761
728
  address: this.contractAddress,
762
- abi: exports.TetherUSD_jsonAbi,
729
+ abi: exports.USDToken_jsonAbi,
763
730
  eventName: 'Approval',
764
731
  args: filter,
765
732
  onLogs: (logs) => {
@@ -770,16 +737,34 @@ class TetherUSD_json {
770
737
  });
771
738
  },
772
739
  /**
773
- * Watch OwnershipTransferred events
740
+ * Watch NameChanged events
774
741
  * @param callback Function to call when event is emitted
775
742
  * @param filter Optional filter for indexed parameters
776
743
  * @returns Unwatch function to stop listening
777
744
  */
778
- OwnershipTransferred: (callback, filter) => {
745
+ NameChanged: (callback) => {
779
746
  return this.publicClient.watchContractEvent({
780
747
  address: this.contractAddress,
781
- abi: exports.TetherUSD_jsonAbi,
782
- eventName: 'OwnershipTransferred',
748
+ abi: exports.USDToken_jsonAbi,
749
+ eventName: 'NameChanged',
750
+ onLogs: (logs) => {
751
+ logs.forEach((log) => {
752
+ callback(log.args);
753
+ });
754
+ },
755
+ });
756
+ },
757
+ /**
758
+ * Watch OwnershipRenounced events
759
+ * @param callback Function to call when event is emitted
760
+ * @param filter Optional filter for indexed parameters
761
+ * @returns Unwatch function to stop listening
762
+ */
763
+ OwnershipRenounced: (callback, filter) => {
764
+ return this.publicClient.watchContractEvent({
765
+ address: this.contractAddress,
766
+ abi: exports.USDToken_jsonAbi,
767
+ eventName: 'OwnershipRenounced',
783
768
  args: filter,
784
769
  onLogs: (logs) => {
785
770
  logs.forEach((log) => {
@@ -788,6 +773,24 @@ class TetherUSD_json {
788
773
  },
789
774
  });
790
775
  },
776
+ /**
777
+ * Watch SymbolChanged events
778
+ * @param callback Function to call when event is emitted
779
+ * @param filter Optional filter for indexed parameters
780
+ * @returns Unwatch function to stop listening
781
+ */
782
+ SymbolChanged: (callback) => {
783
+ return this.publicClient.watchContractEvent({
784
+ address: this.contractAddress,
785
+ abi: exports.USDToken_jsonAbi,
786
+ eventName: 'SymbolChanged',
787
+ onLogs: (logs) => {
788
+ logs.forEach((log) => {
789
+ callback(log.args);
790
+ });
791
+ },
792
+ });
793
+ },
791
794
  /**
792
795
  * Watch Transfer events
793
796
  * @param callback Function to call when event is emitted
@@ -797,7 +800,7 @@ class TetherUSD_json {
797
800
  Transfer: (callback, filter) => {
798
801
  return this.publicClient.watchContractEvent({
799
802
  address: this.contractAddress,
800
- abi: exports.TetherUSD_jsonAbi,
803
+ abi: exports.USDToken_jsonAbi,
801
804
  eventName: 'Transfer',
802
805
  args: filter,
803
806
  onLogs: (logs) => {
@@ -810,4 +813,4 @@ class TetherUSD_json {
810
813
  };
811
814
  }
812
815
  }
813
- exports.TetherUSD_json = TetherUSD_json;
816
+ exports.USDToken_json = USDToken_json;