@gitmyabi/usdt 1.0.7 → 1.0.9

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,41 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MyToken_json = exports.MyToken_jsonAbi = void 0;
3
+ exports.TetherUSD_json = exports.TetherUSD_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * MyToken_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.MyToken_jsonAbi = [
10
+ exports.TetherUSD_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": "_cap",
26
- "type": "uint256"
27
- },
28
- {
29
- "internalType": "uint256",
30
- "name": "_initialSupply",
31
- "type": "uint256"
32
- },
33
- {
34
- "internalType": "string",
35
- "name": "_logoURI",
36
- "type": "string"
37
- }
38
- ],
12
+ "inputs": [],
39
13
  "stateMutability": "nonpayable",
40
14
  "type": "constructor"
41
15
  },
@@ -64,25 +38,6 @@ exports.MyToken_jsonAbi = [
64
38
  "name": "Approval",
65
39
  "type": "event"
66
40
  },
67
- {
68
- "anonymous": false,
69
- "inputs": [
70
- {
71
- "indexed": true,
72
- "internalType": "address",
73
- "name": "previousOwner",
74
- "type": "address"
75
- },
76
- {
77
- "indexed": true,
78
- "internalType": "address",
79
- "name": "newOwner",
80
- "type": "address"
81
- }
82
- ],
83
- "name": "OwnershipTransferred",
84
- "type": "event"
85
- },
86
41
  {
87
42
  "anonymous": false,
88
43
  "inputs": [
@@ -136,12 +91,12 @@ exports.MyToken_jsonAbi = [
136
91
  "inputs": [
137
92
  {
138
93
  "internalType": "address",
139
- "name": "spender",
94
+ "name": "s",
140
95
  "type": "address"
141
96
  },
142
97
  {
143
98
  "internalType": "uint256",
144
- "name": "value",
99
+ "name": "v",
145
100
  "type": "uint256"
146
101
  }
147
102
  ],
@@ -175,19 +130,6 @@ exports.MyToken_jsonAbi = [
175
130
  "stateMutability": "view",
176
131
  "type": "function"
177
132
  },
178
- {
179
- "inputs": [],
180
- "name": "cap",
181
- "outputs": [
182
- {
183
- "internalType": "uint256",
184
- "name": "",
185
- "type": "uint256"
186
- }
187
- ],
188
- "stateMutability": "view",
189
- "type": "function"
190
- },
191
133
  {
192
134
  "inputs": [],
193
135
  "name": "decimals",
@@ -201,37 +143,6 @@ exports.MyToken_jsonAbi = [
201
143
  "stateMutability": "view",
202
144
  "type": "function"
203
145
  },
204
- {
205
- "inputs": [],
206
- "name": "logoURI",
207
- "outputs": [
208
- {
209
- "internalType": "string",
210
- "name": "",
211
- "type": "string"
212
- }
213
- ],
214
- "stateMutability": "view",
215
- "type": "function"
216
- },
217
- {
218
- "inputs": [
219
- {
220
- "internalType": "address",
221
- "name": "to",
222
- "type": "address"
223
- },
224
- {
225
- "internalType": "uint256",
226
- "name": "amount",
227
- "type": "uint256"
228
- }
229
- ],
230
- "name": "mint",
231
- "outputs": [],
232
- "stateMutability": "nonpayable",
233
- "type": "function"
234
- },
235
146
  {
236
147
  "inputs": [],
237
148
  "name": "name",
@@ -245,39 +156,6 @@ exports.MyToken_jsonAbi = [
245
156
  "stateMutability": "view",
246
157
  "type": "function"
247
158
  },
248
- {
249
- "inputs": [],
250
- "name": "owner",
251
- "outputs": [
252
- {
253
- "internalType": "address",
254
- "name": "",
255
- "type": "address"
256
- }
257
- ],
258
- "stateMutability": "view",
259
- "type": "function"
260
- },
261
- {
262
- "inputs": [],
263
- "name": "renounceOwnership",
264
- "outputs": [],
265
- "stateMutability": "nonpayable",
266
- "type": "function"
267
- },
268
- {
269
- "inputs": [
270
- {
271
- "internalType": "string",
272
- "name": "_logoURI",
273
- "type": "string"
274
- }
275
- ],
276
- "name": "setLogoURI",
277
- "outputs": [],
278
- "stateMutability": "nonpayable",
279
- "type": "function"
280
- },
281
159
  {
282
160
  "inputs": [],
283
161
  "name": "symbol",
@@ -313,7 +191,7 @@ exports.MyToken_jsonAbi = [
313
191
  },
314
192
  {
315
193
  "internalType": "uint256",
316
- "name": "value",
194
+ "name": "v",
317
195
  "type": "uint256"
318
196
  }
319
197
  ],
@@ -332,17 +210,17 @@ exports.MyToken_jsonAbi = [
332
210
  "inputs": [
333
211
  {
334
212
  "internalType": "address",
335
- "name": "from",
213
+ "name": "f",
336
214
  "type": "address"
337
215
  },
338
216
  {
339
217
  "internalType": "address",
340
- "name": "to",
218
+ "name": "t",
341
219
  "type": "address"
342
220
  },
343
221
  {
344
222
  "internalType": "uint256",
345
- "name": "value",
223
+ "name": "v",
346
224
  "type": "uint256"
347
225
  }
348
226
  ],
@@ -356,23 +234,10 @@ exports.MyToken_jsonAbi = [
356
234
  ],
357
235
  "stateMutability": "nonpayable",
358
236
  "type": "function"
359
- },
360
- {
361
- "inputs": [
362
- {
363
- "internalType": "address",
364
- "name": "newOwner",
365
- "type": "address"
366
- }
367
- ],
368
- "name": "transferOwnership",
369
- "outputs": [],
370
- "stateMutability": "nonpayable",
371
- "type": "function"
372
237
  }
373
238
  ];
374
239
  /**
375
- * MyToken_json Contract Class
240
+ * TetherUSD_json Contract Class
376
241
  *
377
242
  * Provides a class-based API similar to TypeChain for interacting with the contract.
378
243
  *
@@ -380,12 +245,12 @@ exports.MyToken_jsonAbi = [
380
245
  * ```typescript
381
246
  * import { createPublicClient, createWalletClient, http } from 'viem';
382
247
  * import { mainnet } from 'viem/chains';
383
- * import { MyToken_json } from 'MyToken_json';
248
+ * import { TetherUSD_json } from 'TetherUSD_json';
384
249
  *
385
250
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
386
251
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
387
252
  *
388
- * const contract = new MyToken_json('0x...', { publicClient, walletClient });
253
+ * const contract = new TetherUSD_json('0x...', { publicClient, walletClient });
389
254
  *
390
255
  * // Read functions
391
256
  * const result = await contract.balanceOf('0x...');
@@ -403,13 +268,13 @@ exports.MyToken_jsonAbi = [
403
268
  * });
404
269
  * ```
405
270
  */
406
- class MyToken_json {
271
+ class TetherUSD_json {
407
272
  constructor(address, clients) {
408
273
  this.contractAddress = address;
409
274
  this.publicClient = clients.publicClient;
410
275
  this.contract = (0, viem_1.getContract)({
411
276
  address,
412
- abi: exports.MyToken_jsonAbi,
277
+ abi: exports.TetherUSD_jsonAbi,
413
278
  client: {
414
279
  public: clients.publicClient,
415
280
  wallet: clients.walletClient,
@@ -442,13 +307,6 @@ class MyToken_json {
442
307
  async balanceOf(arg0) {
443
308
  return this.contract.read.balanceOf([arg0]);
444
309
  }
445
- /**
446
- * cap
447
- * view
448
- */
449
- async cap() {
450
- return this.contract.read.cap();
451
- }
452
310
  /**
453
311
  * decimals
454
312
  * view
@@ -456,13 +314,6 @@ class MyToken_json {
456
314
  async decimals() {
457
315
  return this.contract.read.decimals();
458
316
  }
459
- /**
460
- * logoURI
461
- * view
462
- */
463
- async logoURI() {
464
- return this.contract.read.logoURI();
465
- }
466
317
  /**
467
318
  * name
468
319
  * view
@@ -470,13 +321,6 @@ class MyToken_json {
470
321
  async name() {
471
322
  return this.contract.read.name();
472
323
  }
473
- /**
474
- * owner
475
- * view
476
- */
477
- async owner() {
478
- return this.contract.read.owner();
479
- }
480
324
  /**
481
325
  * symbol
482
326
  * view
@@ -496,77 +340,33 @@ class MyToken_json {
496
340
  * nonpayable
497
341
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
498
342
  */
499
- async approve(spender, value, options) {
500
- if (!this.contract.write) {
501
- throw new Error('Wallet client is required for write operations');
502
- }
503
- return this.contract.write.approve([spender, value], options);
504
- }
505
- /**
506
- * mint
507
- * nonpayable
508
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
509
- */
510
- async mint(to, amount, options) {
511
- if (!this.contract.write) {
512
- throw new Error('Wallet client is required for write operations');
513
- }
514
- return this.contract.write.mint([to, amount], options);
515
- }
516
- /**
517
- * renounceOwnership
518
- * nonpayable
519
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
520
- */
521
- async renounceOwnership(options) {
522
- if (!this.contract.write) {
523
- throw new Error('Wallet client is required for write operations');
524
- }
525
- return this.contract.write.renounceOwnership(options);
526
- }
527
- /**
528
- * setLogoURI
529
- * nonpayable
530
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
531
- */
532
- async setLogoURI(_logoURI, options) {
343
+ async approve(s, v, options) {
533
344
  if (!this.contract.write) {
534
345
  throw new Error('Wallet client is required for write operations');
535
346
  }
536
- return this.contract.write.setLogoURI([_logoURI], options);
347
+ return this.contract.write.approve([s, v], options);
537
348
  }
538
349
  /**
539
350
  * transfer
540
351
  * nonpayable
541
352
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
542
353
  */
543
- async transfer(to, value, options) {
354
+ async transfer(to, v, options) {
544
355
  if (!this.contract.write) {
545
356
  throw new Error('Wallet client is required for write operations');
546
357
  }
547
- return this.contract.write.transfer([to, value], options);
358
+ return this.contract.write.transfer([to, v], options);
548
359
  }
549
360
  /**
550
361
  * transferFrom
551
362
  * nonpayable
552
363
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
553
364
  */
554
- async transferFrom(from, to, value, options) {
365
+ async transferFrom(f, t, v, options) {
555
366
  if (!this.contract.write) {
556
367
  throw new Error('Wallet client is required for write operations');
557
368
  }
558
- return this.contract.write.transferFrom([from, to, value], options);
559
- }
560
- /**
561
- * transferOwnership
562
- * nonpayable
563
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
564
- */
565
- async transferOwnership(newOwner, options) {
566
- if (!this.contract.write) {
567
- throw new Error('Wallet client is required for write operations');
568
- }
569
- return this.contract.write.transferOwnership([newOwner], options);
369
+ return this.contract.write.transferFrom([f, t, v], options);
570
370
  }
571
371
  /**
572
372
  * Simulate contract write operations (dry-run without sending transaction)
@@ -587,56 +387,24 @@ class MyToken_json {
587
387
  * Returns gas estimate and result without sending transaction
588
388
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
589
389
  */
590
- async approve(spender, value, options) {
591
- return contract.simulate.approve([spender, value], options);
592
- },
593
- /**
594
- * Simulate mint
595
- * Returns gas estimate and result without sending transaction
596
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
597
- */
598
- async mint(to, amount, options) {
599
- return contract.simulate.mint([to, amount], options);
600
- },
601
- /**
602
- * Simulate renounceOwnership
603
- * Returns gas estimate and result without sending transaction
604
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
605
- */
606
- async renounceOwnership(options) {
607
- return contract.simulate.renounceOwnership(options);
608
- },
609
- /**
610
- * Simulate setLogoURI
611
- * Returns gas estimate and result without sending transaction
612
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
613
- */
614
- async setLogoURI(_logoURI, options) {
615
- return contract.simulate.setLogoURI([_logoURI], options);
390
+ async approve(s, v, options) {
391
+ return contract.simulate.approve([s, v], options);
616
392
  },
617
393
  /**
618
394
  * Simulate transfer
619
395
  * Returns gas estimate and result without sending transaction
620
396
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
621
397
  */
622
- async transfer(to, value, options) {
623
- return contract.simulate.transfer([to, value], options);
398
+ async transfer(to, v, options) {
399
+ return contract.simulate.transfer([to, v], options);
624
400
  },
625
401
  /**
626
402
  * Simulate transferFrom
627
403
  * Returns gas estimate and result without sending transaction
628
404
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
629
405
  */
630
- async transferFrom(from, to, value, options) {
631
- return contract.simulate.transferFrom([from, to, value], options);
632
- },
633
- /**
634
- * Simulate transferOwnership
635
- * Returns gas estimate and result without sending transaction
636
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
637
- */
638
- async transferOwnership(newOwner, options) {
639
- return contract.simulate.transferOwnership([newOwner], options);
406
+ async transferFrom(f, t, v, options) {
407
+ return contract.simulate.transferFrom([f, t, v], options);
640
408
  }
641
409
  };
642
410
  }
@@ -663,7 +431,7 @@ class MyToken_json {
663
431
  Approval: (callback, filter) => {
664
432
  return this.publicClient.watchContractEvent({
665
433
  address: this.contractAddress,
666
- abi: exports.MyToken_jsonAbi,
434
+ abi: exports.TetherUSD_jsonAbi,
667
435
  eventName: 'Approval',
668
436
  args: filter,
669
437
  onLogs: (logs) => {
@@ -673,25 +441,6 @@ class MyToken_json {
673
441
  },
674
442
  });
675
443
  },
676
- /**
677
- * Watch OwnershipTransferred events
678
- * @param callback Function to call when event is emitted
679
- * @param filter Optional filter for indexed parameters
680
- * @returns Unwatch function to stop listening
681
- */
682
- OwnershipTransferred: (callback, filter) => {
683
- return this.publicClient.watchContractEvent({
684
- address: this.contractAddress,
685
- abi: exports.MyToken_jsonAbi,
686
- eventName: 'OwnershipTransferred',
687
- args: filter,
688
- onLogs: (logs) => {
689
- logs.forEach((log) => {
690
- callback(log.args);
691
- });
692
- },
693
- });
694
- },
695
444
  /**
696
445
  * Watch Transfer events
697
446
  * @param callback Function to call when event is emitted
@@ -701,7 +450,7 @@ class MyToken_json {
701
450
  Transfer: (callback, filter) => {
702
451
  return this.publicClient.watchContractEvent({
703
452
  address: this.contractAddress,
704
- abi: exports.MyToken_jsonAbi,
453
+ abi: exports.TetherUSD_jsonAbi,
705
454
  eventName: 'Transfer',
706
455
  args: filter,
707
456
  onLogs: (logs) => {
@@ -714,4 +463,4 @@ class MyToken_json {
714
463
  };
715
464
  }
716
465
  }
717
- exports.MyToken_json = MyToken_json;
466
+ exports.TetherUSD_json = TetherUSD_json;