@gitmyabi/usdt 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/contracts/{USDToken_json.d.ts → TetherUSDT_json.d.ts} +84 -371
- package/contracts/{USDToken_json.js → TetherUSDT_json.js} +105 -369
- package/contracts/TetherUSDT_json.ts +654 -0
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
- package/contracts/USDToken_json.ts +0 -1039
|
@@ -1,81 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TetherUSDT_json = exports.TetherUSDT_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* TetherUSDT_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.TetherUSDT_jsonAbi = [
|
|
11
11
|
{
|
|
12
12
|
"inputs": [],
|
|
13
13
|
"stateMutability": "nonpayable",
|
|
14
14
|
"type": "constructor"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"anonymous": false,
|
|
18
17
|
"inputs": [
|
|
19
18
|
{
|
|
20
|
-
"indexed": true,
|
|
21
19
|
"internalType": "address",
|
|
22
|
-
"name": "
|
|
20
|
+
"name": "spender",
|
|
23
21
|
"type": "address"
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
|
-
"
|
|
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",
|
|
35
|
+
"type": "error"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"inputs": [
|
|
39
|
+
{
|
|
27
40
|
"internalType": "address",
|
|
28
|
-
"name": "
|
|
41
|
+
"name": "sender",
|
|
29
42
|
"type": "address"
|
|
30
43
|
},
|
|
31
44
|
{
|
|
32
|
-
"indexed": false,
|
|
33
45
|
"internalType": "uint256",
|
|
34
|
-
"name": "
|
|
46
|
+
"name": "balance",
|
|
47
|
+
"type": "uint256"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"internalType": "uint256",
|
|
51
|
+
"name": "needed",
|
|
35
52
|
"type": "uint256"
|
|
36
53
|
}
|
|
37
54
|
],
|
|
38
|
-
"name": "
|
|
39
|
-
"type": "
|
|
55
|
+
"name": "ERC20InsufficientBalance",
|
|
56
|
+
"type": "error"
|
|
40
57
|
},
|
|
41
58
|
{
|
|
42
|
-
"anonymous": false,
|
|
43
59
|
"inputs": [
|
|
44
60
|
{
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"type": "string"
|
|
61
|
+
"internalType": "address",
|
|
62
|
+
"name": "approver",
|
|
63
|
+
"type": "address"
|
|
49
64
|
}
|
|
50
65
|
],
|
|
51
|
-
"name": "
|
|
52
|
-
"type": "
|
|
66
|
+
"name": "ERC20InvalidApprover",
|
|
67
|
+
"type": "error"
|
|
53
68
|
},
|
|
54
69
|
{
|
|
55
|
-
"anonymous": false,
|
|
56
70
|
"inputs": [
|
|
57
71
|
{
|
|
58
|
-
"indexed": true,
|
|
59
72
|
"internalType": "address",
|
|
60
|
-
"name": "
|
|
73
|
+
"name": "receiver",
|
|
61
74
|
"type": "address"
|
|
62
75
|
}
|
|
63
76
|
],
|
|
64
|
-
"name": "
|
|
65
|
-
"type": "
|
|
77
|
+
"name": "ERC20InvalidReceiver",
|
|
78
|
+
"type": "error"
|
|
66
79
|
},
|
|
67
80
|
{
|
|
68
|
-
"anonymous": false,
|
|
69
81
|
"inputs": [
|
|
70
82
|
{
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"type": "string"
|
|
83
|
+
"internalType": "address",
|
|
84
|
+
"name": "sender",
|
|
85
|
+
"type": "address"
|
|
75
86
|
}
|
|
76
87
|
],
|
|
77
|
-
"name": "
|
|
78
|
-
"type": "
|
|
88
|
+
"name": "ERC20InvalidSender",
|
|
89
|
+
"type": "error"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"inputs": [
|
|
93
|
+
{
|
|
94
|
+
"internalType": "address",
|
|
95
|
+
"name": "spender",
|
|
96
|
+
"type": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"name": "ERC20InvalidSpender",
|
|
100
|
+
"type": "error"
|
|
79
101
|
},
|
|
80
102
|
{
|
|
81
103
|
"anonymous": false,
|
|
@@ -83,13 +105,13 @@ exports.USDToken_jsonAbi = [
|
|
|
83
105
|
{
|
|
84
106
|
"indexed": true,
|
|
85
107
|
"internalType": "address",
|
|
86
|
-
"name": "
|
|
108
|
+
"name": "owner",
|
|
87
109
|
"type": "address"
|
|
88
110
|
},
|
|
89
111
|
{
|
|
90
112
|
"indexed": true,
|
|
91
113
|
"internalType": "address",
|
|
92
|
-
"name": "
|
|
114
|
+
"name": "spender",
|
|
93
115
|
"type": "address"
|
|
94
116
|
},
|
|
95
117
|
{
|
|
@@ -99,66 +121,48 @@ exports.USDToken_jsonAbi = [
|
|
|
99
121
|
"type": "uint256"
|
|
100
122
|
}
|
|
101
123
|
],
|
|
102
|
-
"name": "
|
|
124
|
+
"name": "Approval",
|
|
103
125
|
"type": "event"
|
|
104
126
|
},
|
|
105
127
|
{
|
|
128
|
+
"anonymous": false,
|
|
106
129
|
"inputs": [
|
|
107
130
|
{
|
|
131
|
+
"indexed": true,
|
|
108
132
|
"internalType": "address",
|
|
109
|
-
"name": "",
|
|
133
|
+
"name": "from",
|
|
110
134
|
"type": "address"
|
|
111
135
|
},
|
|
112
136
|
{
|
|
137
|
+
"indexed": true,
|
|
113
138
|
"internalType": "address",
|
|
114
|
-
"name": "",
|
|
139
|
+
"name": "to",
|
|
115
140
|
"type": "address"
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
"name": "allowance",
|
|
119
|
-
"outputs": [
|
|
141
|
+
},
|
|
120
142
|
{
|
|
143
|
+
"indexed": false,
|
|
121
144
|
"internalType": "uint256",
|
|
122
|
-
"name": "",
|
|
145
|
+
"name": "value",
|
|
123
146
|
"type": "uint256"
|
|
124
147
|
}
|
|
125
148
|
],
|
|
126
|
-
"
|
|
127
|
-
"type": "
|
|
149
|
+
"name": "Transfer",
|
|
150
|
+
"type": "event"
|
|
128
151
|
},
|
|
129
152
|
{
|
|
130
153
|
"inputs": [
|
|
131
154
|
{
|
|
132
155
|
"internalType": "address",
|
|
133
|
-
"name": "
|
|
156
|
+
"name": "owner",
|
|
134
157
|
"type": "address"
|
|
135
158
|
},
|
|
136
|
-
{
|
|
137
|
-
"internalType": "uint256",
|
|
138
|
-
"name": "amount",
|
|
139
|
-
"type": "uint256"
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"name": "approve",
|
|
143
|
-
"outputs": [
|
|
144
|
-
{
|
|
145
|
-
"internalType": "bool",
|
|
146
|
-
"name": "",
|
|
147
|
-
"type": "bool"
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
"stateMutability": "nonpayable",
|
|
151
|
-
"type": "function"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"inputs": [
|
|
155
159
|
{
|
|
156
160
|
"internalType": "address",
|
|
157
|
-
"name": "",
|
|
161
|
+
"name": "spender",
|
|
158
162
|
"type": "address"
|
|
159
163
|
}
|
|
160
164
|
],
|
|
161
|
-
"name": "
|
|
165
|
+
"name": "allowance",
|
|
162
166
|
"outputs": [
|
|
163
167
|
{
|
|
164
168
|
"internalType": "uint256",
|
|
@@ -169,19 +173,6 @@ exports.USDToken_jsonAbi = [
|
|
|
169
173
|
"stateMutability": "view",
|
|
170
174
|
"type": "function"
|
|
171
175
|
},
|
|
172
|
-
{
|
|
173
|
-
"inputs": [],
|
|
174
|
-
"name": "decimals",
|
|
175
|
-
"outputs": [
|
|
176
|
-
{
|
|
177
|
-
"internalType": "uint8",
|
|
178
|
-
"name": "",
|
|
179
|
-
"type": "uint8"
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
"stateMutability": "view",
|
|
183
|
-
"type": "function"
|
|
184
|
-
},
|
|
185
176
|
{
|
|
186
177
|
"inputs": [
|
|
187
178
|
{
|
|
@@ -191,11 +182,11 @@ exports.USDToken_jsonAbi = [
|
|
|
191
182
|
},
|
|
192
183
|
{
|
|
193
184
|
"internalType": "uint256",
|
|
194
|
-
"name": "
|
|
185
|
+
"name": "value",
|
|
195
186
|
"type": "uint256"
|
|
196
187
|
}
|
|
197
188
|
],
|
|
198
|
-
"name": "
|
|
189
|
+
"name": "approve",
|
|
199
190
|
"outputs": [
|
|
200
191
|
{
|
|
201
192
|
"internalType": "bool",
|
|
@@ -210,34 +201,29 @@ exports.USDToken_jsonAbi = [
|
|
|
210
201
|
"inputs": [
|
|
211
202
|
{
|
|
212
203
|
"internalType": "address",
|
|
213
|
-
"name": "
|
|
204
|
+
"name": "account",
|
|
214
205
|
"type": "address"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"internalType": "uint256",
|
|
218
|
-
"name": "addedValue",
|
|
219
|
-
"type": "uint256"
|
|
220
206
|
}
|
|
221
207
|
],
|
|
222
|
-
"name": "
|
|
208
|
+
"name": "balanceOf",
|
|
223
209
|
"outputs": [
|
|
224
210
|
{
|
|
225
|
-
"internalType": "
|
|
211
|
+
"internalType": "uint256",
|
|
226
212
|
"name": "",
|
|
227
|
-
"type": "
|
|
213
|
+
"type": "uint256"
|
|
228
214
|
}
|
|
229
215
|
],
|
|
230
|
-
"stateMutability": "
|
|
216
|
+
"stateMutability": "view",
|
|
231
217
|
"type": "function"
|
|
232
218
|
},
|
|
233
219
|
{
|
|
234
220
|
"inputs": [],
|
|
235
|
-
"name": "
|
|
221
|
+
"name": "decimals",
|
|
236
222
|
"outputs": [
|
|
237
223
|
{
|
|
238
|
-
"internalType": "
|
|
224
|
+
"internalType": "uint8",
|
|
239
225
|
"name": "",
|
|
240
|
-
"type": "
|
|
226
|
+
"type": "uint8"
|
|
241
227
|
}
|
|
242
228
|
],
|
|
243
229
|
"stateMutability": "view",
|
|
@@ -256,65 +242,6 @@ exports.USDToken_jsonAbi = [
|
|
|
256
242
|
"stateMutability": "view",
|
|
257
243
|
"type": "function"
|
|
258
244
|
},
|
|
259
|
-
{
|
|
260
|
-
"inputs": [],
|
|
261
|
-
"name": "owner",
|
|
262
|
-
"outputs": [
|
|
263
|
-
{
|
|
264
|
-
"internalType": "address",
|
|
265
|
-
"name": "",
|
|
266
|
-
"type": "address"
|
|
267
|
-
}
|
|
268
|
-
],
|
|
269
|
-
"stateMutability": "view",
|
|
270
|
-
"type": "function"
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"inputs": [],
|
|
274
|
-
"name": "renounceOwnership",
|
|
275
|
-
"outputs": [],
|
|
276
|
-
"stateMutability": "nonpayable",
|
|
277
|
-
"type": "function"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"inputs": [],
|
|
281
|
-
"name": "renounced",
|
|
282
|
-
"outputs": [
|
|
283
|
-
{
|
|
284
|
-
"internalType": "bool",
|
|
285
|
-
"name": "",
|
|
286
|
-
"type": "bool"
|
|
287
|
-
}
|
|
288
|
-
],
|
|
289
|
-
"stateMutability": "view",
|
|
290
|
-
"type": "function"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"inputs": [
|
|
294
|
-
{
|
|
295
|
-
"internalType": "string",
|
|
296
|
-
"name": "newName",
|
|
297
|
-
"type": "string"
|
|
298
|
-
}
|
|
299
|
-
],
|
|
300
|
-
"name": "setName",
|
|
301
|
-
"outputs": [],
|
|
302
|
-
"stateMutability": "nonpayable",
|
|
303
|
-
"type": "function"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"inputs": [
|
|
307
|
-
{
|
|
308
|
-
"internalType": "string",
|
|
309
|
-
"name": "newSymbol",
|
|
310
|
-
"type": "string"
|
|
311
|
-
}
|
|
312
|
-
],
|
|
313
|
-
"name": "setSymbol",
|
|
314
|
-
"outputs": [],
|
|
315
|
-
"stateMutability": "nonpayable",
|
|
316
|
-
"type": "function"
|
|
317
|
-
},
|
|
318
245
|
{
|
|
319
246
|
"inputs": [],
|
|
320
247
|
"name": "symbol",
|
|
@@ -328,19 +255,6 @@ exports.USDToken_jsonAbi = [
|
|
|
328
255
|
"stateMutability": "view",
|
|
329
256
|
"type": "function"
|
|
330
257
|
},
|
|
331
|
-
{
|
|
332
|
-
"inputs": [],
|
|
333
|
-
"name": "tokenImage",
|
|
334
|
-
"outputs": [
|
|
335
|
-
{
|
|
336
|
-
"internalType": "string",
|
|
337
|
-
"name": "",
|
|
338
|
-
"type": "string"
|
|
339
|
-
}
|
|
340
|
-
],
|
|
341
|
-
"stateMutability": "pure",
|
|
342
|
-
"type": "function"
|
|
343
|
-
},
|
|
344
258
|
{
|
|
345
259
|
"inputs": [],
|
|
346
260
|
"name": "totalSupply",
|
|
@@ -363,7 +277,7 @@ exports.USDToken_jsonAbi = [
|
|
|
363
277
|
},
|
|
364
278
|
{
|
|
365
279
|
"internalType": "uint256",
|
|
366
|
-
"name": "
|
|
280
|
+
"name": "value",
|
|
367
281
|
"type": "uint256"
|
|
368
282
|
}
|
|
369
283
|
],
|
|
@@ -392,7 +306,7 @@ exports.USDToken_jsonAbi = [
|
|
|
392
306
|
},
|
|
393
307
|
{
|
|
394
308
|
"internalType": "uint256",
|
|
395
|
-
"name": "
|
|
309
|
+
"name": "value",
|
|
396
310
|
"type": "uint256"
|
|
397
311
|
}
|
|
398
312
|
],
|
|
@@ -409,7 +323,7 @@ exports.USDToken_jsonAbi = [
|
|
|
409
323
|
}
|
|
410
324
|
];
|
|
411
325
|
/**
|
|
412
|
-
*
|
|
326
|
+
* TetherUSDT_json Contract Class
|
|
413
327
|
*
|
|
414
328
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
415
329
|
*
|
|
@@ -417,12 +331,12 @@ exports.USDToken_jsonAbi = [
|
|
|
417
331
|
* ```typescript
|
|
418
332
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
419
333
|
* import { mainnet } from 'viem/chains';
|
|
420
|
-
* import {
|
|
334
|
+
* import { TetherUSDT_json } from 'TetherUSDT_json';
|
|
421
335
|
*
|
|
422
336
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
423
337
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
424
338
|
*
|
|
425
|
-
* const contract = new
|
|
339
|
+
* const contract = new TetherUSDT_json('0x...', { publicClient, walletClient });
|
|
426
340
|
*
|
|
427
341
|
* // Read functions
|
|
428
342
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -440,13 +354,13 @@ exports.USDToken_jsonAbi = [
|
|
|
440
354
|
* });
|
|
441
355
|
* ```
|
|
442
356
|
*/
|
|
443
|
-
class
|
|
357
|
+
class TetherUSDT_json {
|
|
444
358
|
constructor(address, clients) {
|
|
445
359
|
this.contractAddress = address;
|
|
446
360
|
this.publicClient = clients.publicClient;
|
|
447
361
|
this.contract = (0, viem_1.getContract)({
|
|
448
362
|
address,
|
|
449
|
-
abi: exports.
|
|
363
|
+
abi: exports.TetherUSDT_jsonAbi,
|
|
450
364
|
client: {
|
|
451
365
|
public: clients.publicClient,
|
|
452
366
|
wallet: clients.walletClient,
|
|
@@ -469,15 +383,15 @@ class USDToken_json {
|
|
|
469
383
|
* allowance
|
|
470
384
|
* view
|
|
471
385
|
*/
|
|
472
|
-
async allowance(
|
|
473
|
-
return this.contract.read.allowance([
|
|
386
|
+
async allowance(owner, spender) {
|
|
387
|
+
return this.contract.read.allowance([owner, spender]);
|
|
474
388
|
}
|
|
475
389
|
/**
|
|
476
390
|
* balanceOf
|
|
477
391
|
* view
|
|
478
392
|
*/
|
|
479
|
-
async balanceOf(
|
|
480
|
-
return this.contract.read.balanceOf([
|
|
393
|
+
async balanceOf(account) {
|
|
394
|
+
return this.contract.read.balanceOf([account]);
|
|
481
395
|
}
|
|
482
396
|
/**
|
|
483
397
|
* decimals
|
|
@@ -486,13 +400,6 @@ class USDToken_json {
|
|
|
486
400
|
async decimals() {
|
|
487
401
|
return this.contract.read.decimals();
|
|
488
402
|
}
|
|
489
|
-
/**
|
|
490
|
-
* isRenounced
|
|
491
|
-
* view
|
|
492
|
-
*/
|
|
493
|
-
async isRenounced() {
|
|
494
|
-
return this.contract.read.isRenounced();
|
|
495
|
-
}
|
|
496
403
|
/**
|
|
497
404
|
* name
|
|
498
405
|
* view
|
|
@@ -500,20 +407,6 @@ class USDToken_json {
|
|
|
500
407
|
async name() {
|
|
501
408
|
return this.contract.read.name();
|
|
502
409
|
}
|
|
503
|
-
/**
|
|
504
|
-
* owner
|
|
505
|
-
* view
|
|
506
|
-
*/
|
|
507
|
-
async owner() {
|
|
508
|
-
return this.contract.read.owner();
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* renounced
|
|
512
|
-
* view
|
|
513
|
-
*/
|
|
514
|
-
async renounced() {
|
|
515
|
-
return this.contract.read.renounced();
|
|
516
|
-
}
|
|
517
410
|
/**
|
|
518
411
|
* symbol
|
|
519
412
|
* view
|
|
@@ -521,13 +414,6 @@ class USDToken_json {
|
|
|
521
414
|
async symbol() {
|
|
522
415
|
return this.contract.read.symbol();
|
|
523
416
|
}
|
|
524
|
-
/**
|
|
525
|
-
* tokenImage
|
|
526
|
-
* pure
|
|
527
|
-
*/
|
|
528
|
-
async tokenImage() {
|
|
529
|
-
return this.contract.read.tokenImage();
|
|
530
|
-
}
|
|
531
417
|
/**
|
|
532
418
|
* totalSupply
|
|
533
419
|
* view
|
|
@@ -540,88 +426,33 @@ class USDToken_json {
|
|
|
540
426
|
* nonpayable
|
|
541
427
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
542
428
|
*/
|
|
543
|
-
async approve(spender,
|
|
544
|
-
if (!this.contract.write) {
|
|
545
|
-
throw new Error('Wallet client is required for write operations');
|
|
546
|
-
}
|
|
547
|
-
return this.contract.write.approve([spender, amount], options);
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* decreaseAllowance
|
|
551
|
-
* nonpayable
|
|
552
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
553
|
-
*/
|
|
554
|
-
async decreaseAllowance(spender, subtractedValue, options) {
|
|
555
|
-
if (!this.contract.write) {
|
|
556
|
-
throw new Error('Wallet client is required for write operations');
|
|
557
|
-
}
|
|
558
|
-
return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* increaseAllowance
|
|
562
|
-
* nonpayable
|
|
563
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
564
|
-
*/
|
|
565
|
-
async increaseAllowance(spender, addedValue, options) {
|
|
566
|
-
if (!this.contract.write) {
|
|
567
|
-
throw new Error('Wallet client is required for write operations');
|
|
568
|
-
}
|
|
569
|
-
return this.contract.write.increaseAllowance([spender, addedValue], options);
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* renounceOwnership
|
|
573
|
-
* nonpayable
|
|
574
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
575
|
-
*/
|
|
576
|
-
async renounceOwnership(options) {
|
|
429
|
+
async approve(spender, value, options) {
|
|
577
430
|
if (!this.contract.write) {
|
|
578
431
|
throw new Error('Wallet client is required for write operations');
|
|
579
432
|
}
|
|
580
|
-
return this.contract.write.
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* setName
|
|
584
|
-
* nonpayable
|
|
585
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
586
|
-
*/
|
|
587
|
-
async setName(newName, options) {
|
|
588
|
-
if (!this.contract.write) {
|
|
589
|
-
throw new Error('Wallet client is required for write operations');
|
|
590
|
-
}
|
|
591
|
-
return this.contract.write.setName([newName], options);
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* setSymbol
|
|
595
|
-
* nonpayable
|
|
596
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
597
|
-
*/
|
|
598
|
-
async setSymbol(newSymbol, options) {
|
|
599
|
-
if (!this.contract.write) {
|
|
600
|
-
throw new Error('Wallet client is required for write operations');
|
|
601
|
-
}
|
|
602
|
-
return this.contract.write.setSymbol([newSymbol], options);
|
|
433
|
+
return this.contract.write.approve([spender, value], options);
|
|
603
434
|
}
|
|
604
435
|
/**
|
|
605
436
|
* transfer
|
|
606
437
|
* nonpayable
|
|
607
438
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
608
439
|
*/
|
|
609
|
-
async transfer(to,
|
|
440
|
+
async transfer(to, value, options) {
|
|
610
441
|
if (!this.contract.write) {
|
|
611
442
|
throw new Error('Wallet client is required for write operations');
|
|
612
443
|
}
|
|
613
|
-
return this.contract.write.transfer([to,
|
|
444
|
+
return this.contract.write.transfer([to, value], options);
|
|
614
445
|
}
|
|
615
446
|
/**
|
|
616
447
|
* transferFrom
|
|
617
448
|
* nonpayable
|
|
618
449
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
619
450
|
*/
|
|
620
|
-
async transferFrom(from, to,
|
|
451
|
+
async transferFrom(from, to, value, options) {
|
|
621
452
|
if (!this.contract.write) {
|
|
622
453
|
throw new Error('Wallet client is required for write operations');
|
|
623
454
|
}
|
|
624
|
-
return this.contract.write.transferFrom([from, to,
|
|
455
|
+
return this.contract.write.transferFrom([from, to, value], options);
|
|
625
456
|
}
|
|
626
457
|
/**
|
|
627
458
|
* Simulate contract write operations (dry-run without sending transaction)
|
|
@@ -642,64 +473,24 @@ class USDToken_json {
|
|
|
642
473
|
* Returns gas estimate and result without sending transaction
|
|
643
474
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
644
475
|
*/
|
|
645
|
-
async approve(spender,
|
|
646
|
-
return contract.simulate.approve([spender,
|
|
647
|
-
},
|
|
648
|
-
/**
|
|
649
|
-
* Simulate decreaseAllowance
|
|
650
|
-
* Returns gas estimate and result without sending transaction
|
|
651
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
652
|
-
*/
|
|
653
|
-
async decreaseAllowance(spender, subtractedValue, options) {
|
|
654
|
-
return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
|
|
655
|
-
},
|
|
656
|
-
/**
|
|
657
|
-
* Simulate increaseAllowance
|
|
658
|
-
* Returns gas estimate and result without sending transaction
|
|
659
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
660
|
-
*/
|
|
661
|
-
async increaseAllowance(spender, addedValue, options) {
|
|
662
|
-
return contract.simulate.increaseAllowance([spender, addedValue], options);
|
|
663
|
-
},
|
|
664
|
-
/**
|
|
665
|
-
* Simulate renounceOwnership
|
|
666
|
-
* Returns gas estimate and result without sending transaction
|
|
667
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
668
|
-
*/
|
|
669
|
-
async renounceOwnership(options) {
|
|
670
|
-
return contract.simulate.renounceOwnership(options);
|
|
671
|
-
},
|
|
672
|
-
/**
|
|
673
|
-
* Simulate setName
|
|
674
|
-
* Returns gas estimate and result without sending transaction
|
|
675
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
676
|
-
*/
|
|
677
|
-
async setName(newName, options) {
|
|
678
|
-
return contract.simulate.setName([newName], options);
|
|
679
|
-
},
|
|
680
|
-
/**
|
|
681
|
-
* Simulate setSymbol
|
|
682
|
-
* Returns gas estimate and result without sending transaction
|
|
683
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
684
|
-
*/
|
|
685
|
-
async setSymbol(newSymbol, options) {
|
|
686
|
-
return contract.simulate.setSymbol([newSymbol], options);
|
|
476
|
+
async approve(spender, value, options) {
|
|
477
|
+
return contract.simulate.approve([spender, value], options);
|
|
687
478
|
},
|
|
688
479
|
/**
|
|
689
480
|
* Simulate transfer
|
|
690
481
|
* Returns gas estimate and result without sending transaction
|
|
691
482
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
692
483
|
*/
|
|
693
|
-
async transfer(to,
|
|
694
|
-
return contract.simulate.transfer([to,
|
|
484
|
+
async transfer(to, value, options) {
|
|
485
|
+
return contract.simulate.transfer([to, value], options);
|
|
695
486
|
},
|
|
696
487
|
/**
|
|
697
488
|
* Simulate transferFrom
|
|
698
489
|
* Returns gas estimate and result without sending transaction
|
|
699
490
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
700
491
|
*/
|
|
701
|
-
async transferFrom(from, to,
|
|
702
|
-
return contract.simulate.transferFrom([from, to,
|
|
492
|
+
async transferFrom(from, to, value, options) {
|
|
493
|
+
return contract.simulate.transferFrom([from, to, value], options);
|
|
703
494
|
}
|
|
704
495
|
};
|
|
705
496
|
}
|
|
@@ -726,7 +517,7 @@ class USDToken_json {
|
|
|
726
517
|
Approval: (callback, filter) => {
|
|
727
518
|
return this.publicClient.watchContractEvent({
|
|
728
519
|
address: this.contractAddress,
|
|
729
|
-
abi: exports.
|
|
520
|
+
abi: exports.TetherUSDT_jsonAbi,
|
|
730
521
|
eventName: 'Approval',
|
|
731
522
|
args: filter,
|
|
732
523
|
onLogs: (logs) => {
|
|
@@ -736,61 +527,6 @@ class USDToken_json {
|
|
|
736
527
|
},
|
|
737
528
|
});
|
|
738
529
|
},
|
|
739
|
-
/**
|
|
740
|
-
* Watch NameChanged events
|
|
741
|
-
* @param callback Function to call when event is emitted
|
|
742
|
-
* @param filter Optional filter for indexed parameters
|
|
743
|
-
* @returns Unwatch function to stop listening
|
|
744
|
-
*/
|
|
745
|
-
NameChanged: (callback) => {
|
|
746
|
-
return this.publicClient.watchContractEvent({
|
|
747
|
-
address: this.contractAddress,
|
|
748
|
-
abi: exports.USDToken_jsonAbi,
|
|
749
|
-
eventName: 'NameChanged',
|
|
750
|
-
onLogs: (logs) => {
|
|
751
|
-
logs.forEach((log) => {
|
|
752
|
-
callback(log.args);
|
|
753
|
-
});
|
|
754
|
-
},
|
|
755
|
-
});
|
|
756
|
-
},
|
|
757
|
-
/**
|
|
758
|
-
* Watch OwnershipRenounced events
|
|
759
|
-
* @param callback Function to call when event is emitted
|
|
760
|
-
* @param filter Optional filter for indexed parameters
|
|
761
|
-
* @returns Unwatch function to stop listening
|
|
762
|
-
*/
|
|
763
|
-
OwnershipRenounced: (callback, filter) => {
|
|
764
|
-
return this.publicClient.watchContractEvent({
|
|
765
|
-
address: this.contractAddress,
|
|
766
|
-
abi: exports.USDToken_jsonAbi,
|
|
767
|
-
eventName: 'OwnershipRenounced',
|
|
768
|
-
args: filter,
|
|
769
|
-
onLogs: (logs) => {
|
|
770
|
-
logs.forEach((log) => {
|
|
771
|
-
callback(log.args);
|
|
772
|
-
});
|
|
773
|
-
},
|
|
774
|
-
});
|
|
775
|
-
},
|
|
776
|
-
/**
|
|
777
|
-
* Watch SymbolChanged events
|
|
778
|
-
* @param callback Function to call when event is emitted
|
|
779
|
-
* @param filter Optional filter for indexed parameters
|
|
780
|
-
* @returns Unwatch function to stop listening
|
|
781
|
-
*/
|
|
782
|
-
SymbolChanged: (callback) => {
|
|
783
|
-
return this.publicClient.watchContractEvent({
|
|
784
|
-
address: this.contractAddress,
|
|
785
|
-
abi: exports.USDToken_jsonAbi,
|
|
786
|
-
eventName: 'SymbolChanged',
|
|
787
|
-
onLogs: (logs) => {
|
|
788
|
-
logs.forEach((log) => {
|
|
789
|
-
callback(log.args);
|
|
790
|
-
});
|
|
791
|
-
},
|
|
792
|
-
});
|
|
793
|
-
},
|
|
794
530
|
/**
|
|
795
531
|
* Watch Transfer events
|
|
796
532
|
* @param callback Function to call when event is emitted
|
|
@@ -800,7 +536,7 @@ class USDToken_json {
|
|
|
800
536
|
Transfer: (callback, filter) => {
|
|
801
537
|
return this.publicClient.watchContractEvent({
|
|
802
538
|
address: this.contractAddress,
|
|
803
|
-
abi: exports.
|
|
539
|
+
abi: exports.TetherUSDT_jsonAbi,
|
|
804
540
|
eventName: 'Transfer',
|
|
805
541
|
args: filter,
|
|
806
542
|
onLogs: (logs) => {
|
|
@@ -813,4 +549,4 @@ class USDToken_json {
|
|
|
813
549
|
};
|
|
814
550
|
}
|
|
815
551
|
}
|
|
816
|
-
exports.
|
|
552
|
+
exports.TetherUSDT_json = TetherUSDT_json;
|