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