@gitmyabi/usdt 1.0.15 → 1.0.16
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/{SimpleUSDT_json.d.ts → UERC20_json.d.ts} +244 -83
- package/contracts/{SimpleUSDT_json.js → UERC20_json.js} +287 -104
- package/contracts/{SimpleUSDT_json.ts → UERC20_json.ts} +323 -110
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
|
@@ -1,102 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UERC20_json = exports.UERC20_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* UERC20_json ABI
|
|
7
7
|
*
|
|
8
8
|
* This ABI is typed using viem's type system for full type safety.
|
|
9
9
|
*/
|
|
10
|
-
exports.
|
|
10
|
+
exports.UERC20_jsonAbi = [
|
|
11
11
|
{
|
|
12
12
|
"inputs": [],
|
|
13
13
|
"stateMutability": "nonpayable",
|
|
14
14
|
"type": "constructor"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"inputs": [
|
|
18
|
-
|
|
19
|
-
"internalType": "address",
|
|
20
|
-
"name": "spender",
|
|
21
|
-
"type": "address"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"internalType": "uint256",
|
|
25
|
-
"name": "allowance",
|
|
26
|
-
"type": "uint256"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"internalType": "uint256",
|
|
30
|
-
"name": "needed",
|
|
31
|
-
"type": "uint256"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"name": "ERC20InsufficientAllowance",
|
|
17
|
+
"inputs": [],
|
|
18
|
+
"name": "AllowanceOverflow",
|
|
35
19
|
"type": "error"
|
|
36
20
|
},
|
|
37
21
|
{
|
|
38
|
-
"inputs": [
|
|
39
|
-
|
|
40
|
-
"internalType": "address",
|
|
41
|
-
"name": "sender",
|
|
42
|
-
"type": "address"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"internalType": "uint256",
|
|
46
|
-
"name": "balance",
|
|
47
|
-
"type": "uint256"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"internalType": "uint256",
|
|
51
|
-
"name": "needed",
|
|
52
|
-
"type": "uint256"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"name": "ERC20InsufficientBalance",
|
|
22
|
+
"inputs": [],
|
|
23
|
+
"name": "AllowanceUnderflow",
|
|
56
24
|
"type": "error"
|
|
57
25
|
},
|
|
58
26
|
{
|
|
59
|
-
"inputs": [
|
|
60
|
-
|
|
61
|
-
"internalType": "address",
|
|
62
|
-
"name": "approver",
|
|
63
|
-
"type": "address"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"name": "ERC20InvalidApprover",
|
|
27
|
+
"inputs": [],
|
|
28
|
+
"name": "InsufficientAllowance",
|
|
67
29
|
"type": "error"
|
|
68
30
|
},
|
|
69
31
|
{
|
|
70
|
-
"inputs": [
|
|
71
|
-
|
|
72
|
-
"internalType": "address",
|
|
73
|
-
"name": "receiver",
|
|
74
|
-
"type": "address"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
"name": "ERC20InvalidReceiver",
|
|
32
|
+
"inputs": [],
|
|
33
|
+
"name": "InsufficientBalance",
|
|
78
34
|
"type": "error"
|
|
79
35
|
},
|
|
80
36
|
{
|
|
81
|
-
"inputs": [
|
|
82
|
-
|
|
83
|
-
"internalType": "address",
|
|
84
|
-
"name": "sender",
|
|
85
|
-
"type": "address"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"name": "ERC20InvalidSender",
|
|
37
|
+
"inputs": [],
|
|
38
|
+
"name": "InvalidPermit",
|
|
89
39
|
"type": "error"
|
|
90
40
|
},
|
|
91
41
|
{
|
|
92
|
-
"inputs": [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
42
|
+
"inputs": [],
|
|
43
|
+
"name": "Permit2AllowanceIsFixedAtInfinity",
|
|
44
|
+
"type": "error"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"inputs": [],
|
|
48
|
+
"name": "PermitExpired",
|
|
49
|
+
"type": "error"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"inputs": [],
|
|
53
|
+
"name": "TotalSupplyOverflow",
|
|
100
54
|
"type": "error"
|
|
101
55
|
},
|
|
102
56
|
{
|
|
@@ -117,7 +71,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
117
71
|
{
|
|
118
72
|
"indexed": false,
|
|
119
73
|
"internalType": "uint256",
|
|
120
|
-
"name": "
|
|
74
|
+
"name": "amount",
|
|
121
75
|
"type": "uint256"
|
|
122
76
|
}
|
|
123
77
|
],
|
|
@@ -142,13 +96,26 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
142
96
|
{
|
|
143
97
|
"indexed": false,
|
|
144
98
|
"internalType": "uint256",
|
|
145
|
-
"name": "
|
|
99
|
+
"name": "amount",
|
|
146
100
|
"type": "uint256"
|
|
147
101
|
}
|
|
148
102
|
],
|
|
149
103
|
"name": "Transfer",
|
|
150
104
|
"type": "event"
|
|
151
105
|
},
|
|
106
|
+
{
|
|
107
|
+
"inputs": [],
|
|
108
|
+
"name": "DOMAIN_SEPARATOR",
|
|
109
|
+
"outputs": [
|
|
110
|
+
{
|
|
111
|
+
"internalType": "bytes32",
|
|
112
|
+
"name": "result",
|
|
113
|
+
"type": "bytes32"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"stateMutability": "view",
|
|
117
|
+
"type": "function"
|
|
118
|
+
},
|
|
152
119
|
{
|
|
153
120
|
"inputs": [
|
|
154
121
|
{
|
|
@@ -166,7 +133,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
166
133
|
"outputs": [
|
|
167
134
|
{
|
|
168
135
|
"internalType": "uint256",
|
|
169
|
-
"name": "",
|
|
136
|
+
"name": "result",
|
|
170
137
|
"type": "uint256"
|
|
171
138
|
}
|
|
172
139
|
],
|
|
@@ -182,7 +149,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
182
149
|
},
|
|
183
150
|
{
|
|
184
151
|
"internalType": "uint256",
|
|
185
|
-
"name": "
|
|
152
|
+
"name": "amount",
|
|
186
153
|
"type": "uint256"
|
|
187
154
|
}
|
|
188
155
|
],
|
|
@@ -201,7 +168,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
201
168
|
"inputs": [
|
|
202
169
|
{
|
|
203
170
|
"internalType": "address",
|
|
204
|
-
"name": "
|
|
171
|
+
"name": "owner",
|
|
205
172
|
"type": "address"
|
|
206
173
|
}
|
|
207
174
|
],
|
|
@@ -209,13 +176,26 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
209
176
|
"outputs": [
|
|
210
177
|
{
|
|
211
178
|
"internalType": "uint256",
|
|
212
|
-
"name": "",
|
|
179
|
+
"name": "result",
|
|
213
180
|
"type": "uint256"
|
|
214
181
|
}
|
|
215
182
|
],
|
|
216
183
|
"stateMutability": "view",
|
|
217
184
|
"type": "function"
|
|
218
185
|
},
|
|
186
|
+
{
|
|
187
|
+
"inputs": [],
|
|
188
|
+
"name": "creator",
|
|
189
|
+
"outputs": [
|
|
190
|
+
{
|
|
191
|
+
"internalType": "address",
|
|
192
|
+
"name": "",
|
|
193
|
+
"type": "address"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
"stateMutability": "view",
|
|
197
|
+
"type": "function"
|
|
198
|
+
},
|
|
219
199
|
{
|
|
220
200
|
"inputs": [],
|
|
221
201
|
"name": "decimals",
|
|
@@ -226,7 +206,48 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
226
206
|
"type": "uint8"
|
|
227
207
|
}
|
|
228
208
|
],
|
|
229
|
-
"stateMutability": "
|
|
209
|
+
"stateMutability": "view",
|
|
210
|
+
"type": "function"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"inputs": [],
|
|
214
|
+
"name": "graffiti",
|
|
215
|
+
"outputs": [
|
|
216
|
+
{
|
|
217
|
+
"internalType": "bytes32",
|
|
218
|
+
"name": "",
|
|
219
|
+
"type": "bytes32"
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"stateMutability": "view",
|
|
223
|
+
"type": "function"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"inputs": [],
|
|
227
|
+
"name": "metadata",
|
|
228
|
+
"outputs": [
|
|
229
|
+
{
|
|
230
|
+
"internalType": "string",
|
|
231
|
+
"name": "description",
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"internalType": "string",
|
|
236
|
+
"name": "website",
|
|
237
|
+
"type": "string"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"internalType": "string",
|
|
241
|
+
"name": "image",
|
|
242
|
+
"type": "string"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"internalType": "bytes",
|
|
246
|
+
"name": "extraData",
|
|
247
|
+
"type": "bytes"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"stateMutability": "view",
|
|
230
251
|
"type": "function"
|
|
231
252
|
},
|
|
232
253
|
{
|
|
@@ -242,6 +263,87 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
242
263
|
"stateMutability": "view",
|
|
243
264
|
"type": "function"
|
|
244
265
|
},
|
|
266
|
+
{
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"internalType": "address",
|
|
270
|
+
"name": "owner",
|
|
271
|
+
"type": "address"
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"name": "nonces",
|
|
275
|
+
"outputs": [
|
|
276
|
+
{
|
|
277
|
+
"internalType": "uint256",
|
|
278
|
+
"name": "result",
|
|
279
|
+
"type": "uint256"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"stateMutability": "view",
|
|
283
|
+
"type": "function"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"inputs": [
|
|
287
|
+
{
|
|
288
|
+
"internalType": "address",
|
|
289
|
+
"name": "owner",
|
|
290
|
+
"type": "address"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"internalType": "address",
|
|
294
|
+
"name": "spender",
|
|
295
|
+
"type": "address"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"internalType": "uint256",
|
|
299
|
+
"name": "value",
|
|
300
|
+
"type": "uint256"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"internalType": "uint256",
|
|
304
|
+
"name": "deadline",
|
|
305
|
+
"type": "uint256"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"internalType": "uint8",
|
|
309
|
+
"name": "v",
|
|
310
|
+
"type": "uint8"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"internalType": "bytes32",
|
|
314
|
+
"name": "r",
|
|
315
|
+
"type": "bytes32"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"internalType": "bytes32",
|
|
319
|
+
"name": "s",
|
|
320
|
+
"type": "bytes32"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"name": "permit",
|
|
324
|
+
"outputs": [],
|
|
325
|
+
"stateMutability": "nonpayable",
|
|
326
|
+
"type": "function"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"inputs": [
|
|
330
|
+
{
|
|
331
|
+
"internalType": "bytes4",
|
|
332
|
+
"name": "_interfaceId",
|
|
333
|
+
"type": "bytes4"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"name": "supportsInterface",
|
|
337
|
+
"outputs": [
|
|
338
|
+
{
|
|
339
|
+
"internalType": "bool",
|
|
340
|
+
"name": "",
|
|
341
|
+
"type": "bool"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"stateMutability": "view",
|
|
345
|
+
"type": "function"
|
|
346
|
+
},
|
|
245
347
|
{
|
|
246
348
|
"inputs": [],
|
|
247
349
|
"name": "symbol",
|
|
@@ -255,13 +357,26 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
255
357
|
"stateMutability": "view",
|
|
256
358
|
"type": "function"
|
|
257
359
|
},
|
|
360
|
+
{
|
|
361
|
+
"inputs": [],
|
|
362
|
+
"name": "tokenURI",
|
|
363
|
+
"outputs": [
|
|
364
|
+
{
|
|
365
|
+
"internalType": "string",
|
|
366
|
+
"name": "",
|
|
367
|
+
"type": "string"
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
"stateMutability": "view",
|
|
371
|
+
"type": "function"
|
|
372
|
+
},
|
|
258
373
|
{
|
|
259
374
|
"inputs": [],
|
|
260
375
|
"name": "totalSupply",
|
|
261
376
|
"outputs": [
|
|
262
377
|
{
|
|
263
378
|
"internalType": "uint256",
|
|
264
|
-
"name": "",
|
|
379
|
+
"name": "result",
|
|
265
380
|
"type": "uint256"
|
|
266
381
|
}
|
|
267
382
|
],
|
|
@@ -277,7 +392,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
277
392
|
},
|
|
278
393
|
{
|
|
279
394
|
"internalType": "uint256",
|
|
280
|
-
"name": "
|
|
395
|
+
"name": "amount",
|
|
281
396
|
"type": "uint256"
|
|
282
397
|
}
|
|
283
398
|
],
|
|
@@ -306,7 +421,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
306
421
|
},
|
|
307
422
|
{
|
|
308
423
|
"internalType": "uint256",
|
|
309
|
-
"name": "
|
|
424
|
+
"name": "amount",
|
|
310
425
|
"type": "uint256"
|
|
311
426
|
}
|
|
312
427
|
],
|
|
@@ -323,7 +438,7 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
323
438
|
}
|
|
324
439
|
];
|
|
325
440
|
/**
|
|
326
|
-
*
|
|
441
|
+
* UERC20_json Contract Class
|
|
327
442
|
*
|
|
328
443
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
329
444
|
*
|
|
@@ -331,12 +446,12 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
331
446
|
* ```typescript
|
|
332
447
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
333
448
|
* import { mainnet } from 'viem/chains';
|
|
334
|
-
* import {
|
|
449
|
+
* import { UERC20_json } from 'UERC20_json';
|
|
335
450
|
*
|
|
336
451
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
337
452
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
338
453
|
*
|
|
339
|
-
* const contract = new
|
|
454
|
+
* const contract = new UERC20_json('0x...', { publicClient, walletClient });
|
|
340
455
|
*
|
|
341
456
|
* // Read functions
|
|
342
457
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -354,13 +469,13 @@ exports.SimpleUSDT_jsonAbi = [
|
|
|
354
469
|
* });
|
|
355
470
|
* ```
|
|
356
471
|
*/
|
|
357
|
-
class
|
|
472
|
+
class UERC20_json {
|
|
358
473
|
constructor(address, clients) {
|
|
359
474
|
this.contractAddress = address;
|
|
360
475
|
this.publicClient = clients.publicClient;
|
|
361
476
|
this.contract = (0, viem_1.getContract)({
|
|
362
477
|
address,
|
|
363
|
-
abi: exports.
|
|
478
|
+
abi: exports.UERC20_jsonAbi,
|
|
364
479
|
client: {
|
|
365
480
|
public: clients.publicClient,
|
|
366
481
|
wallet: clients.walletClient,
|
|
@@ -379,6 +494,13 @@ class SimpleUSDT_json {
|
|
|
379
494
|
getContract() {
|
|
380
495
|
return this.contract;
|
|
381
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* DOMAIN_SEPARATOR
|
|
499
|
+
* view
|
|
500
|
+
*/
|
|
501
|
+
async DOMAIN_SEPARATOR() {
|
|
502
|
+
return this.contract.read.DOMAIN_SEPARATOR();
|
|
503
|
+
}
|
|
382
504
|
/**
|
|
383
505
|
* allowance
|
|
384
506
|
* view
|
|
@@ -390,16 +512,37 @@ class SimpleUSDT_json {
|
|
|
390
512
|
* balanceOf
|
|
391
513
|
* view
|
|
392
514
|
*/
|
|
393
|
-
async balanceOf(
|
|
394
|
-
return this.contract.read.balanceOf([
|
|
515
|
+
async balanceOf(owner) {
|
|
516
|
+
return this.contract.read.balanceOf([owner]);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* creator
|
|
520
|
+
* view
|
|
521
|
+
*/
|
|
522
|
+
async creator() {
|
|
523
|
+
return this.contract.read.creator();
|
|
395
524
|
}
|
|
396
525
|
/**
|
|
397
526
|
* decimals
|
|
398
|
-
*
|
|
527
|
+
* view
|
|
399
528
|
*/
|
|
400
529
|
async decimals() {
|
|
401
530
|
return this.contract.read.decimals();
|
|
402
531
|
}
|
|
532
|
+
/**
|
|
533
|
+
* graffiti
|
|
534
|
+
* view
|
|
535
|
+
*/
|
|
536
|
+
async graffiti() {
|
|
537
|
+
return this.contract.read.graffiti();
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* metadata
|
|
541
|
+
* view
|
|
542
|
+
*/
|
|
543
|
+
async metadata() {
|
|
544
|
+
return this.contract.read.metadata();
|
|
545
|
+
}
|
|
403
546
|
/**
|
|
404
547
|
* name
|
|
405
548
|
* view
|
|
@@ -407,6 +550,20 @@ class SimpleUSDT_json {
|
|
|
407
550
|
async name() {
|
|
408
551
|
return this.contract.read.name();
|
|
409
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* nonces
|
|
555
|
+
* view
|
|
556
|
+
*/
|
|
557
|
+
async nonces(owner) {
|
|
558
|
+
return this.contract.read.nonces([owner]);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* supportsInterface
|
|
562
|
+
* view
|
|
563
|
+
*/
|
|
564
|
+
async supportsInterface(_interfaceId) {
|
|
565
|
+
return this.contract.read.supportsInterface([_interfaceId]);
|
|
566
|
+
}
|
|
410
567
|
/**
|
|
411
568
|
* symbol
|
|
412
569
|
* view
|
|
@@ -414,6 +571,13 @@ class SimpleUSDT_json {
|
|
|
414
571
|
async symbol() {
|
|
415
572
|
return this.contract.read.symbol();
|
|
416
573
|
}
|
|
574
|
+
/**
|
|
575
|
+
* tokenURI
|
|
576
|
+
* view
|
|
577
|
+
*/
|
|
578
|
+
async tokenURI() {
|
|
579
|
+
return this.contract.read.tokenURI();
|
|
580
|
+
}
|
|
417
581
|
/**
|
|
418
582
|
* totalSupply
|
|
419
583
|
* view
|
|
@@ -426,33 +590,44 @@ class SimpleUSDT_json {
|
|
|
426
590
|
* nonpayable
|
|
427
591
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
428
592
|
*/
|
|
429
|
-
async approve(spender,
|
|
593
|
+
async approve(spender, amount, options) {
|
|
430
594
|
if (!this.contract.write) {
|
|
431
595
|
throw new Error('Wallet client is required for write operations');
|
|
432
596
|
}
|
|
433
|
-
return this.contract.write.approve([spender,
|
|
597
|
+
return this.contract.write.approve([spender, amount], options);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* permit
|
|
601
|
+
* nonpayable
|
|
602
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
603
|
+
*/
|
|
604
|
+
async permit(owner, spender, value, deadline, v, r, s, options) {
|
|
605
|
+
if (!this.contract.write) {
|
|
606
|
+
throw new Error('Wallet client is required for write operations');
|
|
607
|
+
}
|
|
608
|
+
return this.contract.write.permit([owner, spender, value, deadline, v, r, s], options);
|
|
434
609
|
}
|
|
435
610
|
/**
|
|
436
611
|
* transfer
|
|
437
612
|
* nonpayable
|
|
438
613
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
439
614
|
*/
|
|
440
|
-
async transfer(to,
|
|
615
|
+
async transfer(to, amount, options) {
|
|
441
616
|
if (!this.contract.write) {
|
|
442
617
|
throw new Error('Wallet client is required for write operations');
|
|
443
618
|
}
|
|
444
|
-
return this.contract.write.transfer([to,
|
|
619
|
+
return this.contract.write.transfer([to, amount], options);
|
|
445
620
|
}
|
|
446
621
|
/**
|
|
447
622
|
* transferFrom
|
|
448
623
|
* nonpayable
|
|
449
624
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
450
625
|
*/
|
|
451
|
-
async transferFrom(from, to,
|
|
626
|
+
async transferFrom(from, to, amount, options) {
|
|
452
627
|
if (!this.contract.write) {
|
|
453
628
|
throw new Error('Wallet client is required for write operations');
|
|
454
629
|
}
|
|
455
|
-
return this.contract.write.transferFrom([from, to,
|
|
630
|
+
return this.contract.write.transferFrom([from, to, amount], options);
|
|
456
631
|
}
|
|
457
632
|
/**
|
|
458
633
|
* Simulate contract write operations (dry-run without sending transaction)
|
|
@@ -473,24 +648,32 @@ class SimpleUSDT_json {
|
|
|
473
648
|
* Returns gas estimate and result without sending transaction
|
|
474
649
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
475
650
|
*/
|
|
476
|
-
async approve(spender,
|
|
477
|
-
return contract.simulate.approve([spender,
|
|
651
|
+
async approve(spender, amount, options) {
|
|
652
|
+
return contract.simulate.approve([spender, amount], options);
|
|
653
|
+
},
|
|
654
|
+
/**
|
|
655
|
+
* Simulate permit
|
|
656
|
+
* Returns gas estimate and result without sending transaction
|
|
657
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
658
|
+
*/
|
|
659
|
+
async permit(owner, spender, value, deadline, v, r, s, options) {
|
|
660
|
+
return contract.simulate.permit([owner, spender, value, deadline, v, r, s], options);
|
|
478
661
|
},
|
|
479
662
|
/**
|
|
480
663
|
* Simulate transfer
|
|
481
664
|
* Returns gas estimate and result without sending transaction
|
|
482
665
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
483
666
|
*/
|
|
484
|
-
async transfer(to,
|
|
485
|
-
return contract.simulate.transfer([to,
|
|
667
|
+
async transfer(to, amount, options) {
|
|
668
|
+
return contract.simulate.transfer([to, amount], options);
|
|
486
669
|
},
|
|
487
670
|
/**
|
|
488
671
|
* Simulate transferFrom
|
|
489
672
|
* Returns gas estimate and result without sending transaction
|
|
490
673
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
491
674
|
*/
|
|
492
|
-
async transferFrom(from, to,
|
|
493
|
-
return contract.simulate.transferFrom([from, to,
|
|
675
|
+
async transferFrom(from, to, amount, options) {
|
|
676
|
+
return contract.simulate.transferFrom([from, to, amount], options);
|
|
494
677
|
}
|
|
495
678
|
};
|
|
496
679
|
}
|
|
@@ -517,7 +700,7 @@ class SimpleUSDT_json {
|
|
|
517
700
|
Approval: (callback, filter) => {
|
|
518
701
|
return this.publicClient.watchContractEvent({
|
|
519
702
|
address: this.contractAddress,
|
|
520
|
-
abi: exports.
|
|
703
|
+
abi: exports.UERC20_jsonAbi,
|
|
521
704
|
eventName: 'Approval',
|
|
522
705
|
args: filter,
|
|
523
706
|
onLogs: (logs) => {
|
|
@@ -536,7 +719,7 @@ class SimpleUSDT_json {
|
|
|
536
719
|
Transfer: (callback, filter) => {
|
|
537
720
|
return this.publicClient.watchContractEvent({
|
|
538
721
|
address: this.contractAddress,
|
|
539
|
-
abi: exports.
|
|
722
|
+
abi: exports.UERC20_jsonAbi,
|
|
540
723
|
eventName: 'Transfer',
|
|
541
724
|
args: filter,
|
|
542
725
|
onLogs: (logs) => {
|
|
@@ -549,4 +732,4 @@ class SimpleUSDT_json {
|
|
|
549
732
|
};
|
|
550
733
|
}
|
|
551
734
|
}
|
|
552
|
-
exports.
|
|
735
|
+
exports.UERC20_json = UERC20_json;
|