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