@gitmyabi/usdt 1.0.1 → 1.0.2
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/{USDT_json.d.ts → USDToken_json.d.ts} +42 -233
- package/contracts/{USDT_json.js → USDToken_json.js} +54 -228
- package/contracts/{USDT_json.ts → USDToken_json.ts} +59 -303
- 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
|
{
|
|
@@ -112,42 +81,16 @@ export const USDT_jsonAbi = [
|
|
|
112
81
|
"name": "Transfer",
|
|
113
82
|
"type": "event"
|
|
114
83
|
},
|
|
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
84
|
{
|
|
142
85
|
"inputs": [
|
|
143
86
|
{
|
|
144
87
|
"internalType": "address",
|
|
145
|
-
"name": "
|
|
88
|
+
"name": "",
|
|
146
89
|
"type": "address"
|
|
147
90
|
},
|
|
148
91
|
{
|
|
149
92
|
"internalType": "address",
|
|
150
|
-
"name": "
|
|
93
|
+
"name": "",
|
|
151
94
|
"type": "address"
|
|
152
95
|
}
|
|
153
96
|
],
|
|
@@ -190,7 +133,7 @@ export const USDT_jsonAbi = [
|
|
|
190
133
|
"inputs": [
|
|
191
134
|
{
|
|
192
135
|
"internalType": "address",
|
|
193
|
-
"name": "
|
|
136
|
+
"name": "",
|
|
194
137
|
"type": "address"
|
|
195
138
|
}
|
|
196
139
|
],
|
|
@@ -210,62 +153,14 @@ export const USDT_jsonAbi = [
|
|
|
210
153
|
"name": "decimals",
|
|
211
154
|
"outputs": [
|
|
212
155
|
{
|
|
213
|
-
"internalType": "
|
|
156
|
+
"internalType": "uint8",
|
|
214
157
|
"name": "",
|
|
215
|
-
"type": "
|
|
158
|
+
"type": "uint8"
|
|
216
159
|
}
|
|
217
160
|
],
|
|
218
161
|
"stateMutability": "view",
|
|
219
162
|
"type": "function"
|
|
220
163
|
},
|
|
221
|
-
{
|
|
222
|
-
"inputs": [
|
|
223
|
-
{
|
|
224
|
-
"internalType": "address",
|
|
225
|
-
"name": "spender",
|
|
226
|
-
"type": "address"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"internalType": "uint256",
|
|
230
|
-
"name": "subtractedValue",
|
|
231
|
-
"type": "uint256"
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
"name": "decreaseAllowance",
|
|
235
|
-
"outputs": [
|
|
236
|
-
{
|
|
237
|
-
"internalType": "bool",
|
|
238
|
-
"name": "",
|
|
239
|
-
"type": "bool"
|
|
240
|
-
}
|
|
241
|
-
],
|
|
242
|
-
"stateMutability": "nonpayable",
|
|
243
|
-
"type": "function"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"inputs": [
|
|
247
|
-
{
|
|
248
|
-
"internalType": "address",
|
|
249
|
-
"name": "spender",
|
|
250
|
-
"type": "address"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"internalType": "uint256",
|
|
254
|
-
"name": "addedValue",
|
|
255
|
-
"type": "uint256"
|
|
256
|
-
}
|
|
257
|
-
],
|
|
258
|
-
"name": "increaseAllowance",
|
|
259
|
-
"outputs": [
|
|
260
|
-
{
|
|
261
|
-
"internalType": "bool",
|
|
262
|
-
"name": "",
|
|
263
|
-
"type": "bool"
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
"stateMutability": "nonpayable",
|
|
267
|
-
"type": "function"
|
|
268
|
-
},
|
|
269
164
|
{
|
|
270
165
|
"inputs": [],
|
|
271
166
|
"name": "name",
|
|
@@ -292,24 +187,6 @@ export const USDT_jsonAbi = [
|
|
|
292
187
|
"stateMutability": "view",
|
|
293
188
|
"type": "function"
|
|
294
189
|
},
|
|
295
|
-
{
|
|
296
|
-
"inputs": [
|
|
297
|
-
{
|
|
298
|
-
"internalType": "address",
|
|
299
|
-
"name": "tokenAddress",
|
|
300
|
-
"type": "address"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"internalType": "uint256",
|
|
304
|
-
"name": "tokenAmount",
|
|
305
|
-
"type": "uint256"
|
|
306
|
-
}
|
|
307
|
-
],
|
|
308
|
-
"name": "recoverERC20",
|
|
309
|
-
"outputs": [],
|
|
310
|
-
"stateMutability": "nonpayable",
|
|
311
|
-
"type": "function"
|
|
312
|
-
},
|
|
313
190
|
{
|
|
314
191
|
"inputs": [],
|
|
315
192
|
"name": "renounceOwnership",
|
|
@@ -330,6 +207,19 @@ export const USDT_jsonAbi = [
|
|
|
330
207
|
"stateMutability": "view",
|
|
331
208
|
"type": "function"
|
|
332
209
|
},
|
|
210
|
+
{
|
|
211
|
+
"inputs": [],
|
|
212
|
+
"name": "tokenImage",
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"internalType": "string",
|
|
216
|
+
"name": "",
|
|
217
|
+
"type": "string"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"stateMutability": "pure",
|
|
221
|
+
"type": "function"
|
|
222
|
+
},
|
|
333
223
|
{
|
|
334
224
|
"inputs": [],
|
|
335
225
|
"name": "totalSupply",
|
|
@@ -347,7 +237,7 @@ export const USDT_jsonAbi = [
|
|
|
347
237
|
"inputs": [
|
|
348
238
|
{
|
|
349
239
|
"internalType": "address",
|
|
350
|
-
"name": "
|
|
240
|
+
"name": "to",
|
|
351
241
|
"type": "address"
|
|
352
242
|
},
|
|
353
243
|
{
|
|
@@ -371,12 +261,12 @@ export const USDT_jsonAbi = [
|
|
|
371
261
|
"inputs": [
|
|
372
262
|
{
|
|
373
263
|
"internalType": "address",
|
|
374
|
-
"name": "
|
|
264
|
+
"name": "from",
|
|
375
265
|
"type": "address"
|
|
376
266
|
},
|
|
377
267
|
{
|
|
378
268
|
"internalType": "address",
|
|
379
|
-
"name": "
|
|
269
|
+
"name": "to",
|
|
380
270
|
"type": "address"
|
|
381
271
|
},
|
|
382
272
|
{
|
|
@@ -412,19 +302,19 @@ export const USDT_jsonAbi = [
|
|
|
412
302
|
] as const satisfies Abi;
|
|
413
303
|
|
|
414
304
|
/**
|
|
415
|
-
* Type-safe ABI for
|
|
305
|
+
* Type-safe ABI for USDToken_json
|
|
416
306
|
*/
|
|
417
|
-
export type
|
|
307
|
+
export type USDToken_jsonAbi = typeof USDToken_jsonAbi;
|
|
418
308
|
|
|
419
309
|
/**
|
|
420
|
-
* Contract instance type for
|
|
310
|
+
* Contract instance type for USDToken_json
|
|
421
311
|
*/
|
|
422
312
|
// Use any for contract type to avoid complex viem type issues
|
|
423
313
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
424
|
-
export type
|
|
314
|
+
export type USDToken_jsonContract = any;
|
|
425
315
|
|
|
426
316
|
/**
|
|
427
|
-
*
|
|
317
|
+
* USDToken_json Contract Class
|
|
428
318
|
*
|
|
429
319
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
430
320
|
*
|
|
@@ -432,12 +322,12 @@ export type USDT_jsonContract = any;
|
|
|
432
322
|
* ```typescript
|
|
433
323
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
434
324
|
* import { mainnet } from 'viem/chains';
|
|
435
|
-
* import {
|
|
325
|
+
* import { USDToken_json } from 'USDToken_json';
|
|
436
326
|
*
|
|
437
327
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
438
328
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
439
329
|
*
|
|
440
|
-
* const contract = new
|
|
330
|
+
* const contract = new USDToken_json('0x...', { publicClient, walletClient });
|
|
441
331
|
*
|
|
442
332
|
* // Read functions
|
|
443
333
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -455,8 +345,8 @@ export type USDT_jsonContract = any;
|
|
|
455
345
|
* });
|
|
456
346
|
* ```
|
|
457
347
|
*/
|
|
458
|
-
export class
|
|
459
|
-
private contract:
|
|
348
|
+
export class USDToken_json {
|
|
349
|
+
private contract: USDToken_jsonContract;
|
|
460
350
|
private contractAddress: Address;
|
|
461
351
|
private publicClient: PublicClient;
|
|
462
352
|
|
|
@@ -471,7 +361,7 @@ export class USDT_json {
|
|
|
471
361
|
this.publicClient = clients.publicClient;
|
|
472
362
|
this.contract = getContract({
|
|
473
363
|
address,
|
|
474
|
-
abi:
|
|
364
|
+
abi: USDToken_jsonAbi,
|
|
475
365
|
client: {
|
|
476
366
|
public: clients.publicClient,
|
|
477
367
|
wallet: clients.walletClient,
|
|
@@ -489,40 +379,24 @@ export class USDT_json {
|
|
|
489
379
|
/**
|
|
490
380
|
* Get the underlying viem contract instance
|
|
491
381
|
*/
|
|
492
|
-
getContract():
|
|
382
|
+
getContract(): USDToken_jsonContract {
|
|
493
383
|
return this.contract;
|
|
494
384
|
}
|
|
495
385
|
|
|
496
|
-
/**
|
|
497
|
-
* Optimization
|
|
498
|
-
* view
|
|
499
|
-
*/
|
|
500
|
-
async Optimization(): Promise<bigint> {
|
|
501
|
-
return this.contract.read.Optimization() as Promise<bigint>;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* _owner
|
|
506
|
-
* view
|
|
507
|
-
*/
|
|
508
|
-
async _owner(): Promise<`0x${string}`> {
|
|
509
|
-
return this.contract.read._owner() as Promise<`0x${string}`>;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
386
|
/**
|
|
513
387
|
* allowance
|
|
514
388
|
* view
|
|
515
389
|
*/
|
|
516
|
-
async allowance(
|
|
517
|
-
return this.contract.read.allowance([
|
|
390
|
+
async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
|
|
391
|
+
return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
|
|
518
392
|
}
|
|
519
393
|
|
|
520
394
|
/**
|
|
521
395
|
* balanceOf
|
|
522
396
|
* view
|
|
523
397
|
*/
|
|
524
|
-
async balanceOf(
|
|
525
|
-
return this.contract.read.balanceOf([
|
|
398
|
+
async balanceOf(arg0: `0x${string}`): Promise<bigint> {
|
|
399
|
+
return this.contract.read.balanceOf([arg0] as const) as Promise<bigint>;
|
|
526
400
|
}
|
|
527
401
|
|
|
528
402
|
/**
|
|
@@ -557,6 +431,14 @@ export class USDT_json {
|
|
|
557
431
|
return this.contract.read.symbol() as Promise<string>;
|
|
558
432
|
}
|
|
559
433
|
|
|
434
|
+
/**
|
|
435
|
+
* tokenImage
|
|
436
|
+
* pure
|
|
437
|
+
*/
|
|
438
|
+
async tokenImage(): Promise<string> {
|
|
439
|
+
return this.contract.read.tokenImage() as Promise<string>;
|
|
440
|
+
}
|
|
441
|
+
|
|
560
442
|
/**
|
|
561
443
|
* totalSupply
|
|
562
444
|
* view
|
|
@@ -588,75 +470,6 @@ export class USDT_json {
|
|
|
588
470
|
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
589
471
|
}
|
|
590
472
|
|
|
591
|
-
/**
|
|
592
|
-
* decreaseAllowance
|
|
593
|
-
* nonpayable
|
|
594
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
595
|
-
*/
|
|
596
|
-
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
597
|
-
accessList?: import('viem').AccessList;
|
|
598
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
599
|
-
chain?: import('viem').Chain | null;
|
|
600
|
-
dataSuffix?: `0x${string}`;
|
|
601
|
-
gas?: bigint;
|
|
602
|
-
gasPrice?: bigint;
|
|
603
|
-
maxFeePerGas?: bigint;
|
|
604
|
-
maxPriorityFeePerGas?: bigint;
|
|
605
|
-
nonce?: number;
|
|
606
|
-
value?: bigint;
|
|
607
|
-
}): Promise<`0x${string}`> {
|
|
608
|
-
if (!this.contract.write) {
|
|
609
|
-
throw new Error('Wallet client is required for write operations');
|
|
610
|
-
}
|
|
611
|
-
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* increaseAllowance
|
|
616
|
-
* nonpayable
|
|
617
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
618
|
-
*/
|
|
619
|
-
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
620
|
-
accessList?: import('viem').AccessList;
|
|
621
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
622
|
-
chain?: import('viem').Chain | null;
|
|
623
|
-
dataSuffix?: `0x${string}`;
|
|
624
|
-
gas?: bigint;
|
|
625
|
-
gasPrice?: bigint;
|
|
626
|
-
maxFeePerGas?: bigint;
|
|
627
|
-
maxPriorityFeePerGas?: bigint;
|
|
628
|
-
nonce?: number;
|
|
629
|
-
value?: bigint;
|
|
630
|
-
}): Promise<`0x${string}`> {
|
|
631
|
-
if (!this.contract.write) {
|
|
632
|
-
throw new Error('Wallet client is required for write operations');
|
|
633
|
-
}
|
|
634
|
-
return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* recoverERC20
|
|
639
|
-
* nonpayable
|
|
640
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
641
|
-
*/
|
|
642
|
-
async recoverERC20(tokenAddress: `0x${string}`, tokenAmount: bigint, options?: {
|
|
643
|
-
accessList?: import('viem').AccessList;
|
|
644
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
645
|
-
chain?: import('viem').Chain | null;
|
|
646
|
-
dataSuffix?: `0x${string}`;
|
|
647
|
-
gas?: bigint;
|
|
648
|
-
gasPrice?: bigint;
|
|
649
|
-
maxFeePerGas?: bigint;
|
|
650
|
-
maxPriorityFeePerGas?: bigint;
|
|
651
|
-
nonce?: number;
|
|
652
|
-
value?: bigint;
|
|
653
|
-
}): Promise<`0x${string}`> {
|
|
654
|
-
if (!this.contract.write) {
|
|
655
|
-
throw new Error('Wallet client is required for write operations');
|
|
656
|
-
}
|
|
657
|
-
return this.contract.write.recoverERC20([tokenAddress, tokenAmount] as const, options) as Promise<`0x${string}`>;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
473
|
/**
|
|
661
474
|
* renounceOwnership
|
|
662
475
|
* nonpayable
|
|
@@ -685,7 +498,7 @@ export class USDT_json {
|
|
|
685
498
|
* nonpayable
|
|
686
499
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
687
500
|
*/
|
|
688
|
-
async transfer(
|
|
501
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
689
502
|
accessList?: import('viem').AccessList;
|
|
690
503
|
authorizationList?: import('viem').AuthorizationList;
|
|
691
504
|
chain?: import('viem').Chain | null;
|
|
@@ -700,7 +513,7 @@ export class USDT_json {
|
|
|
700
513
|
if (!this.contract.write) {
|
|
701
514
|
throw new Error('Wallet client is required for write operations');
|
|
702
515
|
}
|
|
703
|
-
return this.contract.write.transfer([
|
|
516
|
+
return this.contract.write.transfer([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
704
517
|
}
|
|
705
518
|
|
|
706
519
|
/**
|
|
@@ -708,7 +521,7 @@ export class USDT_json {
|
|
|
708
521
|
* nonpayable
|
|
709
522
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
710
523
|
*/
|
|
711
|
-
async transferFrom(
|
|
524
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
712
525
|
accessList?: import('viem').AccessList;
|
|
713
526
|
authorizationList?: import('viem').AuthorizationList;
|
|
714
527
|
chain?: import('viem').Chain | null;
|
|
@@ -723,7 +536,7 @@ export class USDT_json {
|
|
|
723
536
|
if (!this.contract.write) {
|
|
724
537
|
throw new Error('Wallet client is required for write operations');
|
|
725
538
|
}
|
|
726
|
-
return this.contract.write.transferFrom([
|
|
539
|
+
return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
|
|
727
540
|
}
|
|
728
541
|
|
|
729
542
|
/**
|
|
@@ -784,63 +597,6 @@ export class USDT_json {
|
|
|
784
597
|
}): Promise<boolean> {
|
|
785
598
|
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
786
599
|
},
|
|
787
|
-
/**
|
|
788
|
-
* Simulate decreaseAllowance
|
|
789
|
-
* Returns gas estimate and result without sending transaction
|
|
790
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
791
|
-
*/
|
|
792
|
-
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
793
|
-
accessList?: import('viem').AccessList;
|
|
794
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
795
|
-
chain?: import('viem').Chain | null;
|
|
796
|
-
dataSuffix?: `0x${string}`;
|
|
797
|
-
gas?: bigint;
|
|
798
|
-
gasPrice?: bigint;
|
|
799
|
-
maxFeePerGas?: bigint;
|
|
800
|
-
maxPriorityFeePerGas?: bigint;
|
|
801
|
-
nonce?: number;
|
|
802
|
-
value?: bigint;
|
|
803
|
-
}): Promise<boolean> {
|
|
804
|
-
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
805
|
-
},
|
|
806
|
-
/**
|
|
807
|
-
* Simulate increaseAllowance
|
|
808
|
-
* Returns gas estimate and result without sending transaction
|
|
809
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
810
|
-
*/
|
|
811
|
-
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
812
|
-
accessList?: import('viem').AccessList;
|
|
813
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
814
|
-
chain?: import('viem').Chain | null;
|
|
815
|
-
dataSuffix?: `0x${string}`;
|
|
816
|
-
gas?: bigint;
|
|
817
|
-
gasPrice?: bigint;
|
|
818
|
-
maxFeePerGas?: bigint;
|
|
819
|
-
maxPriorityFeePerGas?: bigint;
|
|
820
|
-
nonce?: number;
|
|
821
|
-
value?: bigint;
|
|
822
|
-
}): Promise<boolean> {
|
|
823
|
-
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
824
|
-
},
|
|
825
|
-
/**
|
|
826
|
-
* Simulate recoverERC20
|
|
827
|
-
* Returns gas estimate and result without sending transaction
|
|
828
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
829
|
-
*/
|
|
830
|
-
async recoverERC20(tokenAddress: `0x${string}`, tokenAmount: bigint, options?: {
|
|
831
|
-
accessList?: import('viem').AccessList;
|
|
832
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
833
|
-
chain?: import('viem').Chain | null;
|
|
834
|
-
dataSuffix?: `0x${string}`;
|
|
835
|
-
gas?: bigint;
|
|
836
|
-
gasPrice?: bigint;
|
|
837
|
-
maxFeePerGas?: bigint;
|
|
838
|
-
maxPriorityFeePerGas?: bigint;
|
|
839
|
-
nonce?: number;
|
|
840
|
-
value?: bigint;
|
|
841
|
-
}): Promise<void> {
|
|
842
|
-
return contract.simulate.recoverERC20([tokenAddress, tokenAmount] as const, options) as Promise<void>;
|
|
843
|
-
},
|
|
844
600
|
/**
|
|
845
601
|
* Simulate renounceOwnership
|
|
846
602
|
* Returns gas estimate and result without sending transaction
|
|
@@ -865,7 +621,7 @@ export class USDT_json {
|
|
|
865
621
|
* Returns gas estimate and result without sending transaction
|
|
866
622
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
867
623
|
*/
|
|
868
|
-
async transfer(
|
|
624
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
869
625
|
accessList?: import('viem').AccessList;
|
|
870
626
|
authorizationList?: import('viem').AuthorizationList;
|
|
871
627
|
chain?: import('viem').Chain | null;
|
|
@@ -877,14 +633,14 @@ export class USDT_json {
|
|
|
877
633
|
nonce?: number;
|
|
878
634
|
value?: bigint;
|
|
879
635
|
}): Promise<boolean> {
|
|
880
|
-
return contract.simulate.transfer([
|
|
636
|
+
return contract.simulate.transfer([to, amount] as const, options) as Promise<boolean>;
|
|
881
637
|
},
|
|
882
638
|
/**
|
|
883
639
|
* Simulate transferFrom
|
|
884
640
|
* Returns gas estimate and result without sending transaction
|
|
885
641
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
886
642
|
*/
|
|
887
|
-
async transferFrom(
|
|
643
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
888
644
|
accessList?: import('viem').AccessList;
|
|
889
645
|
authorizationList?: import('viem').AuthorizationList;
|
|
890
646
|
chain?: import('viem').Chain | null;
|
|
@@ -896,7 +652,7 @@ export class USDT_json {
|
|
|
896
652
|
nonce?: number;
|
|
897
653
|
value?: bigint;
|
|
898
654
|
}): Promise<boolean> {
|
|
899
|
-
return contract.simulate.transferFrom([
|
|
655
|
+
return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
|
|
900
656
|
},
|
|
901
657
|
/**
|
|
902
658
|
* Simulate transferOwnership
|
|
@@ -943,7 +699,7 @@ export class USDT_json {
|
|
|
943
699
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
944
700
|
return this.publicClient.watchContractEvent({
|
|
945
701
|
address: this.contractAddress,
|
|
946
|
-
abi:
|
|
702
|
+
abi: USDToken_jsonAbi,
|
|
947
703
|
eventName: 'Approval',
|
|
948
704
|
args: filter,
|
|
949
705
|
onLogs: (logs: any[]) => {
|
|
@@ -962,7 +718,7 @@ export class USDT_json {
|
|
|
962
718
|
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
|
|
963
719
|
return this.publicClient.watchContractEvent({
|
|
964
720
|
address: this.contractAddress,
|
|
965
|
-
abi:
|
|
721
|
+
abi: USDToken_jsonAbi,
|
|
966
722
|
eventName: 'OwnershipTransferred',
|
|
967
723
|
args: filter,
|
|
968
724
|
onLogs: (logs: any[]) => {
|
|
@@ -981,7 +737,7 @@ export class USDT_json {
|
|
|
981
737
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
982
738
|
return this.publicClient.watchContractEvent({
|
|
983
739
|
address: this.contractAddress,
|
|
984
|
-
abi:
|
|
740
|
+
abi: USDToken_jsonAbi,
|
|
985
741
|
eventName: 'Transfer',
|
|
986
742
|
args: filter,
|
|
987
743
|
onLogs: (logs: any[]) => {
|
package/contracts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { USDToken_jsonAbi, USDToken_json } from './USDToken_json';
|
|
2
|
+
export type { USDToken_jsonAbi as USDToken_jsonAbiType, USDToken_jsonContract } from './USDToken_json';
|
package/contracts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.USDToken_json = exports.USDToken_jsonAbi = void 0;
|
|
4
4
|
// Auto-generated exports for all contracts
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
5
|
+
var USDToken_json_1 = require("./USDToken_json");
|
|
6
|
+
Object.defineProperty(exports, "USDToken_jsonAbi", { enumerable: true, get: function () { return USDToken_json_1.USDToken_jsonAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "USDToken_json", { enumerable: true, get: function () { return USDToken_json_1.USDToken_json; } });
|
package/contracts/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Auto-generated exports for all contracts
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
2
|
+
export { USDToken_jsonAbi, USDToken_json } from './USDToken_json';
|
|
3
|
+
export type { USDToken_jsonAbi as USDToken_jsonAbiType, USDToken_jsonContract } from './USDToken_json';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitmyabi/usdt",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Auto-generated TypeScript type bindings for USDT (build etherscan-usdt-
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for USDT (build etherscan-usdt-4921427d-1784884935869, commit 646cbeb, branch etherscan)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "https://github.com/etherscan/usdt"
|
|
40
40
|
},
|
|
41
41
|
"branch": "etherscan",
|
|
42
|
-
"shortHash": "
|
|
42
|
+
"shortHash": "646cbeb"
|
|
43
43
|
}
|