@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.
- package/README.md +3 -3
- package/contracts/{TetherUSD_json.d.ts → USDToken_json.d.ts} +138 -168
- package/contracts/{TetherUSD_json.js → USDToken_json.js} +190 -187
- package/contracts/{TetherUSD_json.ts → USDToken_json.ts} +199 -216
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
|
@@ -2,45 +2,14 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* USDToken_json ABI
|
|
6
6
|
*
|
|
7
7
|
* This ABI is typed using viem's type system for full type safety.
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
9
|
+
export const USDToken_jsonAbi = [
|
|
10
10
|
{
|
|
11
|
-
"inputs": [
|
|
12
|
-
|
|
13
|
-
"internalType": "string",
|
|
14
|
-
"name": "name_",
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"internalType": "string",
|
|
19
|
-
"name": "symbol_",
|
|
20
|
-
"type": "string"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"internalType": "uint256",
|
|
24
|
-
"name": "decimals_",
|
|
25
|
-
"type": "uint256"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"internalType": "uint256",
|
|
29
|
-
"name": "initialBalance_",
|
|
30
|
-
"type": "uint256"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"internalType": "address",
|
|
34
|
-
"name": "tokenOwner",
|
|
35
|
-
"type": "address"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"internalType": "address payable",
|
|
39
|
-
"name": "feeReceiver_",
|
|
40
|
-
"type": "address"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"stateMutability": "payable",
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
44
13
|
"type": "constructor"
|
|
45
14
|
},
|
|
46
15
|
{
|
|
@@ -68,6 +37,19 @@ export const TetherUSD_jsonAbi = [
|
|
|
68
37
|
"name": "Approval",
|
|
69
38
|
"type": "event"
|
|
70
39
|
},
|
|
40
|
+
{
|
|
41
|
+
"anonymous": false,
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"indexed": false,
|
|
45
|
+
"internalType": "string",
|
|
46
|
+
"name": "newName",
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"name": "NameChanged",
|
|
51
|
+
"type": "event"
|
|
52
|
+
},
|
|
71
53
|
{
|
|
72
54
|
"anonymous": false,
|
|
73
55
|
"inputs": [
|
|
@@ -76,15 +58,22 @@ export const TetherUSD_jsonAbi = [
|
|
|
76
58
|
"internalType": "address",
|
|
77
59
|
"name": "previousOwner",
|
|
78
60
|
"type": "address"
|
|
79
|
-
}
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"name": "OwnershipRenounced",
|
|
64
|
+
"type": "event"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"anonymous": false,
|
|
68
|
+
"inputs": [
|
|
80
69
|
{
|
|
81
|
-
"indexed":
|
|
82
|
-
"internalType": "
|
|
83
|
-
"name": "
|
|
84
|
-
"type": "
|
|
70
|
+
"indexed": false,
|
|
71
|
+
"internalType": "string",
|
|
72
|
+
"name": "newSymbol",
|
|
73
|
+
"type": "string"
|
|
85
74
|
}
|
|
86
75
|
],
|
|
87
|
-
"name": "
|
|
76
|
+
"name": "SymbolChanged",
|
|
88
77
|
"type": "event"
|
|
89
78
|
},
|
|
90
79
|
{
|
|
@@ -112,42 +101,16 @@ export const TetherUSD_jsonAbi = [
|
|
|
112
101
|
"name": "Transfer",
|
|
113
102
|
"type": "event"
|
|
114
103
|
},
|
|
115
|
-
{
|
|
116
|
-
"inputs": [],
|
|
117
|
-
"name": "Optimization",
|
|
118
|
-
"outputs": [
|
|
119
|
-
{
|
|
120
|
-
"internalType": "uint256",
|
|
121
|
-
"name": "",
|
|
122
|
-
"type": "uint256"
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
"stateMutability": "view",
|
|
126
|
-
"type": "function"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"inputs": [],
|
|
130
|
-
"name": "_owner",
|
|
131
|
-
"outputs": [
|
|
132
|
-
{
|
|
133
|
-
"internalType": "address",
|
|
134
|
-
"name": "",
|
|
135
|
-
"type": "address"
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
"stateMutability": "view",
|
|
139
|
-
"type": "function"
|
|
140
|
-
},
|
|
141
104
|
{
|
|
142
105
|
"inputs": [
|
|
143
106
|
{
|
|
144
107
|
"internalType": "address",
|
|
145
|
-
"name": "
|
|
108
|
+
"name": "",
|
|
146
109
|
"type": "address"
|
|
147
110
|
},
|
|
148
111
|
{
|
|
149
112
|
"internalType": "address",
|
|
150
|
-
"name": "
|
|
113
|
+
"name": "",
|
|
151
114
|
"type": "address"
|
|
152
115
|
}
|
|
153
116
|
],
|
|
@@ -190,7 +153,7 @@ export const TetherUSD_jsonAbi = [
|
|
|
190
153
|
"inputs": [
|
|
191
154
|
{
|
|
192
155
|
"internalType": "address",
|
|
193
|
-
"name": "
|
|
156
|
+
"name": "",
|
|
194
157
|
"type": "address"
|
|
195
158
|
}
|
|
196
159
|
],
|
|
@@ -210,9 +173,9 @@ export const TetherUSD_jsonAbi = [
|
|
|
210
173
|
"name": "decimals",
|
|
211
174
|
"outputs": [
|
|
212
175
|
{
|
|
213
|
-
"internalType": "
|
|
176
|
+
"internalType": "uint8",
|
|
214
177
|
"name": "",
|
|
215
|
-
"type": "
|
|
178
|
+
"type": "uint8"
|
|
216
179
|
}
|
|
217
180
|
],
|
|
218
181
|
"stateMutability": "view",
|
|
@@ -267,21 +230,16 @@ export const TetherUSD_jsonAbi = [
|
|
|
267
230
|
"type": "function"
|
|
268
231
|
},
|
|
269
232
|
{
|
|
270
|
-
"inputs": [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
"name": "account",
|
|
274
|
-
"type": "address"
|
|
275
|
-
},
|
|
233
|
+
"inputs": [],
|
|
234
|
+
"name": "isRenounced",
|
|
235
|
+
"outputs": [
|
|
276
236
|
{
|
|
277
|
-
"internalType": "
|
|
278
|
-
"name": "
|
|
279
|
-
"type": "
|
|
237
|
+
"internalType": "bool",
|
|
238
|
+
"name": "",
|
|
239
|
+
"type": "bool"
|
|
280
240
|
}
|
|
281
241
|
],
|
|
282
|
-
"
|
|
283
|
-
"outputs": [],
|
|
284
|
-
"stateMutability": "nonpayable",
|
|
242
|
+
"stateMutability": "view",
|
|
285
243
|
"type": "function"
|
|
286
244
|
},
|
|
287
245
|
{
|
|
@@ -311,26 +269,47 @@ export const TetherUSD_jsonAbi = [
|
|
|
311
269
|
"type": "function"
|
|
312
270
|
},
|
|
313
271
|
{
|
|
314
|
-
"inputs": [
|
|
272
|
+
"inputs": [],
|
|
273
|
+
"name": "renounceOwnership",
|
|
274
|
+
"outputs": [],
|
|
275
|
+
"stateMutability": "nonpayable",
|
|
276
|
+
"type": "function"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"inputs": [],
|
|
280
|
+
"name": "renounced",
|
|
281
|
+
"outputs": [
|
|
315
282
|
{
|
|
316
|
-
"internalType": "
|
|
317
|
-
"name": "
|
|
318
|
-
"type": "
|
|
319
|
-
}
|
|
283
|
+
"internalType": "bool",
|
|
284
|
+
"name": "",
|
|
285
|
+
"type": "bool"
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"stateMutability": "view",
|
|
289
|
+
"type": "function"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"inputs": [
|
|
320
293
|
{
|
|
321
|
-
"internalType": "
|
|
322
|
-
"name": "
|
|
323
|
-
"type": "
|
|
294
|
+
"internalType": "string",
|
|
295
|
+
"name": "newName",
|
|
296
|
+
"type": "string"
|
|
324
297
|
}
|
|
325
298
|
],
|
|
326
|
-
"name": "
|
|
299
|
+
"name": "setName",
|
|
327
300
|
"outputs": [],
|
|
328
301
|
"stateMutability": "nonpayable",
|
|
329
302
|
"type": "function"
|
|
330
303
|
},
|
|
331
304
|
{
|
|
332
|
-
"inputs": [
|
|
333
|
-
|
|
305
|
+
"inputs": [
|
|
306
|
+
{
|
|
307
|
+
"internalType": "string",
|
|
308
|
+
"name": "newSymbol",
|
|
309
|
+
"type": "string"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"name": "setSymbol",
|
|
334
313
|
"outputs": [],
|
|
335
314
|
"stateMutability": "nonpayable",
|
|
336
315
|
"type": "function"
|
|
@@ -348,6 +327,19 @@ export const TetherUSD_jsonAbi = [
|
|
|
348
327
|
"stateMutability": "view",
|
|
349
328
|
"type": "function"
|
|
350
329
|
},
|
|
330
|
+
{
|
|
331
|
+
"inputs": [],
|
|
332
|
+
"name": "tokenImage",
|
|
333
|
+
"outputs": [
|
|
334
|
+
{
|
|
335
|
+
"internalType": "string",
|
|
336
|
+
"name": "",
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"stateMutability": "pure",
|
|
341
|
+
"type": "function"
|
|
342
|
+
},
|
|
351
343
|
{
|
|
352
344
|
"inputs": [],
|
|
353
345
|
"name": "totalSupply",
|
|
@@ -365,7 +357,7 @@ export const TetherUSD_jsonAbi = [
|
|
|
365
357
|
"inputs": [
|
|
366
358
|
{
|
|
367
359
|
"internalType": "address",
|
|
368
|
-
"name": "
|
|
360
|
+
"name": "to",
|
|
369
361
|
"type": "address"
|
|
370
362
|
},
|
|
371
363
|
{
|
|
@@ -389,12 +381,12 @@ export const TetherUSD_jsonAbi = [
|
|
|
389
381
|
"inputs": [
|
|
390
382
|
{
|
|
391
383
|
"internalType": "address",
|
|
392
|
-
"name": "
|
|
384
|
+
"name": "from",
|
|
393
385
|
"type": "address"
|
|
394
386
|
},
|
|
395
387
|
{
|
|
396
388
|
"internalType": "address",
|
|
397
|
-
"name": "
|
|
389
|
+
"name": "to",
|
|
398
390
|
"type": "address"
|
|
399
391
|
},
|
|
400
392
|
{
|
|
@@ -413,36 +405,23 @@ export const TetherUSD_jsonAbi = [
|
|
|
413
405
|
],
|
|
414
406
|
"stateMutability": "nonpayable",
|
|
415
407
|
"type": "function"
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
"inputs": [
|
|
419
|
-
{
|
|
420
|
-
"internalType": "address",
|
|
421
|
-
"name": "newOwner",
|
|
422
|
-
"type": "address"
|
|
423
|
-
}
|
|
424
|
-
],
|
|
425
|
-
"name": "transferOwnership",
|
|
426
|
-
"outputs": [],
|
|
427
|
-
"stateMutability": "nonpayable",
|
|
428
|
-
"type": "function"
|
|
429
408
|
}
|
|
430
409
|
] as const satisfies Abi;
|
|
431
410
|
|
|
432
411
|
/**
|
|
433
|
-
* Type-safe ABI for
|
|
412
|
+
* Type-safe ABI for USDToken_json
|
|
434
413
|
*/
|
|
435
|
-
export type
|
|
414
|
+
export type USDToken_jsonAbi = typeof USDToken_jsonAbi;
|
|
436
415
|
|
|
437
416
|
/**
|
|
438
|
-
* Contract instance type for
|
|
417
|
+
* Contract instance type for USDToken_json
|
|
439
418
|
*/
|
|
440
419
|
// Use any for contract type to avoid complex viem type issues
|
|
441
420
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
442
|
-
export type
|
|
421
|
+
export type USDToken_jsonContract = any;
|
|
443
422
|
|
|
444
423
|
/**
|
|
445
|
-
*
|
|
424
|
+
* USDToken_json Contract Class
|
|
446
425
|
*
|
|
447
426
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
448
427
|
*
|
|
@@ -450,12 +429,12 @@ export type TetherUSD_jsonContract = any;
|
|
|
450
429
|
* ```typescript
|
|
451
430
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
452
431
|
* import { mainnet } from 'viem/chains';
|
|
453
|
-
* import {
|
|
432
|
+
* import { USDToken_json } from 'USDToken_json';
|
|
454
433
|
*
|
|
455
434
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
456
435
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
457
436
|
*
|
|
458
|
-
* const contract = new
|
|
437
|
+
* const contract = new USDToken_json('0x...', { publicClient, walletClient });
|
|
459
438
|
*
|
|
460
439
|
* // Read functions
|
|
461
440
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -473,8 +452,8 @@ export type TetherUSD_jsonContract = any;
|
|
|
473
452
|
* });
|
|
474
453
|
* ```
|
|
475
454
|
*/
|
|
476
|
-
export class
|
|
477
|
-
private contract:
|
|
455
|
+
export class USDToken_json {
|
|
456
|
+
private contract: USDToken_jsonContract;
|
|
478
457
|
private contractAddress: Address;
|
|
479
458
|
private publicClient: PublicClient;
|
|
480
459
|
|
|
@@ -489,7 +468,7 @@ export class TetherUSD_json {
|
|
|
489
468
|
this.publicClient = clients.publicClient;
|
|
490
469
|
this.contract = getContract({
|
|
491
470
|
address,
|
|
492
|
-
abi:
|
|
471
|
+
abi: USDToken_jsonAbi,
|
|
493
472
|
client: {
|
|
494
473
|
public: clients.publicClient,
|
|
495
474
|
wallet: clients.walletClient,
|
|
@@ -507,40 +486,24 @@ export class TetherUSD_json {
|
|
|
507
486
|
/**
|
|
508
487
|
* Get the underlying viem contract instance
|
|
509
488
|
*/
|
|
510
|
-
getContract():
|
|
489
|
+
getContract(): USDToken_jsonContract {
|
|
511
490
|
return this.contract;
|
|
512
491
|
}
|
|
513
492
|
|
|
514
|
-
/**
|
|
515
|
-
* Optimization
|
|
516
|
-
* view
|
|
517
|
-
*/
|
|
518
|
-
async Optimization(): Promise<bigint> {
|
|
519
|
-
return this.contract.read.Optimization() as Promise<bigint>;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* _owner
|
|
524
|
-
* view
|
|
525
|
-
*/
|
|
526
|
-
async _owner(): Promise<`0x${string}`> {
|
|
527
|
-
return this.contract.read._owner() as Promise<`0x${string}`>;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
493
|
/**
|
|
531
494
|
* allowance
|
|
532
495
|
* view
|
|
533
496
|
*/
|
|
534
|
-
async allowance(
|
|
535
|
-
return this.contract.read.allowance([
|
|
497
|
+
async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
|
|
498
|
+
return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
|
|
536
499
|
}
|
|
537
500
|
|
|
538
501
|
/**
|
|
539
502
|
* balanceOf
|
|
540
503
|
* view
|
|
541
504
|
*/
|
|
542
|
-
async balanceOf(
|
|
543
|
-
return this.contract.read.balanceOf([
|
|
505
|
+
async balanceOf(arg0: `0x${string}`): Promise<bigint> {
|
|
506
|
+
return this.contract.read.balanceOf([arg0] as const) as Promise<bigint>;
|
|
544
507
|
}
|
|
545
508
|
|
|
546
509
|
/**
|
|
@@ -551,6 +514,14 @@ export class TetherUSD_json {
|
|
|
551
514
|
return this.contract.read.decimals() as Promise<bigint>;
|
|
552
515
|
}
|
|
553
516
|
|
|
517
|
+
/**
|
|
518
|
+
* isRenounced
|
|
519
|
+
* view
|
|
520
|
+
*/
|
|
521
|
+
async isRenounced(): Promise<boolean> {
|
|
522
|
+
return this.contract.read.isRenounced() as Promise<boolean>;
|
|
523
|
+
}
|
|
524
|
+
|
|
554
525
|
/**
|
|
555
526
|
* name
|
|
556
527
|
* view
|
|
@@ -567,6 +538,14 @@ export class TetherUSD_json {
|
|
|
567
538
|
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
568
539
|
}
|
|
569
540
|
|
|
541
|
+
/**
|
|
542
|
+
* renounced
|
|
543
|
+
* view
|
|
544
|
+
*/
|
|
545
|
+
async renounced(): Promise<boolean> {
|
|
546
|
+
return this.contract.read.renounced() as Promise<boolean>;
|
|
547
|
+
}
|
|
548
|
+
|
|
570
549
|
/**
|
|
571
550
|
* symbol
|
|
572
551
|
* view
|
|
@@ -575,6 +554,14 @@ export class TetherUSD_json {
|
|
|
575
554
|
return this.contract.read.symbol() as Promise<string>;
|
|
576
555
|
}
|
|
577
556
|
|
|
557
|
+
/**
|
|
558
|
+
* tokenImage
|
|
559
|
+
* pure
|
|
560
|
+
*/
|
|
561
|
+
async tokenImage(): Promise<string> {
|
|
562
|
+
return this.contract.read.tokenImage() as Promise<string>;
|
|
563
|
+
}
|
|
564
|
+
|
|
578
565
|
/**
|
|
579
566
|
* totalSupply
|
|
580
567
|
* view
|
|
@@ -653,11 +640,11 @@ export class TetherUSD_json {
|
|
|
653
640
|
}
|
|
654
641
|
|
|
655
642
|
/**
|
|
656
|
-
*
|
|
643
|
+
* renounceOwnership
|
|
657
644
|
* nonpayable
|
|
658
645
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
659
646
|
*/
|
|
660
|
-
async
|
|
647
|
+
async renounceOwnership(options?: {
|
|
661
648
|
accessList?: import('viem').AccessList;
|
|
662
649
|
authorizationList?: import('viem').AuthorizationList;
|
|
663
650
|
chain?: import('viem').Chain | null;
|
|
@@ -672,15 +659,15 @@ export class TetherUSD_json {
|
|
|
672
659
|
if (!this.contract.write) {
|
|
673
660
|
throw new Error('Wallet client is required for write operations');
|
|
674
661
|
}
|
|
675
|
-
return this.contract.write.
|
|
662
|
+
return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
|
|
676
663
|
}
|
|
677
664
|
|
|
678
665
|
/**
|
|
679
|
-
*
|
|
666
|
+
* setName
|
|
680
667
|
* nonpayable
|
|
681
668
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
682
669
|
*/
|
|
683
|
-
async
|
|
670
|
+
async setName(newName: string, options?: {
|
|
684
671
|
accessList?: import('viem').AccessList;
|
|
685
672
|
authorizationList?: import('viem').AuthorizationList;
|
|
686
673
|
chain?: import('viem').Chain | null;
|
|
@@ -695,15 +682,15 @@ export class TetherUSD_json {
|
|
|
695
682
|
if (!this.contract.write) {
|
|
696
683
|
throw new Error('Wallet client is required for write operations');
|
|
697
684
|
}
|
|
698
|
-
return this.contract.write.
|
|
685
|
+
return this.contract.write.setName([newName] as const, options) as Promise<`0x${string}`>;
|
|
699
686
|
}
|
|
700
687
|
|
|
701
688
|
/**
|
|
702
|
-
*
|
|
689
|
+
* setSymbol
|
|
703
690
|
* nonpayable
|
|
704
691
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
705
692
|
*/
|
|
706
|
-
async
|
|
693
|
+
async setSymbol(newSymbol: string, options?: {
|
|
707
694
|
accessList?: import('viem').AccessList;
|
|
708
695
|
authorizationList?: import('viem').AuthorizationList;
|
|
709
696
|
chain?: import('viem').Chain | null;
|
|
@@ -718,7 +705,7 @@ export class TetherUSD_json {
|
|
|
718
705
|
if (!this.contract.write) {
|
|
719
706
|
throw new Error('Wallet client is required for write operations');
|
|
720
707
|
}
|
|
721
|
-
return this.contract.write.
|
|
708
|
+
return this.contract.write.setSymbol([newSymbol] as const, options) as Promise<`0x${string}`>;
|
|
722
709
|
}
|
|
723
710
|
|
|
724
711
|
/**
|
|
@@ -726,7 +713,7 @@ export class TetherUSD_json {
|
|
|
726
713
|
* nonpayable
|
|
727
714
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
728
715
|
*/
|
|
729
|
-
async transfer(
|
|
716
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
730
717
|
accessList?: import('viem').AccessList;
|
|
731
718
|
authorizationList?: import('viem').AuthorizationList;
|
|
732
719
|
chain?: import('viem').Chain | null;
|
|
@@ -741,7 +728,7 @@ export class TetherUSD_json {
|
|
|
741
728
|
if (!this.contract.write) {
|
|
742
729
|
throw new Error('Wallet client is required for write operations');
|
|
743
730
|
}
|
|
744
|
-
return this.contract.write.transfer([
|
|
731
|
+
return this.contract.write.transfer([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
745
732
|
}
|
|
746
733
|
|
|
747
734
|
/**
|
|
@@ -749,7 +736,7 @@ export class TetherUSD_json {
|
|
|
749
736
|
* nonpayable
|
|
750
737
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
751
738
|
*/
|
|
752
|
-
async transferFrom(
|
|
739
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
753
740
|
accessList?: import('viem').AccessList;
|
|
754
741
|
authorizationList?: import('viem').AuthorizationList;
|
|
755
742
|
chain?: import('viem').Chain | null;
|
|
@@ -764,30 +751,7 @@ export class TetherUSD_json {
|
|
|
764
751
|
if (!this.contract.write) {
|
|
765
752
|
throw new Error('Wallet client is required for write operations');
|
|
766
753
|
}
|
|
767
|
-
return this.contract.write.transferFrom([
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* transferOwnership
|
|
772
|
-
* nonpayable
|
|
773
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
774
|
-
*/
|
|
775
|
-
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
776
|
-
accessList?: import('viem').AccessList;
|
|
777
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
778
|
-
chain?: import('viem').Chain | null;
|
|
779
|
-
dataSuffix?: `0x${string}`;
|
|
780
|
-
gas?: bigint;
|
|
781
|
-
gasPrice?: bigint;
|
|
782
|
-
maxFeePerGas?: bigint;
|
|
783
|
-
maxPriorityFeePerGas?: bigint;
|
|
784
|
-
nonce?: number;
|
|
785
|
-
value?: bigint;
|
|
786
|
-
}): Promise<`0x${string}`> {
|
|
787
|
-
if (!this.contract.write) {
|
|
788
|
-
throw new Error('Wallet client is required for write operations');
|
|
789
|
-
}
|
|
790
|
-
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
754
|
+
return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
|
|
791
755
|
}
|
|
792
756
|
|
|
793
757
|
|
|
@@ -864,11 +828,11 @@ export class TetherUSD_json {
|
|
|
864
828
|
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
865
829
|
},
|
|
866
830
|
/**
|
|
867
|
-
* Simulate
|
|
831
|
+
* Simulate renounceOwnership
|
|
868
832
|
* Returns gas estimate and result without sending transaction
|
|
869
833
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
870
834
|
*/
|
|
871
|
-
async
|
|
835
|
+
async renounceOwnership(options?: {
|
|
872
836
|
accessList?: import('viem').AccessList;
|
|
873
837
|
authorizationList?: import('viem').AuthorizationList;
|
|
874
838
|
chain?: import('viem').Chain | null;
|
|
@@ -880,14 +844,14 @@ export class TetherUSD_json {
|
|
|
880
844
|
nonce?: number;
|
|
881
845
|
value?: bigint;
|
|
882
846
|
}): Promise<void> {
|
|
883
|
-
return contract.simulate.
|
|
847
|
+
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
884
848
|
},
|
|
885
849
|
/**
|
|
886
|
-
* Simulate
|
|
850
|
+
* Simulate setName
|
|
887
851
|
* Returns gas estimate and result without sending transaction
|
|
888
852
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
889
853
|
*/
|
|
890
|
-
async
|
|
854
|
+
async setName(newName: string, options?: {
|
|
891
855
|
accessList?: import('viem').AccessList;
|
|
892
856
|
authorizationList?: import('viem').AuthorizationList;
|
|
893
857
|
chain?: import('viem').Chain | null;
|
|
@@ -899,14 +863,14 @@ export class TetherUSD_json {
|
|
|
899
863
|
nonce?: number;
|
|
900
864
|
value?: bigint;
|
|
901
865
|
}): Promise<void> {
|
|
902
|
-
return contract.simulate.
|
|
866
|
+
return contract.simulate.setName([newName] as const, options) as Promise<void>;
|
|
903
867
|
},
|
|
904
868
|
/**
|
|
905
|
-
* Simulate
|
|
869
|
+
* Simulate setSymbol
|
|
906
870
|
* Returns gas estimate and result without sending transaction
|
|
907
871
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
908
872
|
*/
|
|
909
|
-
async
|
|
873
|
+
async setSymbol(newSymbol: string, options?: {
|
|
910
874
|
accessList?: import('viem').AccessList;
|
|
911
875
|
authorizationList?: import('viem').AuthorizationList;
|
|
912
876
|
chain?: import('viem').Chain | null;
|
|
@@ -918,14 +882,14 @@ export class TetherUSD_json {
|
|
|
918
882
|
nonce?: number;
|
|
919
883
|
value?: bigint;
|
|
920
884
|
}): Promise<void> {
|
|
921
|
-
return contract.simulate.
|
|
885
|
+
return contract.simulate.setSymbol([newSymbol] as const, options) as Promise<void>;
|
|
922
886
|
},
|
|
923
887
|
/**
|
|
924
888
|
* Simulate transfer
|
|
925
889
|
* Returns gas estimate and result without sending transaction
|
|
926
890
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
927
891
|
*/
|
|
928
|
-
async transfer(
|
|
892
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
929
893
|
accessList?: import('viem').AccessList;
|
|
930
894
|
authorizationList?: import('viem').AuthorizationList;
|
|
931
895
|
chain?: import('viem').Chain | null;
|
|
@@ -937,14 +901,14 @@ export class TetherUSD_json {
|
|
|
937
901
|
nonce?: number;
|
|
938
902
|
value?: bigint;
|
|
939
903
|
}): Promise<boolean> {
|
|
940
|
-
return contract.simulate.transfer([
|
|
904
|
+
return contract.simulate.transfer([to, amount] as const, options) as Promise<boolean>;
|
|
941
905
|
},
|
|
942
906
|
/**
|
|
943
907
|
* Simulate transferFrom
|
|
944
908
|
* Returns gas estimate and result without sending transaction
|
|
945
909
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
946
910
|
*/
|
|
947
|
-
async transferFrom(
|
|
911
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
948
912
|
accessList?: import('viem').AccessList;
|
|
949
913
|
authorizationList?: import('viem').AuthorizationList;
|
|
950
914
|
chain?: import('viem').Chain | null;
|
|
@@ -956,26 +920,7 @@ export class TetherUSD_json {
|
|
|
956
920
|
nonce?: number;
|
|
957
921
|
value?: bigint;
|
|
958
922
|
}): Promise<boolean> {
|
|
959
|
-
return contract.simulate.transferFrom([
|
|
960
|
-
},
|
|
961
|
-
/**
|
|
962
|
-
* Simulate transferOwnership
|
|
963
|
-
* Returns gas estimate and result without sending transaction
|
|
964
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
965
|
-
*/
|
|
966
|
-
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
967
|
-
accessList?: import('viem').AccessList;
|
|
968
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
969
|
-
chain?: import('viem').Chain | null;
|
|
970
|
-
dataSuffix?: `0x${string}`;
|
|
971
|
-
gas?: bigint;
|
|
972
|
-
gasPrice?: bigint;
|
|
973
|
-
maxFeePerGas?: bigint;
|
|
974
|
-
maxPriorityFeePerGas?: bigint;
|
|
975
|
-
nonce?: number;
|
|
976
|
-
value?: bigint;
|
|
977
|
-
}): Promise<void> {
|
|
978
|
-
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
923
|
+
return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
|
|
979
924
|
}
|
|
980
925
|
};
|
|
981
926
|
}
|
|
@@ -1003,7 +948,7 @@ export class TetherUSD_json {
|
|
|
1003
948
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
1004
949
|
return this.publicClient.watchContractEvent({
|
|
1005
950
|
address: this.contractAddress,
|
|
1006
|
-
abi:
|
|
951
|
+
abi: USDToken_jsonAbi,
|
|
1007
952
|
eventName: 'Approval',
|
|
1008
953
|
args: filter,
|
|
1009
954
|
onLogs: (logs: any[]) => {
|
|
@@ -1014,16 +959,35 @@ export class TetherUSD_json {
|
|
|
1014
959
|
}) as () => void;
|
|
1015
960
|
},
|
|
1016
961
|
/**
|
|
1017
|
-
* Watch
|
|
962
|
+
* Watch NameChanged events
|
|
963
|
+
* @param callback Function to call when event is emitted
|
|
964
|
+
* @param filter Optional filter for indexed parameters
|
|
965
|
+
* @returns Unwatch function to stop listening
|
|
966
|
+
*/
|
|
967
|
+
NameChanged: (callback: (event: { newName: string }) => void) => {
|
|
968
|
+
return this.publicClient.watchContractEvent({
|
|
969
|
+
address: this.contractAddress,
|
|
970
|
+
abi: USDToken_jsonAbi,
|
|
971
|
+
eventName: 'NameChanged',
|
|
972
|
+
|
|
973
|
+
onLogs: (logs: any[]) => {
|
|
974
|
+
logs.forEach((log: any) => {
|
|
975
|
+
callback(log.args as any);
|
|
976
|
+
});
|
|
977
|
+
},
|
|
978
|
+
}) as () => void;
|
|
979
|
+
},
|
|
980
|
+
/**
|
|
981
|
+
* Watch OwnershipRenounced events
|
|
1018
982
|
* @param callback Function to call when event is emitted
|
|
1019
983
|
* @param filter Optional filter for indexed parameters
|
|
1020
984
|
* @returns Unwatch function to stop listening
|
|
1021
985
|
*/
|
|
1022
|
-
|
|
986
|
+
OwnershipRenounced: (callback: (event: { previousOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}` }) => {
|
|
1023
987
|
return this.publicClient.watchContractEvent({
|
|
1024
988
|
address: this.contractAddress,
|
|
1025
|
-
abi:
|
|
1026
|
-
eventName: '
|
|
989
|
+
abi: USDToken_jsonAbi,
|
|
990
|
+
eventName: 'OwnershipRenounced',
|
|
1027
991
|
args: filter,
|
|
1028
992
|
onLogs: (logs: any[]) => {
|
|
1029
993
|
logs.forEach((log: any) => {
|
|
@@ -1032,6 +996,25 @@ export class TetherUSD_json {
|
|
|
1032
996
|
},
|
|
1033
997
|
}) as () => void;
|
|
1034
998
|
},
|
|
999
|
+
/**
|
|
1000
|
+
* Watch SymbolChanged events
|
|
1001
|
+
* @param callback Function to call when event is emitted
|
|
1002
|
+
* @param filter Optional filter for indexed parameters
|
|
1003
|
+
* @returns Unwatch function to stop listening
|
|
1004
|
+
*/
|
|
1005
|
+
SymbolChanged: (callback: (event: { newSymbol: string }) => void) => {
|
|
1006
|
+
return this.publicClient.watchContractEvent({
|
|
1007
|
+
address: this.contractAddress,
|
|
1008
|
+
abi: USDToken_jsonAbi,
|
|
1009
|
+
eventName: 'SymbolChanged',
|
|
1010
|
+
|
|
1011
|
+
onLogs: (logs: any[]) => {
|
|
1012
|
+
logs.forEach((log: any) => {
|
|
1013
|
+
callback(log.args as any);
|
|
1014
|
+
});
|
|
1015
|
+
},
|
|
1016
|
+
}) as () => void;
|
|
1017
|
+
},
|
|
1035
1018
|
/**
|
|
1036
1019
|
* Watch Transfer events
|
|
1037
1020
|
* @param callback Function to call when event is emitted
|
|
@@ -1041,7 +1024,7 @@ export class TetherUSD_json {
|
|
|
1041
1024
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
1042
1025
|
return this.publicClient.watchContractEvent({
|
|
1043
1026
|
address: this.contractAddress,
|
|
1044
|
-
abi:
|
|
1027
|
+
abi: USDToken_jsonAbi,
|
|
1045
1028
|
eventName: 'Transfer',
|
|
1046
1029
|
args: filter,
|
|
1047
1030
|
onLogs: (logs: any[]) => {
|