@gitmyabi/usdt 1.0.6 → 1.0.7

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,103 +1,68 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TetherUSDT_json = exports.TetherUSDT_jsonAbi = void 0;
3
+ exports.MyToken_json = exports.MyToken_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * TetherUSDT_json ABI
6
+ * MyToken_json ABI
7
7
  *
8
8
  * This ABI is typed using viem's type system for full type safety.
9
9
  */
10
- exports.TetherUSDT_jsonAbi = [
11
- {
12
- "inputs": [],
13
- "stateMutability": "nonpayable",
14
- "type": "constructor"
15
- },
10
+ exports.MyToken_jsonAbi = [
16
11
  {
17
12
  "inputs": [
18
13
  {
19
- "internalType": "address",
20
- "name": "spender",
21
- "type": "address"
14
+ "internalType": "string",
15
+ "name": "_name",
16
+ "type": "string"
22
17
  },
23
18
  {
24
- "internalType": "uint256",
25
- "name": "allowance",
26
- "type": "uint256"
19
+ "internalType": "string",
20
+ "name": "_symbol",
21
+ "type": "string"
27
22
  },
28
23
  {
29
24
  "internalType": "uint256",
30
- "name": "needed",
25
+ "name": "_cap",
31
26
  "type": "uint256"
32
- }
33
- ],
34
- "name": "ERC20InsufficientAllowance",
35
- "type": "error"
36
- },
37
- {
38
- "inputs": [
39
- {
40
- "internalType": "address",
41
- "name": "sender",
42
- "type": "address"
43
27
  },
44
28
  {
45
29
  "internalType": "uint256",
46
- "name": "balance",
30
+ "name": "_initialSupply",
47
31
  "type": "uint256"
48
32
  },
49
33
  {
50
- "internalType": "uint256",
51
- "name": "needed",
52
- "type": "uint256"
53
- }
54
- ],
55
- "name": "ERC20InsufficientBalance",
56
- "type": "error"
57
- },
58
- {
59
- "inputs": [
60
- {
61
- "internalType": "address",
62
- "name": "approver",
63
- "type": "address"
64
- }
65
- ],
66
- "name": "ERC20InvalidApprover",
67
- "type": "error"
68
- },
69
- {
70
- "inputs": [
71
- {
72
- "internalType": "address",
73
- "name": "receiver",
74
- "type": "address"
34
+ "internalType": "string",
35
+ "name": "_logoURI",
36
+ "type": "string"
75
37
  }
76
38
  ],
77
- "name": "ERC20InvalidReceiver",
78
- "type": "error"
39
+ "stateMutability": "nonpayable",
40
+ "type": "constructor"
79
41
  },
80
42
  {
43
+ "anonymous": false,
81
44
  "inputs": [
82
45
  {
46
+ "indexed": true,
83
47
  "internalType": "address",
84
- "name": "sender",
48
+ "name": "owner",
85
49
  "type": "address"
86
- }
87
- ],
88
- "name": "ERC20InvalidSender",
89
- "type": "error"
90
- },
91
- {
92
- "inputs": [
50
+ },
93
51
  {
52
+ "indexed": true,
94
53
  "internalType": "address",
95
54
  "name": "spender",
96
55
  "type": "address"
56
+ },
57
+ {
58
+ "indexed": false,
59
+ "internalType": "uint256",
60
+ "name": "value",
61
+ "type": "uint256"
97
62
  }
98
63
  ],
99
- "name": "ERC20InvalidSpender",
100
- "type": "error"
64
+ "name": "Approval",
65
+ "type": "event"
101
66
  },
102
67
  {
103
68
  "anonymous": false,
@@ -105,23 +70,17 @@ exports.TetherUSDT_jsonAbi = [
105
70
  {
106
71
  "indexed": true,
107
72
  "internalType": "address",
108
- "name": "owner",
73
+ "name": "previousOwner",
109
74
  "type": "address"
110
75
  },
111
76
  {
112
77
  "indexed": true,
113
78
  "internalType": "address",
114
- "name": "spender",
79
+ "name": "newOwner",
115
80
  "type": "address"
116
- },
117
- {
118
- "indexed": false,
119
- "internalType": "uint256",
120
- "name": "value",
121
- "type": "uint256"
122
81
  }
123
82
  ],
124
- "name": "Approval",
83
+ "name": "OwnershipTransferred",
125
84
  "type": "event"
126
85
  },
127
86
  {
@@ -153,12 +112,12 @@ exports.TetherUSDT_jsonAbi = [
153
112
  "inputs": [
154
113
  {
155
114
  "internalType": "address",
156
- "name": "owner",
115
+ "name": "",
157
116
  "type": "address"
158
117
  },
159
118
  {
160
119
  "internalType": "address",
161
- "name": "spender",
120
+ "name": "",
162
121
  "type": "address"
163
122
  }
164
123
  ],
@@ -201,7 +160,7 @@ exports.TetherUSDT_jsonAbi = [
201
160
  "inputs": [
202
161
  {
203
162
  "internalType": "address",
204
- "name": "account",
163
+ "name": "",
205
164
  "type": "address"
206
165
  }
207
166
  ],
@@ -216,6 +175,19 @@ exports.TetherUSDT_jsonAbi = [
216
175
  "stateMutability": "view",
217
176
  "type": "function"
218
177
  },
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
+ },
219
191
  {
220
192
  "inputs": [],
221
193
  "name": "decimals",
@@ -229,6 +201,37 @@ exports.TetherUSDT_jsonAbi = [
229
201
  "stateMutability": "view",
230
202
  "type": "function"
231
203
  },
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
+ },
232
235
  {
233
236
  "inputs": [],
234
237
  "name": "name",
@@ -242,6 +245,39 @@ exports.TetherUSDT_jsonAbi = [
242
245
  "stateMutability": "view",
243
246
  "type": "function"
244
247
  },
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
+ },
245
281
  {
246
282
  "inputs": [],
247
283
  "name": "symbol",
@@ -320,10 +356,23 @@ exports.TetherUSDT_jsonAbi = [
320
356
  ],
321
357
  "stateMutability": "nonpayable",
322
358
  "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"
323
372
  }
324
373
  ];
325
374
  /**
326
- * TetherUSDT_json Contract Class
375
+ * MyToken_json Contract Class
327
376
  *
328
377
  * Provides a class-based API similar to TypeChain for interacting with the contract.
329
378
  *
@@ -331,12 +380,12 @@ exports.TetherUSDT_jsonAbi = [
331
380
  * ```typescript
332
381
  * import { createPublicClient, createWalletClient, http } from 'viem';
333
382
  * import { mainnet } from 'viem/chains';
334
- * import { TetherUSDT_json } from 'TetherUSDT_json';
383
+ * import { MyToken_json } from 'MyToken_json';
335
384
  *
336
385
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
337
386
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
338
387
  *
339
- * const contract = new TetherUSDT_json('0x...', { publicClient, walletClient });
388
+ * const contract = new MyToken_json('0x...', { publicClient, walletClient });
340
389
  *
341
390
  * // Read functions
342
391
  * const result = await contract.balanceOf('0x...');
@@ -354,13 +403,13 @@ exports.TetherUSDT_jsonAbi = [
354
403
  * });
355
404
  * ```
356
405
  */
357
- class TetherUSDT_json {
406
+ class MyToken_json {
358
407
  constructor(address, clients) {
359
408
  this.contractAddress = address;
360
409
  this.publicClient = clients.publicClient;
361
410
  this.contract = (0, viem_1.getContract)({
362
411
  address,
363
- abi: exports.TetherUSDT_jsonAbi,
412
+ abi: exports.MyToken_jsonAbi,
364
413
  client: {
365
414
  public: clients.publicClient,
366
415
  wallet: clients.walletClient,
@@ -383,15 +432,22 @@ class TetherUSDT_json {
383
432
  * allowance
384
433
  * view
385
434
  */
386
- async allowance(owner, spender) {
387
- return this.contract.read.allowance([owner, spender]);
435
+ async allowance(arg0, arg1) {
436
+ return this.contract.read.allowance([arg0, arg1]);
388
437
  }
389
438
  /**
390
439
  * balanceOf
391
440
  * view
392
441
  */
393
- async balanceOf(account) {
394
- return this.contract.read.balanceOf([account]);
442
+ async balanceOf(arg0) {
443
+ return this.contract.read.balanceOf([arg0]);
444
+ }
445
+ /**
446
+ * cap
447
+ * view
448
+ */
449
+ async cap() {
450
+ return this.contract.read.cap();
395
451
  }
396
452
  /**
397
453
  * decimals
@@ -400,6 +456,13 @@ class TetherUSDT_json {
400
456
  async decimals() {
401
457
  return this.contract.read.decimals();
402
458
  }
459
+ /**
460
+ * logoURI
461
+ * view
462
+ */
463
+ async logoURI() {
464
+ return this.contract.read.logoURI();
465
+ }
403
466
  /**
404
467
  * name
405
468
  * view
@@ -407,6 +470,13 @@ class TetherUSDT_json {
407
470
  async name() {
408
471
  return this.contract.read.name();
409
472
  }
473
+ /**
474
+ * owner
475
+ * view
476
+ */
477
+ async owner() {
478
+ return this.contract.read.owner();
479
+ }
410
480
  /**
411
481
  * symbol
412
482
  * view
@@ -432,6 +502,39 @@ class TetherUSDT_json {
432
502
  }
433
503
  return this.contract.write.approve([spender, value], options);
434
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) {
533
+ if (!this.contract.write) {
534
+ throw new Error('Wallet client is required for write operations');
535
+ }
536
+ return this.contract.write.setLogoURI([_logoURI], options);
537
+ }
435
538
  /**
436
539
  * transfer
437
540
  * nonpayable
@@ -454,6 +557,17 @@ class TetherUSDT_json {
454
557
  }
455
558
  return this.contract.write.transferFrom([from, to, value], options);
456
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);
570
+ }
457
571
  /**
458
572
  * Simulate contract write operations (dry-run without sending transaction)
459
573
  *
@@ -476,6 +590,30 @@ class TetherUSDT_json {
476
590
  async approve(spender, value, options) {
477
591
  return contract.simulate.approve([spender, value], options);
478
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);
616
+ },
479
617
  /**
480
618
  * Simulate transfer
481
619
  * Returns gas estimate and result without sending transaction
@@ -491,6 +629,14 @@ class TetherUSDT_json {
491
629
  */
492
630
  async transferFrom(from, to, value, options) {
493
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);
494
640
  }
495
641
  };
496
642
  }
@@ -517,7 +663,7 @@ class TetherUSDT_json {
517
663
  Approval: (callback, filter) => {
518
664
  return this.publicClient.watchContractEvent({
519
665
  address: this.contractAddress,
520
- abi: exports.TetherUSDT_jsonAbi,
666
+ abi: exports.MyToken_jsonAbi,
521
667
  eventName: 'Approval',
522
668
  args: filter,
523
669
  onLogs: (logs) => {
@@ -527,6 +673,25 @@ class TetherUSDT_json {
527
673
  },
528
674
  });
529
675
  },
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
+ },
530
695
  /**
531
696
  * Watch Transfer events
532
697
  * @param callback Function to call when event is emitted
@@ -536,7 +701,7 @@ class TetherUSDT_json {
536
701
  Transfer: (callback, filter) => {
537
702
  return this.publicClient.watchContractEvent({
538
703
  address: this.contractAddress,
539
- abi: exports.TetherUSDT_jsonAbi,
704
+ abi: exports.MyToken_jsonAbi,
540
705
  eventName: 'Transfer',
541
706
  args: filter,
542
707
  onLogs: (logs) => {
@@ -549,4 +714,4 @@ class TetherUSDT_json {
549
714
  };
550
715
  }
551
716
  }
552
- exports.TetherUSDT_json = TetherUSDT_json;
717
+ exports.MyToken_json = MyToken_json;