@gitmyabi/usdt 1.0.2 → 1.0.3

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,16 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USDToken_json = exports.USDToken_jsonAbi = void 0;
3
+ exports.TetherUSD_json = exports.TetherUSD_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * USDToken_json ABI
6
+ * TetherUSD_json ABI
7
7
  *
8
8
  * This ABI is typed using viem's type system for full type safety.
9
9
  */
10
- exports.USDToken_jsonAbi = [
10
+ exports.TetherUSD_jsonAbi = [
11
11
  {
12
- "inputs": [],
13
- "stateMutability": "nonpayable",
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",
14
45
  "type": "constructor"
15
46
  },
16
47
  {
@@ -83,15 +114,41 @@ exports.USDToken_jsonAbi = [
83
114
  "type": "event"
84
115
  },
85
116
  {
86
- "inputs": [
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": [
87
133
  {
88
134
  "internalType": "address",
89
135
  "name": "",
90
136
  "type": "address"
137
+ }
138
+ ],
139
+ "stateMutability": "view",
140
+ "type": "function"
141
+ },
142
+ {
143
+ "inputs": [
144
+ {
145
+ "internalType": "address",
146
+ "name": "owner",
147
+ "type": "address"
91
148
  },
92
149
  {
93
150
  "internalType": "address",
94
- "name": "",
151
+ "name": "spender",
95
152
  "type": "address"
96
153
  }
97
154
  ],
@@ -134,7 +191,7 @@ exports.USDToken_jsonAbi = [
134
191
  "inputs": [
135
192
  {
136
193
  "internalType": "address",
137
- "name": "",
194
+ "name": "account",
138
195
  "type": "address"
139
196
  }
140
197
  ],
@@ -154,14 +211,80 @@ exports.USDToken_jsonAbi = [
154
211
  "name": "decimals",
155
212
  "outputs": [
156
213
  {
157
- "internalType": "uint8",
214
+ "internalType": "uint256",
158
215
  "name": "",
159
- "type": "uint8"
216
+ "type": "uint256"
160
217
  }
161
218
  ],
162
219
  "stateMutability": "view",
163
220
  "type": "function"
164
221
  },
222
+ {
223
+ "inputs": [
224
+ {
225
+ "internalType": "address",
226
+ "name": "spender",
227
+ "type": "address"
228
+ },
229
+ {
230
+ "internalType": "uint256",
231
+ "name": "subtractedValue",
232
+ "type": "uint256"
233
+ }
234
+ ],
235
+ "name": "decreaseAllowance",
236
+ "outputs": [
237
+ {
238
+ "internalType": "bool",
239
+ "name": "",
240
+ "type": "bool"
241
+ }
242
+ ],
243
+ "stateMutability": "nonpayable",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [
248
+ {
249
+ "internalType": "address",
250
+ "name": "spender",
251
+ "type": "address"
252
+ },
253
+ {
254
+ "internalType": "uint256",
255
+ "name": "addedValue",
256
+ "type": "uint256"
257
+ }
258
+ ],
259
+ "name": "increaseAllowance",
260
+ "outputs": [
261
+ {
262
+ "internalType": "bool",
263
+ "name": "",
264
+ "type": "bool"
265
+ }
266
+ ],
267
+ "stateMutability": "nonpayable",
268
+ "type": "function"
269
+ },
270
+ {
271
+ "inputs": [
272
+ {
273
+ "internalType": "address",
274
+ "name": "account",
275
+ "type": "address"
276
+ },
277
+ {
278
+ "internalType": "uint256",
279
+ "name": "amount",
280
+ "type": "uint256"
281
+ }
282
+ ],
283
+ "name": "mint",
284
+ "outputs": [],
285
+ "stateMutability": "nonpayable",
286
+ "type": "function"
287
+ },
165
288
  {
166
289
  "inputs": [],
167
290
  "name": "name",
@@ -189,28 +312,33 @@ exports.USDToken_jsonAbi = [
189
312
  "type": "function"
190
313
  },
191
314
  {
192
- "inputs": [],
193
- "name": "renounceOwnership",
315
+ "inputs": [
316
+ {
317
+ "internalType": "address",
318
+ "name": "tokenAddress",
319
+ "type": "address"
320
+ },
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "tokenAmount",
324
+ "type": "uint256"
325
+ }
326
+ ],
327
+ "name": "recoverERC20",
194
328
  "outputs": [],
195
329
  "stateMutability": "nonpayable",
196
330
  "type": "function"
197
331
  },
198
332
  {
199
333
  "inputs": [],
200
- "name": "symbol",
201
- "outputs": [
202
- {
203
- "internalType": "string",
204
- "name": "",
205
- "type": "string"
206
- }
207
- ],
208
- "stateMutability": "view",
334
+ "name": "renounceOwnership",
335
+ "outputs": [],
336
+ "stateMutability": "nonpayable",
209
337
  "type": "function"
210
338
  },
211
339
  {
212
340
  "inputs": [],
213
- "name": "tokenImage",
341
+ "name": "symbol",
214
342
  "outputs": [
215
343
  {
216
344
  "internalType": "string",
@@ -218,7 +346,7 @@ exports.USDToken_jsonAbi = [
218
346
  "type": "string"
219
347
  }
220
348
  ],
221
- "stateMutability": "pure",
349
+ "stateMutability": "view",
222
350
  "type": "function"
223
351
  },
224
352
  {
@@ -238,7 +366,7 @@ exports.USDToken_jsonAbi = [
238
366
  "inputs": [
239
367
  {
240
368
  "internalType": "address",
241
- "name": "to",
369
+ "name": "recipient",
242
370
  "type": "address"
243
371
  },
244
372
  {
@@ -262,12 +390,12 @@ exports.USDToken_jsonAbi = [
262
390
  "inputs": [
263
391
  {
264
392
  "internalType": "address",
265
- "name": "from",
393
+ "name": "sender",
266
394
  "type": "address"
267
395
  },
268
396
  {
269
397
  "internalType": "address",
270
- "name": "to",
398
+ "name": "recipient",
271
399
  "type": "address"
272
400
  },
273
401
  {
@@ -302,7 +430,7 @@ exports.USDToken_jsonAbi = [
302
430
  }
303
431
  ];
304
432
  /**
305
- * USDToken_json Contract Class
433
+ * TetherUSD_json Contract Class
306
434
  *
307
435
  * Provides a class-based API similar to TypeChain for interacting with the contract.
308
436
  *
@@ -310,12 +438,12 @@ exports.USDToken_jsonAbi = [
310
438
  * ```typescript
311
439
  * import { createPublicClient, createWalletClient, http } from 'viem';
312
440
  * import { mainnet } from 'viem/chains';
313
- * import { USDToken_json } from 'USDToken_json';
441
+ * import { TetherUSD_json } from 'TetherUSD_json';
314
442
  *
315
443
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
316
444
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
317
445
  *
318
- * const contract = new USDToken_json('0x...', { publicClient, walletClient });
446
+ * const contract = new TetherUSD_json('0x...', { publicClient, walletClient });
319
447
  *
320
448
  * // Read functions
321
449
  * const result = await contract.balanceOf('0x...');
@@ -333,13 +461,13 @@ exports.USDToken_jsonAbi = [
333
461
  * });
334
462
  * ```
335
463
  */
336
- class USDToken_json {
464
+ class TetherUSD_json {
337
465
  constructor(address, clients) {
338
466
  this.contractAddress = address;
339
467
  this.publicClient = clients.publicClient;
340
468
  this.contract = (0, viem_1.getContract)({
341
469
  address,
342
- abi: exports.USDToken_jsonAbi,
470
+ abi: exports.TetherUSD_jsonAbi,
343
471
  client: {
344
472
  public: clients.publicClient,
345
473
  wallet: clients.walletClient,
@@ -358,19 +486,33 @@ class USDToken_json {
358
486
  getContract() {
359
487
  return this.contract;
360
488
  }
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
+ }
361
503
  /**
362
504
  * allowance
363
505
  * view
364
506
  */
365
- async allowance(arg0, arg1) {
366
- return this.contract.read.allowance([arg0, arg1]);
507
+ async allowance(owner, spender) {
508
+ return this.contract.read.allowance([owner, spender]);
367
509
  }
368
510
  /**
369
511
  * balanceOf
370
512
  * view
371
513
  */
372
- async balanceOf(arg0) {
373
- return this.contract.read.balanceOf([arg0]);
514
+ async balanceOf(account) {
515
+ return this.contract.read.balanceOf([account]);
374
516
  }
375
517
  /**
376
518
  * decimals
@@ -400,13 +542,6 @@ class USDToken_json {
400
542
  async symbol() {
401
543
  return this.contract.read.symbol();
402
544
  }
403
- /**
404
- * tokenImage
405
- * pure
406
- */
407
- async tokenImage() {
408
- return this.contract.read.tokenImage();
409
- }
410
545
  /**
411
546
  * totalSupply
412
547
  * view
@@ -425,6 +560,50 @@ class USDToken_json {
425
560
  }
426
561
  return this.contract.write.approve([spender, amount], options);
427
562
  }
563
+ /**
564
+ * decreaseAllowance
565
+ * nonpayable
566
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
567
+ */
568
+ async decreaseAllowance(spender, subtractedValue, options) {
569
+ if (!this.contract.write) {
570
+ throw new Error('Wallet client is required for write operations');
571
+ }
572
+ return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
573
+ }
574
+ /**
575
+ * increaseAllowance
576
+ * nonpayable
577
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
578
+ */
579
+ async increaseAllowance(spender, addedValue, options) {
580
+ if (!this.contract.write) {
581
+ throw new Error('Wallet client is required for write operations');
582
+ }
583
+ return this.contract.write.increaseAllowance([spender, addedValue], options);
584
+ }
585
+ /**
586
+ * mint
587
+ * nonpayable
588
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
589
+ */
590
+ async mint(account, amount, options) {
591
+ if (!this.contract.write) {
592
+ throw new Error('Wallet client is required for write operations');
593
+ }
594
+ return this.contract.write.mint([account, amount], options);
595
+ }
596
+ /**
597
+ * recoverERC20
598
+ * nonpayable
599
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
600
+ */
601
+ async recoverERC20(tokenAddress, tokenAmount, options) {
602
+ if (!this.contract.write) {
603
+ throw new Error('Wallet client is required for write operations');
604
+ }
605
+ return this.contract.write.recoverERC20([tokenAddress, tokenAmount], options);
606
+ }
428
607
  /**
429
608
  * renounceOwnership
430
609
  * nonpayable
@@ -441,22 +620,22 @@ class USDToken_json {
441
620
  * nonpayable
442
621
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
443
622
  */
444
- async transfer(to, amount, options) {
623
+ async transfer(recipient, amount, options) {
445
624
  if (!this.contract.write) {
446
625
  throw new Error('Wallet client is required for write operations');
447
626
  }
448
- return this.contract.write.transfer([to, amount], options);
627
+ return this.contract.write.transfer([recipient, amount], options);
449
628
  }
450
629
  /**
451
630
  * transferFrom
452
631
  * nonpayable
453
632
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
454
633
  */
455
- async transferFrom(from, to, amount, options) {
634
+ async transferFrom(sender, recipient, amount, options) {
456
635
  if (!this.contract.write) {
457
636
  throw new Error('Wallet client is required for write operations');
458
637
  }
459
- return this.contract.write.transferFrom([from, to, amount], options);
638
+ return this.contract.write.transferFrom([sender, recipient, amount], options);
460
639
  }
461
640
  /**
462
641
  * transferOwnership
@@ -491,6 +670,38 @@ class USDToken_json {
491
670
  async approve(spender, amount, options) {
492
671
  return contract.simulate.approve([spender, amount], options);
493
672
  },
673
+ /**
674
+ * Simulate decreaseAllowance
675
+ * Returns gas estimate and result without sending transaction
676
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
677
+ */
678
+ async decreaseAllowance(spender, subtractedValue, options) {
679
+ return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
680
+ },
681
+ /**
682
+ * Simulate increaseAllowance
683
+ * Returns gas estimate and result without sending transaction
684
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
685
+ */
686
+ async increaseAllowance(spender, addedValue, options) {
687
+ return contract.simulate.increaseAllowance([spender, addedValue], options);
688
+ },
689
+ /**
690
+ * Simulate mint
691
+ * Returns gas estimate and result without sending transaction
692
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
693
+ */
694
+ async mint(account, amount, options) {
695
+ return contract.simulate.mint([account, amount], options);
696
+ },
697
+ /**
698
+ * Simulate recoverERC20
699
+ * Returns gas estimate and result without sending transaction
700
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
701
+ */
702
+ async recoverERC20(tokenAddress, tokenAmount, options) {
703
+ return contract.simulate.recoverERC20([tokenAddress, tokenAmount], options);
704
+ },
494
705
  /**
495
706
  * Simulate renounceOwnership
496
707
  * Returns gas estimate and result without sending transaction
@@ -504,16 +715,16 @@ class USDToken_json {
504
715
  * Returns gas estimate and result without sending transaction
505
716
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
506
717
  */
507
- async transfer(to, amount, options) {
508
- return contract.simulate.transfer([to, amount], options);
718
+ async transfer(recipient, amount, options) {
719
+ return contract.simulate.transfer([recipient, amount], options);
509
720
  },
510
721
  /**
511
722
  * Simulate transferFrom
512
723
  * Returns gas estimate and result without sending transaction
513
724
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
514
725
  */
515
- async transferFrom(from, to, amount, options) {
516
- return contract.simulate.transferFrom([from, to, amount], options);
726
+ async transferFrom(sender, recipient, amount, options) {
727
+ return contract.simulate.transferFrom([sender, recipient, amount], options);
517
728
  },
518
729
  /**
519
730
  * Simulate transferOwnership
@@ -548,7 +759,7 @@ class USDToken_json {
548
759
  Approval: (callback, filter) => {
549
760
  return this.publicClient.watchContractEvent({
550
761
  address: this.contractAddress,
551
- abi: exports.USDToken_jsonAbi,
762
+ abi: exports.TetherUSD_jsonAbi,
552
763
  eventName: 'Approval',
553
764
  args: filter,
554
765
  onLogs: (logs) => {
@@ -567,7 +778,7 @@ class USDToken_json {
567
778
  OwnershipTransferred: (callback, filter) => {
568
779
  return this.publicClient.watchContractEvent({
569
780
  address: this.contractAddress,
570
- abi: exports.USDToken_jsonAbi,
781
+ abi: exports.TetherUSD_jsonAbi,
571
782
  eventName: 'OwnershipTransferred',
572
783
  args: filter,
573
784
  onLogs: (logs) => {
@@ -586,7 +797,7 @@ class USDToken_json {
586
797
  Transfer: (callback, filter) => {
587
798
  return this.publicClient.watchContractEvent({
588
799
  address: this.contractAddress,
589
- abi: exports.USDToken_jsonAbi,
800
+ abi: exports.TetherUSD_jsonAbi,
590
801
  eventName: 'Transfer',
591
802
  args: filter,
592
803
  onLogs: (logs) => {
@@ -599,4 +810,4 @@ class USDToken_json {
599
810
  };
600
811
  }
601
812
  }
602
- exports.USDToken_json = USDToken_json;
813
+ exports.TetherUSD_json = TetherUSD_json;