@gitmyabi-stg/usdt 0.0.2
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 +108 -0
- package/contracts/TetherToken.d.ts +1249 -0
- package/contracts/TetherToken.js +1351 -0
- package/contracts/TetherToken.ts +1705 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1705 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TetherToken ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const TetherTokenAbi = [
|
|
10
|
+
{
|
|
11
|
+
"constant": true,
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"name": "name",
|
|
14
|
+
"outputs": [
|
|
15
|
+
{
|
|
16
|
+
"name": "",
|
|
17
|
+
"type": "string"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"payable": false,
|
|
21
|
+
"stateMutability": "view",
|
|
22
|
+
"type": "function"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"constant": false,
|
|
26
|
+
"inputs": [
|
|
27
|
+
{
|
|
28
|
+
"name": "_upgradedAddress",
|
|
29
|
+
"type": "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"name": "deprecate",
|
|
33
|
+
"outputs": [],
|
|
34
|
+
"payable": false,
|
|
35
|
+
"stateMutability": "nonpayable",
|
|
36
|
+
"type": "function"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"constant": false,
|
|
40
|
+
"inputs": [
|
|
41
|
+
{
|
|
42
|
+
"name": "_spender",
|
|
43
|
+
"type": "address"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "_value",
|
|
47
|
+
"type": "uint256"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"name": "approve",
|
|
51
|
+
"outputs": [],
|
|
52
|
+
"payable": false,
|
|
53
|
+
"stateMutability": "nonpayable",
|
|
54
|
+
"type": "function"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"constant": true,
|
|
58
|
+
"inputs": [],
|
|
59
|
+
"name": "deprecated",
|
|
60
|
+
"outputs": [
|
|
61
|
+
{
|
|
62
|
+
"name": "",
|
|
63
|
+
"type": "bool"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"payable": false,
|
|
67
|
+
"stateMutability": "view",
|
|
68
|
+
"type": "function"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"constant": false,
|
|
72
|
+
"inputs": [
|
|
73
|
+
{
|
|
74
|
+
"name": "_evilUser",
|
|
75
|
+
"type": "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "addBlackList",
|
|
79
|
+
"outputs": [],
|
|
80
|
+
"payable": false,
|
|
81
|
+
"stateMutability": "nonpayable",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"constant": true,
|
|
86
|
+
"inputs": [],
|
|
87
|
+
"name": "totalSupply",
|
|
88
|
+
"outputs": [
|
|
89
|
+
{
|
|
90
|
+
"name": "",
|
|
91
|
+
"type": "uint256"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"payable": false,
|
|
95
|
+
"stateMutability": "view",
|
|
96
|
+
"type": "function"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"constant": false,
|
|
100
|
+
"inputs": [
|
|
101
|
+
{
|
|
102
|
+
"name": "_from",
|
|
103
|
+
"type": "address"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "_to",
|
|
107
|
+
"type": "address"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "_value",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"name": "transferFrom",
|
|
115
|
+
"outputs": [],
|
|
116
|
+
"payable": false,
|
|
117
|
+
"stateMutability": "nonpayable",
|
|
118
|
+
"type": "function"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"constant": true,
|
|
122
|
+
"inputs": [],
|
|
123
|
+
"name": "upgradedAddress",
|
|
124
|
+
"outputs": [
|
|
125
|
+
{
|
|
126
|
+
"name": "",
|
|
127
|
+
"type": "address"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"payable": false,
|
|
131
|
+
"stateMutability": "view",
|
|
132
|
+
"type": "function"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"constant": true,
|
|
136
|
+
"inputs": [
|
|
137
|
+
{
|
|
138
|
+
"name": "",
|
|
139
|
+
"type": "address"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"name": "balances",
|
|
143
|
+
"outputs": [
|
|
144
|
+
{
|
|
145
|
+
"name": "",
|
|
146
|
+
"type": "uint256"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"payable": false,
|
|
150
|
+
"stateMutability": "view",
|
|
151
|
+
"type": "function"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"constant": true,
|
|
155
|
+
"inputs": [],
|
|
156
|
+
"name": "decimals",
|
|
157
|
+
"outputs": [
|
|
158
|
+
{
|
|
159
|
+
"name": "",
|
|
160
|
+
"type": "uint256"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"payable": false,
|
|
164
|
+
"stateMutability": "view",
|
|
165
|
+
"type": "function"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"constant": true,
|
|
169
|
+
"inputs": [],
|
|
170
|
+
"name": "maximumFee",
|
|
171
|
+
"outputs": [
|
|
172
|
+
{
|
|
173
|
+
"name": "",
|
|
174
|
+
"type": "uint256"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"payable": false,
|
|
178
|
+
"stateMutability": "view",
|
|
179
|
+
"type": "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"constant": true,
|
|
183
|
+
"inputs": [],
|
|
184
|
+
"name": "_totalSupply",
|
|
185
|
+
"outputs": [
|
|
186
|
+
{
|
|
187
|
+
"name": "",
|
|
188
|
+
"type": "uint256"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"payable": false,
|
|
192
|
+
"stateMutability": "view",
|
|
193
|
+
"type": "function"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"constant": false,
|
|
197
|
+
"inputs": [],
|
|
198
|
+
"name": "unpause",
|
|
199
|
+
"outputs": [],
|
|
200
|
+
"payable": false,
|
|
201
|
+
"stateMutability": "nonpayable",
|
|
202
|
+
"type": "function"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"constant": true,
|
|
206
|
+
"inputs": [
|
|
207
|
+
{
|
|
208
|
+
"name": "_maker",
|
|
209
|
+
"type": "address"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"name": "getBlackListStatus",
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"name": "",
|
|
216
|
+
"type": "bool"
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"payable": false,
|
|
220
|
+
"stateMutability": "view",
|
|
221
|
+
"type": "function"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"constant": true,
|
|
225
|
+
"inputs": [
|
|
226
|
+
{
|
|
227
|
+
"name": "",
|
|
228
|
+
"type": "address"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "",
|
|
232
|
+
"type": "address"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"name": "allowed",
|
|
236
|
+
"outputs": [
|
|
237
|
+
{
|
|
238
|
+
"name": "",
|
|
239
|
+
"type": "uint256"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"payable": false,
|
|
243
|
+
"stateMutability": "view",
|
|
244
|
+
"type": "function"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"constant": true,
|
|
248
|
+
"inputs": [],
|
|
249
|
+
"name": "paused",
|
|
250
|
+
"outputs": [
|
|
251
|
+
{
|
|
252
|
+
"name": "",
|
|
253
|
+
"type": "bool"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"payable": false,
|
|
257
|
+
"stateMutability": "view",
|
|
258
|
+
"type": "function"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"constant": true,
|
|
262
|
+
"inputs": [
|
|
263
|
+
{
|
|
264
|
+
"name": "who",
|
|
265
|
+
"type": "address"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"name": "balanceOf",
|
|
269
|
+
"outputs": [
|
|
270
|
+
{
|
|
271
|
+
"name": "",
|
|
272
|
+
"type": "uint256"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"payable": false,
|
|
276
|
+
"stateMutability": "view",
|
|
277
|
+
"type": "function"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"constant": false,
|
|
281
|
+
"inputs": [],
|
|
282
|
+
"name": "pause",
|
|
283
|
+
"outputs": [],
|
|
284
|
+
"payable": false,
|
|
285
|
+
"stateMutability": "nonpayable",
|
|
286
|
+
"type": "function"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"constant": true,
|
|
290
|
+
"inputs": [],
|
|
291
|
+
"name": "getOwner",
|
|
292
|
+
"outputs": [
|
|
293
|
+
{
|
|
294
|
+
"name": "",
|
|
295
|
+
"type": "address"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"payable": false,
|
|
299
|
+
"stateMutability": "view",
|
|
300
|
+
"type": "function"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"constant": true,
|
|
304
|
+
"inputs": [],
|
|
305
|
+
"name": "owner",
|
|
306
|
+
"outputs": [
|
|
307
|
+
{
|
|
308
|
+
"name": "",
|
|
309
|
+
"type": "address"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"payable": false,
|
|
313
|
+
"stateMutability": "view",
|
|
314
|
+
"type": "function"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"constant": true,
|
|
318
|
+
"inputs": [],
|
|
319
|
+
"name": "symbol",
|
|
320
|
+
"outputs": [
|
|
321
|
+
{
|
|
322
|
+
"name": "",
|
|
323
|
+
"type": "string"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"payable": false,
|
|
327
|
+
"stateMutability": "view",
|
|
328
|
+
"type": "function"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"constant": false,
|
|
332
|
+
"inputs": [
|
|
333
|
+
{
|
|
334
|
+
"name": "_to",
|
|
335
|
+
"type": "address"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "_value",
|
|
339
|
+
"type": "uint256"
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"name": "transfer",
|
|
343
|
+
"outputs": [],
|
|
344
|
+
"payable": false,
|
|
345
|
+
"stateMutability": "nonpayable",
|
|
346
|
+
"type": "function"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"constant": false,
|
|
350
|
+
"inputs": [
|
|
351
|
+
{
|
|
352
|
+
"name": "newBasisPoints",
|
|
353
|
+
"type": "uint256"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "newMaxFee",
|
|
357
|
+
"type": "uint256"
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"name": "setParams",
|
|
361
|
+
"outputs": [],
|
|
362
|
+
"payable": false,
|
|
363
|
+
"stateMutability": "nonpayable",
|
|
364
|
+
"type": "function"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"constant": false,
|
|
368
|
+
"inputs": [
|
|
369
|
+
{
|
|
370
|
+
"name": "amount",
|
|
371
|
+
"type": "uint256"
|
|
372
|
+
}
|
|
373
|
+
],
|
|
374
|
+
"name": "issue",
|
|
375
|
+
"outputs": [],
|
|
376
|
+
"payable": false,
|
|
377
|
+
"stateMutability": "nonpayable",
|
|
378
|
+
"type": "function"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"constant": false,
|
|
382
|
+
"inputs": [
|
|
383
|
+
{
|
|
384
|
+
"name": "amount",
|
|
385
|
+
"type": "uint256"
|
|
386
|
+
}
|
|
387
|
+
],
|
|
388
|
+
"name": "redeem",
|
|
389
|
+
"outputs": [],
|
|
390
|
+
"payable": false,
|
|
391
|
+
"stateMutability": "nonpayable",
|
|
392
|
+
"type": "function"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"constant": true,
|
|
396
|
+
"inputs": [
|
|
397
|
+
{
|
|
398
|
+
"name": "_owner",
|
|
399
|
+
"type": "address"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "_spender",
|
|
403
|
+
"type": "address"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"name": "allowance",
|
|
407
|
+
"outputs": [
|
|
408
|
+
{
|
|
409
|
+
"name": "remaining",
|
|
410
|
+
"type": "uint256"
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
"payable": false,
|
|
414
|
+
"stateMutability": "view",
|
|
415
|
+
"type": "function"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"constant": true,
|
|
419
|
+
"inputs": [],
|
|
420
|
+
"name": "basisPointsRate",
|
|
421
|
+
"outputs": [
|
|
422
|
+
{
|
|
423
|
+
"name": "",
|
|
424
|
+
"type": "uint256"
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
"payable": false,
|
|
428
|
+
"stateMutability": "view",
|
|
429
|
+
"type": "function"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"constant": true,
|
|
433
|
+
"inputs": [
|
|
434
|
+
{
|
|
435
|
+
"name": "",
|
|
436
|
+
"type": "address"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"name": "isBlackListed",
|
|
440
|
+
"outputs": [
|
|
441
|
+
{
|
|
442
|
+
"name": "",
|
|
443
|
+
"type": "bool"
|
|
444
|
+
}
|
|
445
|
+
],
|
|
446
|
+
"payable": false,
|
|
447
|
+
"stateMutability": "view",
|
|
448
|
+
"type": "function"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"constant": false,
|
|
452
|
+
"inputs": [
|
|
453
|
+
{
|
|
454
|
+
"name": "_clearedUser",
|
|
455
|
+
"type": "address"
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
"name": "removeBlackList",
|
|
459
|
+
"outputs": [],
|
|
460
|
+
"payable": false,
|
|
461
|
+
"stateMutability": "nonpayable",
|
|
462
|
+
"type": "function"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"constant": true,
|
|
466
|
+
"inputs": [],
|
|
467
|
+
"name": "MAX_UINT",
|
|
468
|
+
"outputs": [
|
|
469
|
+
{
|
|
470
|
+
"name": "",
|
|
471
|
+
"type": "uint256"
|
|
472
|
+
}
|
|
473
|
+
],
|
|
474
|
+
"payable": false,
|
|
475
|
+
"stateMutability": "view",
|
|
476
|
+
"type": "function"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"constant": false,
|
|
480
|
+
"inputs": [
|
|
481
|
+
{
|
|
482
|
+
"name": "newOwner",
|
|
483
|
+
"type": "address"
|
|
484
|
+
}
|
|
485
|
+
],
|
|
486
|
+
"name": "transferOwnership",
|
|
487
|
+
"outputs": [],
|
|
488
|
+
"payable": false,
|
|
489
|
+
"stateMutability": "nonpayable",
|
|
490
|
+
"type": "function"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"constant": false,
|
|
494
|
+
"inputs": [
|
|
495
|
+
{
|
|
496
|
+
"name": "_blackListedUser",
|
|
497
|
+
"type": "address"
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"name": "destroyBlackFunds",
|
|
501
|
+
"outputs": [],
|
|
502
|
+
"payable": false,
|
|
503
|
+
"stateMutability": "nonpayable",
|
|
504
|
+
"type": "function"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"inputs": [
|
|
508
|
+
{
|
|
509
|
+
"name": "_initialSupply",
|
|
510
|
+
"type": "uint256"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "_name",
|
|
514
|
+
"type": "string"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"name": "_symbol",
|
|
518
|
+
"type": "string"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "_decimals",
|
|
522
|
+
"type": "uint256"
|
|
523
|
+
}
|
|
524
|
+
],
|
|
525
|
+
"payable": false,
|
|
526
|
+
"stateMutability": "nonpayable",
|
|
527
|
+
"type": "constructor"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"anonymous": false,
|
|
531
|
+
"inputs": [
|
|
532
|
+
{
|
|
533
|
+
"indexed": false,
|
|
534
|
+
"name": "amount",
|
|
535
|
+
"type": "uint256"
|
|
536
|
+
}
|
|
537
|
+
],
|
|
538
|
+
"name": "Issue",
|
|
539
|
+
"type": "event"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"anonymous": false,
|
|
543
|
+
"inputs": [
|
|
544
|
+
{
|
|
545
|
+
"indexed": false,
|
|
546
|
+
"name": "amount",
|
|
547
|
+
"type": "uint256"
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
"name": "Redeem",
|
|
551
|
+
"type": "event"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"anonymous": false,
|
|
555
|
+
"inputs": [
|
|
556
|
+
{
|
|
557
|
+
"indexed": false,
|
|
558
|
+
"name": "newAddress",
|
|
559
|
+
"type": "address"
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"name": "Deprecate",
|
|
563
|
+
"type": "event"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"anonymous": false,
|
|
567
|
+
"inputs": [
|
|
568
|
+
{
|
|
569
|
+
"indexed": false,
|
|
570
|
+
"name": "feeBasisPoints",
|
|
571
|
+
"type": "uint256"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"indexed": false,
|
|
575
|
+
"name": "maxFee",
|
|
576
|
+
"type": "uint256"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"name": "Params",
|
|
580
|
+
"type": "event"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
"anonymous": false,
|
|
584
|
+
"inputs": [
|
|
585
|
+
{
|
|
586
|
+
"indexed": false,
|
|
587
|
+
"name": "_blackListedUser",
|
|
588
|
+
"type": "address"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"indexed": false,
|
|
592
|
+
"name": "_balance",
|
|
593
|
+
"type": "uint256"
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
"name": "DestroyedBlackFunds",
|
|
597
|
+
"type": "event"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"anonymous": false,
|
|
601
|
+
"inputs": [
|
|
602
|
+
{
|
|
603
|
+
"indexed": false,
|
|
604
|
+
"name": "_user",
|
|
605
|
+
"type": "address"
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"name": "AddedBlackList",
|
|
609
|
+
"type": "event"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"anonymous": false,
|
|
613
|
+
"inputs": [
|
|
614
|
+
{
|
|
615
|
+
"indexed": false,
|
|
616
|
+
"name": "_user",
|
|
617
|
+
"type": "address"
|
|
618
|
+
}
|
|
619
|
+
],
|
|
620
|
+
"name": "RemovedBlackList",
|
|
621
|
+
"type": "event"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"anonymous": false,
|
|
625
|
+
"inputs": [
|
|
626
|
+
{
|
|
627
|
+
"indexed": true,
|
|
628
|
+
"name": "owner",
|
|
629
|
+
"type": "address"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"indexed": true,
|
|
633
|
+
"name": "spender",
|
|
634
|
+
"type": "address"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"indexed": false,
|
|
638
|
+
"name": "value",
|
|
639
|
+
"type": "uint256"
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"name": "Approval",
|
|
643
|
+
"type": "event"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"anonymous": false,
|
|
647
|
+
"inputs": [
|
|
648
|
+
{
|
|
649
|
+
"indexed": true,
|
|
650
|
+
"name": "from",
|
|
651
|
+
"type": "address"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"indexed": true,
|
|
655
|
+
"name": "to",
|
|
656
|
+
"type": "address"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"indexed": false,
|
|
660
|
+
"name": "value",
|
|
661
|
+
"type": "uint256"
|
|
662
|
+
}
|
|
663
|
+
],
|
|
664
|
+
"name": "Transfer",
|
|
665
|
+
"type": "event"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"anonymous": false,
|
|
669
|
+
"inputs": [],
|
|
670
|
+
"name": "Pause",
|
|
671
|
+
"type": "event"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"anonymous": false,
|
|
675
|
+
"inputs": [],
|
|
676
|
+
"name": "Unpause",
|
|
677
|
+
"type": "event"
|
|
678
|
+
}
|
|
679
|
+
] as const satisfies Abi;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Type-safe ABI for TetherToken
|
|
683
|
+
*/
|
|
684
|
+
export type TetherTokenAbi = typeof TetherTokenAbi;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Contract instance type for TetherToken
|
|
688
|
+
*/
|
|
689
|
+
// Use any for contract type to avoid complex viem type issues
|
|
690
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
691
|
+
export type TetherTokenContract = any;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* TetherToken Contract Class
|
|
695
|
+
*
|
|
696
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* ```typescript
|
|
700
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
701
|
+
* import { mainnet } from 'viem/chains';
|
|
702
|
+
* import { TetherToken } from 'TetherToken';
|
|
703
|
+
*
|
|
704
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
705
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
706
|
+
*
|
|
707
|
+
* const contract = new TetherToken('0x...', { publicClient, walletClient });
|
|
708
|
+
*
|
|
709
|
+
* // Read functions
|
|
710
|
+
* const result = await contract.balanceOf('0x...');
|
|
711
|
+
*
|
|
712
|
+
* // Write functions
|
|
713
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
714
|
+
*
|
|
715
|
+
* // Simulate transactions (dry-run)
|
|
716
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
717
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
718
|
+
*
|
|
719
|
+
* // Watch events
|
|
720
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
721
|
+
* console.log('Transfer event:', event);
|
|
722
|
+
* });
|
|
723
|
+
* ```
|
|
724
|
+
*/
|
|
725
|
+
export class TetherToken {
|
|
726
|
+
private contract: TetherTokenContract;
|
|
727
|
+
private contractAddress: Address;
|
|
728
|
+
private publicClient: PublicClient;
|
|
729
|
+
|
|
730
|
+
constructor(
|
|
731
|
+
address: Address,
|
|
732
|
+
clients: {
|
|
733
|
+
publicClient: PublicClient;
|
|
734
|
+
walletClient?: WalletClient;
|
|
735
|
+
}
|
|
736
|
+
) {
|
|
737
|
+
this.contractAddress = address;
|
|
738
|
+
this.publicClient = clients.publicClient;
|
|
739
|
+
this.contract = getContract({
|
|
740
|
+
address,
|
|
741
|
+
abi: TetherTokenAbi,
|
|
742
|
+
client: {
|
|
743
|
+
public: clients.publicClient,
|
|
744
|
+
wallet: clients.walletClient,
|
|
745
|
+
},
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Get the contract address
|
|
751
|
+
*/
|
|
752
|
+
get address(): Address {
|
|
753
|
+
return this.contractAddress;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Get the underlying viem contract instance.
|
|
758
|
+
*/
|
|
759
|
+
getContract(): TetherTokenContract {
|
|
760
|
+
return this.contract;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* name
|
|
765
|
+
* view
|
|
766
|
+
*/
|
|
767
|
+
async name(): Promise<string> {
|
|
768
|
+
return this.contract.read.name() as Promise<string>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* deprecated
|
|
773
|
+
* view
|
|
774
|
+
*/
|
|
775
|
+
async deprecated(): Promise<boolean> {
|
|
776
|
+
return this.contract.read.deprecated() as Promise<boolean>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* totalSupply
|
|
781
|
+
* view
|
|
782
|
+
*/
|
|
783
|
+
async totalSupply(): Promise<bigint> {
|
|
784
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* upgradedAddress
|
|
789
|
+
* view
|
|
790
|
+
*/
|
|
791
|
+
async upgradedAddress(): Promise<`0x${string}`> {
|
|
792
|
+
return this.contract.read.upgradedAddress() as Promise<`0x${string}`>;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* balances
|
|
797
|
+
* view
|
|
798
|
+
*/
|
|
799
|
+
async balances(arg0: `0x${string}`): Promise<bigint> {
|
|
800
|
+
return this.contract.read.balances([arg0] as const) as Promise<bigint>;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* decimals
|
|
805
|
+
* view
|
|
806
|
+
*/
|
|
807
|
+
async decimals(): Promise<bigint> {
|
|
808
|
+
return this.contract.read.decimals() as Promise<bigint>;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* maximumFee
|
|
813
|
+
* view
|
|
814
|
+
*/
|
|
815
|
+
async maximumFee(): Promise<bigint> {
|
|
816
|
+
return this.contract.read.maximumFee() as Promise<bigint>;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* _totalSupply
|
|
821
|
+
* view
|
|
822
|
+
*/
|
|
823
|
+
async _totalSupply(): Promise<bigint> {
|
|
824
|
+
return this.contract.read._totalSupply() as Promise<bigint>;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* getBlackListStatus
|
|
829
|
+
* view
|
|
830
|
+
*/
|
|
831
|
+
async getBlackListStatus(_maker: `0x${string}`): Promise<boolean> {
|
|
832
|
+
return this.contract.read.getBlackListStatus([_maker] as const) as Promise<boolean>;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* allowed
|
|
837
|
+
* view
|
|
838
|
+
*/
|
|
839
|
+
async allowed(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
|
|
840
|
+
return this.contract.read.allowed([arg0, arg1] as const) as Promise<bigint>;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* paused
|
|
845
|
+
* view
|
|
846
|
+
*/
|
|
847
|
+
async paused(): Promise<boolean> {
|
|
848
|
+
return this.contract.read.paused() as Promise<boolean>;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* balanceOf
|
|
853
|
+
* view
|
|
854
|
+
*/
|
|
855
|
+
async balanceOf(who: `0x${string}`): Promise<bigint> {
|
|
856
|
+
return this.contract.read.balanceOf([who] as const) as Promise<bigint>;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* getOwner
|
|
861
|
+
* view
|
|
862
|
+
*/
|
|
863
|
+
async getOwner(): Promise<`0x${string}`> {
|
|
864
|
+
return this.contract.read.getOwner() as Promise<`0x${string}`>;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* owner
|
|
869
|
+
* view
|
|
870
|
+
*/
|
|
871
|
+
async owner(): Promise<`0x${string}`> {
|
|
872
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* symbol
|
|
877
|
+
* view
|
|
878
|
+
*/
|
|
879
|
+
async symbol(): Promise<string> {
|
|
880
|
+
return this.contract.read.symbol() as Promise<string>;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* allowance
|
|
885
|
+
* view
|
|
886
|
+
*/
|
|
887
|
+
async allowance(_owner: `0x${string}`, _spender: `0x${string}`): Promise<bigint> {
|
|
888
|
+
return this.contract.read.allowance([_owner, _spender] as const) as Promise<bigint>;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* basisPointsRate
|
|
893
|
+
* view
|
|
894
|
+
*/
|
|
895
|
+
async basisPointsRate(): Promise<bigint> {
|
|
896
|
+
return this.contract.read.basisPointsRate() as Promise<bigint>;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* isBlackListed
|
|
901
|
+
* view
|
|
902
|
+
*/
|
|
903
|
+
async isBlackListed(arg0: `0x${string}`): Promise<boolean> {
|
|
904
|
+
return this.contract.read.isBlackListed([arg0] as const) as Promise<boolean>;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* MAX_UINT
|
|
909
|
+
* view
|
|
910
|
+
*/
|
|
911
|
+
async MAX_UINT(): Promise<bigint> {
|
|
912
|
+
return this.contract.read.MAX_UINT() as Promise<bigint>;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* deprecate
|
|
917
|
+
* nonpayable
|
|
918
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
919
|
+
*/
|
|
920
|
+
async deprecate(_upgradedAddress: `0x${string}`, options?: {
|
|
921
|
+
accessList?: import('viem').AccessList;
|
|
922
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
923
|
+
chain?: import('viem').Chain | null;
|
|
924
|
+
dataSuffix?: `0x${string}`;
|
|
925
|
+
gas?: bigint;
|
|
926
|
+
gasPrice?: bigint;
|
|
927
|
+
maxFeePerGas?: bigint;
|
|
928
|
+
maxPriorityFeePerGas?: bigint;
|
|
929
|
+
nonce?: number;
|
|
930
|
+
value?: bigint;
|
|
931
|
+
}): Promise<`0x${string}`> {
|
|
932
|
+
if (!this.contract.write) {
|
|
933
|
+
throw new Error('Wallet client is required for write operations');
|
|
934
|
+
}
|
|
935
|
+
return this.contract.write.deprecate([_upgradedAddress] as const, options) as Promise<`0x${string}`>;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* approve
|
|
940
|
+
* nonpayable
|
|
941
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
942
|
+
*/
|
|
943
|
+
async approve(_spender: `0x${string}`, _value: bigint, options?: {
|
|
944
|
+
accessList?: import('viem').AccessList;
|
|
945
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
946
|
+
chain?: import('viem').Chain | null;
|
|
947
|
+
dataSuffix?: `0x${string}`;
|
|
948
|
+
gas?: bigint;
|
|
949
|
+
gasPrice?: bigint;
|
|
950
|
+
maxFeePerGas?: bigint;
|
|
951
|
+
maxPriorityFeePerGas?: bigint;
|
|
952
|
+
nonce?: number;
|
|
953
|
+
value?: bigint;
|
|
954
|
+
}): Promise<`0x${string}`> {
|
|
955
|
+
if (!this.contract.write) {
|
|
956
|
+
throw new Error('Wallet client is required for write operations');
|
|
957
|
+
}
|
|
958
|
+
return this.contract.write.approve([_spender, _value] as const, options) as Promise<`0x${string}`>;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* addBlackList
|
|
963
|
+
* nonpayable
|
|
964
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
965
|
+
*/
|
|
966
|
+
async addBlackList(_evilUser: `0x${string}`, options?: {
|
|
967
|
+
accessList?: import('viem').AccessList;
|
|
968
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
969
|
+
chain?: import('viem').Chain | null;
|
|
970
|
+
dataSuffix?: `0x${string}`;
|
|
971
|
+
gas?: bigint;
|
|
972
|
+
gasPrice?: bigint;
|
|
973
|
+
maxFeePerGas?: bigint;
|
|
974
|
+
maxPriorityFeePerGas?: bigint;
|
|
975
|
+
nonce?: number;
|
|
976
|
+
value?: bigint;
|
|
977
|
+
}): Promise<`0x${string}`> {
|
|
978
|
+
if (!this.contract.write) {
|
|
979
|
+
throw new Error('Wallet client is required for write operations');
|
|
980
|
+
}
|
|
981
|
+
return this.contract.write.addBlackList([_evilUser] as const, options) as Promise<`0x${string}`>;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* transferFrom
|
|
986
|
+
* nonpayable
|
|
987
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
988
|
+
*/
|
|
989
|
+
async transferFrom(_from: `0x${string}`, _to: `0x${string}`, _value: bigint, options?: {
|
|
990
|
+
accessList?: import('viem').AccessList;
|
|
991
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
992
|
+
chain?: import('viem').Chain | null;
|
|
993
|
+
dataSuffix?: `0x${string}`;
|
|
994
|
+
gas?: bigint;
|
|
995
|
+
gasPrice?: bigint;
|
|
996
|
+
maxFeePerGas?: bigint;
|
|
997
|
+
maxPriorityFeePerGas?: bigint;
|
|
998
|
+
nonce?: number;
|
|
999
|
+
value?: bigint;
|
|
1000
|
+
}): Promise<`0x${string}`> {
|
|
1001
|
+
if (!this.contract.write) {
|
|
1002
|
+
throw new Error('Wallet client is required for write operations');
|
|
1003
|
+
}
|
|
1004
|
+
return this.contract.write.transferFrom([_from, _to, _value] as const, options) as Promise<`0x${string}`>;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* unpause
|
|
1009
|
+
* nonpayable
|
|
1010
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1011
|
+
*/
|
|
1012
|
+
async unpause(options?: {
|
|
1013
|
+
accessList?: import('viem').AccessList;
|
|
1014
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1015
|
+
chain?: import('viem').Chain | null;
|
|
1016
|
+
dataSuffix?: `0x${string}`;
|
|
1017
|
+
gas?: bigint;
|
|
1018
|
+
gasPrice?: bigint;
|
|
1019
|
+
maxFeePerGas?: bigint;
|
|
1020
|
+
maxPriorityFeePerGas?: bigint;
|
|
1021
|
+
nonce?: number;
|
|
1022
|
+
value?: bigint;
|
|
1023
|
+
}): Promise<`0x${string}`> {
|
|
1024
|
+
if (!this.contract.write) {
|
|
1025
|
+
throw new Error('Wallet client is required for write operations');
|
|
1026
|
+
}
|
|
1027
|
+
return this.contract.write.unpause(options) as Promise<`0x${string}`>;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* pause
|
|
1032
|
+
* nonpayable
|
|
1033
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1034
|
+
*/
|
|
1035
|
+
async pause(options?: {
|
|
1036
|
+
accessList?: import('viem').AccessList;
|
|
1037
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1038
|
+
chain?: import('viem').Chain | null;
|
|
1039
|
+
dataSuffix?: `0x${string}`;
|
|
1040
|
+
gas?: bigint;
|
|
1041
|
+
gasPrice?: bigint;
|
|
1042
|
+
maxFeePerGas?: bigint;
|
|
1043
|
+
maxPriorityFeePerGas?: bigint;
|
|
1044
|
+
nonce?: number;
|
|
1045
|
+
value?: bigint;
|
|
1046
|
+
}): Promise<`0x${string}`> {
|
|
1047
|
+
if (!this.contract.write) {
|
|
1048
|
+
throw new Error('Wallet client is required for write operations');
|
|
1049
|
+
}
|
|
1050
|
+
return this.contract.write.pause(options) as Promise<`0x${string}`>;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* transfer
|
|
1055
|
+
* nonpayable
|
|
1056
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1057
|
+
*/
|
|
1058
|
+
async transfer(_to: `0x${string}`, _value: bigint, options?: {
|
|
1059
|
+
accessList?: import('viem').AccessList;
|
|
1060
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1061
|
+
chain?: import('viem').Chain | null;
|
|
1062
|
+
dataSuffix?: `0x${string}`;
|
|
1063
|
+
gas?: bigint;
|
|
1064
|
+
gasPrice?: bigint;
|
|
1065
|
+
maxFeePerGas?: bigint;
|
|
1066
|
+
maxPriorityFeePerGas?: bigint;
|
|
1067
|
+
nonce?: number;
|
|
1068
|
+
value?: bigint;
|
|
1069
|
+
}): Promise<`0x${string}`> {
|
|
1070
|
+
if (!this.contract.write) {
|
|
1071
|
+
throw new Error('Wallet client is required for write operations');
|
|
1072
|
+
}
|
|
1073
|
+
return this.contract.write.transfer([_to, _value] as const, options) as Promise<`0x${string}`>;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* setParams
|
|
1078
|
+
* nonpayable
|
|
1079
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1080
|
+
*/
|
|
1081
|
+
async setParams(newBasisPoints: bigint, newMaxFee: bigint, options?: {
|
|
1082
|
+
accessList?: import('viem').AccessList;
|
|
1083
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1084
|
+
chain?: import('viem').Chain | null;
|
|
1085
|
+
dataSuffix?: `0x${string}`;
|
|
1086
|
+
gas?: bigint;
|
|
1087
|
+
gasPrice?: bigint;
|
|
1088
|
+
maxFeePerGas?: bigint;
|
|
1089
|
+
maxPriorityFeePerGas?: bigint;
|
|
1090
|
+
nonce?: number;
|
|
1091
|
+
value?: bigint;
|
|
1092
|
+
}): Promise<`0x${string}`> {
|
|
1093
|
+
if (!this.contract.write) {
|
|
1094
|
+
throw new Error('Wallet client is required for write operations');
|
|
1095
|
+
}
|
|
1096
|
+
return this.contract.write.setParams([newBasisPoints, newMaxFee] as const, options) as Promise<`0x${string}`>;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* issue
|
|
1101
|
+
* nonpayable
|
|
1102
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1103
|
+
*/
|
|
1104
|
+
async issue(amount: bigint, options?: {
|
|
1105
|
+
accessList?: import('viem').AccessList;
|
|
1106
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1107
|
+
chain?: import('viem').Chain | null;
|
|
1108
|
+
dataSuffix?: `0x${string}`;
|
|
1109
|
+
gas?: bigint;
|
|
1110
|
+
gasPrice?: bigint;
|
|
1111
|
+
maxFeePerGas?: bigint;
|
|
1112
|
+
maxPriorityFeePerGas?: bigint;
|
|
1113
|
+
nonce?: number;
|
|
1114
|
+
value?: bigint;
|
|
1115
|
+
}): Promise<`0x${string}`> {
|
|
1116
|
+
if (!this.contract.write) {
|
|
1117
|
+
throw new Error('Wallet client is required for write operations');
|
|
1118
|
+
}
|
|
1119
|
+
return this.contract.write.issue([amount] as const, options) as Promise<`0x${string}`>;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* redeem
|
|
1124
|
+
* nonpayable
|
|
1125
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1126
|
+
*/
|
|
1127
|
+
async redeem(amount: bigint, options?: {
|
|
1128
|
+
accessList?: import('viem').AccessList;
|
|
1129
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1130
|
+
chain?: import('viem').Chain | null;
|
|
1131
|
+
dataSuffix?: `0x${string}`;
|
|
1132
|
+
gas?: bigint;
|
|
1133
|
+
gasPrice?: bigint;
|
|
1134
|
+
maxFeePerGas?: bigint;
|
|
1135
|
+
maxPriorityFeePerGas?: bigint;
|
|
1136
|
+
nonce?: number;
|
|
1137
|
+
value?: bigint;
|
|
1138
|
+
}): Promise<`0x${string}`> {
|
|
1139
|
+
if (!this.contract.write) {
|
|
1140
|
+
throw new Error('Wallet client is required for write operations');
|
|
1141
|
+
}
|
|
1142
|
+
return this.contract.write.redeem([amount] as const, options) as Promise<`0x${string}`>;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* removeBlackList
|
|
1147
|
+
* nonpayable
|
|
1148
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1149
|
+
*/
|
|
1150
|
+
async removeBlackList(_clearedUser: `0x${string}`, options?: {
|
|
1151
|
+
accessList?: import('viem').AccessList;
|
|
1152
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1153
|
+
chain?: import('viem').Chain | null;
|
|
1154
|
+
dataSuffix?: `0x${string}`;
|
|
1155
|
+
gas?: bigint;
|
|
1156
|
+
gasPrice?: bigint;
|
|
1157
|
+
maxFeePerGas?: bigint;
|
|
1158
|
+
maxPriorityFeePerGas?: bigint;
|
|
1159
|
+
nonce?: number;
|
|
1160
|
+
value?: bigint;
|
|
1161
|
+
}): Promise<`0x${string}`> {
|
|
1162
|
+
if (!this.contract.write) {
|
|
1163
|
+
throw new Error('Wallet client is required for write operations');
|
|
1164
|
+
}
|
|
1165
|
+
return this.contract.write.removeBlackList([_clearedUser] as const, options) as Promise<`0x${string}`>;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* transferOwnership
|
|
1170
|
+
* nonpayable
|
|
1171
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1172
|
+
*/
|
|
1173
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1174
|
+
accessList?: import('viem').AccessList;
|
|
1175
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1176
|
+
chain?: import('viem').Chain | null;
|
|
1177
|
+
dataSuffix?: `0x${string}`;
|
|
1178
|
+
gas?: bigint;
|
|
1179
|
+
gasPrice?: bigint;
|
|
1180
|
+
maxFeePerGas?: bigint;
|
|
1181
|
+
maxPriorityFeePerGas?: bigint;
|
|
1182
|
+
nonce?: number;
|
|
1183
|
+
value?: bigint;
|
|
1184
|
+
}): Promise<`0x${string}`> {
|
|
1185
|
+
if (!this.contract.write) {
|
|
1186
|
+
throw new Error('Wallet client is required for write operations');
|
|
1187
|
+
}
|
|
1188
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* destroyBlackFunds
|
|
1193
|
+
* nonpayable
|
|
1194
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1195
|
+
*/
|
|
1196
|
+
async destroyBlackFunds(_blackListedUser: `0x${string}`, options?: {
|
|
1197
|
+
accessList?: import('viem').AccessList;
|
|
1198
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1199
|
+
chain?: import('viem').Chain | null;
|
|
1200
|
+
dataSuffix?: `0x${string}`;
|
|
1201
|
+
gas?: bigint;
|
|
1202
|
+
gasPrice?: bigint;
|
|
1203
|
+
maxFeePerGas?: bigint;
|
|
1204
|
+
maxPriorityFeePerGas?: bigint;
|
|
1205
|
+
nonce?: number;
|
|
1206
|
+
value?: bigint;
|
|
1207
|
+
}): Promise<`0x${string}`> {
|
|
1208
|
+
if (!this.contract.write) {
|
|
1209
|
+
throw new Error('Wallet client is required for write operations');
|
|
1210
|
+
}
|
|
1211
|
+
return this.contract.write.destroyBlackFunds([_blackListedUser] as const, options) as Promise<`0x${string}`>;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1218
|
+
*
|
|
1219
|
+
* @example
|
|
1220
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1221
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1222
|
+
* console.log('Would succeed:', result.result);
|
|
1223
|
+
*/
|
|
1224
|
+
get simulate() {
|
|
1225
|
+
const contract = this.contract;
|
|
1226
|
+
if (!contract.simulate) {
|
|
1227
|
+
throw new Error('Public client is required for simulation');
|
|
1228
|
+
}
|
|
1229
|
+
return {
|
|
1230
|
+
/**
|
|
1231
|
+
* Simulate deprecate
|
|
1232
|
+
* Returns gas estimate and result without sending transaction
|
|
1233
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1234
|
+
*/
|
|
1235
|
+
async deprecate(_upgradedAddress: `0x${string}`, options?: {
|
|
1236
|
+
accessList?: import('viem').AccessList;
|
|
1237
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1238
|
+
chain?: import('viem').Chain | null;
|
|
1239
|
+
dataSuffix?: `0x${string}`;
|
|
1240
|
+
gas?: bigint;
|
|
1241
|
+
gasPrice?: bigint;
|
|
1242
|
+
maxFeePerGas?: bigint;
|
|
1243
|
+
maxPriorityFeePerGas?: bigint;
|
|
1244
|
+
nonce?: number;
|
|
1245
|
+
value?: bigint;
|
|
1246
|
+
}): Promise<void> {
|
|
1247
|
+
return contract.simulate.deprecate([_upgradedAddress] as const, options) as Promise<void>;
|
|
1248
|
+
},
|
|
1249
|
+
/**
|
|
1250
|
+
* Simulate approve
|
|
1251
|
+
* Returns gas estimate and result without sending transaction
|
|
1252
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1253
|
+
*/
|
|
1254
|
+
async approve(_spender: `0x${string}`, _value: bigint, options?: {
|
|
1255
|
+
accessList?: import('viem').AccessList;
|
|
1256
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1257
|
+
chain?: import('viem').Chain | null;
|
|
1258
|
+
dataSuffix?: `0x${string}`;
|
|
1259
|
+
gas?: bigint;
|
|
1260
|
+
gasPrice?: bigint;
|
|
1261
|
+
maxFeePerGas?: bigint;
|
|
1262
|
+
maxPriorityFeePerGas?: bigint;
|
|
1263
|
+
nonce?: number;
|
|
1264
|
+
value?: bigint;
|
|
1265
|
+
}): Promise<void> {
|
|
1266
|
+
return contract.simulate.approve([_spender, _value] as const, options) as Promise<void>;
|
|
1267
|
+
},
|
|
1268
|
+
/**
|
|
1269
|
+
* Simulate addBlackList
|
|
1270
|
+
* Returns gas estimate and result without sending transaction
|
|
1271
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1272
|
+
*/
|
|
1273
|
+
async addBlackList(_evilUser: `0x${string}`, options?: {
|
|
1274
|
+
accessList?: import('viem').AccessList;
|
|
1275
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1276
|
+
chain?: import('viem').Chain | null;
|
|
1277
|
+
dataSuffix?: `0x${string}`;
|
|
1278
|
+
gas?: bigint;
|
|
1279
|
+
gasPrice?: bigint;
|
|
1280
|
+
maxFeePerGas?: bigint;
|
|
1281
|
+
maxPriorityFeePerGas?: bigint;
|
|
1282
|
+
nonce?: number;
|
|
1283
|
+
value?: bigint;
|
|
1284
|
+
}): Promise<void> {
|
|
1285
|
+
return contract.simulate.addBlackList([_evilUser] as const, options) as Promise<void>;
|
|
1286
|
+
},
|
|
1287
|
+
/**
|
|
1288
|
+
* Simulate transferFrom
|
|
1289
|
+
* Returns gas estimate and result without sending transaction
|
|
1290
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1291
|
+
*/
|
|
1292
|
+
async transferFrom(_from: `0x${string}`, _to: `0x${string}`, _value: bigint, options?: {
|
|
1293
|
+
accessList?: import('viem').AccessList;
|
|
1294
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1295
|
+
chain?: import('viem').Chain | null;
|
|
1296
|
+
dataSuffix?: `0x${string}`;
|
|
1297
|
+
gas?: bigint;
|
|
1298
|
+
gasPrice?: bigint;
|
|
1299
|
+
maxFeePerGas?: bigint;
|
|
1300
|
+
maxPriorityFeePerGas?: bigint;
|
|
1301
|
+
nonce?: number;
|
|
1302
|
+
value?: bigint;
|
|
1303
|
+
}): Promise<void> {
|
|
1304
|
+
return contract.simulate.transferFrom([_from, _to, _value] as const, options) as Promise<void>;
|
|
1305
|
+
},
|
|
1306
|
+
/**
|
|
1307
|
+
* Simulate unpause
|
|
1308
|
+
* Returns gas estimate and result without sending transaction
|
|
1309
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1310
|
+
*/
|
|
1311
|
+
async unpause(options?: {
|
|
1312
|
+
accessList?: import('viem').AccessList;
|
|
1313
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1314
|
+
chain?: import('viem').Chain | null;
|
|
1315
|
+
dataSuffix?: `0x${string}`;
|
|
1316
|
+
gas?: bigint;
|
|
1317
|
+
gasPrice?: bigint;
|
|
1318
|
+
maxFeePerGas?: bigint;
|
|
1319
|
+
maxPriorityFeePerGas?: bigint;
|
|
1320
|
+
nonce?: number;
|
|
1321
|
+
value?: bigint;
|
|
1322
|
+
}): Promise<void> {
|
|
1323
|
+
return contract.simulate.unpause(options) as Promise<void>;
|
|
1324
|
+
},
|
|
1325
|
+
/**
|
|
1326
|
+
* Simulate pause
|
|
1327
|
+
* Returns gas estimate and result without sending transaction
|
|
1328
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1329
|
+
*/
|
|
1330
|
+
async pause(options?: {
|
|
1331
|
+
accessList?: import('viem').AccessList;
|
|
1332
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1333
|
+
chain?: import('viem').Chain | null;
|
|
1334
|
+
dataSuffix?: `0x${string}`;
|
|
1335
|
+
gas?: bigint;
|
|
1336
|
+
gasPrice?: bigint;
|
|
1337
|
+
maxFeePerGas?: bigint;
|
|
1338
|
+
maxPriorityFeePerGas?: bigint;
|
|
1339
|
+
nonce?: number;
|
|
1340
|
+
value?: bigint;
|
|
1341
|
+
}): Promise<void> {
|
|
1342
|
+
return contract.simulate.pause(options) as Promise<void>;
|
|
1343
|
+
},
|
|
1344
|
+
/**
|
|
1345
|
+
* Simulate transfer
|
|
1346
|
+
* Returns gas estimate and result without sending transaction
|
|
1347
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1348
|
+
*/
|
|
1349
|
+
async transfer(_to: `0x${string}`, _value: bigint, options?: {
|
|
1350
|
+
accessList?: import('viem').AccessList;
|
|
1351
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1352
|
+
chain?: import('viem').Chain | null;
|
|
1353
|
+
dataSuffix?: `0x${string}`;
|
|
1354
|
+
gas?: bigint;
|
|
1355
|
+
gasPrice?: bigint;
|
|
1356
|
+
maxFeePerGas?: bigint;
|
|
1357
|
+
maxPriorityFeePerGas?: bigint;
|
|
1358
|
+
nonce?: number;
|
|
1359
|
+
value?: bigint;
|
|
1360
|
+
}): Promise<void> {
|
|
1361
|
+
return contract.simulate.transfer([_to, _value] as const, options) as Promise<void>;
|
|
1362
|
+
},
|
|
1363
|
+
/**
|
|
1364
|
+
* Simulate setParams
|
|
1365
|
+
* Returns gas estimate and result without sending transaction
|
|
1366
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1367
|
+
*/
|
|
1368
|
+
async setParams(newBasisPoints: bigint, newMaxFee: bigint, options?: {
|
|
1369
|
+
accessList?: import('viem').AccessList;
|
|
1370
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1371
|
+
chain?: import('viem').Chain | null;
|
|
1372
|
+
dataSuffix?: `0x${string}`;
|
|
1373
|
+
gas?: bigint;
|
|
1374
|
+
gasPrice?: bigint;
|
|
1375
|
+
maxFeePerGas?: bigint;
|
|
1376
|
+
maxPriorityFeePerGas?: bigint;
|
|
1377
|
+
nonce?: number;
|
|
1378
|
+
value?: bigint;
|
|
1379
|
+
}): Promise<void> {
|
|
1380
|
+
return contract.simulate.setParams([newBasisPoints, newMaxFee] as const, options) as Promise<void>;
|
|
1381
|
+
},
|
|
1382
|
+
/**
|
|
1383
|
+
* Simulate issue
|
|
1384
|
+
* Returns gas estimate and result without sending transaction
|
|
1385
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1386
|
+
*/
|
|
1387
|
+
async issue(amount: bigint, options?: {
|
|
1388
|
+
accessList?: import('viem').AccessList;
|
|
1389
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1390
|
+
chain?: import('viem').Chain | null;
|
|
1391
|
+
dataSuffix?: `0x${string}`;
|
|
1392
|
+
gas?: bigint;
|
|
1393
|
+
gasPrice?: bigint;
|
|
1394
|
+
maxFeePerGas?: bigint;
|
|
1395
|
+
maxPriorityFeePerGas?: bigint;
|
|
1396
|
+
nonce?: number;
|
|
1397
|
+
value?: bigint;
|
|
1398
|
+
}): Promise<void> {
|
|
1399
|
+
return contract.simulate.issue([amount] as const, options) as Promise<void>;
|
|
1400
|
+
},
|
|
1401
|
+
/**
|
|
1402
|
+
* Simulate redeem
|
|
1403
|
+
* Returns gas estimate and result without sending transaction
|
|
1404
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1405
|
+
*/
|
|
1406
|
+
async redeem(amount: bigint, options?: {
|
|
1407
|
+
accessList?: import('viem').AccessList;
|
|
1408
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1409
|
+
chain?: import('viem').Chain | null;
|
|
1410
|
+
dataSuffix?: `0x${string}`;
|
|
1411
|
+
gas?: bigint;
|
|
1412
|
+
gasPrice?: bigint;
|
|
1413
|
+
maxFeePerGas?: bigint;
|
|
1414
|
+
maxPriorityFeePerGas?: bigint;
|
|
1415
|
+
nonce?: number;
|
|
1416
|
+
value?: bigint;
|
|
1417
|
+
}): Promise<void> {
|
|
1418
|
+
return contract.simulate.redeem([amount] as const, options) as Promise<void>;
|
|
1419
|
+
},
|
|
1420
|
+
/**
|
|
1421
|
+
* Simulate removeBlackList
|
|
1422
|
+
* Returns gas estimate and result without sending transaction
|
|
1423
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1424
|
+
*/
|
|
1425
|
+
async removeBlackList(_clearedUser: `0x${string}`, options?: {
|
|
1426
|
+
accessList?: import('viem').AccessList;
|
|
1427
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1428
|
+
chain?: import('viem').Chain | null;
|
|
1429
|
+
dataSuffix?: `0x${string}`;
|
|
1430
|
+
gas?: bigint;
|
|
1431
|
+
gasPrice?: bigint;
|
|
1432
|
+
maxFeePerGas?: bigint;
|
|
1433
|
+
maxPriorityFeePerGas?: bigint;
|
|
1434
|
+
nonce?: number;
|
|
1435
|
+
value?: bigint;
|
|
1436
|
+
}): Promise<void> {
|
|
1437
|
+
return contract.simulate.removeBlackList([_clearedUser] as const, options) as Promise<void>;
|
|
1438
|
+
},
|
|
1439
|
+
/**
|
|
1440
|
+
* Simulate transferOwnership
|
|
1441
|
+
* Returns gas estimate and result without sending transaction
|
|
1442
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1443
|
+
*/
|
|
1444
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1445
|
+
accessList?: import('viem').AccessList;
|
|
1446
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1447
|
+
chain?: import('viem').Chain | null;
|
|
1448
|
+
dataSuffix?: `0x${string}`;
|
|
1449
|
+
gas?: bigint;
|
|
1450
|
+
gasPrice?: bigint;
|
|
1451
|
+
maxFeePerGas?: bigint;
|
|
1452
|
+
maxPriorityFeePerGas?: bigint;
|
|
1453
|
+
nonce?: number;
|
|
1454
|
+
value?: bigint;
|
|
1455
|
+
}): Promise<void> {
|
|
1456
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
1457
|
+
},
|
|
1458
|
+
/**
|
|
1459
|
+
* Simulate destroyBlackFunds
|
|
1460
|
+
* Returns gas estimate and result without sending transaction
|
|
1461
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1462
|
+
*/
|
|
1463
|
+
async destroyBlackFunds(_blackListedUser: `0x${string}`, options?: {
|
|
1464
|
+
accessList?: import('viem').AccessList;
|
|
1465
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1466
|
+
chain?: import('viem').Chain | null;
|
|
1467
|
+
dataSuffix?: `0x${string}`;
|
|
1468
|
+
gas?: bigint;
|
|
1469
|
+
gasPrice?: bigint;
|
|
1470
|
+
maxFeePerGas?: bigint;
|
|
1471
|
+
maxPriorityFeePerGas?: bigint;
|
|
1472
|
+
nonce?: number;
|
|
1473
|
+
value?: bigint;
|
|
1474
|
+
}): Promise<void> {
|
|
1475
|
+
return contract.simulate.destroyBlackFunds([_blackListedUser] as const, options) as Promise<void>;
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Watch contract events
|
|
1482
|
+
*
|
|
1483
|
+
* @example
|
|
1484
|
+
* // Watch all Transfer events
|
|
1485
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1486
|
+
* console.log('Transfer:', event);
|
|
1487
|
+
* });
|
|
1488
|
+
*
|
|
1489
|
+
* // Stop watching
|
|
1490
|
+
* unwatch();
|
|
1491
|
+
*/
|
|
1492
|
+
get watch() {
|
|
1493
|
+
return {
|
|
1494
|
+
/**
|
|
1495
|
+
* Watch Issue events
|
|
1496
|
+
* @param callback Function to call when event is emitted
|
|
1497
|
+
* @param filter Optional filter for indexed parameters
|
|
1498
|
+
* @returns Unwatch function to stop listening
|
|
1499
|
+
*/
|
|
1500
|
+
Issue: (callback: (event: { amount: bigint }) => void) => {
|
|
1501
|
+
return this.publicClient.watchContractEvent({
|
|
1502
|
+
address: this.contractAddress,
|
|
1503
|
+
abi: TetherTokenAbi,
|
|
1504
|
+
eventName: 'Issue',
|
|
1505
|
+
|
|
1506
|
+
onLogs: (logs: any[]) => {
|
|
1507
|
+
logs.forEach((log: any) => {
|
|
1508
|
+
callback(log.args as any);
|
|
1509
|
+
});
|
|
1510
|
+
},
|
|
1511
|
+
}) as () => void;
|
|
1512
|
+
},
|
|
1513
|
+
/**
|
|
1514
|
+
* Watch Redeem events
|
|
1515
|
+
* @param callback Function to call when event is emitted
|
|
1516
|
+
* @param filter Optional filter for indexed parameters
|
|
1517
|
+
* @returns Unwatch function to stop listening
|
|
1518
|
+
*/
|
|
1519
|
+
Redeem: (callback: (event: { amount: bigint }) => void) => {
|
|
1520
|
+
return this.publicClient.watchContractEvent({
|
|
1521
|
+
address: this.contractAddress,
|
|
1522
|
+
abi: TetherTokenAbi,
|
|
1523
|
+
eventName: 'Redeem',
|
|
1524
|
+
|
|
1525
|
+
onLogs: (logs: any[]) => {
|
|
1526
|
+
logs.forEach((log: any) => {
|
|
1527
|
+
callback(log.args as any);
|
|
1528
|
+
});
|
|
1529
|
+
},
|
|
1530
|
+
}) as () => void;
|
|
1531
|
+
},
|
|
1532
|
+
/**
|
|
1533
|
+
* Watch Deprecate events
|
|
1534
|
+
* @param callback Function to call when event is emitted
|
|
1535
|
+
* @param filter Optional filter for indexed parameters
|
|
1536
|
+
* @returns Unwatch function to stop listening
|
|
1537
|
+
*/
|
|
1538
|
+
Deprecate: (callback: (event: { newAddress: `0x${string}` }) => void) => {
|
|
1539
|
+
return this.publicClient.watchContractEvent({
|
|
1540
|
+
address: this.contractAddress,
|
|
1541
|
+
abi: TetherTokenAbi,
|
|
1542
|
+
eventName: 'Deprecate',
|
|
1543
|
+
|
|
1544
|
+
onLogs: (logs: any[]) => {
|
|
1545
|
+
logs.forEach((log: any) => {
|
|
1546
|
+
callback(log.args as any);
|
|
1547
|
+
});
|
|
1548
|
+
},
|
|
1549
|
+
}) as () => void;
|
|
1550
|
+
},
|
|
1551
|
+
/**
|
|
1552
|
+
* Watch Params events
|
|
1553
|
+
* @param callback Function to call when event is emitted
|
|
1554
|
+
* @param filter Optional filter for indexed parameters
|
|
1555
|
+
* @returns Unwatch function to stop listening
|
|
1556
|
+
*/
|
|
1557
|
+
Params: (callback: (event: { feeBasisPoints: bigint; maxFee: bigint }) => void) => {
|
|
1558
|
+
return this.publicClient.watchContractEvent({
|
|
1559
|
+
address: this.contractAddress,
|
|
1560
|
+
abi: TetherTokenAbi,
|
|
1561
|
+
eventName: 'Params',
|
|
1562
|
+
|
|
1563
|
+
onLogs: (logs: any[]) => {
|
|
1564
|
+
logs.forEach((log: any) => {
|
|
1565
|
+
callback(log.args as any);
|
|
1566
|
+
});
|
|
1567
|
+
},
|
|
1568
|
+
}) as () => void;
|
|
1569
|
+
},
|
|
1570
|
+
/**
|
|
1571
|
+
* Watch DestroyedBlackFunds events
|
|
1572
|
+
* @param callback Function to call when event is emitted
|
|
1573
|
+
* @param filter Optional filter for indexed parameters
|
|
1574
|
+
* @returns Unwatch function to stop listening
|
|
1575
|
+
*/
|
|
1576
|
+
DestroyedBlackFunds: (callback: (event: { _blackListedUser: `0x${string}`; _balance: bigint }) => void) => {
|
|
1577
|
+
return this.publicClient.watchContractEvent({
|
|
1578
|
+
address: this.contractAddress,
|
|
1579
|
+
abi: TetherTokenAbi,
|
|
1580
|
+
eventName: 'DestroyedBlackFunds',
|
|
1581
|
+
|
|
1582
|
+
onLogs: (logs: any[]) => {
|
|
1583
|
+
logs.forEach((log: any) => {
|
|
1584
|
+
callback(log.args as any);
|
|
1585
|
+
});
|
|
1586
|
+
},
|
|
1587
|
+
}) as () => void;
|
|
1588
|
+
},
|
|
1589
|
+
/**
|
|
1590
|
+
* Watch AddedBlackList events
|
|
1591
|
+
* @param callback Function to call when event is emitted
|
|
1592
|
+
* @param filter Optional filter for indexed parameters
|
|
1593
|
+
* @returns Unwatch function to stop listening
|
|
1594
|
+
*/
|
|
1595
|
+
AddedBlackList: (callback: (event: { _user: `0x${string}` }) => void) => {
|
|
1596
|
+
return this.publicClient.watchContractEvent({
|
|
1597
|
+
address: this.contractAddress,
|
|
1598
|
+
abi: TetherTokenAbi,
|
|
1599
|
+
eventName: 'AddedBlackList',
|
|
1600
|
+
|
|
1601
|
+
onLogs: (logs: any[]) => {
|
|
1602
|
+
logs.forEach((log: any) => {
|
|
1603
|
+
callback(log.args as any);
|
|
1604
|
+
});
|
|
1605
|
+
},
|
|
1606
|
+
}) as () => void;
|
|
1607
|
+
},
|
|
1608
|
+
/**
|
|
1609
|
+
* Watch RemovedBlackList events
|
|
1610
|
+
* @param callback Function to call when event is emitted
|
|
1611
|
+
* @param filter Optional filter for indexed parameters
|
|
1612
|
+
* @returns Unwatch function to stop listening
|
|
1613
|
+
*/
|
|
1614
|
+
RemovedBlackList: (callback: (event: { _user: `0x${string}` }) => void) => {
|
|
1615
|
+
return this.publicClient.watchContractEvent({
|
|
1616
|
+
address: this.contractAddress,
|
|
1617
|
+
abi: TetherTokenAbi,
|
|
1618
|
+
eventName: 'RemovedBlackList',
|
|
1619
|
+
|
|
1620
|
+
onLogs: (logs: any[]) => {
|
|
1621
|
+
logs.forEach((log: any) => {
|
|
1622
|
+
callback(log.args as any);
|
|
1623
|
+
});
|
|
1624
|
+
},
|
|
1625
|
+
}) as () => void;
|
|
1626
|
+
},
|
|
1627
|
+
/**
|
|
1628
|
+
* Watch Approval events
|
|
1629
|
+
* @param callback Function to call when event is emitted
|
|
1630
|
+
* @param filter Optional filter for indexed parameters
|
|
1631
|
+
* @returns Unwatch function to stop listening
|
|
1632
|
+
*/
|
|
1633
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1634
|
+
return this.publicClient.watchContractEvent({
|
|
1635
|
+
address: this.contractAddress,
|
|
1636
|
+
abi: TetherTokenAbi,
|
|
1637
|
+
eventName: 'Approval',
|
|
1638
|
+
args: filter as any,
|
|
1639
|
+
onLogs: (logs: any[]) => {
|
|
1640
|
+
logs.forEach((log: any) => {
|
|
1641
|
+
callback(log.args as any);
|
|
1642
|
+
});
|
|
1643
|
+
},
|
|
1644
|
+
}) as () => void;
|
|
1645
|
+
},
|
|
1646
|
+
/**
|
|
1647
|
+
* Watch Transfer events
|
|
1648
|
+
* @param callback Function to call when event is emitted
|
|
1649
|
+
* @param filter Optional filter for indexed parameters
|
|
1650
|
+
* @returns Unwatch function to stop listening
|
|
1651
|
+
*/
|
|
1652
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1653
|
+
return this.publicClient.watchContractEvent({
|
|
1654
|
+
address: this.contractAddress,
|
|
1655
|
+
abi: TetherTokenAbi,
|
|
1656
|
+
eventName: 'Transfer',
|
|
1657
|
+
args: filter as any,
|
|
1658
|
+
onLogs: (logs: any[]) => {
|
|
1659
|
+
logs.forEach((log: any) => {
|
|
1660
|
+
callback(log.args as any);
|
|
1661
|
+
});
|
|
1662
|
+
},
|
|
1663
|
+
}) as () => void;
|
|
1664
|
+
},
|
|
1665
|
+
/**
|
|
1666
|
+
* Watch Pause events
|
|
1667
|
+
* @param callback Function to call when event is emitted
|
|
1668
|
+
* @param filter Optional filter for indexed parameters
|
|
1669
|
+
* @returns Unwatch function to stop listening
|
|
1670
|
+
*/
|
|
1671
|
+
Pause: (callback: (event: { }) => void) => {
|
|
1672
|
+
return this.publicClient.watchContractEvent({
|
|
1673
|
+
address: this.contractAddress,
|
|
1674
|
+
abi: TetherTokenAbi,
|
|
1675
|
+
eventName: 'Pause',
|
|
1676
|
+
|
|
1677
|
+
onLogs: (logs: any[]) => {
|
|
1678
|
+
logs.forEach((log: any) => {
|
|
1679
|
+
callback(log.args as any);
|
|
1680
|
+
});
|
|
1681
|
+
},
|
|
1682
|
+
}) as () => void;
|
|
1683
|
+
},
|
|
1684
|
+
/**
|
|
1685
|
+
* Watch Unpause events
|
|
1686
|
+
* @param callback Function to call when event is emitted
|
|
1687
|
+
* @param filter Optional filter for indexed parameters
|
|
1688
|
+
* @returns Unwatch function to stop listening
|
|
1689
|
+
*/
|
|
1690
|
+
Unpause: (callback: (event: { }) => void) => {
|
|
1691
|
+
return this.publicClient.watchContractEvent({
|
|
1692
|
+
address: this.contractAddress,
|
|
1693
|
+
abi: TetherTokenAbi,
|
|
1694
|
+
eventName: 'Unpause',
|
|
1695
|
+
|
|
1696
|
+
onLogs: (logs: any[]) => {
|
|
1697
|
+
logs.forEach((log: any) => {
|
|
1698
|
+
callback(log.args as any);
|
|
1699
|
+
});
|
|
1700
|
+
},
|
|
1701
|
+
}) as () => void;
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
}
|