@gitmyabi/usdt 1.0.16 → 1.0.17
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/{UERC20_json.d.ts → USDTToken_json.d.ts} +92 -181
- package/contracts/{UERC20_json.js → USDTToken_json.js} +84 -226
- package/contracts/{UERC20_json.ts → USDTToken_json.ts} +113 -236
- 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,56 +2,16 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* USDTToken_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 USDTToken_jsonAbi = [
|
|
10
10
|
{
|
|
11
11
|
"inputs": [],
|
|
12
12
|
"stateMutability": "nonpayable",
|
|
13
13
|
"type": "constructor"
|
|
14
14
|
},
|
|
15
|
-
{
|
|
16
|
-
"inputs": [],
|
|
17
|
-
"name": "AllowanceOverflow",
|
|
18
|
-
"type": "error"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"inputs": [],
|
|
22
|
-
"name": "AllowanceUnderflow",
|
|
23
|
-
"type": "error"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"inputs": [],
|
|
27
|
-
"name": "InsufficientAllowance",
|
|
28
|
-
"type": "error"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"inputs": [],
|
|
32
|
-
"name": "InsufficientBalance",
|
|
33
|
-
"type": "error"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"inputs": [],
|
|
37
|
-
"name": "InvalidPermit",
|
|
38
|
-
"type": "error"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"inputs": [],
|
|
42
|
-
"name": "Permit2AllowanceIsFixedAtInfinity",
|
|
43
|
-
"type": "error"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"inputs": [],
|
|
47
|
-
"name": "PermitExpired",
|
|
48
|
-
"type": "error"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"inputs": [],
|
|
52
|
-
"name": "TotalSupplyOverflow",
|
|
53
|
-
"type": "error"
|
|
54
|
-
},
|
|
55
15
|
{
|
|
56
16
|
"anonymous": false,
|
|
57
17
|
"inputs": [
|
|
@@ -70,7 +30,7 @@ export const UERC20_jsonAbi = [
|
|
|
70
30
|
{
|
|
71
31
|
"indexed": false,
|
|
72
32
|
"internalType": "uint256",
|
|
73
|
-
"name": "
|
|
33
|
+
"name": "value",
|
|
74
34
|
"type": "uint256"
|
|
75
35
|
}
|
|
76
36
|
],
|
|
@@ -95,7 +55,7 @@ export const UERC20_jsonAbi = [
|
|
|
95
55
|
{
|
|
96
56
|
"indexed": false,
|
|
97
57
|
"internalType": "uint256",
|
|
98
|
-
"name": "
|
|
58
|
+
"name": "value",
|
|
99
59
|
"type": "uint256"
|
|
100
60
|
}
|
|
101
61
|
],
|
|
@@ -104,12 +64,12 @@ export const UERC20_jsonAbi = [
|
|
|
104
64
|
},
|
|
105
65
|
{
|
|
106
66
|
"inputs": [],
|
|
107
|
-
"name": "
|
|
67
|
+
"name": "WITHDRAW_ADDRESS",
|
|
108
68
|
"outputs": [
|
|
109
69
|
{
|
|
110
|
-
"internalType": "
|
|
111
|
-
"name": "
|
|
112
|
-
"type": "
|
|
70
|
+
"internalType": "address",
|
|
71
|
+
"name": "",
|
|
72
|
+
"type": "address"
|
|
113
73
|
}
|
|
114
74
|
],
|
|
115
75
|
"stateMutability": "view",
|
|
@@ -119,12 +79,12 @@ export const UERC20_jsonAbi = [
|
|
|
119
79
|
"inputs": [
|
|
120
80
|
{
|
|
121
81
|
"internalType": "address",
|
|
122
|
-
"name": "
|
|
82
|
+
"name": "",
|
|
123
83
|
"type": "address"
|
|
124
84
|
},
|
|
125
85
|
{
|
|
126
86
|
"internalType": "address",
|
|
127
|
-
"name": "
|
|
87
|
+
"name": "",
|
|
128
88
|
"type": "address"
|
|
129
89
|
}
|
|
130
90
|
],
|
|
@@ -132,7 +92,7 @@ export const UERC20_jsonAbi = [
|
|
|
132
92
|
"outputs": [
|
|
133
93
|
{
|
|
134
94
|
"internalType": "uint256",
|
|
135
|
-
"name": "
|
|
95
|
+
"name": "",
|
|
136
96
|
"type": "uint256"
|
|
137
97
|
}
|
|
138
98
|
],
|
|
@@ -167,7 +127,7 @@ export const UERC20_jsonAbi = [
|
|
|
167
127
|
"inputs": [
|
|
168
128
|
{
|
|
169
129
|
"internalType": "address",
|
|
170
|
-
"name": "
|
|
130
|
+
"name": "",
|
|
171
131
|
"type": "address"
|
|
172
132
|
}
|
|
173
133
|
],
|
|
@@ -175,21 +135,8 @@ export const UERC20_jsonAbi = [
|
|
|
175
135
|
"outputs": [
|
|
176
136
|
{
|
|
177
137
|
"internalType": "uint256",
|
|
178
|
-
"name": "result",
|
|
179
|
-
"type": "uint256"
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
"stateMutability": "view",
|
|
183
|
-
"type": "function"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"inputs": [],
|
|
187
|
-
"name": "creator",
|
|
188
|
-
"outputs": [
|
|
189
|
-
{
|
|
190
|
-
"internalType": "address",
|
|
191
138
|
"name": "",
|
|
192
|
-
"type": "
|
|
139
|
+
"type": "uint256"
|
|
193
140
|
}
|
|
194
141
|
],
|
|
195
142
|
"stateMutability": "view",
|
|
@@ -210,12 +157,12 @@ export const UERC20_jsonAbi = [
|
|
|
210
157
|
},
|
|
211
158
|
{
|
|
212
159
|
"inputs": [],
|
|
213
|
-
"name": "
|
|
160
|
+
"name": "getETHBalance",
|
|
214
161
|
"outputs": [
|
|
215
162
|
{
|
|
216
|
-
"internalType": "
|
|
163
|
+
"internalType": "uint256",
|
|
217
164
|
"name": "",
|
|
218
|
-
"type": "
|
|
165
|
+
"type": "uint256"
|
|
219
166
|
}
|
|
220
167
|
],
|
|
221
168
|
"stateMutability": "view",
|
|
@@ -223,30 +170,15 @@ export const UERC20_jsonAbi = [
|
|
|
223
170
|
},
|
|
224
171
|
{
|
|
225
172
|
"inputs": [],
|
|
226
|
-
"name": "
|
|
173
|
+
"name": "getWithdrawalAddress",
|
|
227
174
|
"outputs": [
|
|
228
175
|
{
|
|
229
|
-
"internalType": "
|
|
230
|
-
"name": "
|
|
231
|
-
"type": "
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"internalType": "string",
|
|
235
|
-
"name": "website",
|
|
236
|
-
"type": "string"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"internalType": "string",
|
|
240
|
-
"name": "image",
|
|
241
|
-
"type": "string"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"internalType": "bytes",
|
|
245
|
-
"name": "extraData",
|
|
246
|
-
"type": "bytes"
|
|
176
|
+
"internalType": "address",
|
|
177
|
+
"name": "",
|
|
178
|
+
"type": "address"
|
|
247
179
|
}
|
|
248
180
|
],
|
|
249
|
-
"stateMutability": "
|
|
181
|
+
"stateMutability": "pure",
|
|
250
182
|
"type": "function"
|
|
251
183
|
},
|
|
252
184
|
{
|
|
@@ -266,83 +198,20 @@ export const UERC20_jsonAbi = [
|
|
|
266
198
|
"inputs": [
|
|
267
199
|
{
|
|
268
200
|
"internalType": "address",
|
|
269
|
-
"name": "
|
|
270
|
-
"type": "address"
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
"name": "nonces",
|
|
274
|
-
"outputs": [
|
|
275
|
-
{
|
|
276
|
-
"internalType": "uint256",
|
|
277
|
-
"name": "result",
|
|
278
|
-
"type": "uint256"
|
|
279
|
-
}
|
|
280
|
-
],
|
|
281
|
-
"stateMutability": "view",
|
|
282
|
-
"type": "function"
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
"inputs": [
|
|
286
|
-
{
|
|
287
|
-
"internalType": "address",
|
|
288
|
-
"name": "owner",
|
|
201
|
+
"name": "token",
|
|
289
202
|
"type": "address"
|
|
290
203
|
},
|
|
291
|
-
{
|
|
292
|
-
"internalType": "address",
|
|
293
|
-
"name": "spender",
|
|
294
|
-
"type": "address"
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"internalType": "uint256",
|
|
298
|
-
"name": "value",
|
|
299
|
-
"type": "uint256"
|
|
300
|
-
},
|
|
301
204
|
{
|
|
302
205
|
"internalType": "uint256",
|
|
303
|
-
"name": "
|
|
206
|
+
"name": "amount",
|
|
304
207
|
"type": "uint256"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"internalType": "uint8",
|
|
308
|
-
"name": "v",
|
|
309
|
-
"type": "uint8"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"internalType": "bytes32",
|
|
313
|
-
"name": "r",
|
|
314
|
-
"type": "bytes32"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"internalType": "bytes32",
|
|
318
|
-
"name": "s",
|
|
319
|
-
"type": "bytes32"
|
|
320
208
|
}
|
|
321
209
|
],
|
|
322
|
-
"name": "
|
|
210
|
+
"name": "recoverToken",
|
|
323
211
|
"outputs": [],
|
|
324
212
|
"stateMutability": "nonpayable",
|
|
325
213
|
"type": "function"
|
|
326
214
|
},
|
|
327
|
-
{
|
|
328
|
-
"inputs": [
|
|
329
|
-
{
|
|
330
|
-
"internalType": "bytes4",
|
|
331
|
-
"name": "_interfaceId",
|
|
332
|
-
"type": "bytes4"
|
|
333
|
-
}
|
|
334
|
-
],
|
|
335
|
-
"name": "supportsInterface",
|
|
336
|
-
"outputs": [
|
|
337
|
-
{
|
|
338
|
-
"internalType": "bool",
|
|
339
|
-
"name": "",
|
|
340
|
-
"type": "bool"
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
"stateMutability": "view",
|
|
344
|
-
"type": "function"
|
|
345
|
-
},
|
|
346
215
|
{
|
|
347
216
|
"inputs": [],
|
|
348
217
|
"name": "symbol",
|
|
@@ -356,26 +225,13 @@ export const UERC20_jsonAbi = [
|
|
|
356
225
|
"stateMutability": "view",
|
|
357
226
|
"type": "function"
|
|
358
227
|
},
|
|
359
|
-
{
|
|
360
|
-
"inputs": [],
|
|
361
|
-
"name": "tokenURI",
|
|
362
|
-
"outputs": [
|
|
363
|
-
{
|
|
364
|
-
"internalType": "string",
|
|
365
|
-
"name": "",
|
|
366
|
-
"type": "string"
|
|
367
|
-
}
|
|
368
|
-
],
|
|
369
|
-
"stateMutability": "view",
|
|
370
|
-
"type": "function"
|
|
371
|
-
},
|
|
372
228
|
{
|
|
373
229
|
"inputs": [],
|
|
374
230
|
"name": "totalSupply",
|
|
375
231
|
"outputs": [
|
|
376
232
|
{
|
|
377
233
|
"internalType": "uint256",
|
|
378
|
-
"name": "
|
|
234
|
+
"name": "",
|
|
379
235
|
"type": "uint256"
|
|
380
236
|
}
|
|
381
237
|
],
|
|
@@ -434,23 +290,34 @@ export const UERC20_jsonAbi = [
|
|
|
434
290
|
],
|
|
435
291
|
"stateMutability": "nonpayable",
|
|
436
292
|
"type": "function"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"inputs": [],
|
|
296
|
+
"name": "withdrawETH",
|
|
297
|
+
"outputs": [],
|
|
298
|
+
"stateMutability": "nonpayable",
|
|
299
|
+
"type": "function"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"stateMutability": "payable",
|
|
303
|
+
"type": "receive"
|
|
437
304
|
}
|
|
438
305
|
] as const satisfies Abi;
|
|
439
306
|
|
|
440
307
|
/**
|
|
441
|
-
* Type-safe ABI for
|
|
308
|
+
* Type-safe ABI for USDTToken_json
|
|
442
309
|
*/
|
|
443
|
-
export type
|
|
310
|
+
export type USDTToken_jsonAbi = typeof USDTToken_jsonAbi;
|
|
444
311
|
|
|
445
312
|
/**
|
|
446
|
-
* Contract instance type for
|
|
313
|
+
* Contract instance type for USDTToken_json
|
|
447
314
|
*/
|
|
448
315
|
// Use any for contract type to avoid complex viem type issues
|
|
449
316
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
450
|
-
export type
|
|
317
|
+
export type USDTToken_jsonContract = any;
|
|
451
318
|
|
|
452
319
|
/**
|
|
453
|
-
*
|
|
320
|
+
* USDTToken_json Contract Class
|
|
454
321
|
*
|
|
455
322
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
456
323
|
*
|
|
@@ -458,12 +325,12 @@ export type UERC20_jsonContract = any;
|
|
|
458
325
|
* ```typescript
|
|
459
326
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
460
327
|
* import { mainnet } from 'viem/chains';
|
|
461
|
-
* import {
|
|
328
|
+
* import { USDTToken_json } from 'USDTToken_json';
|
|
462
329
|
*
|
|
463
330
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
464
331
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
465
332
|
*
|
|
466
|
-
* const contract = new
|
|
333
|
+
* const contract = new USDTToken_json('0x...', { publicClient, walletClient });
|
|
467
334
|
*
|
|
468
335
|
* // Read functions
|
|
469
336
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -481,8 +348,8 @@ export type UERC20_jsonContract = any;
|
|
|
481
348
|
* });
|
|
482
349
|
* ```
|
|
483
350
|
*/
|
|
484
|
-
export class
|
|
485
|
-
private contract:
|
|
351
|
+
export class USDTToken_json {
|
|
352
|
+
private contract: USDTToken_jsonContract;
|
|
486
353
|
private contractAddress: Address;
|
|
487
354
|
private publicClient: PublicClient;
|
|
488
355
|
|
|
@@ -497,7 +364,7 @@ export class UERC20_json {
|
|
|
497
364
|
this.publicClient = clients.publicClient;
|
|
498
365
|
this.contract = getContract({
|
|
499
366
|
address,
|
|
500
|
-
abi:
|
|
367
|
+
abi: USDTToken_jsonAbi,
|
|
501
368
|
client: {
|
|
502
369
|
public: clients.publicClient,
|
|
503
370
|
wallet: clients.walletClient,
|
|
@@ -515,40 +382,32 @@ export class UERC20_json {
|
|
|
515
382
|
/**
|
|
516
383
|
* Get the underlying viem contract instance
|
|
517
384
|
*/
|
|
518
|
-
getContract():
|
|
385
|
+
getContract(): USDTToken_jsonContract {
|
|
519
386
|
return this.contract;
|
|
520
387
|
}
|
|
521
388
|
|
|
522
389
|
/**
|
|
523
|
-
*
|
|
390
|
+
* WITHDRAW_ADDRESS
|
|
524
391
|
* view
|
|
525
392
|
*/
|
|
526
|
-
async
|
|
527
|
-
return this.contract.read.
|
|
393
|
+
async WITHDRAW_ADDRESS(): Promise<`0x${string}`> {
|
|
394
|
+
return this.contract.read.WITHDRAW_ADDRESS() as Promise<`0x${string}`>;
|
|
528
395
|
}
|
|
529
396
|
|
|
530
397
|
/**
|
|
531
398
|
* allowance
|
|
532
399
|
* view
|
|
533
400
|
*/
|
|
534
|
-
async allowance(
|
|
535
|
-
return this.contract.read.allowance([
|
|
401
|
+
async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
|
|
402
|
+
return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
|
|
536
403
|
}
|
|
537
404
|
|
|
538
405
|
/**
|
|
539
406
|
* balanceOf
|
|
540
407
|
* view
|
|
541
408
|
*/
|
|
542
|
-
async balanceOf(
|
|
543
|
-
return this.contract.read.balanceOf([
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* creator
|
|
548
|
-
* view
|
|
549
|
-
*/
|
|
550
|
-
async creator(): Promise<`0x${string}`> {
|
|
551
|
-
return this.contract.read.creator() as Promise<`0x${string}`>;
|
|
409
|
+
async balanceOf(arg0: `0x${string}`): Promise<bigint> {
|
|
410
|
+
return this.contract.read.balanceOf([arg0] as const) as Promise<bigint>;
|
|
552
411
|
}
|
|
553
412
|
|
|
554
413
|
/**
|
|
@@ -560,19 +419,19 @@ export class UERC20_json {
|
|
|
560
419
|
}
|
|
561
420
|
|
|
562
421
|
/**
|
|
563
|
-
*
|
|
422
|
+
* getETHBalance
|
|
564
423
|
* view
|
|
565
424
|
*/
|
|
566
|
-
async
|
|
567
|
-
return this.contract.read.
|
|
425
|
+
async getETHBalance(): Promise<bigint> {
|
|
426
|
+
return this.contract.read.getETHBalance() as Promise<bigint>;
|
|
568
427
|
}
|
|
569
428
|
|
|
570
429
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
430
|
+
* getWithdrawalAddress
|
|
431
|
+
* pure
|
|
573
432
|
*/
|
|
574
|
-
async
|
|
575
|
-
return this.contract.read.
|
|
433
|
+
async getWithdrawalAddress(): Promise<`0x${string}`> {
|
|
434
|
+
return this.contract.read.getWithdrawalAddress() as Promise<`0x${string}`>;
|
|
576
435
|
}
|
|
577
436
|
|
|
578
437
|
/**
|
|
@@ -583,22 +442,6 @@ export class UERC20_json {
|
|
|
583
442
|
return this.contract.read.name() as Promise<string>;
|
|
584
443
|
}
|
|
585
444
|
|
|
586
|
-
/**
|
|
587
|
-
* nonces
|
|
588
|
-
* view
|
|
589
|
-
*/
|
|
590
|
-
async nonces(owner: `0x${string}`): Promise<bigint> {
|
|
591
|
-
return this.contract.read.nonces([owner] as const) as Promise<bigint>;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* supportsInterface
|
|
596
|
-
* view
|
|
597
|
-
*/
|
|
598
|
-
async supportsInterface(_interfaceId: `0x${string}`): Promise<boolean> {
|
|
599
|
-
return this.contract.read.supportsInterface([_interfaceId] as const) as Promise<boolean>;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
445
|
/**
|
|
603
446
|
* symbol
|
|
604
447
|
* view
|
|
@@ -607,14 +450,6 @@ export class UERC20_json {
|
|
|
607
450
|
return this.contract.read.symbol() as Promise<string>;
|
|
608
451
|
}
|
|
609
452
|
|
|
610
|
-
/**
|
|
611
|
-
* tokenURI
|
|
612
|
-
* view
|
|
613
|
-
*/
|
|
614
|
-
async tokenURI(): Promise<string> {
|
|
615
|
-
return this.contract.read.tokenURI() as Promise<string>;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
453
|
/**
|
|
619
454
|
* totalSupply
|
|
620
455
|
* view
|
|
@@ -647,11 +482,11 @@ export class UERC20_json {
|
|
|
647
482
|
}
|
|
648
483
|
|
|
649
484
|
/**
|
|
650
|
-
*
|
|
485
|
+
* recoverToken
|
|
651
486
|
* nonpayable
|
|
652
487
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
653
488
|
*/
|
|
654
|
-
async
|
|
489
|
+
async recoverToken(token: `0x${string}`, amount: bigint, options?: {
|
|
655
490
|
accessList?: import('viem').AccessList;
|
|
656
491
|
authorizationList?: import('viem').AuthorizationList;
|
|
657
492
|
chain?: import('viem').Chain | null;
|
|
@@ -666,7 +501,7 @@ export class UERC20_json {
|
|
|
666
501
|
if (!this.contract.write) {
|
|
667
502
|
throw new Error('Wallet client is required for write operations');
|
|
668
503
|
}
|
|
669
|
-
return this.contract.write.
|
|
504
|
+
return this.contract.write.recoverToken([token, amount] as const, options) as Promise<`0x${string}`>;
|
|
670
505
|
}
|
|
671
506
|
|
|
672
507
|
/**
|
|
@@ -715,6 +550,29 @@ export class UERC20_json {
|
|
|
715
550
|
return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
|
|
716
551
|
}
|
|
717
552
|
|
|
553
|
+
/**
|
|
554
|
+
* withdrawETH
|
|
555
|
+
* nonpayable
|
|
556
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
557
|
+
*/
|
|
558
|
+
async withdrawETH(options?: {
|
|
559
|
+
accessList?: import('viem').AccessList;
|
|
560
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
561
|
+
chain?: import('viem').Chain | null;
|
|
562
|
+
dataSuffix?: `0x${string}`;
|
|
563
|
+
gas?: bigint;
|
|
564
|
+
gasPrice?: bigint;
|
|
565
|
+
maxFeePerGas?: bigint;
|
|
566
|
+
maxPriorityFeePerGas?: bigint;
|
|
567
|
+
nonce?: number;
|
|
568
|
+
value?: bigint;
|
|
569
|
+
}): Promise<`0x${string}`> {
|
|
570
|
+
if (!this.contract.write) {
|
|
571
|
+
throw new Error('Wallet client is required for write operations');
|
|
572
|
+
}
|
|
573
|
+
return this.contract.write.withdrawETH(options) as Promise<`0x${string}`>;
|
|
574
|
+
}
|
|
575
|
+
|
|
718
576
|
|
|
719
577
|
|
|
720
578
|
/**
|
|
@@ -751,11 +609,11 @@ export class UERC20_json {
|
|
|
751
609
|
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
752
610
|
},
|
|
753
611
|
/**
|
|
754
|
-
* Simulate
|
|
612
|
+
* Simulate recoverToken
|
|
755
613
|
* Returns gas estimate and result without sending transaction
|
|
756
614
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
757
615
|
*/
|
|
758
|
-
async
|
|
616
|
+
async recoverToken(token: `0x${string}`, amount: bigint, options?: {
|
|
759
617
|
accessList?: import('viem').AccessList;
|
|
760
618
|
authorizationList?: import('viem').AuthorizationList;
|
|
761
619
|
chain?: import('viem').Chain | null;
|
|
@@ -767,7 +625,7 @@ export class UERC20_json {
|
|
|
767
625
|
nonce?: number;
|
|
768
626
|
value?: bigint;
|
|
769
627
|
}): Promise<void> {
|
|
770
|
-
return contract.simulate.
|
|
628
|
+
return contract.simulate.recoverToken([token, amount] as const, options) as Promise<void>;
|
|
771
629
|
},
|
|
772
630
|
/**
|
|
773
631
|
* Simulate transfer
|
|
@@ -806,6 +664,25 @@ export class UERC20_json {
|
|
|
806
664
|
value?: bigint;
|
|
807
665
|
}): Promise<boolean> {
|
|
808
666
|
return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
|
|
667
|
+
},
|
|
668
|
+
/**
|
|
669
|
+
* Simulate withdrawETH
|
|
670
|
+
* Returns gas estimate and result without sending transaction
|
|
671
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
672
|
+
*/
|
|
673
|
+
async withdrawETH(options?: {
|
|
674
|
+
accessList?: import('viem').AccessList;
|
|
675
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
676
|
+
chain?: import('viem').Chain | null;
|
|
677
|
+
dataSuffix?: `0x${string}`;
|
|
678
|
+
gas?: bigint;
|
|
679
|
+
gasPrice?: bigint;
|
|
680
|
+
maxFeePerGas?: bigint;
|
|
681
|
+
maxPriorityFeePerGas?: bigint;
|
|
682
|
+
nonce?: number;
|
|
683
|
+
value?: bigint;
|
|
684
|
+
}): Promise<void> {
|
|
685
|
+
return contract.simulate.withdrawETH(options) as Promise<void>;
|
|
809
686
|
}
|
|
810
687
|
};
|
|
811
688
|
}
|
|
@@ -830,10 +707,10 @@ export class UERC20_json {
|
|
|
830
707
|
* @param filter Optional filter for indexed parameters
|
|
831
708
|
* @returns Unwatch function to stop listening
|
|
832
709
|
*/
|
|
833
|
-
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`;
|
|
710
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
834
711
|
return this.publicClient.watchContractEvent({
|
|
835
712
|
address: this.contractAddress,
|
|
836
|
-
abi:
|
|
713
|
+
abi: USDTToken_jsonAbi,
|
|
837
714
|
eventName: 'Approval',
|
|
838
715
|
args: filter,
|
|
839
716
|
onLogs: (logs: any[]) => {
|
|
@@ -849,10 +726,10 @@ export class UERC20_json {
|
|
|
849
726
|
* @param filter Optional filter for indexed parameters
|
|
850
727
|
* @returns Unwatch function to stop listening
|
|
851
728
|
*/
|
|
852
|
-
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`;
|
|
729
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
853
730
|
return this.publicClient.watchContractEvent({
|
|
854
731
|
address: this.contractAddress,
|
|
855
|
-
abi:
|
|
732
|
+
abi: USDTToken_jsonAbi,
|
|
856
733
|
eventName: 'Transfer',
|
|
857
734
|
args: filter,
|
|
858
735
|
onLogs: (logs: any[]) => {
|
package/contracts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { USDTToken_jsonAbi, USDTToken_json } from './USDTToken_json';
|
|
2
|
+
export type { USDTToken_jsonAbi as USDTToken_jsonAbiType, USDTToken_jsonContract } from './USDTToken_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.USDTToken_json = exports.USDTToken_jsonAbi = void 0;
|
|
4
4
|
// Auto-generated exports for all contracts
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
5
|
+
var USDTToken_json_1 = require("./USDTToken_json");
|
|
6
|
+
Object.defineProperty(exports, "USDTToken_jsonAbi", { enumerable: true, get: function () { return USDTToken_json_1.USDTToken_jsonAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "USDTToken_json", { enumerable: true, get: function () { return USDTToken_json_1.USDTToken_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 { USDTToken_jsonAbi, USDTToken_json } from './USDTToken_json';
|
|
3
|
+
export type { USDTToken_jsonAbi as USDTToken_jsonAbiType, USDTToken_jsonContract } from './USDTToken_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.17",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for USDT (build etherscan-usdt-0f4bab45-1786223915089, commit 07ea2dd, 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": "07ea2dd"
|
|
43
43
|
}
|