@gitmyabi/usdt 1.0.10 → 1.0.12
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/{TETHER_json.d.ts → StandardERC20_json.d.ts} +91 -336
- package/contracts/{TETHER_json.js → StandardERC20_json.js} +112 -305
- package/contracts/{TETHER_json.ts → StandardERC20_json.ts} +116 -427
- 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,11 +2,11 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* StandardERC20_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 StandardERC20_jsonAbi = [
|
|
10
10
|
{
|
|
11
11
|
"inputs": [
|
|
12
12
|
{
|
|
@@ -20,9 +20,9 @@ export const TETHER_jsonAbi = [
|
|
|
20
20
|
"type": "string"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
"internalType": "
|
|
23
|
+
"internalType": "uint8",
|
|
24
24
|
"name": "decimals_",
|
|
25
|
-
"type": "
|
|
25
|
+
"type": "uint8"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"internalType": "uint256",
|
|
@@ -30,9 +30,9 @@ export const TETHER_jsonAbi = [
|
|
|
30
30
|
"type": "uint256"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"internalType": "
|
|
34
|
-
"name": "
|
|
35
|
-
"type": "
|
|
33
|
+
"internalType": "bytes",
|
|
34
|
+
"name": "signature_",
|
|
35
|
+
"type": "bytes"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"internalType": "address payable",
|
|
@@ -44,170 +44,155 @@ export const TETHER_jsonAbi = [
|
|
|
44
44
|
"type": "constructor"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
"anonymous": false,
|
|
48
47
|
"inputs": [
|
|
49
48
|
{
|
|
50
|
-
"indexed": true,
|
|
51
49
|
"internalType": "address",
|
|
52
|
-
"name": "
|
|
50
|
+
"name": "spender",
|
|
53
51
|
"type": "address"
|
|
54
52
|
},
|
|
55
53
|
{
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"type": "address"
|
|
54
|
+
"internalType": "uint256",
|
|
55
|
+
"name": "allowance",
|
|
56
|
+
"type": "uint256"
|
|
60
57
|
},
|
|
61
58
|
{
|
|
62
|
-
"indexed": false,
|
|
63
59
|
"internalType": "uint256",
|
|
64
|
-
"name": "
|
|
60
|
+
"name": "needed",
|
|
65
61
|
"type": "uint256"
|
|
66
62
|
}
|
|
67
63
|
],
|
|
68
|
-
"name": "
|
|
69
|
-
"type": "
|
|
64
|
+
"name": "ERC20InsufficientAllowance",
|
|
65
|
+
"type": "error"
|
|
70
66
|
},
|
|
71
67
|
{
|
|
72
|
-
"anonymous": false,
|
|
73
68
|
"inputs": [
|
|
74
69
|
{
|
|
75
|
-
"indexed": true,
|
|
76
70
|
"internalType": "address",
|
|
77
|
-
"name": "
|
|
71
|
+
"name": "sender",
|
|
78
72
|
"type": "address"
|
|
79
73
|
},
|
|
80
74
|
{
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
75
|
+
"internalType": "uint256",
|
|
76
|
+
"name": "balance",
|
|
77
|
+
"type": "uint256"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"internalType": "uint256",
|
|
81
|
+
"name": "needed",
|
|
82
|
+
"type": "uint256"
|
|
85
83
|
}
|
|
86
84
|
],
|
|
87
|
-
"name": "
|
|
88
|
-
"type": "
|
|
85
|
+
"name": "ERC20InsufficientBalance",
|
|
86
|
+
"type": "error"
|
|
89
87
|
},
|
|
90
88
|
{
|
|
91
|
-
"anonymous": false,
|
|
92
89
|
"inputs": [
|
|
93
90
|
{
|
|
94
|
-
"indexed": true,
|
|
95
91
|
"internalType": "address",
|
|
96
|
-
"name": "
|
|
92
|
+
"name": "approver",
|
|
97
93
|
"type": "address"
|
|
98
|
-
}
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"name": "ERC20InvalidApprover",
|
|
97
|
+
"type": "error"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"inputs": [
|
|
99
101
|
{
|
|
100
|
-
"indexed": true,
|
|
101
102
|
"internalType": "address",
|
|
102
|
-
"name": "
|
|
103
|
+
"name": "receiver",
|
|
103
104
|
"type": "address"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"indexed": false,
|
|
107
|
-
"internalType": "uint256",
|
|
108
|
-
"name": "value",
|
|
109
|
-
"type": "uint256"
|
|
110
105
|
}
|
|
111
106
|
],
|
|
112
|
-
"name": "
|
|
113
|
-
"type": "
|
|
107
|
+
"name": "ERC20InvalidReceiver",
|
|
108
|
+
"type": "error"
|
|
114
109
|
},
|
|
115
110
|
{
|
|
116
|
-
"inputs": [
|
|
117
|
-
"name": "Optimization",
|
|
118
|
-
"outputs": [
|
|
111
|
+
"inputs": [
|
|
119
112
|
{
|
|
120
|
-
"internalType": "
|
|
121
|
-
"name": "",
|
|
122
|
-
"type": "
|
|
113
|
+
"internalType": "address",
|
|
114
|
+
"name": "sender",
|
|
115
|
+
"type": "address"
|
|
123
116
|
}
|
|
124
117
|
],
|
|
125
|
-
"
|
|
126
|
-
"type": "
|
|
118
|
+
"name": "ERC20InvalidSender",
|
|
119
|
+
"type": "error"
|
|
127
120
|
},
|
|
128
121
|
{
|
|
129
|
-
"inputs": [
|
|
130
|
-
"name": "_owner",
|
|
131
|
-
"outputs": [
|
|
122
|
+
"inputs": [
|
|
132
123
|
{
|
|
133
124
|
"internalType": "address",
|
|
134
|
-
"name": "",
|
|
125
|
+
"name": "spender",
|
|
135
126
|
"type": "address"
|
|
136
127
|
}
|
|
137
128
|
],
|
|
138
|
-
"
|
|
139
|
-
"type": "
|
|
129
|
+
"name": "ERC20InvalidSpender",
|
|
130
|
+
"type": "error"
|
|
140
131
|
},
|
|
141
132
|
{
|
|
133
|
+
"anonymous": false,
|
|
142
134
|
"inputs": [
|
|
143
135
|
{
|
|
136
|
+
"indexed": true,
|
|
144
137
|
"internalType": "address",
|
|
145
138
|
"name": "owner",
|
|
146
139
|
"type": "address"
|
|
147
140
|
},
|
|
148
141
|
{
|
|
142
|
+
"indexed": true,
|
|
149
143
|
"internalType": "address",
|
|
150
144
|
"name": "spender",
|
|
151
145
|
"type": "address"
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"name": "allowance",
|
|
155
|
-
"outputs": [
|
|
146
|
+
},
|
|
156
147
|
{
|
|
148
|
+
"indexed": false,
|
|
157
149
|
"internalType": "uint256",
|
|
158
|
-
"name": "",
|
|
150
|
+
"name": "value",
|
|
159
151
|
"type": "uint256"
|
|
160
152
|
}
|
|
161
153
|
],
|
|
162
|
-
"
|
|
163
|
-
"type": "
|
|
154
|
+
"name": "Approval",
|
|
155
|
+
"type": "event"
|
|
164
156
|
},
|
|
165
157
|
{
|
|
158
|
+
"anonymous": false,
|
|
166
159
|
"inputs": [
|
|
167
160
|
{
|
|
161
|
+
"indexed": true,
|
|
168
162
|
"internalType": "address",
|
|
169
|
-
"name": "
|
|
163
|
+
"name": "from",
|
|
170
164
|
"type": "address"
|
|
171
165
|
},
|
|
172
166
|
{
|
|
167
|
+
"indexed": true,
|
|
168
|
+
"internalType": "address",
|
|
169
|
+
"name": "to",
|
|
170
|
+
"type": "address"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"indexed": false,
|
|
173
174
|
"internalType": "uint256",
|
|
174
|
-
"name": "
|
|
175
|
+
"name": "value",
|
|
175
176
|
"type": "uint256"
|
|
176
177
|
}
|
|
177
178
|
],
|
|
178
|
-
"name": "
|
|
179
|
-
"
|
|
180
|
-
{
|
|
181
|
-
"internalType": "bool",
|
|
182
|
-
"name": "",
|
|
183
|
-
"type": "bool"
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
"stateMutability": "nonpayable",
|
|
187
|
-
"type": "function"
|
|
179
|
+
"name": "Transfer",
|
|
180
|
+
"type": "event"
|
|
188
181
|
},
|
|
189
182
|
{
|
|
190
183
|
"inputs": [
|
|
191
184
|
{
|
|
192
185
|
"internalType": "address",
|
|
193
|
-
"name": "
|
|
186
|
+
"name": "owner",
|
|
194
187
|
"type": "address"
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
"name": "balanceOf",
|
|
198
|
-
"outputs": [
|
|
188
|
+
},
|
|
199
189
|
{
|
|
200
|
-
"internalType": "
|
|
201
|
-
"name": "",
|
|
202
|
-
"type": "
|
|
190
|
+
"internalType": "address",
|
|
191
|
+
"name": "spender",
|
|
192
|
+
"type": "address"
|
|
203
193
|
}
|
|
204
194
|
],
|
|
205
|
-
"
|
|
206
|
-
"type": "function"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"inputs": [],
|
|
210
|
-
"name": "decimals",
|
|
195
|
+
"name": "allowance",
|
|
211
196
|
"outputs": [
|
|
212
197
|
{
|
|
213
198
|
"internalType": "uint256",
|
|
@@ -227,11 +212,11 @@ export const TETHER_jsonAbi = [
|
|
|
227
212
|
},
|
|
228
213
|
{
|
|
229
214
|
"internalType": "uint256",
|
|
230
|
-
"name": "
|
|
215
|
+
"name": "value",
|
|
231
216
|
"type": "uint256"
|
|
232
217
|
}
|
|
233
218
|
],
|
|
234
|
-
"name": "
|
|
219
|
+
"name": "approve",
|
|
235
220
|
"outputs": [
|
|
236
221
|
{
|
|
237
222
|
"internalType": "bool",
|
|
@@ -246,34 +231,29 @@ export const TETHER_jsonAbi = [
|
|
|
246
231
|
"inputs": [
|
|
247
232
|
{
|
|
248
233
|
"internalType": "address",
|
|
249
|
-
"name": "
|
|
234
|
+
"name": "account",
|
|
250
235
|
"type": "address"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"internalType": "uint256",
|
|
254
|
-
"name": "addedValue",
|
|
255
|
-
"type": "uint256"
|
|
256
236
|
}
|
|
257
237
|
],
|
|
258
|
-
"name": "
|
|
238
|
+
"name": "balanceOf",
|
|
259
239
|
"outputs": [
|
|
260
240
|
{
|
|
261
|
-
"internalType": "
|
|
241
|
+
"internalType": "uint256",
|
|
262
242
|
"name": "",
|
|
263
|
-
"type": "
|
|
243
|
+
"type": "uint256"
|
|
264
244
|
}
|
|
265
245
|
],
|
|
266
|
-
"stateMutability": "
|
|
246
|
+
"stateMutability": "view",
|
|
267
247
|
"type": "function"
|
|
268
248
|
},
|
|
269
249
|
{
|
|
270
250
|
"inputs": [],
|
|
271
|
-
"name": "
|
|
251
|
+
"name": "decimals",
|
|
272
252
|
"outputs": [
|
|
273
253
|
{
|
|
274
|
-
"internalType": "
|
|
254
|
+
"internalType": "uint8",
|
|
275
255
|
"name": "",
|
|
276
|
-
"type": "
|
|
256
|
+
"type": "uint8"
|
|
277
257
|
}
|
|
278
258
|
],
|
|
279
259
|
"stateMutability": "view",
|
|
@@ -281,42 +261,17 @@ export const TETHER_jsonAbi = [
|
|
|
281
261
|
},
|
|
282
262
|
{
|
|
283
263
|
"inputs": [],
|
|
284
|
-
"name": "
|
|
264
|
+
"name": "name",
|
|
285
265
|
"outputs": [
|
|
286
266
|
{
|
|
287
|
-
"internalType": "
|
|
267
|
+
"internalType": "string",
|
|
288
268
|
"name": "",
|
|
289
|
-
"type": "
|
|
269
|
+
"type": "string"
|
|
290
270
|
}
|
|
291
271
|
],
|
|
292
272
|
"stateMutability": "view",
|
|
293
273
|
"type": "function"
|
|
294
274
|
},
|
|
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
|
-
{
|
|
314
|
-
"inputs": [],
|
|
315
|
-
"name": "renounceOwnership",
|
|
316
|
-
"outputs": [],
|
|
317
|
-
"stateMutability": "nonpayable",
|
|
318
|
-
"type": "function"
|
|
319
|
-
},
|
|
320
275
|
{
|
|
321
276
|
"inputs": [],
|
|
322
277
|
"name": "symbol",
|
|
@@ -347,12 +302,12 @@ export const TETHER_jsonAbi = [
|
|
|
347
302
|
"inputs": [
|
|
348
303
|
{
|
|
349
304
|
"internalType": "address",
|
|
350
|
-
"name": "
|
|
305
|
+
"name": "to",
|
|
351
306
|
"type": "address"
|
|
352
307
|
},
|
|
353
308
|
{
|
|
354
309
|
"internalType": "uint256",
|
|
355
|
-
"name": "
|
|
310
|
+
"name": "value",
|
|
356
311
|
"type": "uint256"
|
|
357
312
|
}
|
|
358
313
|
],
|
|
@@ -371,17 +326,17 @@ export const TETHER_jsonAbi = [
|
|
|
371
326
|
"inputs": [
|
|
372
327
|
{
|
|
373
328
|
"internalType": "address",
|
|
374
|
-
"name": "
|
|
329
|
+
"name": "from",
|
|
375
330
|
"type": "address"
|
|
376
331
|
},
|
|
377
332
|
{
|
|
378
333
|
"internalType": "address",
|
|
379
|
-
"name": "
|
|
334
|
+
"name": "to",
|
|
380
335
|
"type": "address"
|
|
381
336
|
},
|
|
382
337
|
{
|
|
383
338
|
"internalType": "uint256",
|
|
384
|
-
"name": "
|
|
339
|
+
"name": "value",
|
|
385
340
|
"type": "uint256"
|
|
386
341
|
}
|
|
387
342
|
],
|
|
@@ -395,36 +350,23 @@ export const TETHER_jsonAbi = [
|
|
|
395
350
|
],
|
|
396
351
|
"stateMutability": "nonpayable",
|
|
397
352
|
"type": "function"
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
"inputs": [
|
|
401
|
-
{
|
|
402
|
-
"internalType": "address",
|
|
403
|
-
"name": "newOwner",
|
|
404
|
-
"type": "address"
|
|
405
|
-
}
|
|
406
|
-
],
|
|
407
|
-
"name": "transferOwnership",
|
|
408
|
-
"outputs": [],
|
|
409
|
-
"stateMutability": "nonpayable",
|
|
410
|
-
"type": "function"
|
|
411
353
|
}
|
|
412
354
|
] as const satisfies Abi;
|
|
413
355
|
|
|
414
356
|
/**
|
|
415
|
-
* Type-safe ABI for
|
|
357
|
+
* Type-safe ABI for StandardERC20_json
|
|
416
358
|
*/
|
|
417
|
-
export type
|
|
359
|
+
export type StandardERC20_jsonAbi = typeof StandardERC20_jsonAbi;
|
|
418
360
|
|
|
419
361
|
/**
|
|
420
|
-
* Contract instance type for
|
|
362
|
+
* Contract instance type for StandardERC20_json
|
|
421
363
|
*/
|
|
422
364
|
// Use any for contract type to avoid complex viem type issues
|
|
423
365
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
424
|
-
export type
|
|
366
|
+
export type StandardERC20_jsonContract = any;
|
|
425
367
|
|
|
426
368
|
/**
|
|
427
|
-
*
|
|
369
|
+
* StandardERC20_json Contract Class
|
|
428
370
|
*
|
|
429
371
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
430
372
|
*
|
|
@@ -432,12 +374,12 @@ export type TETHER_jsonContract = any;
|
|
|
432
374
|
* ```typescript
|
|
433
375
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
434
376
|
* import { mainnet } from 'viem/chains';
|
|
435
|
-
* import {
|
|
377
|
+
* import { StandardERC20_json } from 'StandardERC20_json';
|
|
436
378
|
*
|
|
437
379
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
438
380
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
439
381
|
*
|
|
440
|
-
* const contract = new
|
|
382
|
+
* const contract = new StandardERC20_json('0x...', { publicClient, walletClient });
|
|
441
383
|
*
|
|
442
384
|
* // Read functions
|
|
443
385
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -455,8 +397,8 @@ export type TETHER_jsonContract = any;
|
|
|
455
397
|
* });
|
|
456
398
|
* ```
|
|
457
399
|
*/
|
|
458
|
-
export class
|
|
459
|
-
private contract:
|
|
400
|
+
export class StandardERC20_json {
|
|
401
|
+
private contract: StandardERC20_jsonContract;
|
|
460
402
|
private contractAddress: Address;
|
|
461
403
|
private publicClient: PublicClient;
|
|
462
404
|
|
|
@@ -471,7 +413,7 @@ export class TETHER_json {
|
|
|
471
413
|
this.publicClient = clients.publicClient;
|
|
472
414
|
this.contract = getContract({
|
|
473
415
|
address,
|
|
474
|
-
abi:
|
|
416
|
+
abi: StandardERC20_jsonAbi,
|
|
475
417
|
client: {
|
|
476
418
|
public: clients.publicClient,
|
|
477
419
|
wallet: clients.walletClient,
|
|
@@ -489,26 +431,10 @@ export class TETHER_json {
|
|
|
489
431
|
/**
|
|
490
432
|
* Get the underlying viem contract instance
|
|
491
433
|
*/
|
|
492
|
-
getContract():
|
|
434
|
+
getContract(): StandardERC20_jsonContract {
|
|
493
435
|
return this.contract;
|
|
494
436
|
}
|
|
495
437
|
|
|
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
438
|
/**
|
|
513
439
|
* allowance
|
|
514
440
|
* view
|
|
@@ -541,14 +467,6 @@ export class TETHER_json {
|
|
|
541
467
|
return this.contract.read.name() as Promise<string>;
|
|
542
468
|
}
|
|
543
469
|
|
|
544
|
-
/**
|
|
545
|
-
* owner
|
|
546
|
-
* view
|
|
547
|
-
*/
|
|
548
|
-
async owner(): Promise<`0x${string}`> {
|
|
549
|
-
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
470
|
/**
|
|
553
471
|
* symbol
|
|
554
472
|
* view
|
|
@@ -570,76 +488,7 @@ export class TETHER_json {
|
|
|
570
488
|
* nonpayable
|
|
571
489
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
572
490
|
*/
|
|
573
|
-
async approve(spender: `0x${string}`,
|
|
574
|
-
accessList?: import('viem').AccessList;
|
|
575
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
576
|
-
chain?: import('viem').Chain | null;
|
|
577
|
-
dataSuffix?: `0x${string}`;
|
|
578
|
-
gas?: bigint;
|
|
579
|
-
gasPrice?: bigint;
|
|
580
|
-
maxFeePerGas?: bigint;
|
|
581
|
-
maxPriorityFeePerGas?: bigint;
|
|
582
|
-
nonce?: number;
|
|
583
|
-
value?: bigint;
|
|
584
|
-
}): Promise<`0x${string}`> {
|
|
585
|
-
if (!this.contract.write) {
|
|
586
|
-
throw new Error('Wallet client is required for write operations');
|
|
587
|
-
}
|
|
588
|
-
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
589
|
-
}
|
|
590
|
-
|
|
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?: {
|
|
491
|
+
async approve(spender: `0x${string}`, value: bigint, options?: {
|
|
643
492
|
accessList?: import('viem').AccessList;
|
|
644
493
|
authorizationList?: import('viem').AuthorizationList;
|
|
645
494
|
chain?: import('viem').Chain | null;
|
|
@@ -654,30 +503,7 @@ export class TETHER_json {
|
|
|
654
503
|
if (!this.contract.write) {
|
|
655
504
|
throw new Error('Wallet client is required for write operations');
|
|
656
505
|
}
|
|
657
|
-
return this.contract.write.
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* renounceOwnership
|
|
662
|
-
* nonpayable
|
|
663
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
664
|
-
*/
|
|
665
|
-
async renounceOwnership(options?: {
|
|
666
|
-
accessList?: import('viem').AccessList;
|
|
667
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
668
|
-
chain?: import('viem').Chain | null;
|
|
669
|
-
dataSuffix?: `0x${string}`;
|
|
670
|
-
gas?: bigint;
|
|
671
|
-
gasPrice?: bigint;
|
|
672
|
-
maxFeePerGas?: bigint;
|
|
673
|
-
maxPriorityFeePerGas?: bigint;
|
|
674
|
-
nonce?: number;
|
|
675
|
-
value?: bigint;
|
|
676
|
-
}): Promise<`0x${string}`> {
|
|
677
|
-
if (!this.contract.write) {
|
|
678
|
-
throw new Error('Wallet client is required for write operations');
|
|
679
|
-
}
|
|
680
|
-
return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
|
|
506
|
+
return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
|
|
681
507
|
}
|
|
682
508
|
|
|
683
509
|
/**
|
|
@@ -685,7 +511,7 @@ export class TETHER_json {
|
|
|
685
511
|
* nonpayable
|
|
686
512
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
687
513
|
*/
|
|
688
|
-
async transfer(
|
|
514
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
689
515
|
accessList?: import('viem').AccessList;
|
|
690
516
|
authorizationList?: import('viem').AuthorizationList;
|
|
691
517
|
chain?: import('viem').Chain | null;
|
|
@@ -700,7 +526,7 @@ export class TETHER_json {
|
|
|
700
526
|
if (!this.contract.write) {
|
|
701
527
|
throw new Error('Wallet client is required for write operations');
|
|
702
528
|
}
|
|
703
|
-
return this.contract.write.transfer([
|
|
529
|
+
return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
|
|
704
530
|
}
|
|
705
531
|
|
|
706
532
|
/**
|
|
@@ -708,30 +534,7 @@ export class TETHER_json {
|
|
|
708
534
|
* nonpayable
|
|
709
535
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
710
536
|
*/
|
|
711
|
-
async transferFrom(
|
|
712
|
-
accessList?: import('viem').AccessList;
|
|
713
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
714
|
-
chain?: import('viem').Chain | null;
|
|
715
|
-
dataSuffix?: `0x${string}`;
|
|
716
|
-
gas?: bigint;
|
|
717
|
-
gasPrice?: bigint;
|
|
718
|
-
maxFeePerGas?: bigint;
|
|
719
|
-
maxPriorityFeePerGas?: bigint;
|
|
720
|
-
nonce?: number;
|
|
721
|
-
value?: bigint;
|
|
722
|
-
}): Promise<`0x${string}`> {
|
|
723
|
-
if (!this.contract.write) {
|
|
724
|
-
throw new Error('Wallet client is required for write operations');
|
|
725
|
-
}
|
|
726
|
-
return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* transferOwnership
|
|
731
|
-
* nonpayable
|
|
732
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
733
|
-
*/
|
|
734
|
-
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
537
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
735
538
|
accessList?: import('viem').AccessList;
|
|
736
539
|
authorizationList?: import('viem').AuthorizationList;
|
|
737
540
|
chain?: import('viem').Chain | null;
|
|
@@ -746,7 +549,7 @@ export class TETHER_json {
|
|
|
746
549
|
if (!this.contract.write) {
|
|
747
550
|
throw new Error('Wallet client is required for write operations');
|
|
748
551
|
}
|
|
749
|
-
return this.contract.write.
|
|
552
|
+
return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
|
|
750
553
|
}
|
|
751
554
|
|
|
752
555
|
|
|
@@ -770,7 +573,7 @@ export class TETHER_json {
|
|
|
770
573
|
* Returns gas estimate and result without sending transaction
|
|
771
574
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
772
575
|
*/
|
|
773
|
-
async approve(spender: `0x${string}`,
|
|
576
|
+
async approve(spender: `0x${string}`, value: bigint, options?: {
|
|
774
577
|
accessList?: import('viem').AccessList;
|
|
775
578
|
authorizationList?: import('viem').AuthorizationList;
|
|
776
579
|
chain?: import('viem').Chain | null;
|
|
@@ -782,90 +585,14 @@ export class TETHER_json {
|
|
|
782
585
|
nonce?: number;
|
|
783
586
|
value?: bigint;
|
|
784
587
|
}): Promise<boolean> {
|
|
785
|
-
return contract.simulate.approve([spender,
|
|
786
|
-
},
|
|
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
|
-
/**
|
|
845
|
-
* Simulate renounceOwnership
|
|
846
|
-
* Returns gas estimate and result without sending transaction
|
|
847
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
848
|
-
*/
|
|
849
|
-
async renounceOwnership(options?: {
|
|
850
|
-
accessList?: import('viem').AccessList;
|
|
851
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
852
|
-
chain?: import('viem').Chain | null;
|
|
853
|
-
dataSuffix?: `0x${string}`;
|
|
854
|
-
gas?: bigint;
|
|
855
|
-
gasPrice?: bigint;
|
|
856
|
-
maxFeePerGas?: bigint;
|
|
857
|
-
maxPriorityFeePerGas?: bigint;
|
|
858
|
-
nonce?: number;
|
|
859
|
-
value?: bigint;
|
|
860
|
-
}): Promise<void> {
|
|
861
|
-
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
588
|
+
return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
|
|
862
589
|
},
|
|
863
590
|
/**
|
|
864
591
|
* Simulate transfer
|
|
865
592
|
* Returns gas estimate and result without sending transaction
|
|
866
593
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
867
594
|
*/
|
|
868
|
-
async transfer(
|
|
595
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
869
596
|
accessList?: import('viem').AccessList;
|
|
870
597
|
authorizationList?: import('viem').AuthorizationList;
|
|
871
598
|
chain?: import('viem').Chain | null;
|
|
@@ -877,14 +604,14 @@ export class TETHER_json {
|
|
|
877
604
|
nonce?: number;
|
|
878
605
|
value?: bigint;
|
|
879
606
|
}): Promise<boolean> {
|
|
880
|
-
return contract.simulate.transfer([
|
|
607
|
+
return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
|
|
881
608
|
},
|
|
882
609
|
/**
|
|
883
610
|
* Simulate transferFrom
|
|
884
611
|
* Returns gas estimate and result without sending transaction
|
|
885
612
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
886
613
|
*/
|
|
887
|
-
async transferFrom(
|
|
614
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
888
615
|
accessList?: import('viem').AccessList;
|
|
889
616
|
authorizationList?: import('viem').AuthorizationList;
|
|
890
617
|
chain?: import('viem').Chain | null;
|
|
@@ -896,26 +623,7 @@ export class TETHER_json {
|
|
|
896
623
|
nonce?: number;
|
|
897
624
|
value?: bigint;
|
|
898
625
|
}): Promise<boolean> {
|
|
899
|
-
return contract.simulate.transferFrom([
|
|
900
|
-
},
|
|
901
|
-
/**
|
|
902
|
-
* Simulate transferOwnership
|
|
903
|
-
* Returns gas estimate and result without sending transaction
|
|
904
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
905
|
-
*/
|
|
906
|
-
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
907
|
-
accessList?: import('viem').AccessList;
|
|
908
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
909
|
-
chain?: import('viem').Chain | null;
|
|
910
|
-
dataSuffix?: `0x${string}`;
|
|
911
|
-
gas?: bigint;
|
|
912
|
-
gasPrice?: bigint;
|
|
913
|
-
maxFeePerGas?: bigint;
|
|
914
|
-
maxPriorityFeePerGas?: bigint;
|
|
915
|
-
nonce?: number;
|
|
916
|
-
value?: bigint;
|
|
917
|
-
}): Promise<void> {
|
|
918
|
-
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
626
|
+
return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
|
|
919
627
|
}
|
|
920
628
|
};
|
|
921
629
|
}
|
|
@@ -943,7 +651,7 @@ export class TETHER_json {
|
|
|
943
651
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
944
652
|
return this.publicClient.watchContractEvent({
|
|
945
653
|
address: this.contractAddress,
|
|
946
|
-
abi:
|
|
654
|
+
abi: StandardERC20_jsonAbi,
|
|
947
655
|
eventName: 'Approval',
|
|
948
656
|
args: filter,
|
|
949
657
|
onLogs: (logs: any[]) => {
|
|
@@ -953,25 +661,6 @@ export class TETHER_json {
|
|
|
953
661
|
},
|
|
954
662
|
}) as () => void;
|
|
955
663
|
},
|
|
956
|
-
/**
|
|
957
|
-
* Watch OwnershipTransferred events
|
|
958
|
-
* @param callback Function to call when event is emitted
|
|
959
|
-
* @param filter Optional filter for indexed parameters
|
|
960
|
-
* @returns Unwatch function to stop listening
|
|
961
|
-
*/
|
|
962
|
-
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
|
|
963
|
-
return this.publicClient.watchContractEvent({
|
|
964
|
-
address: this.contractAddress,
|
|
965
|
-
abi: TETHER_jsonAbi,
|
|
966
|
-
eventName: 'OwnershipTransferred',
|
|
967
|
-
args: filter,
|
|
968
|
-
onLogs: (logs: any[]) => {
|
|
969
|
-
logs.forEach((log: any) => {
|
|
970
|
-
callback(log.args as any);
|
|
971
|
-
});
|
|
972
|
-
},
|
|
973
|
-
}) as () => void;
|
|
974
|
-
},
|
|
975
664
|
/**
|
|
976
665
|
* Watch Transfer events
|
|
977
666
|
* @param callback Function to call when event is emitted
|
|
@@ -981,7 +670,7 @@ export class TETHER_json {
|
|
|
981
670
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
982
671
|
return this.publicClient.watchContractEvent({
|
|
983
672
|
address: this.contractAddress,
|
|
984
|
-
abi:
|
|
673
|
+
abi: StandardERC20_jsonAbi,
|
|
985
674
|
eventName: 'Transfer',
|
|
986
675
|
args: filter,
|
|
987
676
|
onLogs: (logs: any[]) => {
|