@gitmyabi-stg/xusd 0.0.1
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/FiatTokenProxy.d.ts +311 -0
- package/contracts/FiatTokenProxy.js +328 -0
- package/contracts/FiatTokenProxy.ts +428 -0
- package/contracts/FiatTokenV1.d.ts +1622 -0
- package/contracts/FiatTokenV1.js +1659 -0
- package/contracts/FiatTokenV1.ts +2163 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,2163 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* FiatTokenV1 ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const FiatTokenV1Abi = [
|
|
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": "_spender",
|
|
29
|
+
"type": "address"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "_amount",
|
|
33
|
+
"type": "uint256"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"name": "approve",
|
|
37
|
+
"outputs": [
|
|
38
|
+
{
|
|
39
|
+
"name": "",
|
|
40
|
+
"type": "bool"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"payable": false,
|
|
44
|
+
"stateMutability": "nonpayable",
|
|
45
|
+
"type": "function"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"constant": false,
|
|
49
|
+
"inputs": [
|
|
50
|
+
{
|
|
51
|
+
"name": "_name",
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "_symbol",
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "_decimals",
|
|
60
|
+
"type": "uint8"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "_masterMinter",
|
|
64
|
+
"type": "address"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "_pauser",
|
|
68
|
+
"type": "address"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "_blacklister",
|
|
72
|
+
"type": "address"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "_owner",
|
|
76
|
+
"type": "address"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"name": "initialize",
|
|
80
|
+
"outputs": [],
|
|
81
|
+
"payable": false,
|
|
82
|
+
"stateMutability": "nonpayable",
|
|
83
|
+
"type": "function"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"constant": false,
|
|
87
|
+
"inputs": [
|
|
88
|
+
{
|
|
89
|
+
"name": "_tokenAddress",
|
|
90
|
+
"type": "address"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"name": "reclaimToken",
|
|
94
|
+
"outputs": [],
|
|
95
|
+
"payable": false,
|
|
96
|
+
"stateMutability": "nonpayable",
|
|
97
|
+
"type": "function"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"constant": true,
|
|
101
|
+
"inputs": [],
|
|
102
|
+
"name": "totalSupply",
|
|
103
|
+
"outputs": [
|
|
104
|
+
{
|
|
105
|
+
"name": "",
|
|
106
|
+
"type": "uint256"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"payable": false,
|
|
110
|
+
"stateMutability": "view",
|
|
111
|
+
"type": "function"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"constant": false,
|
|
115
|
+
"inputs": [
|
|
116
|
+
{
|
|
117
|
+
"name": "_account",
|
|
118
|
+
"type": "address"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"name": "unBlacklist",
|
|
122
|
+
"outputs": [],
|
|
123
|
+
"payable": false,
|
|
124
|
+
"stateMutability": "nonpayable",
|
|
125
|
+
"type": "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"constant": false,
|
|
129
|
+
"inputs": [
|
|
130
|
+
{
|
|
131
|
+
"name": "_from",
|
|
132
|
+
"type": "address"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "_to",
|
|
136
|
+
"type": "address"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "_amount",
|
|
140
|
+
"type": "uint256"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"name": "transferFrom",
|
|
144
|
+
"outputs": [
|
|
145
|
+
{
|
|
146
|
+
"name": "",
|
|
147
|
+
"type": "bool"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"payable": false,
|
|
151
|
+
"stateMutability": "nonpayable",
|
|
152
|
+
"type": "function"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"constant": true,
|
|
156
|
+
"inputs": [],
|
|
157
|
+
"name": "decimals",
|
|
158
|
+
"outputs": [
|
|
159
|
+
{
|
|
160
|
+
"name": "",
|
|
161
|
+
"type": "uint8"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"payable": false,
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"constant": true,
|
|
170
|
+
"inputs": [],
|
|
171
|
+
"name": "masterMinter",
|
|
172
|
+
"outputs": [
|
|
173
|
+
{
|
|
174
|
+
"name": "",
|
|
175
|
+
"type": "address"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"payable": false,
|
|
179
|
+
"stateMutability": "view",
|
|
180
|
+
"type": "function"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"constant": false,
|
|
184
|
+
"inputs": [
|
|
185
|
+
{
|
|
186
|
+
"name": "_spender",
|
|
187
|
+
"type": "address"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "_addedValue",
|
|
191
|
+
"type": "uint256"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"name": "increaseAllowance",
|
|
195
|
+
"outputs": [
|
|
196
|
+
{
|
|
197
|
+
"name": "",
|
|
198
|
+
"type": "bool"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"payable": false,
|
|
202
|
+
"stateMutability": "nonpayable",
|
|
203
|
+
"type": "function"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"constant": false,
|
|
207
|
+
"inputs": [],
|
|
208
|
+
"name": "unpause",
|
|
209
|
+
"outputs": [],
|
|
210
|
+
"payable": false,
|
|
211
|
+
"stateMutability": "nonpayable",
|
|
212
|
+
"type": "function"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"constant": false,
|
|
216
|
+
"inputs": [
|
|
217
|
+
{
|
|
218
|
+
"name": "_to",
|
|
219
|
+
"type": "address"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "_amount",
|
|
223
|
+
"type": "uint256"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"name": "mint",
|
|
227
|
+
"outputs": [
|
|
228
|
+
{
|
|
229
|
+
"name": "",
|
|
230
|
+
"type": "bool"
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"payable": false,
|
|
234
|
+
"stateMutability": "nonpayable",
|
|
235
|
+
"type": "function"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"constant": false,
|
|
239
|
+
"inputs": [
|
|
240
|
+
{
|
|
241
|
+
"name": "_amount",
|
|
242
|
+
"type": "uint256"
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"name": "burn",
|
|
246
|
+
"outputs": [],
|
|
247
|
+
"payable": false,
|
|
248
|
+
"stateMutability": "nonpayable",
|
|
249
|
+
"type": "function"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"constant": false,
|
|
253
|
+
"inputs": [
|
|
254
|
+
{
|
|
255
|
+
"name": "_newPauser",
|
|
256
|
+
"type": "address"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"name": "updatePauser",
|
|
260
|
+
"outputs": [],
|
|
261
|
+
"payable": false,
|
|
262
|
+
"stateMutability": "nonpayable",
|
|
263
|
+
"type": "function"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"constant": true,
|
|
267
|
+
"inputs": [],
|
|
268
|
+
"name": "paused",
|
|
269
|
+
"outputs": [
|
|
270
|
+
{
|
|
271
|
+
"name": "",
|
|
272
|
+
"type": "bool"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"payable": false,
|
|
276
|
+
"stateMutability": "view",
|
|
277
|
+
"type": "function"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"constant": true,
|
|
281
|
+
"inputs": [
|
|
282
|
+
{
|
|
283
|
+
"name": "_address",
|
|
284
|
+
"type": "address"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"name": "balanceOf",
|
|
288
|
+
"outputs": [
|
|
289
|
+
{
|
|
290
|
+
"name": "",
|
|
291
|
+
"type": "uint256"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"payable": false,
|
|
295
|
+
"stateMutability": "view",
|
|
296
|
+
"type": "function"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"constant": false,
|
|
300
|
+
"inputs": [
|
|
301
|
+
{
|
|
302
|
+
"name": "_from",
|
|
303
|
+
"type": "address"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"name": "lawEnforcementWipingBurn",
|
|
307
|
+
"outputs": [],
|
|
308
|
+
"payable": false,
|
|
309
|
+
"stateMutability": "nonpayable",
|
|
310
|
+
"type": "function"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"constant": false,
|
|
314
|
+
"inputs": [],
|
|
315
|
+
"name": "pause",
|
|
316
|
+
"outputs": [],
|
|
317
|
+
"payable": false,
|
|
318
|
+
"stateMutability": "nonpayable",
|
|
319
|
+
"type": "function"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"constant": true,
|
|
323
|
+
"inputs": [
|
|
324
|
+
{
|
|
325
|
+
"name": "_minter",
|
|
326
|
+
"type": "address"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"name": "minterAllowance",
|
|
330
|
+
"outputs": [
|
|
331
|
+
{
|
|
332
|
+
"name": "",
|
|
333
|
+
"type": "uint256"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"payable": false,
|
|
337
|
+
"stateMutability": "view",
|
|
338
|
+
"type": "function"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"constant": true,
|
|
342
|
+
"inputs": [],
|
|
343
|
+
"name": "owner",
|
|
344
|
+
"outputs": [
|
|
345
|
+
{
|
|
346
|
+
"name": "",
|
|
347
|
+
"type": "address"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"payable": false,
|
|
351
|
+
"stateMutability": "view",
|
|
352
|
+
"type": "function"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"constant": true,
|
|
356
|
+
"inputs": [],
|
|
357
|
+
"name": "symbol",
|
|
358
|
+
"outputs": [
|
|
359
|
+
{
|
|
360
|
+
"name": "",
|
|
361
|
+
"type": "string"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"payable": false,
|
|
365
|
+
"stateMutability": "view",
|
|
366
|
+
"type": "function"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"constant": true,
|
|
370
|
+
"inputs": [],
|
|
371
|
+
"name": "pauser",
|
|
372
|
+
"outputs": [
|
|
373
|
+
{
|
|
374
|
+
"name": "",
|
|
375
|
+
"type": "address"
|
|
376
|
+
}
|
|
377
|
+
],
|
|
378
|
+
"payable": false,
|
|
379
|
+
"stateMutability": "view",
|
|
380
|
+
"type": "function"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"constant": false,
|
|
384
|
+
"inputs": [
|
|
385
|
+
{
|
|
386
|
+
"name": "_minter",
|
|
387
|
+
"type": "address"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "_decreasedAmount",
|
|
391
|
+
"type": "uint256"
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"name": "decreaseMinterAllowance",
|
|
395
|
+
"outputs": [],
|
|
396
|
+
"payable": false,
|
|
397
|
+
"stateMutability": "nonpayable",
|
|
398
|
+
"type": "function"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"constant": false,
|
|
402
|
+
"inputs": [
|
|
403
|
+
{
|
|
404
|
+
"name": "_spender",
|
|
405
|
+
"type": "address"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "_subtractedValue",
|
|
409
|
+
"type": "uint256"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"name": "decreaseAllowance",
|
|
413
|
+
"outputs": [
|
|
414
|
+
{
|
|
415
|
+
"name": "",
|
|
416
|
+
"type": "bool"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"payable": false,
|
|
420
|
+
"stateMutability": "nonpayable",
|
|
421
|
+
"type": "function"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"constant": false,
|
|
425
|
+
"inputs": [
|
|
426
|
+
{
|
|
427
|
+
"name": "_to",
|
|
428
|
+
"type": "address"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "_amount",
|
|
432
|
+
"type": "uint256"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"name": "transfer",
|
|
436
|
+
"outputs": [
|
|
437
|
+
{
|
|
438
|
+
"name": "",
|
|
439
|
+
"type": "bool"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"payable": false,
|
|
443
|
+
"stateMutability": "nonpayable",
|
|
444
|
+
"type": "function"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"constant": false,
|
|
448
|
+
"inputs": [
|
|
449
|
+
{
|
|
450
|
+
"name": "_newMasterMinter",
|
|
451
|
+
"type": "address"
|
|
452
|
+
}
|
|
453
|
+
],
|
|
454
|
+
"name": "updateMasterMinter",
|
|
455
|
+
"outputs": [],
|
|
456
|
+
"payable": false,
|
|
457
|
+
"stateMutability": "nonpayable",
|
|
458
|
+
"type": "function"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"constant": true,
|
|
462
|
+
"inputs": [
|
|
463
|
+
{
|
|
464
|
+
"name": "_address",
|
|
465
|
+
"type": "address"
|
|
466
|
+
}
|
|
467
|
+
],
|
|
468
|
+
"name": "isMinter",
|
|
469
|
+
"outputs": [
|
|
470
|
+
{
|
|
471
|
+
"name": "",
|
|
472
|
+
"type": "bool"
|
|
473
|
+
}
|
|
474
|
+
],
|
|
475
|
+
"payable": false,
|
|
476
|
+
"stateMutability": "view",
|
|
477
|
+
"type": "function"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"constant": false,
|
|
481
|
+
"inputs": [
|
|
482
|
+
{
|
|
483
|
+
"name": "_newBlacklister",
|
|
484
|
+
"type": "address"
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
"name": "updateBlacklister",
|
|
488
|
+
"outputs": [],
|
|
489
|
+
"payable": false,
|
|
490
|
+
"stateMutability": "nonpayable",
|
|
491
|
+
"type": "function"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"constant": true,
|
|
495
|
+
"inputs": [],
|
|
496
|
+
"name": "blacklister",
|
|
497
|
+
"outputs": [
|
|
498
|
+
{
|
|
499
|
+
"name": "",
|
|
500
|
+
"type": "address"
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
"payable": false,
|
|
504
|
+
"stateMutability": "view",
|
|
505
|
+
"type": "function"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"constant": false,
|
|
509
|
+
"inputs": [
|
|
510
|
+
{
|
|
511
|
+
"name": "_minter",
|
|
512
|
+
"type": "address"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "_increasedAmount",
|
|
516
|
+
"type": "uint256"
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
"name": "increaseMinterAllowance",
|
|
520
|
+
"outputs": [],
|
|
521
|
+
"payable": false,
|
|
522
|
+
"stateMutability": "nonpayable",
|
|
523
|
+
"type": "function"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"constant": true,
|
|
527
|
+
"inputs": [
|
|
528
|
+
{
|
|
529
|
+
"name": "_from",
|
|
530
|
+
"type": "address"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "_value",
|
|
534
|
+
"type": "uint256"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "_data",
|
|
538
|
+
"type": "bytes"
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
"name": "tokenFallback",
|
|
542
|
+
"outputs": [],
|
|
543
|
+
"payable": false,
|
|
544
|
+
"stateMutability": "pure",
|
|
545
|
+
"type": "function"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"constant": true,
|
|
549
|
+
"inputs": [
|
|
550
|
+
{
|
|
551
|
+
"name": "_owner",
|
|
552
|
+
"type": "address"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"name": "_spender",
|
|
556
|
+
"type": "address"
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"name": "allowance",
|
|
560
|
+
"outputs": [
|
|
561
|
+
{
|
|
562
|
+
"name": "",
|
|
563
|
+
"type": "uint256"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"payable": false,
|
|
567
|
+
"stateMutability": "view",
|
|
568
|
+
"type": "function"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"constant": false,
|
|
572
|
+
"inputs": [
|
|
573
|
+
{
|
|
574
|
+
"name": "newOwner",
|
|
575
|
+
"type": "address"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"name": "transferOwnership",
|
|
579
|
+
"outputs": [],
|
|
580
|
+
"payable": false,
|
|
581
|
+
"stateMutability": "nonpayable",
|
|
582
|
+
"type": "function"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"constant": false,
|
|
586
|
+
"inputs": [
|
|
587
|
+
{
|
|
588
|
+
"name": "_account",
|
|
589
|
+
"type": "address"
|
|
590
|
+
}
|
|
591
|
+
],
|
|
592
|
+
"name": "blacklist",
|
|
593
|
+
"outputs": [],
|
|
594
|
+
"payable": false,
|
|
595
|
+
"stateMutability": "nonpayable",
|
|
596
|
+
"type": "function"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"constant": true,
|
|
600
|
+
"inputs": [
|
|
601
|
+
{
|
|
602
|
+
"name": "_account",
|
|
603
|
+
"type": "address"
|
|
604
|
+
}
|
|
605
|
+
],
|
|
606
|
+
"name": "isBlacklisted",
|
|
607
|
+
"outputs": [
|
|
608
|
+
{
|
|
609
|
+
"name": "",
|
|
610
|
+
"type": "bool"
|
|
611
|
+
}
|
|
612
|
+
],
|
|
613
|
+
"payable": false,
|
|
614
|
+
"stateMutability": "view",
|
|
615
|
+
"type": "function"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"anonymous": false,
|
|
619
|
+
"inputs": [
|
|
620
|
+
{
|
|
621
|
+
"indexed": true,
|
|
622
|
+
"name": "minter",
|
|
623
|
+
"type": "address"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"indexed": true,
|
|
627
|
+
"name": "to",
|
|
628
|
+
"type": "address"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"indexed": false,
|
|
632
|
+
"name": "amount",
|
|
633
|
+
"type": "uint256"
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
"name": "Mint",
|
|
637
|
+
"type": "event"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"anonymous": false,
|
|
641
|
+
"inputs": [
|
|
642
|
+
{
|
|
643
|
+
"indexed": true,
|
|
644
|
+
"name": "from",
|
|
645
|
+
"type": "address"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"indexed": true,
|
|
649
|
+
"name": "to",
|
|
650
|
+
"type": "address"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"indexed": false,
|
|
654
|
+
"name": "amount",
|
|
655
|
+
"type": "uint256"
|
|
656
|
+
}
|
|
657
|
+
],
|
|
658
|
+
"name": "Transfer",
|
|
659
|
+
"type": "event"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"anonymous": false,
|
|
663
|
+
"inputs": [
|
|
664
|
+
{
|
|
665
|
+
"indexed": true,
|
|
666
|
+
"name": "burner",
|
|
667
|
+
"type": "address"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"indexed": false,
|
|
671
|
+
"name": "amount",
|
|
672
|
+
"type": "uint256"
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
"name": "Burn",
|
|
676
|
+
"type": "event"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"anonymous": false,
|
|
680
|
+
"inputs": [
|
|
681
|
+
{
|
|
682
|
+
"indexed": true,
|
|
683
|
+
"name": "owner",
|
|
684
|
+
"type": "address"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"indexed": true,
|
|
688
|
+
"name": "spender",
|
|
689
|
+
"type": "address"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"indexed": false,
|
|
693
|
+
"name": "amount",
|
|
694
|
+
"type": "uint256"
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
"name": "Approval",
|
|
698
|
+
"type": "event"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"anonymous": false,
|
|
702
|
+
"inputs": [
|
|
703
|
+
{
|
|
704
|
+
"indexed": true,
|
|
705
|
+
"name": "minter",
|
|
706
|
+
"type": "address"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"indexed": false,
|
|
710
|
+
"name": "minterAllowedAmount",
|
|
711
|
+
"type": "uint256"
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"name": "MinterConfigured",
|
|
715
|
+
"type": "event"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"anonymous": false,
|
|
719
|
+
"inputs": [
|
|
720
|
+
{
|
|
721
|
+
"indexed": true,
|
|
722
|
+
"name": "oldMinter",
|
|
723
|
+
"type": "address"
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"name": "MinterRemoved",
|
|
727
|
+
"type": "event"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"anonymous": false,
|
|
731
|
+
"inputs": [
|
|
732
|
+
{
|
|
733
|
+
"indexed": true,
|
|
734
|
+
"name": "newMasterMinter",
|
|
735
|
+
"type": "address"
|
|
736
|
+
}
|
|
737
|
+
],
|
|
738
|
+
"name": "MasterMinterChanged",
|
|
739
|
+
"type": "event"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"anonymous": false,
|
|
743
|
+
"inputs": [
|
|
744
|
+
{
|
|
745
|
+
"indexed": true,
|
|
746
|
+
"name": "_account",
|
|
747
|
+
"type": "address"
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
"name": "Blacklisted",
|
|
751
|
+
"type": "event"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"anonymous": false,
|
|
755
|
+
"inputs": [
|
|
756
|
+
{
|
|
757
|
+
"indexed": true,
|
|
758
|
+
"name": "_account",
|
|
759
|
+
"type": "address"
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
"name": "UnBlacklisted",
|
|
763
|
+
"type": "event"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"anonymous": false,
|
|
767
|
+
"inputs": [
|
|
768
|
+
{
|
|
769
|
+
"indexed": true,
|
|
770
|
+
"name": "newBlacklister",
|
|
771
|
+
"type": "address"
|
|
772
|
+
}
|
|
773
|
+
],
|
|
774
|
+
"name": "BlacklisterChanged",
|
|
775
|
+
"type": "event"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"anonymous": false,
|
|
779
|
+
"inputs": [],
|
|
780
|
+
"name": "Pause",
|
|
781
|
+
"type": "event"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"anonymous": false,
|
|
785
|
+
"inputs": [],
|
|
786
|
+
"name": "Unpause",
|
|
787
|
+
"type": "event"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"anonymous": false,
|
|
791
|
+
"inputs": [
|
|
792
|
+
{
|
|
793
|
+
"indexed": true,
|
|
794
|
+
"name": "newAddress",
|
|
795
|
+
"type": "address"
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"name": "PauserChanged",
|
|
799
|
+
"type": "event"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"anonymous": false,
|
|
803
|
+
"inputs": [
|
|
804
|
+
{
|
|
805
|
+
"indexed": true,
|
|
806
|
+
"name": "previousOwner",
|
|
807
|
+
"type": "address"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"indexed": true,
|
|
811
|
+
"name": "newOwner",
|
|
812
|
+
"type": "address"
|
|
813
|
+
}
|
|
814
|
+
],
|
|
815
|
+
"name": "OwnershipTransferred",
|
|
816
|
+
"type": "event"
|
|
817
|
+
}
|
|
818
|
+
] as const satisfies Abi;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Type-safe ABI for FiatTokenV1
|
|
822
|
+
*/
|
|
823
|
+
export type FiatTokenV1Abi = typeof FiatTokenV1Abi;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Contract instance type for FiatTokenV1
|
|
827
|
+
*/
|
|
828
|
+
// Use any for contract type to avoid complex viem type issues
|
|
829
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
830
|
+
export type FiatTokenV1Contract = any;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* FiatTokenV1 Contract Class
|
|
834
|
+
*
|
|
835
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
836
|
+
*
|
|
837
|
+
* @example
|
|
838
|
+
* ```typescript
|
|
839
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
840
|
+
* import { mainnet } from 'viem/chains';
|
|
841
|
+
* import { FiatTokenV1 } from 'FiatTokenV1';
|
|
842
|
+
*
|
|
843
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
844
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
845
|
+
*
|
|
846
|
+
* const contract = new FiatTokenV1('0x...', { publicClient, walletClient });
|
|
847
|
+
*
|
|
848
|
+
* // Read functions
|
|
849
|
+
* const result = await contract.balanceOf('0x...');
|
|
850
|
+
*
|
|
851
|
+
* // Write functions
|
|
852
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
853
|
+
*
|
|
854
|
+
* // Simulate transactions (dry-run)
|
|
855
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
856
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
857
|
+
*
|
|
858
|
+
* // Watch events
|
|
859
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
860
|
+
* console.log('Transfer event:', event);
|
|
861
|
+
* });
|
|
862
|
+
* ```
|
|
863
|
+
*/
|
|
864
|
+
export class FiatTokenV1 {
|
|
865
|
+
private contract: FiatTokenV1Contract;
|
|
866
|
+
private contractAddress: Address;
|
|
867
|
+
private publicClient: PublicClient;
|
|
868
|
+
|
|
869
|
+
constructor(
|
|
870
|
+
address: Address,
|
|
871
|
+
clients: {
|
|
872
|
+
publicClient: PublicClient;
|
|
873
|
+
walletClient?: WalletClient;
|
|
874
|
+
}
|
|
875
|
+
) {
|
|
876
|
+
this.contractAddress = address;
|
|
877
|
+
this.publicClient = clients.publicClient;
|
|
878
|
+
this.contract = getContract({
|
|
879
|
+
address,
|
|
880
|
+
abi: FiatTokenV1Abi,
|
|
881
|
+
client: {
|
|
882
|
+
public: clients.publicClient,
|
|
883
|
+
wallet: clients.walletClient,
|
|
884
|
+
},
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Get the contract address
|
|
890
|
+
*/
|
|
891
|
+
get address(): Address {
|
|
892
|
+
return this.contractAddress;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Get the underlying viem contract instance.
|
|
897
|
+
*/
|
|
898
|
+
getContract(): FiatTokenV1Contract {
|
|
899
|
+
return this.contract;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* name
|
|
904
|
+
* view
|
|
905
|
+
*/
|
|
906
|
+
async name(): Promise<string> {
|
|
907
|
+
return this.contract.read.name() as Promise<string>;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* totalSupply
|
|
912
|
+
* view
|
|
913
|
+
*/
|
|
914
|
+
async totalSupply(): Promise<bigint> {
|
|
915
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* decimals
|
|
920
|
+
* view
|
|
921
|
+
*/
|
|
922
|
+
async decimals(): Promise<bigint> {
|
|
923
|
+
return this.contract.read.decimals() as Promise<bigint>;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* masterMinter
|
|
928
|
+
* view
|
|
929
|
+
*/
|
|
930
|
+
async masterMinter(): Promise<`0x${string}`> {
|
|
931
|
+
return this.contract.read.masterMinter() as Promise<`0x${string}`>;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* paused
|
|
936
|
+
* view
|
|
937
|
+
*/
|
|
938
|
+
async paused(): Promise<boolean> {
|
|
939
|
+
return this.contract.read.paused() as Promise<boolean>;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* balanceOf
|
|
944
|
+
* view
|
|
945
|
+
*/
|
|
946
|
+
async balanceOf(_address: `0x${string}`): Promise<bigint> {
|
|
947
|
+
return this.contract.read.balanceOf([_address] as const) as Promise<bigint>;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* minterAllowance
|
|
952
|
+
* view
|
|
953
|
+
*/
|
|
954
|
+
async minterAllowance(_minter: `0x${string}`): Promise<bigint> {
|
|
955
|
+
return this.contract.read.minterAllowance([_minter] as const) as Promise<bigint>;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* owner
|
|
960
|
+
* view
|
|
961
|
+
*/
|
|
962
|
+
async owner(): Promise<`0x${string}`> {
|
|
963
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* symbol
|
|
968
|
+
* view
|
|
969
|
+
*/
|
|
970
|
+
async symbol(): Promise<string> {
|
|
971
|
+
return this.contract.read.symbol() as Promise<string>;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* pauser
|
|
976
|
+
* view
|
|
977
|
+
*/
|
|
978
|
+
async pauser(): Promise<`0x${string}`> {
|
|
979
|
+
return this.contract.read.pauser() as Promise<`0x${string}`>;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* isMinter
|
|
984
|
+
* view
|
|
985
|
+
*/
|
|
986
|
+
async isMinter(_address: `0x${string}`): Promise<boolean> {
|
|
987
|
+
return this.contract.read.isMinter([_address] as const) as Promise<boolean>;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* blacklister
|
|
992
|
+
* view
|
|
993
|
+
*/
|
|
994
|
+
async blacklister(): Promise<`0x${string}`> {
|
|
995
|
+
return this.contract.read.blacklister() as Promise<`0x${string}`>;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* tokenFallback
|
|
1000
|
+
* pure
|
|
1001
|
+
*/
|
|
1002
|
+
async tokenFallback(_from: `0x${string}`, _value: bigint, _data: `0x${string}`): Promise<void> {
|
|
1003
|
+
return this.contract.read.tokenFallback([_from, _value, _data] as const) as Promise<void>;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* allowance
|
|
1008
|
+
* view
|
|
1009
|
+
*/
|
|
1010
|
+
async allowance(_owner: `0x${string}`, _spender: `0x${string}`): Promise<bigint> {
|
|
1011
|
+
return this.contract.read.allowance([_owner, _spender] as const) as Promise<bigint>;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* isBlacklisted
|
|
1016
|
+
* view
|
|
1017
|
+
*/
|
|
1018
|
+
async isBlacklisted(_account: `0x${string}`): Promise<boolean> {
|
|
1019
|
+
return this.contract.read.isBlacklisted([_account] as const) as Promise<boolean>;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* approve
|
|
1024
|
+
* nonpayable
|
|
1025
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1026
|
+
*/
|
|
1027
|
+
async approve(_spender: `0x${string}`, _amount: bigint, options?: {
|
|
1028
|
+
accessList?: import('viem').AccessList;
|
|
1029
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1030
|
+
chain?: import('viem').Chain | null;
|
|
1031
|
+
dataSuffix?: `0x${string}`;
|
|
1032
|
+
gas?: bigint;
|
|
1033
|
+
gasPrice?: bigint;
|
|
1034
|
+
maxFeePerGas?: bigint;
|
|
1035
|
+
maxPriorityFeePerGas?: bigint;
|
|
1036
|
+
nonce?: number;
|
|
1037
|
+
value?: bigint;
|
|
1038
|
+
}): Promise<`0x${string}`> {
|
|
1039
|
+
if (!this.contract.write) {
|
|
1040
|
+
throw new Error('Wallet client is required for write operations');
|
|
1041
|
+
}
|
|
1042
|
+
return this.contract.write.approve([_spender, _amount] as const, options) as Promise<`0x${string}`>;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* initialize
|
|
1047
|
+
* nonpayable
|
|
1048
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1049
|
+
*/
|
|
1050
|
+
async initialize(_name: string, _symbol: string, _decimals: bigint, _masterMinter: `0x${string}`, _pauser: `0x${string}`, _blacklister: `0x${string}`, _owner: `0x${string}`, options?: {
|
|
1051
|
+
accessList?: import('viem').AccessList;
|
|
1052
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1053
|
+
chain?: import('viem').Chain | null;
|
|
1054
|
+
dataSuffix?: `0x${string}`;
|
|
1055
|
+
gas?: bigint;
|
|
1056
|
+
gasPrice?: bigint;
|
|
1057
|
+
maxFeePerGas?: bigint;
|
|
1058
|
+
maxPriorityFeePerGas?: bigint;
|
|
1059
|
+
nonce?: number;
|
|
1060
|
+
value?: bigint;
|
|
1061
|
+
}): Promise<`0x${string}`> {
|
|
1062
|
+
if (!this.contract.write) {
|
|
1063
|
+
throw new Error('Wallet client is required for write operations');
|
|
1064
|
+
}
|
|
1065
|
+
return this.contract.write.initialize([_name, _symbol, _decimals, _masterMinter, _pauser, _blacklister, _owner] as const, options) as Promise<`0x${string}`>;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* reclaimToken
|
|
1070
|
+
* nonpayable
|
|
1071
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1072
|
+
*/
|
|
1073
|
+
async reclaimToken(_tokenAddress: `0x${string}`, options?: {
|
|
1074
|
+
accessList?: import('viem').AccessList;
|
|
1075
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1076
|
+
chain?: import('viem').Chain | null;
|
|
1077
|
+
dataSuffix?: `0x${string}`;
|
|
1078
|
+
gas?: bigint;
|
|
1079
|
+
gasPrice?: bigint;
|
|
1080
|
+
maxFeePerGas?: bigint;
|
|
1081
|
+
maxPriorityFeePerGas?: bigint;
|
|
1082
|
+
nonce?: number;
|
|
1083
|
+
value?: bigint;
|
|
1084
|
+
}): Promise<`0x${string}`> {
|
|
1085
|
+
if (!this.contract.write) {
|
|
1086
|
+
throw new Error('Wallet client is required for write operations');
|
|
1087
|
+
}
|
|
1088
|
+
return this.contract.write.reclaimToken([_tokenAddress] as const, options) as Promise<`0x${string}`>;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* unBlacklist
|
|
1093
|
+
* nonpayable
|
|
1094
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1095
|
+
*/
|
|
1096
|
+
async unBlacklist(_account: `0x${string}`, options?: {
|
|
1097
|
+
accessList?: import('viem').AccessList;
|
|
1098
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1099
|
+
chain?: import('viem').Chain | null;
|
|
1100
|
+
dataSuffix?: `0x${string}`;
|
|
1101
|
+
gas?: bigint;
|
|
1102
|
+
gasPrice?: bigint;
|
|
1103
|
+
maxFeePerGas?: bigint;
|
|
1104
|
+
maxPriorityFeePerGas?: bigint;
|
|
1105
|
+
nonce?: number;
|
|
1106
|
+
value?: bigint;
|
|
1107
|
+
}): Promise<`0x${string}`> {
|
|
1108
|
+
if (!this.contract.write) {
|
|
1109
|
+
throw new Error('Wallet client is required for write operations');
|
|
1110
|
+
}
|
|
1111
|
+
return this.contract.write.unBlacklist([_account] as const, options) as Promise<`0x${string}`>;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* transferFrom
|
|
1116
|
+
* nonpayable
|
|
1117
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1118
|
+
*/
|
|
1119
|
+
async transferFrom(_from: `0x${string}`, _to: `0x${string}`, _amount: bigint, options?: {
|
|
1120
|
+
accessList?: import('viem').AccessList;
|
|
1121
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1122
|
+
chain?: import('viem').Chain | null;
|
|
1123
|
+
dataSuffix?: `0x${string}`;
|
|
1124
|
+
gas?: bigint;
|
|
1125
|
+
gasPrice?: bigint;
|
|
1126
|
+
maxFeePerGas?: bigint;
|
|
1127
|
+
maxPriorityFeePerGas?: bigint;
|
|
1128
|
+
nonce?: number;
|
|
1129
|
+
value?: bigint;
|
|
1130
|
+
}): Promise<`0x${string}`> {
|
|
1131
|
+
if (!this.contract.write) {
|
|
1132
|
+
throw new Error('Wallet client is required for write operations');
|
|
1133
|
+
}
|
|
1134
|
+
return this.contract.write.transferFrom([_from, _to, _amount] as const, options) as Promise<`0x${string}`>;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* increaseAllowance
|
|
1139
|
+
* nonpayable
|
|
1140
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1141
|
+
*/
|
|
1142
|
+
async increaseAllowance(_spender: `0x${string}`, _addedValue: bigint, options?: {
|
|
1143
|
+
accessList?: import('viem').AccessList;
|
|
1144
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1145
|
+
chain?: import('viem').Chain | null;
|
|
1146
|
+
dataSuffix?: `0x${string}`;
|
|
1147
|
+
gas?: bigint;
|
|
1148
|
+
gasPrice?: bigint;
|
|
1149
|
+
maxFeePerGas?: bigint;
|
|
1150
|
+
maxPriorityFeePerGas?: bigint;
|
|
1151
|
+
nonce?: number;
|
|
1152
|
+
value?: bigint;
|
|
1153
|
+
}): Promise<`0x${string}`> {
|
|
1154
|
+
if (!this.contract.write) {
|
|
1155
|
+
throw new Error('Wallet client is required for write operations');
|
|
1156
|
+
}
|
|
1157
|
+
return this.contract.write.increaseAllowance([_spender, _addedValue] as const, options) as Promise<`0x${string}`>;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* unpause
|
|
1162
|
+
* nonpayable
|
|
1163
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1164
|
+
*/
|
|
1165
|
+
async unpause(options?: {
|
|
1166
|
+
accessList?: import('viem').AccessList;
|
|
1167
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1168
|
+
chain?: import('viem').Chain | null;
|
|
1169
|
+
dataSuffix?: `0x${string}`;
|
|
1170
|
+
gas?: bigint;
|
|
1171
|
+
gasPrice?: bigint;
|
|
1172
|
+
maxFeePerGas?: bigint;
|
|
1173
|
+
maxPriorityFeePerGas?: bigint;
|
|
1174
|
+
nonce?: number;
|
|
1175
|
+
value?: bigint;
|
|
1176
|
+
}): Promise<`0x${string}`> {
|
|
1177
|
+
if (!this.contract.write) {
|
|
1178
|
+
throw new Error('Wallet client is required for write operations');
|
|
1179
|
+
}
|
|
1180
|
+
return this.contract.write.unpause(options) as Promise<`0x${string}`>;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* mint
|
|
1185
|
+
* nonpayable
|
|
1186
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1187
|
+
*/
|
|
1188
|
+
async mint(_to: `0x${string}`, _amount: bigint, options?: {
|
|
1189
|
+
accessList?: import('viem').AccessList;
|
|
1190
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1191
|
+
chain?: import('viem').Chain | null;
|
|
1192
|
+
dataSuffix?: `0x${string}`;
|
|
1193
|
+
gas?: bigint;
|
|
1194
|
+
gasPrice?: bigint;
|
|
1195
|
+
maxFeePerGas?: bigint;
|
|
1196
|
+
maxPriorityFeePerGas?: bigint;
|
|
1197
|
+
nonce?: number;
|
|
1198
|
+
value?: bigint;
|
|
1199
|
+
}): Promise<`0x${string}`> {
|
|
1200
|
+
if (!this.contract.write) {
|
|
1201
|
+
throw new Error('Wallet client is required for write operations');
|
|
1202
|
+
}
|
|
1203
|
+
return this.contract.write.mint([_to, _amount] as const, options) as Promise<`0x${string}`>;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* burn
|
|
1208
|
+
* nonpayable
|
|
1209
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1210
|
+
*/
|
|
1211
|
+
async burn(_amount: bigint, options?: {
|
|
1212
|
+
accessList?: import('viem').AccessList;
|
|
1213
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1214
|
+
chain?: import('viem').Chain | null;
|
|
1215
|
+
dataSuffix?: `0x${string}`;
|
|
1216
|
+
gas?: bigint;
|
|
1217
|
+
gasPrice?: bigint;
|
|
1218
|
+
maxFeePerGas?: bigint;
|
|
1219
|
+
maxPriorityFeePerGas?: bigint;
|
|
1220
|
+
nonce?: number;
|
|
1221
|
+
value?: bigint;
|
|
1222
|
+
}): Promise<`0x${string}`> {
|
|
1223
|
+
if (!this.contract.write) {
|
|
1224
|
+
throw new Error('Wallet client is required for write operations');
|
|
1225
|
+
}
|
|
1226
|
+
return this.contract.write.burn([_amount] as const, options) as Promise<`0x${string}`>;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* updatePauser
|
|
1231
|
+
* nonpayable
|
|
1232
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1233
|
+
*/
|
|
1234
|
+
async updatePauser(_newPauser: `0x${string}`, options?: {
|
|
1235
|
+
accessList?: import('viem').AccessList;
|
|
1236
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1237
|
+
chain?: import('viem').Chain | null;
|
|
1238
|
+
dataSuffix?: `0x${string}`;
|
|
1239
|
+
gas?: bigint;
|
|
1240
|
+
gasPrice?: bigint;
|
|
1241
|
+
maxFeePerGas?: bigint;
|
|
1242
|
+
maxPriorityFeePerGas?: bigint;
|
|
1243
|
+
nonce?: number;
|
|
1244
|
+
value?: bigint;
|
|
1245
|
+
}): Promise<`0x${string}`> {
|
|
1246
|
+
if (!this.contract.write) {
|
|
1247
|
+
throw new Error('Wallet client is required for write operations');
|
|
1248
|
+
}
|
|
1249
|
+
return this.contract.write.updatePauser([_newPauser] as const, options) as Promise<`0x${string}`>;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* lawEnforcementWipingBurn
|
|
1254
|
+
* nonpayable
|
|
1255
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1256
|
+
*/
|
|
1257
|
+
async lawEnforcementWipingBurn(_from: `0x${string}`, options?: {
|
|
1258
|
+
accessList?: import('viem').AccessList;
|
|
1259
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1260
|
+
chain?: import('viem').Chain | null;
|
|
1261
|
+
dataSuffix?: `0x${string}`;
|
|
1262
|
+
gas?: bigint;
|
|
1263
|
+
gasPrice?: bigint;
|
|
1264
|
+
maxFeePerGas?: bigint;
|
|
1265
|
+
maxPriorityFeePerGas?: bigint;
|
|
1266
|
+
nonce?: number;
|
|
1267
|
+
value?: bigint;
|
|
1268
|
+
}): Promise<`0x${string}`> {
|
|
1269
|
+
if (!this.contract.write) {
|
|
1270
|
+
throw new Error('Wallet client is required for write operations');
|
|
1271
|
+
}
|
|
1272
|
+
return this.contract.write.lawEnforcementWipingBurn([_from] as const, options) as Promise<`0x${string}`>;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* pause
|
|
1277
|
+
* nonpayable
|
|
1278
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1279
|
+
*/
|
|
1280
|
+
async pause(options?: {
|
|
1281
|
+
accessList?: import('viem').AccessList;
|
|
1282
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1283
|
+
chain?: import('viem').Chain | null;
|
|
1284
|
+
dataSuffix?: `0x${string}`;
|
|
1285
|
+
gas?: bigint;
|
|
1286
|
+
gasPrice?: bigint;
|
|
1287
|
+
maxFeePerGas?: bigint;
|
|
1288
|
+
maxPriorityFeePerGas?: bigint;
|
|
1289
|
+
nonce?: number;
|
|
1290
|
+
value?: bigint;
|
|
1291
|
+
}): Promise<`0x${string}`> {
|
|
1292
|
+
if (!this.contract.write) {
|
|
1293
|
+
throw new Error('Wallet client is required for write operations');
|
|
1294
|
+
}
|
|
1295
|
+
return this.contract.write.pause(options) as Promise<`0x${string}`>;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* decreaseMinterAllowance
|
|
1300
|
+
* nonpayable
|
|
1301
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1302
|
+
*/
|
|
1303
|
+
async decreaseMinterAllowance(_minter: `0x${string}`, _decreasedAmount: bigint, options?: {
|
|
1304
|
+
accessList?: import('viem').AccessList;
|
|
1305
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1306
|
+
chain?: import('viem').Chain | null;
|
|
1307
|
+
dataSuffix?: `0x${string}`;
|
|
1308
|
+
gas?: bigint;
|
|
1309
|
+
gasPrice?: bigint;
|
|
1310
|
+
maxFeePerGas?: bigint;
|
|
1311
|
+
maxPriorityFeePerGas?: bigint;
|
|
1312
|
+
nonce?: number;
|
|
1313
|
+
value?: bigint;
|
|
1314
|
+
}): Promise<`0x${string}`> {
|
|
1315
|
+
if (!this.contract.write) {
|
|
1316
|
+
throw new Error('Wallet client is required for write operations');
|
|
1317
|
+
}
|
|
1318
|
+
return this.contract.write.decreaseMinterAllowance([_minter, _decreasedAmount] as const, options) as Promise<`0x${string}`>;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* decreaseAllowance
|
|
1323
|
+
* nonpayable
|
|
1324
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1325
|
+
*/
|
|
1326
|
+
async decreaseAllowance(_spender: `0x${string}`, _subtractedValue: bigint, options?: {
|
|
1327
|
+
accessList?: import('viem').AccessList;
|
|
1328
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1329
|
+
chain?: import('viem').Chain | null;
|
|
1330
|
+
dataSuffix?: `0x${string}`;
|
|
1331
|
+
gas?: bigint;
|
|
1332
|
+
gasPrice?: bigint;
|
|
1333
|
+
maxFeePerGas?: bigint;
|
|
1334
|
+
maxPriorityFeePerGas?: bigint;
|
|
1335
|
+
nonce?: number;
|
|
1336
|
+
value?: bigint;
|
|
1337
|
+
}): Promise<`0x${string}`> {
|
|
1338
|
+
if (!this.contract.write) {
|
|
1339
|
+
throw new Error('Wallet client is required for write operations');
|
|
1340
|
+
}
|
|
1341
|
+
return this.contract.write.decreaseAllowance([_spender, _subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* transfer
|
|
1346
|
+
* nonpayable
|
|
1347
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1348
|
+
*/
|
|
1349
|
+
async transfer(_to: `0x${string}`, _amount: 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<`0x${string}`> {
|
|
1361
|
+
if (!this.contract.write) {
|
|
1362
|
+
throw new Error('Wallet client is required for write operations');
|
|
1363
|
+
}
|
|
1364
|
+
return this.contract.write.transfer([_to, _amount] as const, options) as Promise<`0x${string}`>;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* updateMasterMinter
|
|
1369
|
+
* nonpayable
|
|
1370
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1371
|
+
*/
|
|
1372
|
+
async updateMasterMinter(_newMasterMinter: `0x${string}`, options?: {
|
|
1373
|
+
accessList?: import('viem').AccessList;
|
|
1374
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1375
|
+
chain?: import('viem').Chain | null;
|
|
1376
|
+
dataSuffix?: `0x${string}`;
|
|
1377
|
+
gas?: bigint;
|
|
1378
|
+
gasPrice?: bigint;
|
|
1379
|
+
maxFeePerGas?: bigint;
|
|
1380
|
+
maxPriorityFeePerGas?: bigint;
|
|
1381
|
+
nonce?: number;
|
|
1382
|
+
value?: bigint;
|
|
1383
|
+
}): Promise<`0x${string}`> {
|
|
1384
|
+
if (!this.contract.write) {
|
|
1385
|
+
throw new Error('Wallet client is required for write operations');
|
|
1386
|
+
}
|
|
1387
|
+
return this.contract.write.updateMasterMinter([_newMasterMinter] as const, options) as Promise<`0x${string}`>;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* updateBlacklister
|
|
1392
|
+
* nonpayable
|
|
1393
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1394
|
+
*/
|
|
1395
|
+
async updateBlacklister(_newBlacklister: `0x${string}`, options?: {
|
|
1396
|
+
accessList?: import('viem').AccessList;
|
|
1397
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1398
|
+
chain?: import('viem').Chain | null;
|
|
1399
|
+
dataSuffix?: `0x${string}`;
|
|
1400
|
+
gas?: bigint;
|
|
1401
|
+
gasPrice?: bigint;
|
|
1402
|
+
maxFeePerGas?: bigint;
|
|
1403
|
+
maxPriorityFeePerGas?: bigint;
|
|
1404
|
+
nonce?: number;
|
|
1405
|
+
value?: bigint;
|
|
1406
|
+
}): Promise<`0x${string}`> {
|
|
1407
|
+
if (!this.contract.write) {
|
|
1408
|
+
throw new Error('Wallet client is required for write operations');
|
|
1409
|
+
}
|
|
1410
|
+
return this.contract.write.updateBlacklister([_newBlacklister] as const, options) as Promise<`0x${string}`>;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* increaseMinterAllowance
|
|
1415
|
+
* nonpayable
|
|
1416
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1417
|
+
*/
|
|
1418
|
+
async increaseMinterAllowance(_minter: `0x${string}`, _increasedAmount: bigint, options?: {
|
|
1419
|
+
accessList?: import('viem').AccessList;
|
|
1420
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1421
|
+
chain?: import('viem').Chain | null;
|
|
1422
|
+
dataSuffix?: `0x${string}`;
|
|
1423
|
+
gas?: bigint;
|
|
1424
|
+
gasPrice?: bigint;
|
|
1425
|
+
maxFeePerGas?: bigint;
|
|
1426
|
+
maxPriorityFeePerGas?: bigint;
|
|
1427
|
+
nonce?: number;
|
|
1428
|
+
value?: bigint;
|
|
1429
|
+
}): Promise<`0x${string}`> {
|
|
1430
|
+
if (!this.contract.write) {
|
|
1431
|
+
throw new Error('Wallet client is required for write operations');
|
|
1432
|
+
}
|
|
1433
|
+
return this.contract.write.increaseMinterAllowance([_minter, _increasedAmount] as const, options) as Promise<`0x${string}`>;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* transferOwnership
|
|
1438
|
+
* nonpayable
|
|
1439
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1440
|
+
*/
|
|
1441
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1442
|
+
accessList?: import('viem').AccessList;
|
|
1443
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1444
|
+
chain?: import('viem').Chain | null;
|
|
1445
|
+
dataSuffix?: `0x${string}`;
|
|
1446
|
+
gas?: bigint;
|
|
1447
|
+
gasPrice?: bigint;
|
|
1448
|
+
maxFeePerGas?: bigint;
|
|
1449
|
+
maxPriorityFeePerGas?: bigint;
|
|
1450
|
+
nonce?: number;
|
|
1451
|
+
value?: bigint;
|
|
1452
|
+
}): Promise<`0x${string}`> {
|
|
1453
|
+
if (!this.contract.write) {
|
|
1454
|
+
throw new Error('Wallet client is required for write operations');
|
|
1455
|
+
}
|
|
1456
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* blacklist
|
|
1461
|
+
* nonpayable
|
|
1462
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1463
|
+
*/
|
|
1464
|
+
async blacklist(_account: `0x${string}`, options?: {
|
|
1465
|
+
accessList?: import('viem').AccessList;
|
|
1466
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1467
|
+
chain?: import('viem').Chain | null;
|
|
1468
|
+
dataSuffix?: `0x${string}`;
|
|
1469
|
+
gas?: bigint;
|
|
1470
|
+
gasPrice?: bigint;
|
|
1471
|
+
maxFeePerGas?: bigint;
|
|
1472
|
+
maxPriorityFeePerGas?: bigint;
|
|
1473
|
+
nonce?: number;
|
|
1474
|
+
value?: bigint;
|
|
1475
|
+
}): Promise<`0x${string}`> {
|
|
1476
|
+
if (!this.contract.write) {
|
|
1477
|
+
throw new Error('Wallet client is required for write operations');
|
|
1478
|
+
}
|
|
1479
|
+
return this.contract.write.blacklist([_account] as const, options) as Promise<`0x${string}`>;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1486
|
+
*
|
|
1487
|
+
* @example
|
|
1488
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1489
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1490
|
+
* console.log('Would succeed:', result.result);
|
|
1491
|
+
*/
|
|
1492
|
+
get simulate() {
|
|
1493
|
+
const contract = this.contract;
|
|
1494
|
+
if (!contract.simulate) {
|
|
1495
|
+
throw new Error('Public client is required for simulation');
|
|
1496
|
+
}
|
|
1497
|
+
return {
|
|
1498
|
+
/**
|
|
1499
|
+
* Simulate approve
|
|
1500
|
+
* Returns gas estimate and result without sending transaction
|
|
1501
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1502
|
+
*/
|
|
1503
|
+
async approve(_spender: `0x${string}`, _amount: bigint, options?: {
|
|
1504
|
+
accessList?: import('viem').AccessList;
|
|
1505
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1506
|
+
chain?: import('viem').Chain | null;
|
|
1507
|
+
dataSuffix?: `0x${string}`;
|
|
1508
|
+
gas?: bigint;
|
|
1509
|
+
gasPrice?: bigint;
|
|
1510
|
+
maxFeePerGas?: bigint;
|
|
1511
|
+
maxPriorityFeePerGas?: bigint;
|
|
1512
|
+
nonce?: number;
|
|
1513
|
+
value?: bigint;
|
|
1514
|
+
}): Promise<boolean> {
|
|
1515
|
+
return contract.simulate.approve([_spender, _amount] as const, options) as Promise<boolean>;
|
|
1516
|
+
},
|
|
1517
|
+
/**
|
|
1518
|
+
* Simulate initialize
|
|
1519
|
+
* Returns gas estimate and result without sending transaction
|
|
1520
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1521
|
+
*/
|
|
1522
|
+
async initialize(_name: string, _symbol: string, _decimals: bigint, _masterMinter: `0x${string}`, _pauser: `0x${string}`, _blacklister: `0x${string}`, _owner: `0x${string}`, options?: {
|
|
1523
|
+
accessList?: import('viem').AccessList;
|
|
1524
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1525
|
+
chain?: import('viem').Chain | null;
|
|
1526
|
+
dataSuffix?: `0x${string}`;
|
|
1527
|
+
gas?: bigint;
|
|
1528
|
+
gasPrice?: bigint;
|
|
1529
|
+
maxFeePerGas?: bigint;
|
|
1530
|
+
maxPriorityFeePerGas?: bigint;
|
|
1531
|
+
nonce?: number;
|
|
1532
|
+
value?: bigint;
|
|
1533
|
+
}): Promise<void> {
|
|
1534
|
+
return contract.simulate.initialize([_name, _symbol, _decimals, _masterMinter, _pauser, _blacklister, _owner] as const, options) as Promise<void>;
|
|
1535
|
+
},
|
|
1536
|
+
/**
|
|
1537
|
+
* Simulate reclaimToken
|
|
1538
|
+
* Returns gas estimate and result without sending transaction
|
|
1539
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1540
|
+
*/
|
|
1541
|
+
async reclaimToken(_tokenAddress: `0x${string}`, options?: {
|
|
1542
|
+
accessList?: import('viem').AccessList;
|
|
1543
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1544
|
+
chain?: import('viem').Chain | null;
|
|
1545
|
+
dataSuffix?: `0x${string}`;
|
|
1546
|
+
gas?: bigint;
|
|
1547
|
+
gasPrice?: bigint;
|
|
1548
|
+
maxFeePerGas?: bigint;
|
|
1549
|
+
maxPriorityFeePerGas?: bigint;
|
|
1550
|
+
nonce?: number;
|
|
1551
|
+
value?: bigint;
|
|
1552
|
+
}): Promise<void> {
|
|
1553
|
+
return contract.simulate.reclaimToken([_tokenAddress] as const, options) as Promise<void>;
|
|
1554
|
+
},
|
|
1555
|
+
/**
|
|
1556
|
+
* Simulate unBlacklist
|
|
1557
|
+
* Returns gas estimate and result without sending transaction
|
|
1558
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1559
|
+
*/
|
|
1560
|
+
async unBlacklist(_account: `0x${string}`, options?: {
|
|
1561
|
+
accessList?: import('viem').AccessList;
|
|
1562
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1563
|
+
chain?: import('viem').Chain | null;
|
|
1564
|
+
dataSuffix?: `0x${string}`;
|
|
1565
|
+
gas?: bigint;
|
|
1566
|
+
gasPrice?: bigint;
|
|
1567
|
+
maxFeePerGas?: bigint;
|
|
1568
|
+
maxPriorityFeePerGas?: bigint;
|
|
1569
|
+
nonce?: number;
|
|
1570
|
+
value?: bigint;
|
|
1571
|
+
}): Promise<void> {
|
|
1572
|
+
return contract.simulate.unBlacklist([_account] as const, options) as Promise<void>;
|
|
1573
|
+
},
|
|
1574
|
+
/**
|
|
1575
|
+
* Simulate transferFrom
|
|
1576
|
+
* Returns gas estimate and result without sending transaction
|
|
1577
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1578
|
+
*/
|
|
1579
|
+
async transferFrom(_from: `0x${string}`, _to: `0x${string}`, _amount: bigint, options?: {
|
|
1580
|
+
accessList?: import('viem').AccessList;
|
|
1581
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1582
|
+
chain?: import('viem').Chain | null;
|
|
1583
|
+
dataSuffix?: `0x${string}`;
|
|
1584
|
+
gas?: bigint;
|
|
1585
|
+
gasPrice?: bigint;
|
|
1586
|
+
maxFeePerGas?: bigint;
|
|
1587
|
+
maxPriorityFeePerGas?: bigint;
|
|
1588
|
+
nonce?: number;
|
|
1589
|
+
value?: bigint;
|
|
1590
|
+
}): Promise<boolean> {
|
|
1591
|
+
return contract.simulate.transferFrom([_from, _to, _amount] as const, options) as Promise<boolean>;
|
|
1592
|
+
},
|
|
1593
|
+
/**
|
|
1594
|
+
* Simulate increaseAllowance
|
|
1595
|
+
* Returns gas estimate and result without sending transaction
|
|
1596
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1597
|
+
*/
|
|
1598
|
+
async increaseAllowance(_spender: `0x${string}`, _addedValue: bigint, options?: {
|
|
1599
|
+
accessList?: import('viem').AccessList;
|
|
1600
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1601
|
+
chain?: import('viem').Chain | null;
|
|
1602
|
+
dataSuffix?: `0x${string}`;
|
|
1603
|
+
gas?: bigint;
|
|
1604
|
+
gasPrice?: bigint;
|
|
1605
|
+
maxFeePerGas?: bigint;
|
|
1606
|
+
maxPriorityFeePerGas?: bigint;
|
|
1607
|
+
nonce?: number;
|
|
1608
|
+
value?: bigint;
|
|
1609
|
+
}): Promise<boolean> {
|
|
1610
|
+
return contract.simulate.increaseAllowance([_spender, _addedValue] as const, options) as Promise<boolean>;
|
|
1611
|
+
},
|
|
1612
|
+
/**
|
|
1613
|
+
* Simulate unpause
|
|
1614
|
+
* Returns gas estimate and result without sending transaction
|
|
1615
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1616
|
+
*/
|
|
1617
|
+
async unpause(options?: {
|
|
1618
|
+
accessList?: import('viem').AccessList;
|
|
1619
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1620
|
+
chain?: import('viem').Chain | null;
|
|
1621
|
+
dataSuffix?: `0x${string}`;
|
|
1622
|
+
gas?: bigint;
|
|
1623
|
+
gasPrice?: bigint;
|
|
1624
|
+
maxFeePerGas?: bigint;
|
|
1625
|
+
maxPriorityFeePerGas?: bigint;
|
|
1626
|
+
nonce?: number;
|
|
1627
|
+
value?: bigint;
|
|
1628
|
+
}): Promise<void> {
|
|
1629
|
+
return contract.simulate.unpause(options) as Promise<void>;
|
|
1630
|
+
},
|
|
1631
|
+
/**
|
|
1632
|
+
* Simulate mint
|
|
1633
|
+
* Returns gas estimate and result without sending transaction
|
|
1634
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1635
|
+
*/
|
|
1636
|
+
async mint(_to: `0x${string}`, _amount: bigint, options?: {
|
|
1637
|
+
accessList?: import('viem').AccessList;
|
|
1638
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1639
|
+
chain?: import('viem').Chain | null;
|
|
1640
|
+
dataSuffix?: `0x${string}`;
|
|
1641
|
+
gas?: bigint;
|
|
1642
|
+
gasPrice?: bigint;
|
|
1643
|
+
maxFeePerGas?: bigint;
|
|
1644
|
+
maxPriorityFeePerGas?: bigint;
|
|
1645
|
+
nonce?: number;
|
|
1646
|
+
value?: bigint;
|
|
1647
|
+
}): Promise<boolean> {
|
|
1648
|
+
return contract.simulate.mint([_to, _amount] as const, options) as Promise<boolean>;
|
|
1649
|
+
},
|
|
1650
|
+
/**
|
|
1651
|
+
* Simulate burn
|
|
1652
|
+
* Returns gas estimate and result without sending transaction
|
|
1653
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1654
|
+
*/
|
|
1655
|
+
async burn(_amount: bigint, options?: {
|
|
1656
|
+
accessList?: import('viem').AccessList;
|
|
1657
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1658
|
+
chain?: import('viem').Chain | null;
|
|
1659
|
+
dataSuffix?: `0x${string}`;
|
|
1660
|
+
gas?: bigint;
|
|
1661
|
+
gasPrice?: bigint;
|
|
1662
|
+
maxFeePerGas?: bigint;
|
|
1663
|
+
maxPriorityFeePerGas?: bigint;
|
|
1664
|
+
nonce?: number;
|
|
1665
|
+
value?: bigint;
|
|
1666
|
+
}): Promise<void> {
|
|
1667
|
+
return contract.simulate.burn([_amount] as const, options) as Promise<void>;
|
|
1668
|
+
},
|
|
1669
|
+
/**
|
|
1670
|
+
* Simulate updatePauser
|
|
1671
|
+
* Returns gas estimate and result without sending transaction
|
|
1672
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1673
|
+
*/
|
|
1674
|
+
async updatePauser(_newPauser: `0x${string}`, options?: {
|
|
1675
|
+
accessList?: import('viem').AccessList;
|
|
1676
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1677
|
+
chain?: import('viem').Chain | null;
|
|
1678
|
+
dataSuffix?: `0x${string}`;
|
|
1679
|
+
gas?: bigint;
|
|
1680
|
+
gasPrice?: bigint;
|
|
1681
|
+
maxFeePerGas?: bigint;
|
|
1682
|
+
maxPriorityFeePerGas?: bigint;
|
|
1683
|
+
nonce?: number;
|
|
1684
|
+
value?: bigint;
|
|
1685
|
+
}): Promise<void> {
|
|
1686
|
+
return contract.simulate.updatePauser([_newPauser] as const, options) as Promise<void>;
|
|
1687
|
+
},
|
|
1688
|
+
/**
|
|
1689
|
+
* Simulate lawEnforcementWipingBurn
|
|
1690
|
+
* Returns gas estimate and result without sending transaction
|
|
1691
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1692
|
+
*/
|
|
1693
|
+
async lawEnforcementWipingBurn(_from: `0x${string}`, options?: {
|
|
1694
|
+
accessList?: import('viem').AccessList;
|
|
1695
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1696
|
+
chain?: import('viem').Chain | null;
|
|
1697
|
+
dataSuffix?: `0x${string}`;
|
|
1698
|
+
gas?: bigint;
|
|
1699
|
+
gasPrice?: bigint;
|
|
1700
|
+
maxFeePerGas?: bigint;
|
|
1701
|
+
maxPriorityFeePerGas?: bigint;
|
|
1702
|
+
nonce?: number;
|
|
1703
|
+
value?: bigint;
|
|
1704
|
+
}): Promise<void> {
|
|
1705
|
+
return contract.simulate.lawEnforcementWipingBurn([_from] as const, options) as Promise<void>;
|
|
1706
|
+
},
|
|
1707
|
+
/**
|
|
1708
|
+
* Simulate pause
|
|
1709
|
+
* Returns gas estimate and result without sending transaction
|
|
1710
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1711
|
+
*/
|
|
1712
|
+
async pause(options?: {
|
|
1713
|
+
accessList?: import('viem').AccessList;
|
|
1714
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1715
|
+
chain?: import('viem').Chain | null;
|
|
1716
|
+
dataSuffix?: `0x${string}`;
|
|
1717
|
+
gas?: bigint;
|
|
1718
|
+
gasPrice?: bigint;
|
|
1719
|
+
maxFeePerGas?: bigint;
|
|
1720
|
+
maxPriorityFeePerGas?: bigint;
|
|
1721
|
+
nonce?: number;
|
|
1722
|
+
value?: bigint;
|
|
1723
|
+
}): Promise<void> {
|
|
1724
|
+
return contract.simulate.pause(options) as Promise<void>;
|
|
1725
|
+
},
|
|
1726
|
+
/**
|
|
1727
|
+
* Simulate decreaseMinterAllowance
|
|
1728
|
+
* Returns gas estimate and result without sending transaction
|
|
1729
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1730
|
+
*/
|
|
1731
|
+
async decreaseMinterAllowance(_minter: `0x${string}`, _decreasedAmount: bigint, options?: {
|
|
1732
|
+
accessList?: import('viem').AccessList;
|
|
1733
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1734
|
+
chain?: import('viem').Chain | null;
|
|
1735
|
+
dataSuffix?: `0x${string}`;
|
|
1736
|
+
gas?: bigint;
|
|
1737
|
+
gasPrice?: bigint;
|
|
1738
|
+
maxFeePerGas?: bigint;
|
|
1739
|
+
maxPriorityFeePerGas?: bigint;
|
|
1740
|
+
nonce?: number;
|
|
1741
|
+
value?: bigint;
|
|
1742
|
+
}): Promise<void> {
|
|
1743
|
+
return contract.simulate.decreaseMinterAllowance([_minter, _decreasedAmount] as const, options) as Promise<void>;
|
|
1744
|
+
},
|
|
1745
|
+
/**
|
|
1746
|
+
* Simulate decreaseAllowance
|
|
1747
|
+
* Returns gas estimate and result without sending transaction
|
|
1748
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1749
|
+
*/
|
|
1750
|
+
async decreaseAllowance(_spender: `0x${string}`, _subtractedValue: bigint, options?: {
|
|
1751
|
+
accessList?: import('viem').AccessList;
|
|
1752
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1753
|
+
chain?: import('viem').Chain | null;
|
|
1754
|
+
dataSuffix?: `0x${string}`;
|
|
1755
|
+
gas?: bigint;
|
|
1756
|
+
gasPrice?: bigint;
|
|
1757
|
+
maxFeePerGas?: bigint;
|
|
1758
|
+
maxPriorityFeePerGas?: bigint;
|
|
1759
|
+
nonce?: number;
|
|
1760
|
+
value?: bigint;
|
|
1761
|
+
}): Promise<boolean> {
|
|
1762
|
+
return contract.simulate.decreaseAllowance([_spender, _subtractedValue] as const, options) as Promise<boolean>;
|
|
1763
|
+
},
|
|
1764
|
+
/**
|
|
1765
|
+
* Simulate transfer
|
|
1766
|
+
* Returns gas estimate and result without sending transaction
|
|
1767
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1768
|
+
*/
|
|
1769
|
+
async transfer(_to: `0x${string}`, _amount: bigint, options?: {
|
|
1770
|
+
accessList?: import('viem').AccessList;
|
|
1771
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1772
|
+
chain?: import('viem').Chain | null;
|
|
1773
|
+
dataSuffix?: `0x${string}`;
|
|
1774
|
+
gas?: bigint;
|
|
1775
|
+
gasPrice?: bigint;
|
|
1776
|
+
maxFeePerGas?: bigint;
|
|
1777
|
+
maxPriorityFeePerGas?: bigint;
|
|
1778
|
+
nonce?: number;
|
|
1779
|
+
value?: bigint;
|
|
1780
|
+
}): Promise<boolean> {
|
|
1781
|
+
return contract.simulate.transfer([_to, _amount] as const, options) as Promise<boolean>;
|
|
1782
|
+
},
|
|
1783
|
+
/**
|
|
1784
|
+
* Simulate updateMasterMinter
|
|
1785
|
+
* Returns gas estimate and result without sending transaction
|
|
1786
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1787
|
+
*/
|
|
1788
|
+
async updateMasterMinter(_newMasterMinter: `0x${string}`, options?: {
|
|
1789
|
+
accessList?: import('viem').AccessList;
|
|
1790
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1791
|
+
chain?: import('viem').Chain | null;
|
|
1792
|
+
dataSuffix?: `0x${string}`;
|
|
1793
|
+
gas?: bigint;
|
|
1794
|
+
gasPrice?: bigint;
|
|
1795
|
+
maxFeePerGas?: bigint;
|
|
1796
|
+
maxPriorityFeePerGas?: bigint;
|
|
1797
|
+
nonce?: number;
|
|
1798
|
+
value?: bigint;
|
|
1799
|
+
}): Promise<void> {
|
|
1800
|
+
return contract.simulate.updateMasterMinter([_newMasterMinter] as const, options) as Promise<void>;
|
|
1801
|
+
},
|
|
1802
|
+
/**
|
|
1803
|
+
* Simulate updateBlacklister
|
|
1804
|
+
* Returns gas estimate and result without sending transaction
|
|
1805
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1806
|
+
*/
|
|
1807
|
+
async updateBlacklister(_newBlacklister: `0x${string}`, options?: {
|
|
1808
|
+
accessList?: import('viem').AccessList;
|
|
1809
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1810
|
+
chain?: import('viem').Chain | null;
|
|
1811
|
+
dataSuffix?: `0x${string}`;
|
|
1812
|
+
gas?: bigint;
|
|
1813
|
+
gasPrice?: bigint;
|
|
1814
|
+
maxFeePerGas?: bigint;
|
|
1815
|
+
maxPriorityFeePerGas?: bigint;
|
|
1816
|
+
nonce?: number;
|
|
1817
|
+
value?: bigint;
|
|
1818
|
+
}): Promise<void> {
|
|
1819
|
+
return contract.simulate.updateBlacklister([_newBlacklister] as const, options) as Promise<void>;
|
|
1820
|
+
},
|
|
1821
|
+
/**
|
|
1822
|
+
* Simulate increaseMinterAllowance
|
|
1823
|
+
* Returns gas estimate and result without sending transaction
|
|
1824
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1825
|
+
*/
|
|
1826
|
+
async increaseMinterAllowance(_minter: `0x${string}`, _increasedAmount: bigint, options?: {
|
|
1827
|
+
accessList?: import('viem').AccessList;
|
|
1828
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1829
|
+
chain?: import('viem').Chain | null;
|
|
1830
|
+
dataSuffix?: `0x${string}`;
|
|
1831
|
+
gas?: bigint;
|
|
1832
|
+
gasPrice?: bigint;
|
|
1833
|
+
maxFeePerGas?: bigint;
|
|
1834
|
+
maxPriorityFeePerGas?: bigint;
|
|
1835
|
+
nonce?: number;
|
|
1836
|
+
value?: bigint;
|
|
1837
|
+
}): Promise<void> {
|
|
1838
|
+
return contract.simulate.increaseMinterAllowance([_minter, _increasedAmount] as const, options) as Promise<void>;
|
|
1839
|
+
},
|
|
1840
|
+
/**
|
|
1841
|
+
* Simulate transferOwnership
|
|
1842
|
+
* Returns gas estimate and result without sending transaction
|
|
1843
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1844
|
+
*/
|
|
1845
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1846
|
+
accessList?: import('viem').AccessList;
|
|
1847
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1848
|
+
chain?: import('viem').Chain | null;
|
|
1849
|
+
dataSuffix?: `0x${string}`;
|
|
1850
|
+
gas?: bigint;
|
|
1851
|
+
gasPrice?: bigint;
|
|
1852
|
+
maxFeePerGas?: bigint;
|
|
1853
|
+
maxPriorityFeePerGas?: bigint;
|
|
1854
|
+
nonce?: number;
|
|
1855
|
+
value?: bigint;
|
|
1856
|
+
}): Promise<void> {
|
|
1857
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
1858
|
+
},
|
|
1859
|
+
/**
|
|
1860
|
+
* Simulate blacklist
|
|
1861
|
+
* Returns gas estimate and result without sending transaction
|
|
1862
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1863
|
+
*/
|
|
1864
|
+
async blacklist(_account: `0x${string}`, options?: {
|
|
1865
|
+
accessList?: import('viem').AccessList;
|
|
1866
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1867
|
+
chain?: import('viem').Chain | null;
|
|
1868
|
+
dataSuffix?: `0x${string}`;
|
|
1869
|
+
gas?: bigint;
|
|
1870
|
+
gasPrice?: bigint;
|
|
1871
|
+
maxFeePerGas?: bigint;
|
|
1872
|
+
maxPriorityFeePerGas?: bigint;
|
|
1873
|
+
nonce?: number;
|
|
1874
|
+
value?: bigint;
|
|
1875
|
+
}): Promise<void> {
|
|
1876
|
+
return contract.simulate.blacklist([_account] as const, options) as Promise<void>;
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Watch contract events
|
|
1883
|
+
*
|
|
1884
|
+
* @example
|
|
1885
|
+
* // Watch all Transfer events
|
|
1886
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1887
|
+
* console.log('Transfer:', event);
|
|
1888
|
+
* });
|
|
1889
|
+
*
|
|
1890
|
+
* // Stop watching
|
|
1891
|
+
* unwatch();
|
|
1892
|
+
*/
|
|
1893
|
+
get watch() {
|
|
1894
|
+
return {
|
|
1895
|
+
/**
|
|
1896
|
+
* Watch Mint events
|
|
1897
|
+
* @param callback Function to call when event is emitted
|
|
1898
|
+
* @param filter Optional filter for indexed parameters
|
|
1899
|
+
* @returns Unwatch function to stop listening
|
|
1900
|
+
*/
|
|
1901
|
+
Mint: (callback: (event: { minter: `0x${string}`; to: `0x${string}`; amount: bigint }) => void, filter?: { minter?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1902
|
+
return this.publicClient.watchContractEvent({
|
|
1903
|
+
address: this.contractAddress,
|
|
1904
|
+
abi: FiatTokenV1Abi,
|
|
1905
|
+
eventName: 'Mint',
|
|
1906
|
+
args: filter as any,
|
|
1907
|
+
onLogs: (logs: any[]) => {
|
|
1908
|
+
logs.forEach((log: any) => {
|
|
1909
|
+
callback(log.args as any);
|
|
1910
|
+
});
|
|
1911
|
+
},
|
|
1912
|
+
}) as () => void;
|
|
1913
|
+
},
|
|
1914
|
+
/**
|
|
1915
|
+
* Watch Transfer events
|
|
1916
|
+
* @param callback Function to call when event is emitted
|
|
1917
|
+
* @param filter Optional filter for indexed parameters
|
|
1918
|
+
* @returns Unwatch function to stop listening
|
|
1919
|
+
*/
|
|
1920
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; amount: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1921
|
+
return this.publicClient.watchContractEvent({
|
|
1922
|
+
address: this.contractAddress,
|
|
1923
|
+
abi: FiatTokenV1Abi,
|
|
1924
|
+
eventName: 'Transfer',
|
|
1925
|
+
args: filter as any,
|
|
1926
|
+
onLogs: (logs: any[]) => {
|
|
1927
|
+
logs.forEach((log: any) => {
|
|
1928
|
+
callback(log.args as any);
|
|
1929
|
+
});
|
|
1930
|
+
},
|
|
1931
|
+
}) as () => void;
|
|
1932
|
+
},
|
|
1933
|
+
/**
|
|
1934
|
+
* Watch Burn events
|
|
1935
|
+
* @param callback Function to call when event is emitted
|
|
1936
|
+
* @param filter Optional filter for indexed parameters
|
|
1937
|
+
* @returns Unwatch function to stop listening
|
|
1938
|
+
*/
|
|
1939
|
+
Burn: (callback: (event: { burner: `0x${string}`; amount: bigint }) => void, filter?: { burner?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1940
|
+
return this.publicClient.watchContractEvent({
|
|
1941
|
+
address: this.contractAddress,
|
|
1942
|
+
abi: FiatTokenV1Abi,
|
|
1943
|
+
eventName: 'Burn',
|
|
1944
|
+
args: filter as any,
|
|
1945
|
+
onLogs: (logs: any[]) => {
|
|
1946
|
+
logs.forEach((log: any) => {
|
|
1947
|
+
callback(log.args as any);
|
|
1948
|
+
});
|
|
1949
|
+
},
|
|
1950
|
+
}) as () => void;
|
|
1951
|
+
},
|
|
1952
|
+
/**
|
|
1953
|
+
* Watch Approval events
|
|
1954
|
+
* @param callback Function to call when event is emitted
|
|
1955
|
+
* @param filter Optional filter for indexed parameters
|
|
1956
|
+
* @returns Unwatch function to stop listening
|
|
1957
|
+
*/
|
|
1958
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; amount: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1959
|
+
return this.publicClient.watchContractEvent({
|
|
1960
|
+
address: this.contractAddress,
|
|
1961
|
+
abi: FiatTokenV1Abi,
|
|
1962
|
+
eventName: 'Approval',
|
|
1963
|
+
args: filter as any,
|
|
1964
|
+
onLogs: (logs: any[]) => {
|
|
1965
|
+
logs.forEach((log: any) => {
|
|
1966
|
+
callback(log.args as any);
|
|
1967
|
+
});
|
|
1968
|
+
},
|
|
1969
|
+
}) as () => void;
|
|
1970
|
+
},
|
|
1971
|
+
/**
|
|
1972
|
+
* Watch MinterConfigured events
|
|
1973
|
+
* @param callback Function to call when event is emitted
|
|
1974
|
+
* @param filter Optional filter for indexed parameters
|
|
1975
|
+
* @returns Unwatch function to stop listening
|
|
1976
|
+
*/
|
|
1977
|
+
MinterConfigured: (callback: (event: { minter: `0x${string}`; minterAllowedAmount: bigint }) => void, filter?: { minter?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1978
|
+
return this.publicClient.watchContractEvent({
|
|
1979
|
+
address: this.contractAddress,
|
|
1980
|
+
abi: FiatTokenV1Abi,
|
|
1981
|
+
eventName: 'MinterConfigured',
|
|
1982
|
+
args: filter as any,
|
|
1983
|
+
onLogs: (logs: any[]) => {
|
|
1984
|
+
logs.forEach((log: any) => {
|
|
1985
|
+
callback(log.args as any);
|
|
1986
|
+
});
|
|
1987
|
+
},
|
|
1988
|
+
}) as () => void;
|
|
1989
|
+
},
|
|
1990
|
+
/**
|
|
1991
|
+
* Watch MinterRemoved events
|
|
1992
|
+
* @param callback Function to call when event is emitted
|
|
1993
|
+
* @param filter Optional filter for indexed parameters
|
|
1994
|
+
* @returns Unwatch function to stop listening
|
|
1995
|
+
*/
|
|
1996
|
+
MinterRemoved: (callback: (event: { oldMinter: `0x${string}` }) => void, filter?: { oldMinter?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1997
|
+
return this.publicClient.watchContractEvent({
|
|
1998
|
+
address: this.contractAddress,
|
|
1999
|
+
abi: FiatTokenV1Abi,
|
|
2000
|
+
eventName: 'MinterRemoved',
|
|
2001
|
+
args: filter as any,
|
|
2002
|
+
onLogs: (logs: any[]) => {
|
|
2003
|
+
logs.forEach((log: any) => {
|
|
2004
|
+
callback(log.args as any);
|
|
2005
|
+
});
|
|
2006
|
+
},
|
|
2007
|
+
}) as () => void;
|
|
2008
|
+
},
|
|
2009
|
+
/**
|
|
2010
|
+
* Watch MasterMinterChanged events
|
|
2011
|
+
* @param callback Function to call when event is emitted
|
|
2012
|
+
* @param filter Optional filter for indexed parameters
|
|
2013
|
+
* @returns Unwatch function to stop listening
|
|
2014
|
+
*/
|
|
2015
|
+
MasterMinterChanged: (callback: (event: { newMasterMinter: `0x${string}` }) => void, filter?: { newMasterMinter?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2016
|
+
return this.publicClient.watchContractEvent({
|
|
2017
|
+
address: this.contractAddress,
|
|
2018
|
+
abi: FiatTokenV1Abi,
|
|
2019
|
+
eventName: 'MasterMinterChanged',
|
|
2020
|
+
args: filter as any,
|
|
2021
|
+
onLogs: (logs: any[]) => {
|
|
2022
|
+
logs.forEach((log: any) => {
|
|
2023
|
+
callback(log.args as any);
|
|
2024
|
+
});
|
|
2025
|
+
},
|
|
2026
|
+
}) as () => void;
|
|
2027
|
+
},
|
|
2028
|
+
/**
|
|
2029
|
+
* Watch Blacklisted events
|
|
2030
|
+
* @param callback Function to call when event is emitted
|
|
2031
|
+
* @param filter Optional filter for indexed parameters
|
|
2032
|
+
* @returns Unwatch function to stop listening
|
|
2033
|
+
*/
|
|
2034
|
+
Blacklisted: (callback: (event: { _account: `0x${string}` }) => void, filter?: { _account?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2035
|
+
return this.publicClient.watchContractEvent({
|
|
2036
|
+
address: this.contractAddress,
|
|
2037
|
+
abi: FiatTokenV1Abi,
|
|
2038
|
+
eventName: 'Blacklisted',
|
|
2039
|
+
args: filter as any,
|
|
2040
|
+
onLogs: (logs: any[]) => {
|
|
2041
|
+
logs.forEach((log: any) => {
|
|
2042
|
+
callback(log.args as any);
|
|
2043
|
+
});
|
|
2044
|
+
},
|
|
2045
|
+
}) as () => void;
|
|
2046
|
+
},
|
|
2047
|
+
/**
|
|
2048
|
+
* Watch UnBlacklisted events
|
|
2049
|
+
* @param callback Function to call when event is emitted
|
|
2050
|
+
* @param filter Optional filter for indexed parameters
|
|
2051
|
+
* @returns Unwatch function to stop listening
|
|
2052
|
+
*/
|
|
2053
|
+
UnBlacklisted: (callback: (event: { _account: `0x${string}` }) => void, filter?: { _account?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2054
|
+
return this.publicClient.watchContractEvent({
|
|
2055
|
+
address: this.contractAddress,
|
|
2056
|
+
abi: FiatTokenV1Abi,
|
|
2057
|
+
eventName: 'UnBlacklisted',
|
|
2058
|
+
args: filter as any,
|
|
2059
|
+
onLogs: (logs: any[]) => {
|
|
2060
|
+
logs.forEach((log: any) => {
|
|
2061
|
+
callback(log.args as any);
|
|
2062
|
+
});
|
|
2063
|
+
},
|
|
2064
|
+
}) as () => void;
|
|
2065
|
+
},
|
|
2066
|
+
/**
|
|
2067
|
+
* Watch BlacklisterChanged events
|
|
2068
|
+
* @param callback Function to call when event is emitted
|
|
2069
|
+
* @param filter Optional filter for indexed parameters
|
|
2070
|
+
* @returns Unwatch function to stop listening
|
|
2071
|
+
*/
|
|
2072
|
+
BlacklisterChanged: (callback: (event: { newBlacklister: `0x${string}` }) => void, filter?: { newBlacklister?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2073
|
+
return this.publicClient.watchContractEvent({
|
|
2074
|
+
address: this.contractAddress,
|
|
2075
|
+
abi: FiatTokenV1Abi,
|
|
2076
|
+
eventName: 'BlacklisterChanged',
|
|
2077
|
+
args: filter as any,
|
|
2078
|
+
onLogs: (logs: any[]) => {
|
|
2079
|
+
logs.forEach((log: any) => {
|
|
2080
|
+
callback(log.args as any);
|
|
2081
|
+
});
|
|
2082
|
+
},
|
|
2083
|
+
}) as () => void;
|
|
2084
|
+
},
|
|
2085
|
+
/**
|
|
2086
|
+
* Watch Pause events
|
|
2087
|
+
* @param callback Function to call when event is emitted
|
|
2088
|
+
* @param filter Optional filter for indexed parameters
|
|
2089
|
+
* @returns Unwatch function to stop listening
|
|
2090
|
+
*/
|
|
2091
|
+
Pause: (callback: (event: { }) => void) => {
|
|
2092
|
+
return this.publicClient.watchContractEvent({
|
|
2093
|
+
address: this.contractAddress,
|
|
2094
|
+
abi: FiatTokenV1Abi,
|
|
2095
|
+
eventName: 'Pause',
|
|
2096
|
+
|
|
2097
|
+
onLogs: (logs: any[]) => {
|
|
2098
|
+
logs.forEach((log: any) => {
|
|
2099
|
+
callback(log.args as any);
|
|
2100
|
+
});
|
|
2101
|
+
},
|
|
2102
|
+
}) as () => void;
|
|
2103
|
+
},
|
|
2104
|
+
/**
|
|
2105
|
+
* Watch Unpause events
|
|
2106
|
+
* @param callback Function to call when event is emitted
|
|
2107
|
+
* @param filter Optional filter for indexed parameters
|
|
2108
|
+
* @returns Unwatch function to stop listening
|
|
2109
|
+
*/
|
|
2110
|
+
Unpause: (callback: (event: { }) => void) => {
|
|
2111
|
+
return this.publicClient.watchContractEvent({
|
|
2112
|
+
address: this.contractAddress,
|
|
2113
|
+
abi: FiatTokenV1Abi,
|
|
2114
|
+
eventName: 'Unpause',
|
|
2115
|
+
|
|
2116
|
+
onLogs: (logs: any[]) => {
|
|
2117
|
+
logs.forEach((log: any) => {
|
|
2118
|
+
callback(log.args as any);
|
|
2119
|
+
});
|
|
2120
|
+
},
|
|
2121
|
+
}) as () => void;
|
|
2122
|
+
},
|
|
2123
|
+
/**
|
|
2124
|
+
* Watch PauserChanged events
|
|
2125
|
+
* @param callback Function to call when event is emitted
|
|
2126
|
+
* @param filter Optional filter for indexed parameters
|
|
2127
|
+
* @returns Unwatch function to stop listening
|
|
2128
|
+
*/
|
|
2129
|
+
PauserChanged: (callback: (event: { newAddress: `0x${string}` }) => void, filter?: { newAddress?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2130
|
+
return this.publicClient.watchContractEvent({
|
|
2131
|
+
address: this.contractAddress,
|
|
2132
|
+
abi: FiatTokenV1Abi,
|
|
2133
|
+
eventName: 'PauserChanged',
|
|
2134
|
+
args: filter as any,
|
|
2135
|
+
onLogs: (logs: any[]) => {
|
|
2136
|
+
logs.forEach((log: any) => {
|
|
2137
|
+
callback(log.args as any);
|
|
2138
|
+
});
|
|
2139
|
+
},
|
|
2140
|
+
}) as () => void;
|
|
2141
|
+
},
|
|
2142
|
+
/**
|
|
2143
|
+
* Watch OwnershipTransferred events
|
|
2144
|
+
* @param callback Function to call when event is emitted
|
|
2145
|
+
* @param filter Optional filter for indexed parameters
|
|
2146
|
+
* @returns Unwatch function to stop listening
|
|
2147
|
+
*/
|
|
2148
|
+
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
2149
|
+
return this.publicClient.watchContractEvent({
|
|
2150
|
+
address: this.contractAddress,
|
|
2151
|
+
abi: FiatTokenV1Abi,
|
|
2152
|
+
eventName: 'OwnershipTransferred',
|
|
2153
|
+
args: filter as any,
|
|
2154
|
+
onLogs: (logs: any[]) => {
|
|
2155
|
+
logs.forEach((log: any) => {
|
|
2156
|
+
callback(log.args as any);
|
|
2157
|
+
});
|
|
2158
|
+
},
|
|
2159
|
+
}) as () => void;
|
|
2160
|
+
}
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
}
|