@gitmyabi/usdt 1.0.7 → 1.0.8
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/{MyToken_json.d.ts → Tether_json.d.ts} +272 -98
- package/contracts/{MyToken_json.js → Tether_json.js} +306 -118
- package/contracts/{MyToken_json.ts → Tether_json.ts} +362 -128
- 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,41 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Tether_json = exports.Tether_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Tether_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.Tether_jsonAbi = [
|
|
11
11
|
{
|
|
12
|
-
"inputs": [
|
|
13
|
-
{
|
|
14
|
-
"internalType": "string",
|
|
15
|
-
"name": "_name",
|
|
16
|
-
"type": "string"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"internalType": "string",
|
|
20
|
-
"name": "_symbol",
|
|
21
|
-
"type": "string"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"internalType": "uint256",
|
|
25
|
-
"name": "_cap",
|
|
26
|
-
"type": "uint256"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"internalType": "uint256",
|
|
30
|
-
"name": "_initialSupply",
|
|
31
|
-
"type": "uint256"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"internalType": "string",
|
|
35
|
-
"name": "_logoURI",
|
|
36
|
-
"type": "string"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
12
|
+
"inputs": [],
|
|
39
13
|
"stateMutability": "nonpayable",
|
|
40
14
|
"type": "constructor"
|
|
41
15
|
},
|
|
@@ -45,7 +19,7 @@ exports.MyToken_jsonAbi = [
|
|
|
45
19
|
{
|
|
46
20
|
"indexed": true,
|
|
47
21
|
"internalType": "address",
|
|
48
|
-
"name": "
|
|
22
|
+
"name": "tokenOwner",
|
|
49
23
|
"type": "address"
|
|
50
24
|
},
|
|
51
25
|
{
|
|
@@ -64,6 +38,25 @@ exports.MyToken_jsonAbi = [
|
|
|
64
38
|
"name": "Approval",
|
|
65
39
|
"type": "event"
|
|
66
40
|
},
|
|
41
|
+
{
|
|
42
|
+
"anonymous": false,
|
|
43
|
+
"inputs": [
|
|
44
|
+
{
|
|
45
|
+
"indexed": true,
|
|
46
|
+
"internalType": "address",
|
|
47
|
+
"name": "account",
|
|
48
|
+
"type": "address"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"indexed": false,
|
|
52
|
+
"internalType": "uint256",
|
|
53
|
+
"name": "amount",
|
|
54
|
+
"type": "uint256"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"name": "Freeze",
|
|
58
|
+
"type": "event"
|
|
59
|
+
},
|
|
67
60
|
{
|
|
68
61
|
"anonymous": false,
|
|
69
62
|
"inputs": [
|
|
@@ -109,15 +102,34 @@ exports.MyToken_jsonAbi = [
|
|
|
109
102
|
"type": "event"
|
|
110
103
|
},
|
|
111
104
|
{
|
|
105
|
+
"anonymous": false,
|
|
112
106
|
"inputs": [
|
|
113
107
|
{
|
|
108
|
+
"indexed": true,
|
|
114
109
|
"internalType": "address",
|
|
115
|
-
"name": "",
|
|
110
|
+
"name": "account",
|
|
116
111
|
"type": "address"
|
|
117
112
|
},
|
|
113
|
+
{
|
|
114
|
+
"indexed": false,
|
|
115
|
+
"internalType": "uint256",
|
|
116
|
+
"name": "amount",
|
|
117
|
+
"type": "uint256"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"name": "Unfreeze",
|
|
121
|
+
"type": "event"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"inputs": [
|
|
118
125
|
{
|
|
119
126
|
"internalType": "address",
|
|
120
|
-
"name": "",
|
|
127
|
+
"name": "tokenOwner",
|
|
128
|
+
"type": "address"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"internalType": "address",
|
|
132
|
+
"name": "spender",
|
|
121
133
|
"type": "address"
|
|
122
134
|
}
|
|
123
135
|
],
|
|
@@ -141,7 +153,7 @@ exports.MyToken_jsonAbi = [
|
|
|
141
153
|
},
|
|
142
154
|
{
|
|
143
155
|
"internalType": "uint256",
|
|
144
|
-
"name": "
|
|
156
|
+
"name": "amount",
|
|
145
157
|
"type": "uint256"
|
|
146
158
|
}
|
|
147
159
|
],
|
|
@@ -160,11 +172,11 @@ exports.MyToken_jsonAbi = [
|
|
|
160
172
|
"inputs": [
|
|
161
173
|
{
|
|
162
174
|
"internalType": "address",
|
|
163
|
-
"name": "",
|
|
175
|
+
"name": "account",
|
|
164
176
|
"type": "address"
|
|
165
177
|
}
|
|
166
178
|
],
|
|
167
|
-
"name": "
|
|
179
|
+
"name": "availableBalanceOf",
|
|
168
180
|
"outputs": [
|
|
169
181
|
{
|
|
170
182
|
"internalType": "uint256",
|
|
@@ -176,8 +188,14 @@ exports.MyToken_jsonAbi = [
|
|
|
176
188
|
"type": "function"
|
|
177
189
|
},
|
|
178
190
|
{
|
|
179
|
-
"inputs": [
|
|
180
|
-
|
|
191
|
+
"inputs": [
|
|
192
|
+
{
|
|
193
|
+
"internalType": "address",
|
|
194
|
+
"name": "account",
|
|
195
|
+
"type": "address"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"name": "balanceOf",
|
|
181
199
|
"outputs": [
|
|
182
200
|
{
|
|
183
201
|
"internalType": "uint256",
|
|
@@ -202,23 +220,34 @@ exports.MyToken_jsonAbi = [
|
|
|
202
220
|
"type": "function"
|
|
203
221
|
},
|
|
204
222
|
{
|
|
205
|
-
"inputs": [
|
|
206
|
-
|
|
223
|
+
"inputs": [
|
|
224
|
+
{
|
|
225
|
+
"internalType": "address",
|
|
226
|
+
"name": "spender",
|
|
227
|
+
"type": "address"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"internalType": "uint256",
|
|
231
|
+
"name": "subtractedValue",
|
|
232
|
+
"type": "uint256"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"name": "decreaseAllowance",
|
|
207
236
|
"outputs": [
|
|
208
237
|
{
|
|
209
|
-
"internalType": "
|
|
238
|
+
"internalType": "bool",
|
|
210
239
|
"name": "",
|
|
211
|
-
"type": "
|
|
240
|
+
"type": "bool"
|
|
212
241
|
}
|
|
213
242
|
],
|
|
214
|
-
"stateMutability": "
|
|
243
|
+
"stateMutability": "nonpayable",
|
|
215
244
|
"type": "function"
|
|
216
245
|
},
|
|
217
246
|
{
|
|
218
247
|
"inputs": [
|
|
219
248
|
{
|
|
220
249
|
"internalType": "address",
|
|
221
|
-
"name": "
|
|
250
|
+
"name": "account",
|
|
222
251
|
"type": "address"
|
|
223
252
|
},
|
|
224
253
|
{
|
|
@@ -227,55 +256,84 @@ exports.MyToken_jsonAbi = [
|
|
|
227
256
|
"type": "uint256"
|
|
228
257
|
}
|
|
229
258
|
],
|
|
230
|
-
"name": "
|
|
231
|
-
"outputs": [
|
|
259
|
+
"name": "freezeBalance",
|
|
260
|
+
"outputs": [
|
|
261
|
+
{
|
|
262
|
+
"internalType": "bool",
|
|
263
|
+
"name": "",
|
|
264
|
+
"type": "bool"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
232
267
|
"stateMutability": "nonpayable",
|
|
233
268
|
"type": "function"
|
|
234
269
|
},
|
|
235
270
|
{
|
|
236
|
-
"inputs": [
|
|
237
|
-
|
|
271
|
+
"inputs": [
|
|
272
|
+
{
|
|
273
|
+
"internalType": "address",
|
|
274
|
+
"name": "account",
|
|
275
|
+
"type": "address"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"name": "frozenBalanceOf",
|
|
238
279
|
"outputs": [
|
|
239
280
|
{
|
|
240
|
-
"internalType": "
|
|
281
|
+
"internalType": "uint256",
|
|
241
282
|
"name": "",
|
|
242
|
-
"type": "
|
|
283
|
+
"type": "uint256"
|
|
243
284
|
}
|
|
244
285
|
],
|
|
245
286
|
"stateMutability": "view",
|
|
246
287
|
"type": "function"
|
|
247
288
|
},
|
|
248
289
|
{
|
|
249
|
-
"inputs": [
|
|
250
|
-
"name": "owner",
|
|
251
|
-
"outputs": [
|
|
290
|
+
"inputs": [
|
|
252
291
|
{
|
|
253
292
|
"internalType": "address",
|
|
254
|
-
"name": "",
|
|
293
|
+
"name": "spender",
|
|
255
294
|
"type": "address"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"internalType": "uint256",
|
|
298
|
+
"name": "addedValue",
|
|
299
|
+
"type": "uint256"
|
|
256
300
|
}
|
|
257
301
|
],
|
|
258
|
-
"
|
|
302
|
+
"name": "increaseAllowance",
|
|
303
|
+
"outputs": [
|
|
304
|
+
{
|
|
305
|
+
"internalType": "bool",
|
|
306
|
+
"name": "",
|
|
307
|
+
"type": "bool"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"stateMutability": "nonpayable",
|
|
259
311
|
"type": "function"
|
|
260
312
|
},
|
|
261
313
|
{
|
|
262
314
|
"inputs": [],
|
|
263
|
-
"name": "
|
|
264
|
-
"outputs": [
|
|
265
|
-
|
|
315
|
+
"name": "name",
|
|
316
|
+
"outputs": [
|
|
317
|
+
{
|
|
318
|
+
"internalType": "string",
|
|
319
|
+
"name": "",
|
|
320
|
+
"type": "string"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"stateMutability": "view",
|
|
266
324
|
"type": "function"
|
|
267
325
|
},
|
|
268
326
|
{
|
|
269
|
-
"inputs": [
|
|
327
|
+
"inputs": [],
|
|
328
|
+
"name": "owner",
|
|
329
|
+
"outputs": [
|
|
270
330
|
{
|
|
271
|
-
"internalType": "
|
|
272
|
-
"name": "
|
|
273
|
-
"type": "
|
|
331
|
+
"internalType": "address",
|
|
332
|
+
"name": "",
|
|
333
|
+
"type": "address"
|
|
274
334
|
}
|
|
275
335
|
],
|
|
276
|
-
"
|
|
277
|
-
"outputs": [],
|
|
278
|
-
"stateMutability": "nonpayable",
|
|
336
|
+
"stateMutability": "view",
|
|
279
337
|
"type": "function"
|
|
280
338
|
},
|
|
281
339
|
{
|
|
@@ -313,7 +371,7 @@ exports.MyToken_jsonAbi = [
|
|
|
313
371
|
},
|
|
314
372
|
{
|
|
315
373
|
"internalType": "uint256",
|
|
316
|
-
"name": "
|
|
374
|
+
"name": "amount",
|
|
317
375
|
"type": "uint256"
|
|
318
376
|
}
|
|
319
377
|
],
|
|
@@ -342,7 +400,7 @@ exports.MyToken_jsonAbi = [
|
|
|
342
400
|
},
|
|
343
401
|
{
|
|
344
402
|
"internalType": "uint256",
|
|
345
|
-
"name": "
|
|
403
|
+
"name": "amount",
|
|
346
404
|
"type": "uint256"
|
|
347
405
|
}
|
|
348
406
|
],
|
|
@@ -366,13 +424,67 @@ exports.MyToken_jsonAbi = [
|
|
|
366
424
|
}
|
|
367
425
|
],
|
|
368
426
|
"name": "transferOwnership",
|
|
369
|
-
"outputs": [
|
|
427
|
+
"outputs": [
|
|
428
|
+
{
|
|
429
|
+
"internalType": "bool",
|
|
430
|
+
"name": "",
|
|
431
|
+
"type": "bool"
|
|
432
|
+
}
|
|
433
|
+
],
|
|
434
|
+
"stateMutability": "nonpayable",
|
|
435
|
+
"type": "function"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"inputs": [
|
|
439
|
+
{
|
|
440
|
+
"internalType": "address",
|
|
441
|
+
"name": "to",
|
|
442
|
+
"type": "address"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"internalType": "uint256",
|
|
446
|
+
"name": "amount",
|
|
447
|
+
"type": "uint256"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"name": "transferWithFreeze",
|
|
451
|
+
"outputs": [
|
|
452
|
+
{
|
|
453
|
+
"internalType": "bool",
|
|
454
|
+
"name": "",
|
|
455
|
+
"type": "bool"
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
"stateMutability": "nonpayable",
|
|
459
|
+
"type": "function"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"inputs": [
|
|
463
|
+
{
|
|
464
|
+
"internalType": "address",
|
|
465
|
+
"name": "account",
|
|
466
|
+
"type": "address"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"internalType": "uint256",
|
|
470
|
+
"name": "amount",
|
|
471
|
+
"type": "uint256"
|
|
472
|
+
}
|
|
473
|
+
],
|
|
474
|
+
"name": "unfreezeBalance",
|
|
475
|
+
"outputs": [
|
|
476
|
+
{
|
|
477
|
+
"internalType": "bool",
|
|
478
|
+
"name": "",
|
|
479
|
+
"type": "bool"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
370
482
|
"stateMutability": "nonpayable",
|
|
371
483
|
"type": "function"
|
|
372
484
|
}
|
|
373
485
|
];
|
|
374
486
|
/**
|
|
375
|
-
*
|
|
487
|
+
* Tether_json Contract Class
|
|
376
488
|
*
|
|
377
489
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
378
490
|
*
|
|
@@ -380,12 +492,12 @@ exports.MyToken_jsonAbi = [
|
|
|
380
492
|
* ```typescript
|
|
381
493
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
382
494
|
* import { mainnet } from 'viem/chains';
|
|
383
|
-
* import {
|
|
495
|
+
* import { Tether_json } from 'Tether_json';
|
|
384
496
|
*
|
|
385
497
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
386
498
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
387
499
|
*
|
|
388
|
-
* const contract = new
|
|
500
|
+
* const contract = new Tether_json('0x...', { publicClient, walletClient });
|
|
389
501
|
*
|
|
390
502
|
* // Read functions
|
|
391
503
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -403,13 +515,13 @@ exports.MyToken_jsonAbi = [
|
|
|
403
515
|
* });
|
|
404
516
|
* ```
|
|
405
517
|
*/
|
|
406
|
-
class
|
|
518
|
+
class Tether_json {
|
|
407
519
|
constructor(address, clients) {
|
|
408
520
|
this.contractAddress = address;
|
|
409
521
|
this.publicClient = clients.publicClient;
|
|
410
522
|
this.contract = (0, viem_1.getContract)({
|
|
411
523
|
address,
|
|
412
|
-
abi: exports.
|
|
524
|
+
abi: exports.Tether_jsonAbi,
|
|
413
525
|
client: {
|
|
414
526
|
public: clients.publicClient,
|
|
415
527
|
wallet: clients.walletClient,
|
|
@@ -432,22 +544,22 @@ class MyToken_json {
|
|
|
432
544
|
* allowance
|
|
433
545
|
* view
|
|
434
546
|
*/
|
|
435
|
-
async allowance(
|
|
436
|
-
return this.contract.read.allowance([
|
|
547
|
+
async allowance(tokenOwner, spender) {
|
|
548
|
+
return this.contract.read.allowance([tokenOwner, spender]);
|
|
437
549
|
}
|
|
438
550
|
/**
|
|
439
|
-
*
|
|
551
|
+
* availableBalanceOf
|
|
440
552
|
* view
|
|
441
553
|
*/
|
|
442
|
-
async
|
|
443
|
-
return this.contract.read.
|
|
554
|
+
async availableBalanceOf(account) {
|
|
555
|
+
return this.contract.read.availableBalanceOf([account]);
|
|
444
556
|
}
|
|
445
557
|
/**
|
|
446
|
-
*
|
|
558
|
+
* balanceOf
|
|
447
559
|
* view
|
|
448
560
|
*/
|
|
449
|
-
async
|
|
450
|
-
return this.contract.read.
|
|
561
|
+
async balanceOf(account) {
|
|
562
|
+
return this.contract.read.balanceOf([account]);
|
|
451
563
|
}
|
|
452
564
|
/**
|
|
453
565
|
* decimals
|
|
@@ -457,11 +569,11 @@ class MyToken_json {
|
|
|
457
569
|
return this.contract.read.decimals();
|
|
458
570
|
}
|
|
459
571
|
/**
|
|
460
|
-
*
|
|
572
|
+
* frozenBalanceOf
|
|
461
573
|
* view
|
|
462
574
|
*/
|
|
463
|
-
async
|
|
464
|
-
return this.contract.read.
|
|
575
|
+
async frozenBalanceOf(account) {
|
|
576
|
+
return this.contract.read.frozenBalanceOf([account]);
|
|
465
577
|
}
|
|
466
578
|
/**
|
|
467
579
|
* name
|
|
@@ -496,66 +608,66 @@ class MyToken_json {
|
|
|
496
608
|
* nonpayable
|
|
497
609
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
498
610
|
*/
|
|
499
|
-
async approve(spender,
|
|
611
|
+
async approve(spender, amount, options) {
|
|
500
612
|
if (!this.contract.write) {
|
|
501
613
|
throw new Error('Wallet client is required for write operations');
|
|
502
614
|
}
|
|
503
|
-
return this.contract.write.approve([spender,
|
|
615
|
+
return this.contract.write.approve([spender, amount], options);
|
|
504
616
|
}
|
|
505
617
|
/**
|
|
506
|
-
*
|
|
618
|
+
* decreaseAllowance
|
|
507
619
|
* nonpayable
|
|
508
620
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
509
621
|
*/
|
|
510
|
-
async
|
|
622
|
+
async decreaseAllowance(spender, subtractedValue, options) {
|
|
511
623
|
if (!this.contract.write) {
|
|
512
624
|
throw new Error('Wallet client is required for write operations');
|
|
513
625
|
}
|
|
514
|
-
return this.contract.write.
|
|
626
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
|
|
515
627
|
}
|
|
516
628
|
/**
|
|
517
|
-
*
|
|
629
|
+
* freezeBalance
|
|
518
630
|
* nonpayable
|
|
519
631
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
520
632
|
*/
|
|
521
|
-
async
|
|
633
|
+
async freezeBalance(account, amount, options) {
|
|
522
634
|
if (!this.contract.write) {
|
|
523
635
|
throw new Error('Wallet client is required for write operations');
|
|
524
636
|
}
|
|
525
|
-
return this.contract.write.
|
|
637
|
+
return this.contract.write.freezeBalance([account, amount], options);
|
|
526
638
|
}
|
|
527
639
|
/**
|
|
528
|
-
*
|
|
640
|
+
* increaseAllowance
|
|
529
641
|
* nonpayable
|
|
530
642
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
531
643
|
*/
|
|
532
|
-
async
|
|
644
|
+
async increaseAllowance(spender, addedValue, options) {
|
|
533
645
|
if (!this.contract.write) {
|
|
534
646
|
throw new Error('Wallet client is required for write operations');
|
|
535
647
|
}
|
|
536
|
-
return this.contract.write.
|
|
648
|
+
return this.contract.write.increaseAllowance([spender, addedValue], options);
|
|
537
649
|
}
|
|
538
650
|
/**
|
|
539
651
|
* transfer
|
|
540
652
|
* nonpayable
|
|
541
653
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
542
654
|
*/
|
|
543
|
-
async transfer(to,
|
|
655
|
+
async transfer(to, amount, options) {
|
|
544
656
|
if (!this.contract.write) {
|
|
545
657
|
throw new Error('Wallet client is required for write operations');
|
|
546
658
|
}
|
|
547
|
-
return this.contract.write.transfer([to,
|
|
659
|
+
return this.contract.write.transfer([to, amount], options);
|
|
548
660
|
}
|
|
549
661
|
/**
|
|
550
662
|
* transferFrom
|
|
551
663
|
* nonpayable
|
|
552
664
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
553
665
|
*/
|
|
554
|
-
async transferFrom(from, to,
|
|
666
|
+
async transferFrom(from, to, amount, options) {
|
|
555
667
|
if (!this.contract.write) {
|
|
556
668
|
throw new Error('Wallet client is required for write operations');
|
|
557
669
|
}
|
|
558
|
-
return this.contract.write.transferFrom([from, to,
|
|
670
|
+
return this.contract.write.transferFrom([from, to, amount], options);
|
|
559
671
|
}
|
|
560
672
|
/**
|
|
561
673
|
* transferOwnership
|
|
@@ -568,6 +680,28 @@ class MyToken_json {
|
|
|
568
680
|
}
|
|
569
681
|
return this.contract.write.transferOwnership([newOwner], options);
|
|
570
682
|
}
|
|
683
|
+
/**
|
|
684
|
+
* transferWithFreeze
|
|
685
|
+
* nonpayable
|
|
686
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
687
|
+
*/
|
|
688
|
+
async transferWithFreeze(to, amount, options) {
|
|
689
|
+
if (!this.contract.write) {
|
|
690
|
+
throw new Error('Wallet client is required for write operations');
|
|
691
|
+
}
|
|
692
|
+
return this.contract.write.transferWithFreeze([to, amount], options);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* unfreezeBalance
|
|
696
|
+
* nonpayable
|
|
697
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
698
|
+
*/
|
|
699
|
+
async unfreezeBalance(account, amount, options) {
|
|
700
|
+
if (!this.contract.write) {
|
|
701
|
+
throw new Error('Wallet client is required for write operations');
|
|
702
|
+
}
|
|
703
|
+
return this.contract.write.unfreezeBalance([account, amount], options);
|
|
704
|
+
}
|
|
571
705
|
/**
|
|
572
706
|
* Simulate contract write operations (dry-run without sending transaction)
|
|
573
707
|
*
|
|
@@ -587,48 +721,48 @@ class MyToken_json {
|
|
|
587
721
|
* Returns gas estimate and result without sending transaction
|
|
588
722
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
589
723
|
*/
|
|
590
|
-
async approve(spender,
|
|
591
|
-
return contract.simulate.approve([spender,
|
|
724
|
+
async approve(spender, amount, options) {
|
|
725
|
+
return contract.simulate.approve([spender, amount], options);
|
|
592
726
|
},
|
|
593
727
|
/**
|
|
594
|
-
* Simulate
|
|
728
|
+
* Simulate decreaseAllowance
|
|
595
729
|
* Returns gas estimate and result without sending transaction
|
|
596
730
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
597
731
|
*/
|
|
598
|
-
async
|
|
599
|
-
return contract.simulate.
|
|
732
|
+
async decreaseAllowance(spender, subtractedValue, options) {
|
|
733
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
|
|
600
734
|
},
|
|
601
735
|
/**
|
|
602
|
-
* Simulate
|
|
736
|
+
* Simulate freezeBalance
|
|
603
737
|
* Returns gas estimate and result without sending transaction
|
|
604
738
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
605
739
|
*/
|
|
606
|
-
async
|
|
607
|
-
return contract.simulate.
|
|
740
|
+
async freezeBalance(account, amount, options) {
|
|
741
|
+
return contract.simulate.freezeBalance([account, amount], options);
|
|
608
742
|
},
|
|
609
743
|
/**
|
|
610
|
-
* Simulate
|
|
744
|
+
* Simulate increaseAllowance
|
|
611
745
|
* Returns gas estimate and result without sending transaction
|
|
612
746
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
613
747
|
*/
|
|
614
|
-
async
|
|
615
|
-
return contract.simulate.
|
|
748
|
+
async increaseAllowance(spender, addedValue, options) {
|
|
749
|
+
return contract.simulate.increaseAllowance([spender, addedValue], options);
|
|
616
750
|
},
|
|
617
751
|
/**
|
|
618
752
|
* Simulate transfer
|
|
619
753
|
* Returns gas estimate and result without sending transaction
|
|
620
754
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
621
755
|
*/
|
|
622
|
-
async transfer(to,
|
|
623
|
-
return contract.simulate.transfer([to,
|
|
756
|
+
async transfer(to, amount, options) {
|
|
757
|
+
return contract.simulate.transfer([to, amount], options);
|
|
624
758
|
},
|
|
625
759
|
/**
|
|
626
760
|
* Simulate transferFrom
|
|
627
761
|
* Returns gas estimate and result without sending transaction
|
|
628
762
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
629
763
|
*/
|
|
630
|
-
async transferFrom(from, to,
|
|
631
|
-
return contract.simulate.transferFrom([from, to,
|
|
764
|
+
async transferFrom(from, to, amount, options) {
|
|
765
|
+
return contract.simulate.transferFrom([from, to, amount], options);
|
|
632
766
|
},
|
|
633
767
|
/**
|
|
634
768
|
* Simulate transferOwnership
|
|
@@ -637,6 +771,22 @@ class MyToken_json {
|
|
|
637
771
|
*/
|
|
638
772
|
async transferOwnership(newOwner, options) {
|
|
639
773
|
return contract.simulate.transferOwnership([newOwner], options);
|
|
774
|
+
},
|
|
775
|
+
/**
|
|
776
|
+
* Simulate transferWithFreeze
|
|
777
|
+
* Returns gas estimate and result without sending transaction
|
|
778
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
779
|
+
*/
|
|
780
|
+
async transferWithFreeze(to, amount, options) {
|
|
781
|
+
return contract.simulate.transferWithFreeze([to, amount], options);
|
|
782
|
+
},
|
|
783
|
+
/**
|
|
784
|
+
* Simulate unfreezeBalance
|
|
785
|
+
* Returns gas estimate and result without sending transaction
|
|
786
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
787
|
+
*/
|
|
788
|
+
async unfreezeBalance(account, amount, options) {
|
|
789
|
+
return contract.simulate.unfreezeBalance([account, amount], options);
|
|
640
790
|
}
|
|
641
791
|
};
|
|
642
792
|
}
|
|
@@ -663,7 +813,7 @@ class MyToken_json {
|
|
|
663
813
|
Approval: (callback, filter) => {
|
|
664
814
|
return this.publicClient.watchContractEvent({
|
|
665
815
|
address: this.contractAddress,
|
|
666
|
-
abi: exports.
|
|
816
|
+
abi: exports.Tether_jsonAbi,
|
|
667
817
|
eventName: 'Approval',
|
|
668
818
|
args: filter,
|
|
669
819
|
onLogs: (logs) => {
|
|
@@ -673,6 +823,25 @@ class MyToken_json {
|
|
|
673
823
|
},
|
|
674
824
|
});
|
|
675
825
|
},
|
|
826
|
+
/**
|
|
827
|
+
* Watch Freeze events
|
|
828
|
+
* @param callback Function to call when event is emitted
|
|
829
|
+
* @param filter Optional filter for indexed parameters
|
|
830
|
+
* @returns Unwatch function to stop listening
|
|
831
|
+
*/
|
|
832
|
+
Freeze: (callback, filter) => {
|
|
833
|
+
return this.publicClient.watchContractEvent({
|
|
834
|
+
address: this.contractAddress,
|
|
835
|
+
abi: exports.Tether_jsonAbi,
|
|
836
|
+
eventName: 'Freeze',
|
|
837
|
+
args: filter,
|
|
838
|
+
onLogs: (logs) => {
|
|
839
|
+
logs.forEach((log) => {
|
|
840
|
+
callback(log.args);
|
|
841
|
+
});
|
|
842
|
+
},
|
|
843
|
+
});
|
|
844
|
+
},
|
|
676
845
|
/**
|
|
677
846
|
* Watch OwnershipTransferred events
|
|
678
847
|
* @param callback Function to call when event is emitted
|
|
@@ -682,7 +851,7 @@ class MyToken_json {
|
|
|
682
851
|
OwnershipTransferred: (callback, filter) => {
|
|
683
852
|
return this.publicClient.watchContractEvent({
|
|
684
853
|
address: this.contractAddress,
|
|
685
|
-
abi: exports.
|
|
854
|
+
abi: exports.Tether_jsonAbi,
|
|
686
855
|
eventName: 'OwnershipTransferred',
|
|
687
856
|
args: filter,
|
|
688
857
|
onLogs: (logs) => {
|
|
@@ -701,7 +870,7 @@ class MyToken_json {
|
|
|
701
870
|
Transfer: (callback, filter) => {
|
|
702
871
|
return this.publicClient.watchContractEvent({
|
|
703
872
|
address: this.contractAddress,
|
|
704
|
-
abi: exports.
|
|
873
|
+
abi: exports.Tether_jsonAbi,
|
|
705
874
|
eventName: 'Transfer',
|
|
706
875
|
args: filter,
|
|
707
876
|
onLogs: (logs) => {
|
|
@@ -710,8 +879,27 @@ class MyToken_json {
|
|
|
710
879
|
});
|
|
711
880
|
},
|
|
712
881
|
});
|
|
882
|
+
},
|
|
883
|
+
/**
|
|
884
|
+
* Watch Unfreeze events
|
|
885
|
+
* @param callback Function to call when event is emitted
|
|
886
|
+
* @param filter Optional filter for indexed parameters
|
|
887
|
+
* @returns Unwatch function to stop listening
|
|
888
|
+
*/
|
|
889
|
+
Unfreeze: (callback, filter) => {
|
|
890
|
+
return this.publicClient.watchContractEvent({
|
|
891
|
+
address: this.contractAddress,
|
|
892
|
+
abi: exports.Tether_jsonAbi,
|
|
893
|
+
eventName: 'Unfreeze',
|
|
894
|
+
args: filter,
|
|
895
|
+
onLogs: (logs) => {
|
|
896
|
+
logs.forEach((log) => {
|
|
897
|
+
callback(log.args);
|
|
898
|
+
});
|
|
899
|
+
},
|
|
900
|
+
});
|
|
713
901
|
}
|
|
714
902
|
};
|
|
715
903
|
}
|
|
716
904
|
}
|
|
717
|
-
exports.
|
|
905
|
+
exports.Tether_json = Tether_json;
|