@gitmyabi/usdt 1.0.19 → 1.0.20
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/{USDToken_json.d.ts → SimpleUSDTToken_json.d.ts} +36 -320
- package/contracts/{USDToken_json.js → SimpleUSDTToken_json.js} +46 -333
- package/contracts/{USDToken_json.ts → SimpleUSDTToken_json.ts} +50 -434
- 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,13 +2,19 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* SimpleUSDTToken_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 SimpleUSDTToken_jsonAbi = [
|
|
10
10
|
{
|
|
11
|
-
"inputs": [
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "uint256",
|
|
14
|
+
"name": "initialSupply",
|
|
15
|
+
"type": "uint256"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
12
18
|
"stateMutability": "nonpayable",
|
|
13
19
|
"type": "constructor"
|
|
14
20
|
},
|
|
@@ -37,45 +43,6 @@ export const USDToken_jsonAbi = [
|
|
|
37
43
|
"name": "Approval",
|
|
38
44
|
"type": "event"
|
|
39
45
|
},
|
|
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
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"anonymous": false,
|
|
55
|
-
"inputs": [
|
|
56
|
-
{
|
|
57
|
-
"indexed": true,
|
|
58
|
-
"internalType": "address",
|
|
59
|
-
"name": "previousOwner",
|
|
60
|
-
"type": "address"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"name": "OwnershipRenounced",
|
|
64
|
-
"type": "event"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"anonymous": false,
|
|
68
|
-
"inputs": [
|
|
69
|
-
{
|
|
70
|
-
"indexed": false,
|
|
71
|
-
"internalType": "string",
|
|
72
|
-
"name": "newSymbol",
|
|
73
|
-
"type": "string"
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
"name": "SymbolChanged",
|
|
77
|
-
"type": "event"
|
|
78
|
-
},
|
|
79
46
|
{
|
|
80
47
|
"anonymous": false,
|
|
81
48
|
"inputs": [
|
|
@@ -134,7 +101,7 @@ export const USDToken_jsonAbi = [
|
|
|
134
101
|
},
|
|
135
102
|
{
|
|
136
103
|
"internalType": "uint256",
|
|
137
|
-
"name": "
|
|
104
|
+
"name": "value",
|
|
138
105
|
"type": "uint256"
|
|
139
106
|
}
|
|
140
107
|
],
|
|
@@ -142,7 +109,7 @@ export const USDToken_jsonAbi = [
|
|
|
142
109
|
"outputs": [
|
|
143
110
|
{
|
|
144
111
|
"internalType": "bool",
|
|
145
|
-
"name": "",
|
|
112
|
+
"name": "success",
|
|
146
113
|
"type": "bool"
|
|
147
114
|
}
|
|
148
115
|
],
|
|
@@ -185,63 +152,20 @@ export const USDToken_jsonAbi = [
|
|
|
185
152
|
"inputs": [
|
|
186
153
|
{
|
|
187
154
|
"internalType": "address",
|
|
188
|
-
"name": "
|
|
189
|
-
"type": "address"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"internalType": "uint256",
|
|
193
|
-
"name": "subtractedValue",
|
|
194
|
-
"type": "uint256"
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
"name": "decreaseAllowance",
|
|
198
|
-
"outputs": [
|
|
199
|
-
{
|
|
200
|
-
"internalType": "bool",
|
|
201
|
-
"name": "",
|
|
202
|
-
"type": "bool"
|
|
203
|
-
}
|
|
204
|
-
],
|
|
205
|
-
"stateMutability": "nonpayable",
|
|
206
|
-
"type": "function"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"inputs": [
|
|
210
|
-
{
|
|
211
|
-
"internalType": "address",
|
|
212
|
-
"name": "spender",
|
|
155
|
+
"name": "to",
|
|
213
156
|
"type": "address"
|
|
214
157
|
},
|
|
215
158
|
{
|
|
216
159
|
"internalType": "uint256",
|
|
217
|
-
"name": "
|
|
160
|
+
"name": "amount",
|
|
218
161
|
"type": "uint256"
|
|
219
162
|
}
|
|
220
163
|
],
|
|
221
|
-
"name": "
|
|
222
|
-
"outputs": [
|
|
223
|
-
{
|
|
224
|
-
"internalType": "bool",
|
|
225
|
-
"name": "",
|
|
226
|
-
"type": "bool"
|
|
227
|
-
}
|
|
228
|
-
],
|
|
164
|
+
"name": "mint",
|
|
165
|
+
"outputs": [],
|
|
229
166
|
"stateMutability": "nonpayable",
|
|
230
167
|
"type": "function"
|
|
231
168
|
},
|
|
232
|
-
{
|
|
233
|
-
"inputs": [],
|
|
234
|
-
"name": "isRenounced",
|
|
235
|
-
"outputs": [
|
|
236
|
-
{
|
|
237
|
-
"internalType": "bool",
|
|
238
|
-
"name": "",
|
|
239
|
-
"type": "bool"
|
|
240
|
-
}
|
|
241
|
-
],
|
|
242
|
-
"stateMutability": "view",
|
|
243
|
-
"type": "function"
|
|
244
|
-
},
|
|
245
169
|
{
|
|
246
170
|
"inputs": [],
|
|
247
171
|
"name": "name",
|
|
@@ -268,52 +192,6 @@ export const USDToken_jsonAbi = [
|
|
|
268
192
|
"stateMutability": "view",
|
|
269
193
|
"type": "function"
|
|
270
194
|
},
|
|
271
|
-
{
|
|
272
|
-
"inputs": [],
|
|
273
|
-
"name": "renounceOwnership",
|
|
274
|
-
"outputs": [],
|
|
275
|
-
"stateMutability": "nonpayable",
|
|
276
|
-
"type": "function"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"inputs": [],
|
|
280
|
-
"name": "renounced",
|
|
281
|
-
"outputs": [
|
|
282
|
-
{
|
|
283
|
-
"internalType": "bool",
|
|
284
|
-
"name": "",
|
|
285
|
-
"type": "bool"
|
|
286
|
-
}
|
|
287
|
-
],
|
|
288
|
-
"stateMutability": "view",
|
|
289
|
-
"type": "function"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"inputs": [
|
|
293
|
-
{
|
|
294
|
-
"internalType": "string",
|
|
295
|
-
"name": "newName",
|
|
296
|
-
"type": "string"
|
|
297
|
-
}
|
|
298
|
-
],
|
|
299
|
-
"name": "setName",
|
|
300
|
-
"outputs": [],
|
|
301
|
-
"stateMutability": "nonpayable",
|
|
302
|
-
"type": "function"
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
"inputs": [
|
|
306
|
-
{
|
|
307
|
-
"internalType": "string",
|
|
308
|
-
"name": "newSymbol",
|
|
309
|
-
"type": "string"
|
|
310
|
-
}
|
|
311
|
-
],
|
|
312
|
-
"name": "setSymbol",
|
|
313
|
-
"outputs": [],
|
|
314
|
-
"stateMutability": "nonpayable",
|
|
315
|
-
"type": "function"
|
|
316
|
-
},
|
|
317
195
|
{
|
|
318
196
|
"inputs": [],
|
|
319
197
|
"name": "symbol",
|
|
@@ -327,19 +205,6 @@ export const USDToken_jsonAbi = [
|
|
|
327
205
|
"stateMutability": "view",
|
|
328
206
|
"type": "function"
|
|
329
207
|
},
|
|
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
|
-
},
|
|
343
208
|
{
|
|
344
209
|
"inputs": [],
|
|
345
210
|
"name": "totalSupply",
|
|
@@ -362,7 +227,7 @@ export const USDToken_jsonAbi = [
|
|
|
362
227
|
},
|
|
363
228
|
{
|
|
364
229
|
"internalType": "uint256",
|
|
365
|
-
"name": "
|
|
230
|
+
"name": "value",
|
|
366
231
|
"type": "uint256"
|
|
367
232
|
}
|
|
368
233
|
],
|
|
@@ -370,7 +235,7 @@ export const USDToken_jsonAbi = [
|
|
|
370
235
|
"outputs": [
|
|
371
236
|
{
|
|
372
237
|
"internalType": "bool",
|
|
373
|
-
"name": "",
|
|
238
|
+
"name": "success",
|
|
374
239
|
"type": "bool"
|
|
375
240
|
}
|
|
376
241
|
],
|
|
@@ -391,7 +256,7 @@ export const USDToken_jsonAbi = [
|
|
|
391
256
|
},
|
|
392
257
|
{
|
|
393
258
|
"internalType": "uint256",
|
|
394
|
-
"name": "
|
|
259
|
+
"name": "value",
|
|
395
260
|
"type": "uint256"
|
|
396
261
|
}
|
|
397
262
|
],
|
|
@@ -399,7 +264,7 @@ export const USDToken_jsonAbi = [
|
|
|
399
264
|
"outputs": [
|
|
400
265
|
{
|
|
401
266
|
"internalType": "bool",
|
|
402
|
-
"name": "",
|
|
267
|
+
"name": "success",
|
|
403
268
|
"type": "bool"
|
|
404
269
|
}
|
|
405
270
|
],
|
|
@@ -409,19 +274,19 @@ export const USDToken_jsonAbi = [
|
|
|
409
274
|
] as const satisfies Abi;
|
|
410
275
|
|
|
411
276
|
/**
|
|
412
|
-
* Type-safe ABI for
|
|
277
|
+
* Type-safe ABI for SimpleUSDTToken_json
|
|
413
278
|
*/
|
|
414
|
-
export type
|
|
279
|
+
export type SimpleUSDTToken_jsonAbi = typeof SimpleUSDTToken_jsonAbi;
|
|
415
280
|
|
|
416
281
|
/**
|
|
417
|
-
* Contract instance type for
|
|
282
|
+
* Contract instance type for SimpleUSDTToken_json
|
|
418
283
|
*/
|
|
419
284
|
// Use any for contract type to avoid complex viem type issues
|
|
420
285
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
421
|
-
export type
|
|
286
|
+
export type SimpleUSDTToken_jsonContract = any;
|
|
422
287
|
|
|
423
288
|
/**
|
|
424
|
-
*
|
|
289
|
+
* SimpleUSDTToken_json Contract Class
|
|
425
290
|
*
|
|
426
291
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
427
292
|
*
|
|
@@ -429,12 +294,12 @@ export type USDToken_jsonContract = any;
|
|
|
429
294
|
* ```typescript
|
|
430
295
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
431
296
|
* import { mainnet } from 'viem/chains';
|
|
432
|
-
* import {
|
|
297
|
+
* import { SimpleUSDTToken_json } from 'SimpleUSDTToken_json';
|
|
433
298
|
*
|
|
434
299
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
435
300
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
436
301
|
*
|
|
437
|
-
* const contract = new
|
|
302
|
+
* const contract = new SimpleUSDTToken_json('0x...', { publicClient, walletClient });
|
|
438
303
|
*
|
|
439
304
|
* // Read functions
|
|
440
305
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -452,8 +317,8 @@ export type USDToken_jsonContract = any;
|
|
|
452
317
|
* });
|
|
453
318
|
* ```
|
|
454
319
|
*/
|
|
455
|
-
export class
|
|
456
|
-
private contract:
|
|
320
|
+
export class SimpleUSDTToken_json {
|
|
321
|
+
private contract: SimpleUSDTToken_jsonContract;
|
|
457
322
|
private contractAddress: Address;
|
|
458
323
|
private publicClient: PublicClient;
|
|
459
324
|
|
|
@@ -468,7 +333,7 @@ export class USDToken_json {
|
|
|
468
333
|
this.publicClient = clients.publicClient;
|
|
469
334
|
this.contract = getContract({
|
|
470
335
|
address,
|
|
471
|
-
abi:
|
|
336
|
+
abi: SimpleUSDTToken_jsonAbi,
|
|
472
337
|
client: {
|
|
473
338
|
public: clients.publicClient,
|
|
474
339
|
wallet: clients.walletClient,
|
|
@@ -486,7 +351,7 @@ export class USDToken_json {
|
|
|
486
351
|
/**
|
|
487
352
|
* Get the underlying viem contract instance
|
|
488
353
|
*/
|
|
489
|
-
getContract():
|
|
354
|
+
getContract(): SimpleUSDTToken_jsonContract {
|
|
490
355
|
return this.contract;
|
|
491
356
|
}
|
|
492
357
|
|
|
@@ -514,14 +379,6 @@ export class USDToken_json {
|
|
|
514
379
|
return this.contract.read.decimals() as Promise<bigint>;
|
|
515
380
|
}
|
|
516
381
|
|
|
517
|
-
/**
|
|
518
|
-
* isRenounced
|
|
519
|
-
* view
|
|
520
|
-
*/
|
|
521
|
-
async isRenounced(): Promise<boolean> {
|
|
522
|
-
return this.contract.read.isRenounced() as Promise<boolean>;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
382
|
/**
|
|
526
383
|
* name
|
|
527
384
|
* view
|
|
@@ -538,14 +395,6 @@ export class USDToken_json {
|
|
|
538
395
|
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
539
396
|
}
|
|
540
397
|
|
|
541
|
-
/**
|
|
542
|
-
* renounced
|
|
543
|
-
* view
|
|
544
|
-
*/
|
|
545
|
-
async renounced(): Promise<boolean> {
|
|
546
|
-
return this.contract.read.renounced() as Promise<boolean>;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
398
|
/**
|
|
550
399
|
* symbol
|
|
551
400
|
* view
|
|
@@ -554,14 +403,6 @@ export class USDToken_json {
|
|
|
554
403
|
return this.contract.read.symbol() as Promise<string>;
|
|
555
404
|
}
|
|
556
405
|
|
|
557
|
-
/**
|
|
558
|
-
* tokenImage
|
|
559
|
-
* pure
|
|
560
|
-
*/
|
|
561
|
-
async tokenImage(): Promise<string> {
|
|
562
|
-
return this.contract.read.tokenImage() as Promise<string>;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
406
|
/**
|
|
566
407
|
* totalSupply
|
|
567
408
|
* view
|
|
@@ -575,53 +416,7 @@ export class USDToken_json {
|
|
|
575
416
|
* nonpayable
|
|
576
417
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
577
418
|
*/
|
|
578
|
-
async approve(spender: `0x${string}`,
|
|
579
|
-
accessList?: import('viem').AccessList;
|
|
580
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
581
|
-
chain?: import('viem').Chain | null;
|
|
582
|
-
dataSuffix?: `0x${string}`;
|
|
583
|
-
gas?: bigint;
|
|
584
|
-
gasPrice?: bigint;
|
|
585
|
-
maxFeePerGas?: bigint;
|
|
586
|
-
maxPriorityFeePerGas?: bigint;
|
|
587
|
-
nonce?: number;
|
|
588
|
-
value?: bigint;
|
|
589
|
-
}): Promise<`0x${string}`> {
|
|
590
|
-
if (!this.contract.write) {
|
|
591
|
-
throw new Error('Wallet client is required for write operations');
|
|
592
|
-
}
|
|
593
|
-
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* decreaseAllowance
|
|
598
|
-
* nonpayable
|
|
599
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
600
|
-
*/
|
|
601
|
-
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
602
|
-
accessList?: import('viem').AccessList;
|
|
603
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
604
|
-
chain?: import('viem').Chain | null;
|
|
605
|
-
dataSuffix?: `0x${string}`;
|
|
606
|
-
gas?: bigint;
|
|
607
|
-
gasPrice?: bigint;
|
|
608
|
-
maxFeePerGas?: bigint;
|
|
609
|
-
maxPriorityFeePerGas?: bigint;
|
|
610
|
-
nonce?: number;
|
|
611
|
-
value?: bigint;
|
|
612
|
-
}): Promise<`0x${string}`> {
|
|
613
|
-
if (!this.contract.write) {
|
|
614
|
-
throw new Error('Wallet client is required for write operations');
|
|
615
|
-
}
|
|
616
|
-
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* increaseAllowance
|
|
621
|
-
* nonpayable
|
|
622
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
623
|
-
*/
|
|
624
|
-
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
419
|
+
async approve(spender: `0x${string}`, value: bigint, options?: {
|
|
625
420
|
accessList?: import('viem').AccessList;
|
|
626
421
|
authorizationList?: import('viem').AuthorizationList;
|
|
627
422
|
chain?: import('viem').Chain | null;
|
|
@@ -636,15 +431,15 @@ export class USDToken_json {
|
|
|
636
431
|
if (!this.contract.write) {
|
|
637
432
|
throw new Error('Wallet client is required for write operations');
|
|
638
433
|
}
|
|
639
|
-
return this.contract.write.
|
|
434
|
+
return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
|
|
640
435
|
}
|
|
641
436
|
|
|
642
437
|
/**
|
|
643
|
-
*
|
|
438
|
+
* mint
|
|
644
439
|
* nonpayable
|
|
645
440
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
646
441
|
*/
|
|
647
|
-
async
|
|
442
|
+
async mint(to: `0x${string}`, amount: bigint, options?: {
|
|
648
443
|
accessList?: import('viem').AccessList;
|
|
649
444
|
authorizationList?: import('viem').AuthorizationList;
|
|
650
445
|
chain?: import('viem').Chain | null;
|
|
@@ -659,53 +454,7 @@ export class USDToken_json {
|
|
|
659
454
|
if (!this.contract.write) {
|
|
660
455
|
throw new Error('Wallet client is required for write operations');
|
|
661
456
|
}
|
|
662
|
-
return this.contract.write.
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* setName
|
|
667
|
-
* nonpayable
|
|
668
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
669
|
-
*/
|
|
670
|
-
async setName(newName: string, options?: {
|
|
671
|
-
accessList?: import('viem').AccessList;
|
|
672
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
673
|
-
chain?: import('viem').Chain | null;
|
|
674
|
-
dataSuffix?: `0x${string}`;
|
|
675
|
-
gas?: bigint;
|
|
676
|
-
gasPrice?: bigint;
|
|
677
|
-
maxFeePerGas?: bigint;
|
|
678
|
-
maxPriorityFeePerGas?: bigint;
|
|
679
|
-
nonce?: number;
|
|
680
|
-
value?: bigint;
|
|
681
|
-
}): Promise<`0x${string}`> {
|
|
682
|
-
if (!this.contract.write) {
|
|
683
|
-
throw new Error('Wallet client is required for write operations');
|
|
684
|
-
}
|
|
685
|
-
return this.contract.write.setName([newName] as const, options) as Promise<`0x${string}`>;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
/**
|
|
689
|
-
* setSymbol
|
|
690
|
-
* nonpayable
|
|
691
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
692
|
-
*/
|
|
693
|
-
async setSymbol(newSymbol: string, options?: {
|
|
694
|
-
accessList?: import('viem').AccessList;
|
|
695
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
696
|
-
chain?: import('viem').Chain | null;
|
|
697
|
-
dataSuffix?: `0x${string}`;
|
|
698
|
-
gas?: bigint;
|
|
699
|
-
gasPrice?: bigint;
|
|
700
|
-
maxFeePerGas?: bigint;
|
|
701
|
-
maxPriorityFeePerGas?: bigint;
|
|
702
|
-
nonce?: number;
|
|
703
|
-
value?: bigint;
|
|
704
|
-
}): Promise<`0x${string}`> {
|
|
705
|
-
if (!this.contract.write) {
|
|
706
|
-
throw new Error('Wallet client is required for write operations');
|
|
707
|
-
}
|
|
708
|
-
return this.contract.write.setSymbol([newSymbol] as const, options) as Promise<`0x${string}`>;
|
|
457
|
+
return this.contract.write.mint([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
709
458
|
}
|
|
710
459
|
|
|
711
460
|
/**
|
|
@@ -713,7 +462,7 @@ export class USDToken_json {
|
|
|
713
462
|
* nonpayable
|
|
714
463
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
715
464
|
*/
|
|
716
|
-
async transfer(to: `0x${string}`,
|
|
465
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
717
466
|
accessList?: import('viem').AccessList;
|
|
718
467
|
authorizationList?: import('viem').AuthorizationList;
|
|
719
468
|
chain?: import('viem').Chain | null;
|
|
@@ -728,7 +477,7 @@ export class USDToken_json {
|
|
|
728
477
|
if (!this.contract.write) {
|
|
729
478
|
throw new Error('Wallet client is required for write operations');
|
|
730
479
|
}
|
|
731
|
-
return this.contract.write.transfer([to,
|
|
480
|
+
return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
|
|
732
481
|
}
|
|
733
482
|
|
|
734
483
|
/**
|
|
@@ -736,7 +485,7 @@ export class USDToken_json {
|
|
|
736
485
|
* nonpayable
|
|
737
486
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
738
487
|
*/
|
|
739
|
-
async transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
488
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
740
489
|
accessList?: import('viem').AccessList;
|
|
741
490
|
authorizationList?: import('viem').AuthorizationList;
|
|
742
491
|
chain?: import('viem').Chain | null;
|
|
@@ -751,7 +500,7 @@ export class USDToken_json {
|
|
|
751
500
|
if (!this.contract.write) {
|
|
752
501
|
throw new Error('Wallet client is required for write operations');
|
|
753
502
|
}
|
|
754
|
-
return this.contract.write.transferFrom([from, to,
|
|
503
|
+
return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
|
|
755
504
|
}
|
|
756
505
|
|
|
757
506
|
|
|
@@ -775,7 +524,7 @@ export class USDToken_json {
|
|
|
775
524
|
* Returns gas estimate and result without sending transaction
|
|
776
525
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
777
526
|
*/
|
|
778
|
-
async approve(spender: `0x${string}`,
|
|
527
|
+
async approve(spender: `0x${string}`, value: bigint, options?: {
|
|
779
528
|
accessList?: import('viem').AccessList;
|
|
780
529
|
authorizationList?: import('viem').AuthorizationList;
|
|
781
530
|
chain?: import('viem').Chain | null;
|
|
@@ -787,90 +536,14 @@ export class USDToken_json {
|
|
|
787
536
|
nonce?: number;
|
|
788
537
|
value?: bigint;
|
|
789
538
|
}): Promise<boolean> {
|
|
790
|
-
return contract.simulate.approve([spender,
|
|
539
|
+
return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
|
|
791
540
|
},
|
|
792
541
|
/**
|
|
793
|
-
* Simulate
|
|
542
|
+
* Simulate mint
|
|
794
543
|
* Returns gas estimate and result without sending transaction
|
|
795
544
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
796
545
|
*/
|
|
797
|
-
async
|
|
798
|
-
accessList?: import('viem').AccessList;
|
|
799
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
800
|
-
chain?: import('viem').Chain | null;
|
|
801
|
-
dataSuffix?: `0x${string}`;
|
|
802
|
-
gas?: bigint;
|
|
803
|
-
gasPrice?: bigint;
|
|
804
|
-
maxFeePerGas?: bigint;
|
|
805
|
-
maxPriorityFeePerGas?: bigint;
|
|
806
|
-
nonce?: number;
|
|
807
|
-
value?: bigint;
|
|
808
|
-
}): Promise<boolean> {
|
|
809
|
-
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
810
|
-
},
|
|
811
|
-
/**
|
|
812
|
-
* Simulate increaseAllowance
|
|
813
|
-
* Returns gas estimate and result without sending transaction
|
|
814
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
815
|
-
*/
|
|
816
|
-
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
817
|
-
accessList?: import('viem').AccessList;
|
|
818
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
819
|
-
chain?: import('viem').Chain | null;
|
|
820
|
-
dataSuffix?: `0x${string}`;
|
|
821
|
-
gas?: bigint;
|
|
822
|
-
gasPrice?: bigint;
|
|
823
|
-
maxFeePerGas?: bigint;
|
|
824
|
-
maxPriorityFeePerGas?: bigint;
|
|
825
|
-
nonce?: number;
|
|
826
|
-
value?: bigint;
|
|
827
|
-
}): Promise<boolean> {
|
|
828
|
-
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
829
|
-
},
|
|
830
|
-
/**
|
|
831
|
-
* Simulate renounceOwnership
|
|
832
|
-
* Returns gas estimate and result without sending transaction
|
|
833
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
834
|
-
*/
|
|
835
|
-
async renounceOwnership(options?: {
|
|
836
|
-
accessList?: import('viem').AccessList;
|
|
837
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
838
|
-
chain?: import('viem').Chain | null;
|
|
839
|
-
dataSuffix?: `0x${string}`;
|
|
840
|
-
gas?: bigint;
|
|
841
|
-
gasPrice?: bigint;
|
|
842
|
-
maxFeePerGas?: bigint;
|
|
843
|
-
maxPriorityFeePerGas?: bigint;
|
|
844
|
-
nonce?: number;
|
|
845
|
-
value?: bigint;
|
|
846
|
-
}): Promise<void> {
|
|
847
|
-
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
848
|
-
},
|
|
849
|
-
/**
|
|
850
|
-
* Simulate setName
|
|
851
|
-
* Returns gas estimate and result without sending transaction
|
|
852
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
853
|
-
*/
|
|
854
|
-
async setName(newName: string, options?: {
|
|
855
|
-
accessList?: import('viem').AccessList;
|
|
856
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
857
|
-
chain?: import('viem').Chain | null;
|
|
858
|
-
dataSuffix?: `0x${string}`;
|
|
859
|
-
gas?: bigint;
|
|
860
|
-
gasPrice?: bigint;
|
|
861
|
-
maxFeePerGas?: bigint;
|
|
862
|
-
maxPriorityFeePerGas?: bigint;
|
|
863
|
-
nonce?: number;
|
|
864
|
-
value?: bigint;
|
|
865
|
-
}): Promise<void> {
|
|
866
|
-
return contract.simulate.setName([newName] as const, options) as Promise<void>;
|
|
867
|
-
},
|
|
868
|
-
/**
|
|
869
|
-
* Simulate setSymbol
|
|
870
|
-
* Returns gas estimate and result without sending transaction
|
|
871
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
872
|
-
*/
|
|
873
|
-
async setSymbol(newSymbol: string, options?: {
|
|
546
|
+
async mint(to: `0x${string}`, amount: bigint, options?: {
|
|
874
547
|
accessList?: import('viem').AccessList;
|
|
875
548
|
authorizationList?: import('viem').AuthorizationList;
|
|
876
549
|
chain?: import('viem').Chain | null;
|
|
@@ -882,14 +555,14 @@ export class USDToken_json {
|
|
|
882
555
|
nonce?: number;
|
|
883
556
|
value?: bigint;
|
|
884
557
|
}): Promise<void> {
|
|
885
|
-
return contract.simulate.
|
|
558
|
+
return contract.simulate.mint([to, amount] as const, options) as Promise<void>;
|
|
886
559
|
},
|
|
887
560
|
/**
|
|
888
561
|
* Simulate transfer
|
|
889
562
|
* Returns gas estimate and result without sending transaction
|
|
890
563
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
891
564
|
*/
|
|
892
|
-
async transfer(to: `0x${string}`,
|
|
565
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
893
566
|
accessList?: import('viem').AccessList;
|
|
894
567
|
authorizationList?: import('viem').AuthorizationList;
|
|
895
568
|
chain?: import('viem').Chain | null;
|
|
@@ -901,14 +574,14 @@ export class USDToken_json {
|
|
|
901
574
|
nonce?: number;
|
|
902
575
|
value?: bigint;
|
|
903
576
|
}): Promise<boolean> {
|
|
904
|
-
return contract.simulate.transfer([to,
|
|
577
|
+
return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
|
|
905
578
|
},
|
|
906
579
|
/**
|
|
907
580
|
* Simulate transferFrom
|
|
908
581
|
* Returns gas estimate and result without sending transaction
|
|
909
582
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
910
583
|
*/
|
|
911
|
-
async transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
584
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
912
585
|
accessList?: import('viem').AccessList;
|
|
913
586
|
authorizationList?: import('viem').AuthorizationList;
|
|
914
587
|
chain?: import('viem').Chain | null;
|
|
@@ -920,7 +593,7 @@ export class USDToken_json {
|
|
|
920
593
|
nonce?: number;
|
|
921
594
|
value?: bigint;
|
|
922
595
|
}): Promise<boolean> {
|
|
923
|
-
return contract.simulate.transferFrom([from, to,
|
|
596
|
+
return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
|
|
924
597
|
}
|
|
925
598
|
};
|
|
926
599
|
}
|
|
@@ -948,7 +621,7 @@ export class USDToken_json {
|
|
|
948
621
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
949
622
|
return this.publicClient.watchContractEvent({
|
|
950
623
|
address: this.contractAddress,
|
|
951
|
-
abi:
|
|
624
|
+
abi: SimpleUSDTToken_jsonAbi,
|
|
952
625
|
eventName: 'Approval',
|
|
953
626
|
args: filter,
|
|
954
627
|
onLogs: (logs: any[]) => {
|
|
@@ -958,63 +631,6 @@ export class USDToken_json {
|
|
|
958
631
|
},
|
|
959
632
|
}) as () => void;
|
|
960
633
|
},
|
|
961
|
-
/**
|
|
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
|
|
982
|
-
* @param callback Function to call when event is emitted
|
|
983
|
-
* @param filter Optional filter for indexed parameters
|
|
984
|
-
* @returns Unwatch function to stop listening
|
|
985
|
-
*/
|
|
986
|
-
OwnershipRenounced: (callback: (event: { previousOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}` }) => {
|
|
987
|
-
return this.publicClient.watchContractEvent({
|
|
988
|
-
address: this.contractAddress,
|
|
989
|
-
abi: USDToken_jsonAbi,
|
|
990
|
-
eventName: 'OwnershipRenounced',
|
|
991
|
-
args: filter,
|
|
992
|
-
onLogs: (logs: any[]) => {
|
|
993
|
-
logs.forEach((log: any) => {
|
|
994
|
-
callback(log.args as any);
|
|
995
|
-
});
|
|
996
|
-
},
|
|
997
|
-
}) as () => void;
|
|
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
|
-
},
|
|
1018
634
|
/**
|
|
1019
635
|
* Watch Transfer events
|
|
1020
636
|
* @param callback Function to call when event is emitted
|
|
@@ -1024,7 +640,7 @@ export class USDToken_json {
|
|
|
1024
640
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
1025
641
|
return this.publicClient.watchContractEvent({
|
|
1026
642
|
address: this.contractAddress,
|
|
1027
|
-
abi:
|
|
643
|
+
abi: SimpleUSDTToken_jsonAbi,
|
|
1028
644
|
eventName: 'Transfer',
|
|
1029
645
|
args: filter,
|
|
1030
646
|
onLogs: (logs: any[]) => {
|