@gitmyabi/cawbrl 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/CErc20Delegate_json.d.ts +2670 -0
- package/contracts/CErc20Delegate_json.js +2793 -0
- package/contracts/CErc20Delegate_json.ts +3530 -0
- package/contracts/CErc20Delegator_json.d.ts +2419 -0
- package/contracts/CErc20Delegator_json.js +2524 -0
- package/contracts/CErc20Delegator_json.ts +3214 -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,3530 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CErc20Delegate_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const CErc20Delegate_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "constructor"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [],
|
|
17
|
+
"name": "AcceptAdminPendingAdminCheck",
|
|
18
|
+
"type": "error"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"inputs": [
|
|
22
|
+
{
|
|
23
|
+
"internalType": "uint256",
|
|
24
|
+
"name": "actualAddAmount",
|
|
25
|
+
"type": "uint256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"name": "AddReservesFactorFreshCheck",
|
|
29
|
+
"type": "error"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"inputs": [],
|
|
33
|
+
"name": "BorrowCashNotAvailable",
|
|
34
|
+
"type": "error"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"inputs": [
|
|
38
|
+
{
|
|
39
|
+
"internalType": "uint256",
|
|
40
|
+
"name": "errorCode",
|
|
41
|
+
"type": "uint256"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"name": "BorrowComptrollerRejection",
|
|
45
|
+
"type": "error"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "BorrowFreshnessCheck",
|
|
50
|
+
"type": "error"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "uint256",
|
|
56
|
+
"name": "errorCode",
|
|
57
|
+
"type": "uint256"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"name": "LiquidateAccrueBorrowInterestFailed",
|
|
61
|
+
"type": "error"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"inputs": [
|
|
65
|
+
{
|
|
66
|
+
"internalType": "uint256",
|
|
67
|
+
"name": "errorCode",
|
|
68
|
+
"type": "uint256"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"name": "LiquidateAccrueCollateralInterestFailed",
|
|
72
|
+
"type": "error"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"inputs": [],
|
|
76
|
+
"name": "LiquidateCloseAmountIsUintMax",
|
|
77
|
+
"type": "error"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"inputs": [],
|
|
81
|
+
"name": "LiquidateCloseAmountIsZero",
|
|
82
|
+
"type": "error"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"inputs": [],
|
|
86
|
+
"name": "LiquidateCollateralFreshnessCheck",
|
|
87
|
+
"type": "error"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"inputs": [
|
|
91
|
+
{
|
|
92
|
+
"internalType": "uint256",
|
|
93
|
+
"name": "errorCode",
|
|
94
|
+
"type": "uint256"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"name": "LiquidateComptrollerRejection",
|
|
98
|
+
"type": "error"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"inputs": [],
|
|
102
|
+
"name": "LiquidateFreshnessCheck",
|
|
103
|
+
"type": "error"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"inputs": [],
|
|
107
|
+
"name": "LiquidateLiquidatorIsBorrower",
|
|
108
|
+
"type": "error"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"inputs": [
|
|
112
|
+
{
|
|
113
|
+
"internalType": "uint256",
|
|
114
|
+
"name": "errorCode",
|
|
115
|
+
"type": "uint256"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"name": "LiquidateRepayBorrowFreshFailed",
|
|
119
|
+
"type": "error"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"inputs": [
|
|
123
|
+
{
|
|
124
|
+
"internalType": "uint256",
|
|
125
|
+
"name": "errorCode",
|
|
126
|
+
"type": "uint256"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"name": "LiquidateSeizeComptrollerRejection",
|
|
130
|
+
"type": "error"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"inputs": [],
|
|
134
|
+
"name": "LiquidateSeizeLiquidatorIsBorrower",
|
|
135
|
+
"type": "error"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"inputs": [
|
|
139
|
+
{
|
|
140
|
+
"internalType": "uint256",
|
|
141
|
+
"name": "errorCode",
|
|
142
|
+
"type": "uint256"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"name": "MintComptrollerRejection",
|
|
146
|
+
"type": "error"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"inputs": [],
|
|
150
|
+
"name": "MintFreshnessCheck",
|
|
151
|
+
"type": "error"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"inputs": [
|
|
155
|
+
{
|
|
156
|
+
"internalType": "uint256",
|
|
157
|
+
"name": "errorCode",
|
|
158
|
+
"type": "uint256"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"name": "RedeemComptrollerRejection",
|
|
162
|
+
"type": "error"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"inputs": [],
|
|
166
|
+
"name": "RedeemFreshnessCheck",
|
|
167
|
+
"type": "error"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"inputs": [],
|
|
171
|
+
"name": "RedeemTransferOutNotPossible",
|
|
172
|
+
"type": "error"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"inputs": [],
|
|
176
|
+
"name": "ReduceReservesAdminCheck",
|
|
177
|
+
"type": "error"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"inputs": [],
|
|
181
|
+
"name": "ReduceReservesCashNotAvailable",
|
|
182
|
+
"type": "error"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"inputs": [],
|
|
186
|
+
"name": "ReduceReservesCashValidation",
|
|
187
|
+
"type": "error"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [],
|
|
191
|
+
"name": "ReduceReservesFreshCheck",
|
|
192
|
+
"type": "error"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"inputs": [
|
|
196
|
+
{
|
|
197
|
+
"internalType": "uint256",
|
|
198
|
+
"name": "errorCode",
|
|
199
|
+
"type": "uint256"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"name": "RepayBorrowComptrollerRejection",
|
|
203
|
+
"type": "error"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"inputs": [],
|
|
207
|
+
"name": "RepayBorrowFreshnessCheck",
|
|
208
|
+
"type": "error"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"inputs": [],
|
|
212
|
+
"name": "SetComptrollerOwnerCheck",
|
|
213
|
+
"type": "error"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"inputs": [],
|
|
217
|
+
"name": "SetInterestRateModelFreshCheck",
|
|
218
|
+
"type": "error"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [],
|
|
222
|
+
"name": "SetInterestRateModelOwnerCheck",
|
|
223
|
+
"type": "error"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"inputs": [],
|
|
227
|
+
"name": "SetPendingAdminOwnerCheck",
|
|
228
|
+
"type": "error"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"inputs": [],
|
|
232
|
+
"name": "SetReserveFactorAdminCheck",
|
|
233
|
+
"type": "error"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"inputs": [],
|
|
237
|
+
"name": "SetReserveFactorBoundsCheck",
|
|
238
|
+
"type": "error"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"inputs": [],
|
|
242
|
+
"name": "SetReserveFactorFreshCheck",
|
|
243
|
+
"type": "error"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"inputs": [],
|
|
247
|
+
"name": "SetWhitelistAdminOwnerCheck",
|
|
248
|
+
"type": "error"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"inputs": [
|
|
252
|
+
{
|
|
253
|
+
"internalType": "uint256",
|
|
254
|
+
"name": "errorCode",
|
|
255
|
+
"type": "uint256"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"name": "TransferComptrollerRejection",
|
|
259
|
+
"type": "error"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"inputs": [],
|
|
263
|
+
"name": "TransferNotAllowed",
|
|
264
|
+
"type": "error"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"inputs": [],
|
|
268
|
+
"name": "TransferNotEnough",
|
|
269
|
+
"type": "error"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"inputs": [],
|
|
273
|
+
"name": "TransferTooMuch",
|
|
274
|
+
"type": "error"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"anonymous": false,
|
|
278
|
+
"inputs": [
|
|
279
|
+
{
|
|
280
|
+
"indexed": false,
|
|
281
|
+
"internalType": "uint256",
|
|
282
|
+
"name": "cashPrior",
|
|
283
|
+
"type": "uint256"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"indexed": false,
|
|
287
|
+
"internalType": "uint256",
|
|
288
|
+
"name": "interestAccumulated",
|
|
289
|
+
"type": "uint256"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"indexed": false,
|
|
293
|
+
"internalType": "uint256",
|
|
294
|
+
"name": "borrowIndex",
|
|
295
|
+
"type": "uint256"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"indexed": false,
|
|
299
|
+
"internalType": "uint256",
|
|
300
|
+
"name": "totalBorrows",
|
|
301
|
+
"type": "uint256"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"name": "AccrueInterest",
|
|
305
|
+
"type": "event"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"anonymous": false,
|
|
309
|
+
"inputs": [
|
|
310
|
+
{
|
|
311
|
+
"indexed": true,
|
|
312
|
+
"internalType": "address",
|
|
313
|
+
"name": "owner",
|
|
314
|
+
"type": "address"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"indexed": true,
|
|
318
|
+
"internalType": "address",
|
|
319
|
+
"name": "spender",
|
|
320
|
+
"type": "address"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"indexed": false,
|
|
324
|
+
"internalType": "uint256",
|
|
325
|
+
"name": "amount",
|
|
326
|
+
"type": "uint256"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"name": "Approval",
|
|
330
|
+
"type": "event"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"anonymous": false,
|
|
334
|
+
"inputs": [
|
|
335
|
+
{
|
|
336
|
+
"indexed": false,
|
|
337
|
+
"internalType": "address",
|
|
338
|
+
"name": "borrower",
|
|
339
|
+
"type": "address"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"indexed": false,
|
|
343
|
+
"internalType": "uint256",
|
|
344
|
+
"name": "borrowAmount",
|
|
345
|
+
"type": "uint256"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"indexed": false,
|
|
349
|
+
"internalType": "uint256",
|
|
350
|
+
"name": "accountBorrows",
|
|
351
|
+
"type": "uint256"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"indexed": false,
|
|
355
|
+
"internalType": "uint256",
|
|
356
|
+
"name": "totalBorrows",
|
|
357
|
+
"type": "uint256"
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"name": "Borrow",
|
|
361
|
+
"type": "event"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"anonymous": false,
|
|
365
|
+
"inputs": [
|
|
366
|
+
{
|
|
367
|
+
"indexed": false,
|
|
368
|
+
"internalType": "address",
|
|
369
|
+
"name": "liquidator",
|
|
370
|
+
"type": "address"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"indexed": false,
|
|
374
|
+
"internalType": "address",
|
|
375
|
+
"name": "borrower",
|
|
376
|
+
"type": "address"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"indexed": false,
|
|
380
|
+
"internalType": "uint256",
|
|
381
|
+
"name": "repayAmount",
|
|
382
|
+
"type": "uint256"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"indexed": false,
|
|
386
|
+
"internalType": "address",
|
|
387
|
+
"name": "cTokenCollateral",
|
|
388
|
+
"type": "address"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"indexed": false,
|
|
392
|
+
"internalType": "uint256",
|
|
393
|
+
"name": "seizeTokens",
|
|
394
|
+
"type": "uint256"
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"name": "LiquidateBorrow",
|
|
398
|
+
"type": "event"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"anonymous": false,
|
|
402
|
+
"inputs": [
|
|
403
|
+
{
|
|
404
|
+
"indexed": false,
|
|
405
|
+
"internalType": "address",
|
|
406
|
+
"name": "minter",
|
|
407
|
+
"type": "address"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"indexed": false,
|
|
411
|
+
"internalType": "uint256",
|
|
412
|
+
"name": "mintAmount",
|
|
413
|
+
"type": "uint256"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"indexed": false,
|
|
417
|
+
"internalType": "uint256",
|
|
418
|
+
"name": "mintTokens",
|
|
419
|
+
"type": "uint256"
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
"name": "Mint",
|
|
423
|
+
"type": "event"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"anonymous": false,
|
|
427
|
+
"inputs": [
|
|
428
|
+
{
|
|
429
|
+
"indexed": false,
|
|
430
|
+
"internalType": "address",
|
|
431
|
+
"name": "oldAdmin",
|
|
432
|
+
"type": "address"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"indexed": false,
|
|
436
|
+
"internalType": "address",
|
|
437
|
+
"name": "newAdmin",
|
|
438
|
+
"type": "address"
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"name": "NewAdmin",
|
|
442
|
+
"type": "event"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"anonymous": false,
|
|
446
|
+
"inputs": [
|
|
447
|
+
{
|
|
448
|
+
"indexed": false,
|
|
449
|
+
"internalType": "contract ComptrollerInterface",
|
|
450
|
+
"name": "oldComptroller",
|
|
451
|
+
"type": "address"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"indexed": false,
|
|
455
|
+
"internalType": "contract ComptrollerInterface",
|
|
456
|
+
"name": "newComptroller",
|
|
457
|
+
"type": "address"
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"name": "NewComptroller",
|
|
461
|
+
"type": "event"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"anonymous": false,
|
|
465
|
+
"inputs": [
|
|
466
|
+
{
|
|
467
|
+
"indexed": false,
|
|
468
|
+
"internalType": "contract InterestRateModel",
|
|
469
|
+
"name": "oldInterestRateModel",
|
|
470
|
+
"type": "address"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"indexed": false,
|
|
474
|
+
"internalType": "contract InterestRateModel",
|
|
475
|
+
"name": "newInterestRateModel",
|
|
476
|
+
"type": "address"
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
"name": "NewMarketInterestRateModel",
|
|
480
|
+
"type": "event"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"anonymous": false,
|
|
484
|
+
"inputs": [
|
|
485
|
+
{
|
|
486
|
+
"indexed": false,
|
|
487
|
+
"internalType": "address",
|
|
488
|
+
"name": "oldPendingAdmin",
|
|
489
|
+
"type": "address"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"indexed": false,
|
|
493
|
+
"internalType": "address",
|
|
494
|
+
"name": "newPendingAdmin",
|
|
495
|
+
"type": "address"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"name": "NewPendingAdmin",
|
|
499
|
+
"type": "event"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"anonymous": false,
|
|
503
|
+
"inputs": [
|
|
504
|
+
{
|
|
505
|
+
"indexed": false,
|
|
506
|
+
"internalType": "uint256",
|
|
507
|
+
"name": "oldReserveFactorMantissa",
|
|
508
|
+
"type": "uint256"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"indexed": false,
|
|
512
|
+
"internalType": "uint256",
|
|
513
|
+
"name": "newReserveFactorMantissa",
|
|
514
|
+
"type": "uint256"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
"name": "NewReserveFactor",
|
|
518
|
+
"type": "event"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"anonymous": false,
|
|
522
|
+
"inputs": [
|
|
523
|
+
{
|
|
524
|
+
"indexed": false,
|
|
525
|
+
"internalType": "contract WhitelistAccess",
|
|
526
|
+
"name": "oldWhitelist",
|
|
527
|
+
"type": "address"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"indexed": false,
|
|
531
|
+
"internalType": "contract WhitelistAccess",
|
|
532
|
+
"name": "newWhitelist",
|
|
533
|
+
"type": "address"
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
"name": "NewWhitelist",
|
|
537
|
+
"type": "event"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"anonymous": false,
|
|
541
|
+
"inputs": [
|
|
542
|
+
{
|
|
543
|
+
"indexed": false,
|
|
544
|
+
"internalType": "address",
|
|
545
|
+
"name": "redeemer",
|
|
546
|
+
"type": "address"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"indexed": false,
|
|
550
|
+
"internalType": "uint256",
|
|
551
|
+
"name": "redeemAmount",
|
|
552
|
+
"type": "uint256"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"indexed": false,
|
|
556
|
+
"internalType": "uint256",
|
|
557
|
+
"name": "redeemTokens",
|
|
558
|
+
"type": "uint256"
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"name": "Redeem",
|
|
562
|
+
"type": "event"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"anonymous": false,
|
|
566
|
+
"inputs": [
|
|
567
|
+
{
|
|
568
|
+
"indexed": false,
|
|
569
|
+
"internalType": "address",
|
|
570
|
+
"name": "payer",
|
|
571
|
+
"type": "address"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"indexed": false,
|
|
575
|
+
"internalType": "address",
|
|
576
|
+
"name": "borrower",
|
|
577
|
+
"type": "address"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"indexed": false,
|
|
581
|
+
"internalType": "uint256",
|
|
582
|
+
"name": "repayAmount",
|
|
583
|
+
"type": "uint256"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"indexed": false,
|
|
587
|
+
"internalType": "uint256",
|
|
588
|
+
"name": "accountBorrows",
|
|
589
|
+
"type": "uint256"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"indexed": false,
|
|
593
|
+
"internalType": "uint256",
|
|
594
|
+
"name": "totalBorrows",
|
|
595
|
+
"type": "uint256"
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
"name": "RepayBorrow",
|
|
599
|
+
"type": "event"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"anonymous": false,
|
|
603
|
+
"inputs": [
|
|
604
|
+
{
|
|
605
|
+
"indexed": false,
|
|
606
|
+
"internalType": "address",
|
|
607
|
+
"name": "benefactor",
|
|
608
|
+
"type": "address"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"indexed": false,
|
|
612
|
+
"internalType": "uint256",
|
|
613
|
+
"name": "addAmount",
|
|
614
|
+
"type": "uint256"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"indexed": false,
|
|
618
|
+
"internalType": "uint256",
|
|
619
|
+
"name": "newTotalReserves",
|
|
620
|
+
"type": "uint256"
|
|
621
|
+
}
|
|
622
|
+
],
|
|
623
|
+
"name": "ReservesAdded",
|
|
624
|
+
"type": "event"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"anonymous": false,
|
|
628
|
+
"inputs": [
|
|
629
|
+
{
|
|
630
|
+
"indexed": false,
|
|
631
|
+
"internalType": "address",
|
|
632
|
+
"name": "admin",
|
|
633
|
+
"type": "address"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"indexed": false,
|
|
637
|
+
"internalType": "uint256",
|
|
638
|
+
"name": "reduceAmount",
|
|
639
|
+
"type": "uint256"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"indexed": false,
|
|
643
|
+
"internalType": "uint256",
|
|
644
|
+
"name": "newTotalReserves",
|
|
645
|
+
"type": "uint256"
|
|
646
|
+
}
|
|
647
|
+
],
|
|
648
|
+
"name": "ReservesReduced",
|
|
649
|
+
"type": "event"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"anonymous": false,
|
|
653
|
+
"inputs": [
|
|
654
|
+
{
|
|
655
|
+
"indexed": true,
|
|
656
|
+
"internalType": "address",
|
|
657
|
+
"name": "from",
|
|
658
|
+
"type": "address"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"indexed": true,
|
|
662
|
+
"internalType": "address",
|
|
663
|
+
"name": "to",
|
|
664
|
+
"type": "address"
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"indexed": false,
|
|
668
|
+
"internalType": "uint256",
|
|
669
|
+
"name": "amount",
|
|
670
|
+
"type": "uint256"
|
|
671
|
+
}
|
|
672
|
+
],
|
|
673
|
+
"name": "Transfer",
|
|
674
|
+
"type": "event"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"inputs": [],
|
|
678
|
+
"name": "NO_ERROR",
|
|
679
|
+
"outputs": [
|
|
680
|
+
{
|
|
681
|
+
"internalType": "uint256",
|
|
682
|
+
"name": "",
|
|
683
|
+
"type": "uint256"
|
|
684
|
+
}
|
|
685
|
+
],
|
|
686
|
+
"stateMutability": "view",
|
|
687
|
+
"type": "function"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"inputs": [],
|
|
691
|
+
"name": "_acceptAdmin",
|
|
692
|
+
"outputs": [
|
|
693
|
+
{
|
|
694
|
+
"internalType": "uint256",
|
|
695
|
+
"name": "",
|
|
696
|
+
"type": "uint256"
|
|
697
|
+
}
|
|
698
|
+
],
|
|
699
|
+
"stateMutability": "nonpayable",
|
|
700
|
+
"type": "function"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"inputs": [
|
|
704
|
+
{
|
|
705
|
+
"internalType": "uint256",
|
|
706
|
+
"name": "addAmount",
|
|
707
|
+
"type": "uint256"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
"name": "_addReserves",
|
|
711
|
+
"outputs": [
|
|
712
|
+
{
|
|
713
|
+
"internalType": "uint256",
|
|
714
|
+
"name": "",
|
|
715
|
+
"type": "uint256"
|
|
716
|
+
}
|
|
717
|
+
],
|
|
718
|
+
"stateMutability": "nonpayable",
|
|
719
|
+
"type": "function"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"inputs": [
|
|
723
|
+
{
|
|
724
|
+
"internalType": "bytes",
|
|
725
|
+
"name": "data",
|
|
726
|
+
"type": "bytes"
|
|
727
|
+
}
|
|
728
|
+
],
|
|
729
|
+
"name": "_becomeImplementation",
|
|
730
|
+
"outputs": [],
|
|
731
|
+
"stateMutability": "nonpayable",
|
|
732
|
+
"type": "function"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"inputs": [
|
|
736
|
+
{
|
|
737
|
+
"internalType": "address",
|
|
738
|
+
"name": "compLikeDelegatee",
|
|
739
|
+
"type": "address"
|
|
740
|
+
}
|
|
741
|
+
],
|
|
742
|
+
"name": "_delegateCompLikeTo",
|
|
743
|
+
"outputs": [],
|
|
744
|
+
"stateMutability": "nonpayable",
|
|
745
|
+
"type": "function"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"inputs": [
|
|
749
|
+
{
|
|
750
|
+
"internalType": "uint256",
|
|
751
|
+
"name": "reduceAmount",
|
|
752
|
+
"type": "uint256"
|
|
753
|
+
}
|
|
754
|
+
],
|
|
755
|
+
"name": "_reduceReserves",
|
|
756
|
+
"outputs": [
|
|
757
|
+
{
|
|
758
|
+
"internalType": "uint256",
|
|
759
|
+
"name": "",
|
|
760
|
+
"type": "uint256"
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
"stateMutability": "nonpayable",
|
|
764
|
+
"type": "function"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"inputs": [],
|
|
768
|
+
"name": "_resignImplementation",
|
|
769
|
+
"outputs": [],
|
|
770
|
+
"stateMutability": "nonpayable",
|
|
771
|
+
"type": "function"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"inputs": [
|
|
775
|
+
{
|
|
776
|
+
"internalType": "contract ComptrollerInterface",
|
|
777
|
+
"name": "newComptroller",
|
|
778
|
+
"type": "address"
|
|
779
|
+
}
|
|
780
|
+
],
|
|
781
|
+
"name": "_setComptroller",
|
|
782
|
+
"outputs": [
|
|
783
|
+
{
|
|
784
|
+
"internalType": "uint256",
|
|
785
|
+
"name": "",
|
|
786
|
+
"type": "uint256"
|
|
787
|
+
}
|
|
788
|
+
],
|
|
789
|
+
"stateMutability": "nonpayable",
|
|
790
|
+
"type": "function"
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"inputs": [
|
|
794
|
+
{
|
|
795
|
+
"internalType": "contract InterestRateModel",
|
|
796
|
+
"name": "newInterestRateModel",
|
|
797
|
+
"type": "address"
|
|
798
|
+
}
|
|
799
|
+
],
|
|
800
|
+
"name": "_setInterestRateModel",
|
|
801
|
+
"outputs": [
|
|
802
|
+
{
|
|
803
|
+
"internalType": "uint256",
|
|
804
|
+
"name": "",
|
|
805
|
+
"type": "uint256"
|
|
806
|
+
}
|
|
807
|
+
],
|
|
808
|
+
"stateMutability": "nonpayable",
|
|
809
|
+
"type": "function"
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"inputs": [
|
|
813
|
+
{
|
|
814
|
+
"internalType": "address payable",
|
|
815
|
+
"name": "newPendingAdmin",
|
|
816
|
+
"type": "address"
|
|
817
|
+
}
|
|
818
|
+
],
|
|
819
|
+
"name": "_setPendingAdmin",
|
|
820
|
+
"outputs": [
|
|
821
|
+
{
|
|
822
|
+
"internalType": "uint256",
|
|
823
|
+
"name": "",
|
|
824
|
+
"type": "uint256"
|
|
825
|
+
}
|
|
826
|
+
],
|
|
827
|
+
"stateMutability": "nonpayable",
|
|
828
|
+
"type": "function"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"inputs": [
|
|
832
|
+
{
|
|
833
|
+
"internalType": "uint256",
|
|
834
|
+
"name": "newReserveFactorMantissa",
|
|
835
|
+
"type": "uint256"
|
|
836
|
+
}
|
|
837
|
+
],
|
|
838
|
+
"name": "_setReserveFactor",
|
|
839
|
+
"outputs": [
|
|
840
|
+
{
|
|
841
|
+
"internalType": "uint256",
|
|
842
|
+
"name": "",
|
|
843
|
+
"type": "uint256"
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"stateMutability": "nonpayable",
|
|
847
|
+
"type": "function"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"inputs": [
|
|
851
|
+
{
|
|
852
|
+
"internalType": "contract WhitelistAccess",
|
|
853
|
+
"name": "newWhitelist",
|
|
854
|
+
"type": "address"
|
|
855
|
+
}
|
|
856
|
+
],
|
|
857
|
+
"name": "_setWhitelist",
|
|
858
|
+
"outputs": [
|
|
859
|
+
{
|
|
860
|
+
"internalType": "uint256",
|
|
861
|
+
"name": "",
|
|
862
|
+
"type": "uint256"
|
|
863
|
+
}
|
|
864
|
+
],
|
|
865
|
+
"stateMutability": "nonpayable",
|
|
866
|
+
"type": "function"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"inputs": [],
|
|
870
|
+
"name": "accrualBlockNumber",
|
|
871
|
+
"outputs": [
|
|
872
|
+
{
|
|
873
|
+
"internalType": "uint256",
|
|
874
|
+
"name": "",
|
|
875
|
+
"type": "uint256"
|
|
876
|
+
}
|
|
877
|
+
],
|
|
878
|
+
"stateMutability": "view",
|
|
879
|
+
"type": "function"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"inputs": [],
|
|
883
|
+
"name": "accrueInterest",
|
|
884
|
+
"outputs": [
|
|
885
|
+
{
|
|
886
|
+
"internalType": "uint256",
|
|
887
|
+
"name": "",
|
|
888
|
+
"type": "uint256"
|
|
889
|
+
}
|
|
890
|
+
],
|
|
891
|
+
"stateMutability": "nonpayable",
|
|
892
|
+
"type": "function"
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"inputs": [],
|
|
896
|
+
"name": "admin",
|
|
897
|
+
"outputs": [
|
|
898
|
+
{
|
|
899
|
+
"internalType": "address payable",
|
|
900
|
+
"name": "",
|
|
901
|
+
"type": "address"
|
|
902
|
+
}
|
|
903
|
+
],
|
|
904
|
+
"stateMutability": "view",
|
|
905
|
+
"type": "function"
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"inputs": [
|
|
909
|
+
{
|
|
910
|
+
"internalType": "address",
|
|
911
|
+
"name": "owner",
|
|
912
|
+
"type": "address"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"internalType": "address",
|
|
916
|
+
"name": "spender",
|
|
917
|
+
"type": "address"
|
|
918
|
+
}
|
|
919
|
+
],
|
|
920
|
+
"name": "allowance",
|
|
921
|
+
"outputs": [
|
|
922
|
+
{
|
|
923
|
+
"internalType": "uint256",
|
|
924
|
+
"name": "",
|
|
925
|
+
"type": "uint256"
|
|
926
|
+
}
|
|
927
|
+
],
|
|
928
|
+
"stateMutability": "view",
|
|
929
|
+
"type": "function"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"inputs": [
|
|
933
|
+
{
|
|
934
|
+
"internalType": "address",
|
|
935
|
+
"name": "spender",
|
|
936
|
+
"type": "address"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
"internalType": "uint256",
|
|
940
|
+
"name": "amount",
|
|
941
|
+
"type": "uint256"
|
|
942
|
+
}
|
|
943
|
+
],
|
|
944
|
+
"name": "approve",
|
|
945
|
+
"outputs": [
|
|
946
|
+
{
|
|
947
|
+
"internalType": "bool",
|
|
948
|
+
"name": "",
|
|
949
|
+
"type": "bool"
|
|
950
|
+
}
|
|
951
|
+
],
|
|
952
|
+
"stateMutability": "nonpayable",
|
|
953
|
+
"type": "function"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"inputs": [
|
|
957
|
+
{
|
|
958
|
+
"internalType": "address",
|
|
959
|
+
"name": "owner",
|
|
960
|
+
"type": "address"
|
|
961
|
+
}
|
|
962
|
+
],
|
|
963
|
+
"name": "balanceOf",
|
|
964
|
+
"outputs": [
|
|
965
|
+
{
|
|
966
|
+
"internalType": "uint256",
|
|
967
|
+
"name": "",
|
|
968
|
+
"type": "uint256"
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
"stateMutability": "view",
|
|
972
|
+
"type": "function"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"inputs": [
|
|
976
|
+
{
|
|
977
|
+
"internalType": "address",
|
|
978
|
+
"name": "owner",
|
|
979
|
+
"type": "address"
|
|
980
|
+
}
|
|
981
|
+
],
|
|
982
|
+
"name": "balanceOfUnderlying",
|
|
983
|
+
"outputs": [
|
|
984
|
+
{
|
|
985
|
+
"internalType": "uint256",
|
|
986
|
+
"name": "",
|
|
987
|
+
"type": "uint256"
|
|
988
|
+
}
|
|
989
|
+
],
|
|
990
|
+
"stateMutability": "nonpayable",
|
|
991
|
+
"type": "function"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"inputs": [
|
|
995
|
+
{
|
|
996
|
+
"internalType": "uint256",
|
|
997
|
+
"name": "borrowAmount",
|
|
998
|
+
"type": "uint256"
|
|
999
|
+
}
|
|
1000
|
+
],
|
|
1001
|
+
"name": "borrow",
|
|
1002
|
+
"outputs": [
|
|
1003
|
+
{
|
|
1004
|
+
"internalType": "uint256",
|
|
1005
|
+
"name": "",
|
|
1006
|
+
"type": "uint256"
|
|
1007
|
+
}
|
|
1008
|
+
],
|
|
1009
|
+
"stateMutability": "nonpayable",
|
|
1010
|
+
"type": "function"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"inputs": [
|
|
1014
|
+
{
|
|
1015
|
+
"internalType": "address",
|
|
1016
|
+
"name": "account",
|
|
1017
|
+
"type": "address"
|
|
1018
|
+
}
|
|
1019
|
+
],
|
|
1020
|
+
"name": "borrowBalanceCurrent",
|
|
1021
|
+
"outputs": [
|
|
1022
|
+
{
|
|
1023
|
+
"internalType": "uint256",
|
|
1024
|
+
"name": "",
|
|
1025
|
+
"type": "uint256"
|
|
1026
|
+
}
|
|
1027
|
+
],
|
|
1028
|
+
"stateMutability": "nonpayable",
|
|
1029
|
+
"type": "function"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"inputs": [
|
|
1033
|
+
{
|
|
1034
|
+
"internalType": "address",
|
|
1035
|
+
"name": "account",
|
|
1036
|
+
"type": "address"
|
|
1037
|
+
}
|
|
1038
|
+
],
|
|
1039
|
+
"name": "borrowBalanceStored",
|
|
1040
|
+
"outputs": [
|
|
1041
|
+
{
|
|
1042
|
+
"internalType": "uint256",
|
|
1043
|
+
"name": "",
|
|
1044
|
+
"type": "uint256"
|
|
1045
|
+
}
|
|
1046
|
+
],
|
|
1047
|
+
"stateMutability": "view",
|
|
1048
|
+
"type": "function"
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
"inputs": [],
|
|
1052
|
+
"name": "borrowIndex",
|
|
1053
|
+
"outputs": [
|
|
1054
|
+
{
|
|
1055
|
+
"internalType": "uint256",
|
|
1056
|
+
"name": "",
|
|
1057
|
+
"type": "uint256"
|
|
1058
|
+
}
|
|
1059
|
+
],
|
|
1060
|
+
"stateMutability": "view",
|
|
1061
|
+
"type": "function"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"inputs": [],
|
|
1065
|
+
"name": "borrowRatePerBlock",
|
|
1066
|
+
"outputs": [
|
|
1067
|
+
{
|
|
1068
|
+
"internalType": "uint256",
|
|
1069
|
+
"name": "",
|
|
1070
|
+
"type": "uint256"
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
|
+
"stateMutability": "view",
|
|
1074
|
+
"type": "function"
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
"inputs": [],
|
|
1078
|
+
"name": "comptroller",
|
|
1079
|
+
"outputs": [
|
|
1080
|
+
{
|
|
1081
|
+
"internalType": "contract ComptrollerInterface",
|
|
1082
|
+
"name": "",
|
|
1083
|
+
"type": "address"
|
|
1084
|
+
}
|
|
1085
|
+
],
|
|
1086
|
+
"stateMutability": "view",
|
|
1087
|
+
"type": "function"
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"inputs": [],
|
|
1091
|
+
"name": "decimals",
|
|
1092
|
+
"outputs": [
|
|
1093
|
+
{
|
|
1094
|
+
"internalType": "uint8",
|
|
1095
|
+
"name": "",
|
|
1096
|
+
"type": "uint8"
|
|
1097
|
+
}
|
|
1098
|
+
],
|
|
1099
|
+
"stateMutability": "view",
|
|
1100
|
+
"type": "function"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"inputs": [],
|
|
1104
|
+
"name": "exchangeRateCurrent",
|
|
1105
|
+
"outputs": [
|
|
1106
|
+
{
|
|
1107
|
+
"internalType": "uint256",
|
|
1108
|
+
"name": "",
|
|
1109
|
+
"type": "uint256"
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
"stateMutability": "nonpayable",
|
|
1113
|
+
"type": "function"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"inputs": [],
|
|
1117
|
+
"name": "exchangeRateStored",
|
|
1118
|
+
"outputs": [
|
|
1119
|
+
{
|
|
1120
|
+
"internalType": "uint256",
|
|
1121
|
+
"name": "",
|
|
1122
|
+
"type": "uint256"
|
|
1123
|
+
}
|
|
1124
|
+
],
|
|
1125
|
+
"stateMutability": "view",
|
|
1126
|
+
"type": "function"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"inputs": [
|
|
1130
|
+
{
|
|
1131
|
+
"internalType": "address",
|
|
1132
|
+
"name": "account",
|
|
1133
|
+
"type": "address"
|
|
1134
|
+
}
|
|
1135
|
+
],
|
|
1136
|
+
"name": "getAccountSnapshot",
|
|
1137
|
+
"outputs": [
|
|
1138
|
+
{
|
|
1139
|
+
"internalType": "uint256",
|
|
1140
|
+
"name": "",
|
|
1141
|
+
"type": "uint256"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"internalType": "uint256",
|
|
1145
|
+
"name": "",
|
|
1146
|
+
"type": "uint256"
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"internalType": "uint256",
|
|
1150
|
+
"name": "",
|
|
1151
|
+
"type": "uint256"
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
"internalType": "uint256",
|
|
1155
|
+
"name": "",
|
|
1156
|
+
"type": "uint256"
|
|
1157
|
+
}
|
|
1158
|
+
],
|
|
1159
|
+
"stateMutability": "view",
|
|
1160
|
+
"type": "function"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"inputs": [],
|
|
1164
|
+
"name": "getCash",
|
|
1165
|
+
"outputs": [
|
|
1166
|
+
{
|
|
1167
|
+
"internalType": "uint256",
|
|
1168
|
+
"name": "",
|
|
1169
|
+
"type": "uint256"
|
|
1170
|
+
}
|
|
1171
|
+
],
|
|
1172
|
+
"stateMutability": "view",
|
|
1173
|
+
"type": "function"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"inputs": [],
|
|
1177
|
+
"name": "implementation",
|
|
1178
|
+
"outputs": [
|
|
1179
|
+
{
|
|
1180
|
+
"internalType": "address",
|
|
1181
|
+
"name": "",
|
|
1182
|
+
"type": "address"
|
|
1183
|
+
}
|
|
1184
|
+
],
|
|
1185
|
+
"stateMutability": "view",
|
|
1186
|
+
"type": "function"
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
"inputs": [
|
|
1190
|
+
{
|
|
1191
|
+
"internalType": "address",
|
|
1192
|
+
"name": "underlying_",
|
|
1193
|
+
"type": "address"
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
"internalType": "contract ComptrollerInterface",
|
|
1197
|
+
"name": "comptroller_",
|
|
1198
|
+
"type": "address"
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"internalType": "contract InterestRateModel",
|
|
1202
|
+
"name": "interestRateModel_",
|
|
1203
|
+
"type": "address"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
"internalType": "uint256",
|
|
1207
|
+
"name": "initialExchangeRateMantissa_",
|
|
1208
|
+
"type": "uint256"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
"internalType": "string",
|
|
1212
|
+
"name": "name_",
|
|
1213
|
+
"type": "string"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"internalType": "string",
|
|
1217
|
+
"name": "symbol_",
|
|
1218
|
+
"type": "string"
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"internalType": "uint8",
|
|
1222
|
+
"name": "decimals_",
|
|
1223
|
+
"type": "uint8"
|
|
1224
|
+
}
|
|
1225
|
+
],
|
|
1226
|
+
"name": "initialize",
|
|
1227
|
+
"outputs": [],
|
|
1228
|
+
"stateMutability": "nonpayable",
|
|
1229
|
+
"type": "function"
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"inputs": [
|
|
1233
|
+
{
|
|
1234
|
+
"internalType": "contract ComptrollerInterface",
|
|
1235
|
+
"name": "comptroller_",
|
|
1236
|
+
"type": "address"
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
"internalType": "contract InterestRateModel",
|
|
1240
|
+
"name": "interestRateModel_",
|
|
1241
|
+
"type": "address"
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"internalType": "uint256",
|
|
1245
|
+
"name": "initialExchangeRateMantissa_",
|
|
1246
|
+
"type": "uint256"
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
"internalType": "string",
|
|
1250
|
+
"name": "name_",
|
|
1251
|
+
"type": "string"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"internalType": "string",
|
|
1255
|
+
"name": "symbol_",
|
|
1256
|
+
"type": "string"
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"internalType": "uint8",
|
|
1260
|
+
"name": "decimals_",
|
|
1261
|
+
"type": "uint8"
|
|
1262
|
+
}
|
|
1263
|
+
],
|
|
1264
|
+
"name": "initialize",
|
|
1265
|
+
"outputs": [],
|
|
1266
|
+
"stateMutability": "nonpayable",
|
|
1267
|
+
"type": "function"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"inputs": [],
|
|
1271
|
+
"name": "interestRateModel",
|
|
1272
|
+
"outputs": [
|
|
1273
|
+
{
|
|
1274
|
+
"internalType": "contract InterestRateModel",
|
|
1275
|
+
"name": "",
|
|
1276
|
+
"type": "address"
|
|
1277
|
+
}
|
|
1278
|
+
],
|
|
1279
|
+
"stateMutability": "view",
|
|
1280
|
+
"type": "function"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"inputs": [],
|
|
1284
|
+
"name": "isCToken",
|
|
1285
|
+
"outputs": [
|
|
1286
|
+
{
|
|
1287
|
+
"internalType": "bool",
|
|
1288
|
+
"name": "",
|
|
1289
|
+
"type": "bool"
|
|
1290
|
+
}
|
|
1291
|
+
],
|
|
1292
|
+
"stateMutability": "view",
|
|
1293
|
+
"type": "function"
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
"inputs": [
|
|
1297
|
+
{
|
|
1298
|
+
"internalType": "address",
|
|
1299
|
+
"name": "borrower",
|
|
1300
|
+
"type": "address"
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
"internalType": "uint256",
|
|
1304
|
+
"name": "repayAmount",
|
|
1305
|
+
"type": "uint256"
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
"internalType": "contract CTokenInterface",
|
|
1309
|
+
"name": "cTokenCollateral",
|
|
1310
|
+
"type": "address"
|
|
1311
|
+
}
|
|
1312
|
+
],
|
|
1313
|
+
"name": "liquidateBorrow",
|
|
1314
|
+
"outputs": [
|
|
1315
|
+
{
|
|
1316
|
+
"internalType": "uint256",
|
|
1317
|
+
"name": "",
|
|
1318
|
+
"type": "uint256"
|
|
1319
|
+
}
|
|
1320
|
+
],
|
|
1321
|
+
"stateMutability": "nonpayable",
|
|
1322
|
+
"type": "function"
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
"inputs": [
|
|
1326
|
+
{
|
|
1327
|
+
"internalType": "uint256",
|
|
1328
|
+
"name": "mintAmount",
|
|
1329
|
+
"type": "uint256"
|
|
1330
|
+
}
|
|
1331
|
+
],
|
|
1332
|
+
"name": "mint",
|
|
1333
|
+
"outputs": [
|
|
1334
|
+
{
|
|
1335
|
+
"internalType": "uint256",
|
|
1336
|
+
"name": "",
|
|
1337
|
+
"type": "uint256"
|
|
1338
|
+
}
|
|
1339
|
+
],
|
|
1340
|
+
"stateMutability": "nonpayable",
|
|
1341
|
+
"type": "function"
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
"inputs": [],
|
|
1345
|
+
"name": "name",
|
|
1346
|
+
"outputs": [
|
|
1347
|
+
{
|
|
1348
|
+
"internalType": "string",
|
|
1349
|
+
"name": "",
|
|
1350
|
+
"type": "string"
|
|
1351
|
+
}
|
|
1352
|
+
],
|
|
1353
|
+
"stateMutability": "view",
|
|
1354
|
+
"type": "function"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"inputs": [],
|
|
1358
|
+
"name": "pendingAdmin",
|
|
1359
|
+
"outputs": [
|
|
1360
|
+
{
|
|
1361
|
+
"internalType": "address payable",
|
|
1362
|
+
"name": "",
|
|
1363
|
+
"type": "address"
|
|
1364
|
+
}
|
|
1365
|
+
],
|
|
1366
|
+
"stateMutability": "view",
|
|
1367
|
+
"type": "function"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"inputs": [],
|
|
1371
|
+
"name": "protocolSeizeShareMantissa",
|
|
1372
|
+
"outputs": [
|
|
1373
|
+
{
|
|
1374
|
+
"internalType": "uint256",
|
|
1375
|
+
"name": "",
|
|
1376
|
+
"type": "uint256"
|
|
1377
|
+
}
|
|
1378
|
+
],
|
|
1379
|
+
"stateMutability": "view",
|
|
1380
|
+
"type": "function"
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
"inputs": [
|
|
1384
|
+
{
|
|
1385
|
+
"internalType": "uint256",
|
|
1386
|
+
"name": "redeemTokens",
|
|
1387
|
+
"type": "uint256"
|
|
1388
|
+
}
|
|
1389
|
+
],
|
|
1390
|
+
"name": "redeem",
|
|
1391
|
+
"outputs": [
|
|
1392
|
+
{
|
|
1393
|
+
"internalType": "uint256",
|
|
1394
|
+
"name": "",
|
|
1395
|
+
"type": "uint256"
|
|
1396
|
+
}
|
|
1397
|
+
],
|
|
1398
|
+
"stateMutability": "nonpayable",
|
|
1399
|
+
"type": "function"
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"inputs": [
|
|
1403
|
+
{
|
|
1404
|
+
"internalType": "uint256",
|
|
1405
|
+
"name": "redeemAmount",
|
|
1406
|
+
"type": "uint256"
|
|
1407
|
+
}
|
|
1408
|
+
],
|
|
1409
|
+
"name": "redeemUnderlying",
|
|
1410
|
+
"outputs": [
|
|
1411
|
+
{
|
|
1412
|
+
"internalType": "uint256",
|
|
1413
|
+
"name": "",
|
|
1414
|
+
"type": "uint256"
|
|
1415
|
+
}
|
|
1416
|
+
],
|
|
1417
|
+
"stateMutability": "nonpayable",
|
|
1418
|
+
"type": "function"
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
"inputs": [
|
|
1422
|
+
{
|
|
1423
|
+
"internalType": "uint256",
|
|
1424
|
+
"name": "repayAmount",
|
|
1425
|
+
"type": "uint256"
|
|
1426
|
+
}
|
|
1427
|
+
],
|
|
1428
|
+
"name": "repayBorrow",
|
|
1429
|
+
"outputs": [
|
|
1430
|
+
{
|
|
1431
|
+
"internalType": "uint256",
|
|
1432
|
+
"name": "",
|
|
1433
|
+
"type": "uint256"
|
|
1434
|
+
}
|
|
1435
|
+
],
|
|
1436
|
+
"stateMutability": "nonpayable",
|
|
1437
|
+
"type": "function"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
"inputs": [
|
|
1441
|
+
{
|
|
1442
|
+
"internalType": "address",
|
|
1443
|
+
"name": "borrower",
|
|
1444
|
+
"type": "address"
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
"internalType": "uint256",
|
|
1448
|
+
"name": "repayAmount",
|
|
1449
|
+
"type": "uint256"
|
|
1450
|
+
}
|
|
1451
|
+
],
|
|
1452
|
+
"name": "repayBorrowBehalf",
|
|
1453
|
+
"outputs": [
|
|
1454
|
+
{
|
|
1455
|
+
"internalType": "uint256",
|
|
1456
|
+
"name": "",
|
|
1457
|
+
"type": "uint256"
|
|
1458
|
+
}
|
|
1459
|
+
],
|
|
1460
|
+
"stateMutability": "nonpayable",
|
|
1461
|
+
"type": "function"
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
"inputs": [],
|
|
1465
|
+
"name": "reserveFactorMantissa",
|
|
1466
|
+
"outputs": [
|
|
1467
|
+
{
|
|
1468
|
+
"internalType": "uint256",
|
|
1469
|
+
"name": "",
|
|
1470
|
+
"type": "uint256"
|
|
1471
|
+
}
|
|
1472
|
+
],
|
|
1473
|
+
"stateMutability": "view",
|
|
1474
|
+
"type": "function"
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"inputs": [
|
|
1478
|
+
{
|
|
1479
|
+
"internalType": "address",
|
|
1480
|
+
"name": "liquidator",
|
|
1481
|
+
"type": "address"
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
"internalType": "address",
|
|
1485
|
+
"name": "borrower",
|
|
1486
|
+
"type": "address"
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
"internalType": "uint256",
|
|
1490
|
+
"name": "seizeTokens",
|
|
1491
|
+
"type": "uint256"
|
|
1492
|
+
}
|
|
1493
|
+
],
|
|
1494
|
+
"name": "seize",
|
|
1495
|
+
"outputs": [
|
|
1496
|
+
{
|
|
1497
|
+
"internalType": "uint256",
|
|
1498
|
+
"name": "",
|
|
1499
|
+
"type": "uint256"
|
|
1500
|
+
}
|
|
1501
|
+
],
|
|
1502
|
+
"stateMutability": "nonpayable",
|
|
1503
|
+
"type": "function"
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"inputs": [],
|
|
1507
|
+
"name": "supplyRatePerBlock",
|
|
1508
|
+
"outputs": [
|
|
1509
|
+
{
|
|
1510
|
+
"internalType": "uint256",
|
|
1511
|
+
"name": "",
|
|
1512
|
+
"type": "uint256"
|
|
1513
|
+
}
|
|
1514
|
+
],
|
|
1515
|
+
"stateMutability": "view",
|
|
1516
|
+
"type": "function"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"inputs": [
|
|
1520
|
+
{
|
|
1521
|
+
"internalType": "contract EIP20NonStandardInterface",
|
|
1522
|
+
"name": "token",
|
|
1523
|
+
"type": "address"
|
|
1524
|
+
}
|
|
1525
|
+
],
|
|
1526
|
+
"name": "sweepToken",
|
|
1527
|
+
"outputs": [],
|
|
1528
|
+
"stateMutability": "nonpayable",
|
|
1529
|
+
"type": "function"
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
"inputs": [],
|
|
1533
|
+
"name": "symbol",
|
|
1534
|
+
"outputs": [
|
|
1535
|
+
{
|
|
1536
|
+
"internalType": "string",
|
|
1537
|
+
"name": "",
|
|
1538
|
+
"type": "string"
|
|
1539
|
+
}
|
|
1540
|
+
],
|
|
1541
|
+
"stateMutability": "view",
|
|
1542
|
+
"type": "function"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"inputs": [],
|
|
1546
|
+
"name": "totalBorrows",
|
|
1547
|
+
"outputs": [
|
|
1548
|
+
{
|
|
1549
|
+
"internalType": "uint256",
|
|
1550
|
+
"name": "",
|
|
1551
|
+
"type": "uint256"
|
|
1552
|
+
}
|
|
1553
|
+
],
|
|
1554
|
+
"stateMutability": "view",
|
|
1555
|
+
"type": "function"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"inputs": [],
|
|
1559
|
+
"name": "totalBorrowsCurrent",
|
|
1560
|
+
"outputs": [
|
|
1561
|
+
{
|
|
1562
|
+
"internalType": "uint256",
|
|
1563
|
+
"name": "",
|
|
1564
|
+
"type": "uint256"
|
|
1565
|
+
}
|
|
1566
|
+
],
|
|
1567
|
+
"stateMutability": "nonpayable",
|
|
1568
|
+
"type": "function"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"inputs": [],
|
|
1572
|
+
"name": "totalReserves",
|
|
1573
|
+
"outputs": [
|
|
1574
|
+
{
|
|
1575
|
+
"internalType": "uint256",
|
|
1576
|
+
"name": "",
|
|
1577
|
+
"type": "uint256"
|
|
1578
|
+
}
|
|
1579
|
+
],
|
|
1580
|
+
"stateMutability": "view",
|
|
1581
|
+
"type": "function"
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
"inputs": [],
|
|
1585
|
+
"name": "totalSupply",
|
|
1586
|
+
"outputs": [
|
|
1587
|
+
{
|
|
1588
|
+
"internalType": "uint256",
|
|
1589
|
+
"name": "",
|
|
1590
|
+
"type": "uint256"
|
|
1591
|
+
}
|
|
1592
|
+
],
|
|
1593
|
+
"stateMutability": "view",
|
|
1594
|
+
"type": "function"
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
"inputs": [
|
|
1598
|
+
{
|
|
1599
|
+
"internalType": "address",
|
|
1600
|
+
"name": "dst",
|
|
1601
|
+
"type": "address"
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
"internalType": "uint256",
|
|
1605
|
+
"name": "amount",
|
|
1606
|
+
"type": "uint256"
|
|
1607
|
+
}
|
|
1608
|
+
],
|
|
1609
|
+
"name": "transfer",
|
|
1610
|
+
"outputs": [
|
|
1611
|
+
{
|
|
1612
|
+
"internalType": "bool",
|
|
1613
|
+
"name": "",
|
|
1614
|
+
"type": "bool"
|
|
1615
|
+
}
|
|
1616
|
+
],
|
|
1617
|
+
"stateMutability": "nonpayable",
|
|
1618
|
+
"type": "function"
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"inputs": [
|
|
1622
|
+
{
|
|
1623
|
+
"internalType": "address",
|
|
1624
|
+
"name": "src",
|
|
1625
|
+
"type": "address"
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"internalType": "address",
|
|
1629
|
+
"name": "dst",
|
|
1630
|
+
"type": "address"
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
"internalType": "uint256",
|
|
1634
|
+
"name": "amount",
|
|
1635
|
+
"type": "uint256"
|
|
1636
|
+
}
|
|
1637
|
+
],
|
|
1638
|
+
"name": "transferFrom",
|
|
1639
|
+
"outputs": [
|
|
1640
|
+
{
|
|
1641
|
+
"internalType": "bool",
|
|
1642
|
+
"name": "",
|
|
1643
|
+
"type": "bool"
|
|
1644
|
+
}
|
|
1645
|
+
],
|
|
1646
|
+
"stateMutability": "nonpayable",
|
|
1647
|
+
"type": "function"
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
"inputs": [],
|
|
1651
|
+
"name": "underlying",
|
|
1652
|
+
"outputs": [
|
|
1653
|
+
{
|
|
1654
|
+
"internalType": "address",
|
|
1655
|
+
"name": "",
|
|
1656
|
+
"type": "address"
|
|
1657
|
+
}
|
|
1658
|
+
],
|
|
1659
|
+
"stateMutability": "view",
|
|
1660
|
+
"type": "function"
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"inputs": [],
|
|
1664
|
+
"name": "whitelist",
|
|
1665
|
+
"outputs": [
|
|
1666
|
+
{
|
|
1667
|
+
"internalType": "contract WhitelistAccess",
|
|
1668
|
+
"name": "",
|
|
1669
|
+
"type": "address"
|
|
1670
|
+
}
|
|
1671
|
+
],
|
|
1672
|
+
"stateMutability": "view",
|
|
1673
|
+
"type": "function"
|
|
1674
|
+
}
|
|
1675
|
+
] as const satisfies Abi;
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* Type-safe ABI for CErc20Delegate_json
|
|
1679
|
+
*/
|
|
1680
|
+
export type CErc20Delegate_jsonAbi = typeof CErc20Delegate_jsonAbi;
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* Contract instance type for CErc20Delegate_json
|
|
1684
|
+
*/
|
|
1685
|
+
// Use any for contract type to avoid complex viem type issues
|
|
1686
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
1687
|
+
export type CErc20Delegate_jsonContract = any;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* CErc20Delegate_json Contract Class
|
|
1691
|
+
*
|
|
1692
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1693
|
+
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```typescript
|
|
1696
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1697
|
+
* import { mainnet } from 'viem/chains';
|
|
1698
|
+
* import { CErc20Delegate_json } from 'CErc20Delegate_json';
|
|
1699
|
+
*
|
|
1700
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1701
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1702
|
+
*
|
|
1703
|
+
* const contract = new CErc20Delegate_json('0x...', { publicClient, walletClient });
|
|
1704
|
+
*
|
|
1705
|
+
* // Read functions
|
|
1706
|
+
* const result = await contract.balanceOf('0x...');
|
|
1707
|
+
*
|
|
1708
|
+
* // Write functions
|
|
1709
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1710
|
+
*
|
|
1711
|
+
* // Simulate transactions (dry-run)
|
|
1712
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1713
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1714
|
+
*
|
|
1715
|
+
* // Watch events
|
|
1716
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1717
|
+
* console.log('Transfer event:', event);
|
|
1718
|
+
* });
|
|
1719
|
+
* ```
|
|
1720
|
+
*/
|
|
1721
|
+
export class CErc20Delegate_json {
|
|
1722
|
+
private contract: CErc20Delegate_jsonContract;
|
|
1723
|
+
private contractAddress: Address;
|
|
1724
|
+
private publicClient: PublicClient;
|
|
1725
|
+
|
|
1726
|
+
constructor(
|
|
1727
|
+
address: Address,
|
|
1728
|
+
clients: {
|
|
1729
|
+
publicClient: PublicClient;
|
|
1730
|
+
walletClient?: WalletClient;
|
|
1731
|
+
}
|
|
1732
|
+
) {
|
|
1733
|
+
this.contractAddress = address;
|
|
1734
|
+
this.publicClient = clients.publicClient;
|
|
1735
|
+
this.contract = getContract({
|
|
1736
|
+
address,
|
|
1737
|
+
abi: CErc20Delegate_jsonAbi,
|
|
1738
|
+
client: {
|
|
1739
|
+
public: clients.publicClient,
|
|
1740
|
+
wallet: clients.walletClient,
|
|
1741
|
+
},
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Get the contract address
|
|
1747
|
+
*/
|
|
1748
|
+
get address(): Address {
|
|
1749
|
+
return this.contractAddress;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Get the underlying viem contract instance
|
|
1754
|
+
*/
|
|
1755
|
+
getContract(): CErc20Delegate_jsonContract {
|
|
1756
|
+
return this.contract;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* NO_ERROR
|
|
1761
|
+
* view
|
|
1762
|
+
*/
|
|
1763
|
+
async NO_ERROR(): Promise<bigint> {
|
|
1764
|
+
return this.contract.read.NO_ERROR() as Promise<bigint>;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* accrualBlockNumber
|
|
1769
|
+
* view
|
|
1770
|
+
*/
|
|
1771
|
+
async accrualBlockNumber(): Promise<bigint> {
|
|
1772
|
+
return this.contract.read.accrualBlockNumber() as Promise<bigint>;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* admin
|
|
1777
|
+
* view
|
|
1778
|
+
*/
|
|
1779
|
+
async admin(): Promise<`0x${string}`> {
|
|
1780
|
+
return this.contract.read.admin() as Promise<`0x${string}`>;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* allowance
|
|
1785
|
+
* view
|
|
1786
|
+
*/
|
|
1787
|
+
async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
|
|
1788
|
+
return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* balanceOf
|
|
1793
|
+
* view
|
|
1794
|
+
*/
|
|
1795
|
+
async balanceOf(owner: `0x${string}`): Promise<bigint> {
|
|
1796
|
+
return this.contract.read.balanceOf([owner] as const) as Promise<bigint>;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/**
|
|
1800
|
+
* borrowBalanceStored
|
|
1801
|
+
* view
|
|
1802
|
+
*/
|
|
1803
|
+
async borrowBalanceStored(account: `0x${string}`): Promise<bigint> {
|
|
1804
|
+
return this.contract.read.borrowBalanceStored([account] as const) as Promise<bigint>;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* borrowIndex
|
|
1809
|
+
* view
|
|
1810
|
+
*/
|
|
1811
|
+
async borrowIndex(): Promise<bigint> {
|
|
1812
|
+
return this.contract.read.borrowIndex() as Promise<bigint>;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* borrowRatePerBlock
|
|
1817
|
+
* view
|
|
1818
|
+
*/
|
|
1819
|
+
async borrowRatePerBlock(): Promise<bigint> {
|
|
1820
|
+
return this.contract.read.borrowRatePerBlock() as Promise<bigint>;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* comptroller
|
|
1825
|
+
* view
|
|
1826
|
+
*/
|
|
1827
|
+
async comptroller(): Promise<`0x${string}`> {
|
|
1828
|
+
return this.contract.read.comptroller() as Promise<`0x${string}`>;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* decimals
|
|
1833
|
+
* view
|
|
1834
|
+
*/
|
|
1835
|
+
async decimals(): Promise<bigint> {
|
|
1836
|
+
return this.contract.read.decimals() as Promise<bigint>;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* exchangeRateStored
|
|
1841
|
+
* view
|
|
1842
|
+
*/
|
|
1843
|
+
async exchangeRateStored(): Promise<bigint> {
|
|
1844
|
+
return this.contract.read.exchangeRateStored() as Promise<bigint>;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* getAccountSnapshot
|
|
1849
|
+
* view
|
|
1850
|
+
*/
|
|
1851
|
+
async getAccountSnapshot(account: `0x${string}`): Promise<[bigint, bigint, bigint, bigint]> {
|
|
1852
|
+
return this.contract.read.getAccountSnapshot([account] as const) as Promise<[bigint, bigint, bigint, bigint]>;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* getCash
|
|
1857
|
+
* view
|
|
1858
|
+
*/
|
|
1859
|
+
async getCash(): Promise<bigint> {
|
|
1860
|
+
return this.contract.read.getCash() as Promise<bigint>;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* implementation
|
|
1865
|
+
* view
|
|
1866
|
+
*/
|
|
1867
|
+
async implementation(): Promise<`0x${string}`> {
|
|
1868
|
+
return this.contract.read.implementation() as Promise<`0x${string}`>;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* interestRateModel
|
|
1873
|
+
* view
|
|
1874
|
+
*/
|
|
1875
|
+
async interestRateModel(): Promise<`0x${string}`> {
|
|
1876
|
+
return this.contract.read.interestRateModel() as Promise<`0x${string}`>;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* isCToken
|
|
1881
|
+
* view
|
|
1882
|
+
*/
|
|
1883
|
+
async isCToken(): Promise<boolean> {
|
|
1884
|
+
return this.contract.read.isCToken() as Promise<boolean>;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* name
|
|
1889
|
+
* view
|
|
1890
|
+
*/
|
|
1891
|
+
async name(): Promise<string> {
|
|
1892
|
+
return this.contract.read.name() as Promise<string>;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* pendingAdmin
|
|
1897
|
+
* view
|
|
1898
|
+
*/
|
|
1899
|
+
async pendingAdmin(): Promise<`0x${string}`> {
|
|
1900
|
+
return this.contract.read.pendingAdmin() as Promise<`0x${string}`>;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* protocolSeizeShareMantissa
|
|
1905
|
+
* view
|
|
1906
|
+
*/
|
|
1907
|
+
async protocolSeizeShareMantissa(): Promise<bigint> {
|
|
1908
|
+
return this.contract.read.protocolSeizeShareMantissa() as Promise<bigint>;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* reserveFactorMantissa
|
|
1913
|
+
* view
|
|
1914
|
+
*/
|
|
1915
|
+
async reserveFactorMantissa(): Promise<bigint> {
|
|
1916
|
+
return this.contract.read.reserveFactorMantissa() as Promise<bigint>;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* supplyRatePerBlock
|
|
1921
|
+
* view
|
|
1922
|
+
*/
|
|
1923
|
+
async supplyRatePerBlock(): Promise<bigint> {
|
|
1924
|
+
return this.contract.read.supplyRatePerBlock() as Promise<bigint>;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* symbol
|
|
1929
|
+
* view
|
|
1930
|
+
*/
|
|
1931
|
+
async symbol(): Promise<string> {
|
|
1932
|
+
return this.contract.read.symbol() as Promise<string>;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* totalBorrows
|
|
1937
|
+
* view
|
|
1938
|
+
*/
|
|
1939
|
+
async totalBorrows(): Promise<bigint> {
|
|
1940
|
+
return this.contract.read.totalBorrows() as Promise<bigint>;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
/**
|
|
1944
|
+
* totalReserves
|
|
1945
|
+
* view
|
|
1946
|
+
*/
|
|
1947
|
+
async totalReserves(): Promise<bigint> {
|
|
1948
|
+
return this.contract.read.totalReserves() as Promise<bigint>;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* totalSupply
|
|
1953
|
+
* view
|
|
1954
|
+
*/
|
|
1955
|
+
async totalSupply(): Promise<bigint> {
|
|
1956
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* underlying
|
|
1961
|
+
* view
|
|
1962
|
+
*/
|
|
1963
|
+
async underlying(): Promise<`0x${string}`> {
|
|
1964
|
+
return this.contract.read.underlying() as Promise<`0x${string}`>;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* whitelist
|
|
1969
|
+
* view
|
|
1970
|
+
*/
|
|
1971
|
+
async whitelist(): Promise<`0x${string}`> {
|
|
1972
|
+
return this.contract.read.whitelist() as Promise<`0x${string}`>;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* _acceptAdmin
|
|
1977
|
+
* nonpayable
|
|
1978
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1979
|
+
*/
|
|
1980
|
+
async _acceptAdmin(options?: {
|
|
1981
|
+
accessList?: import('viem').AccessList;
|
|
1982
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1983
|
+
chain?: import('viem').Chain | null;
|
|
1984
|
+
dataSuffix?: `0x${string}`;
|
|
1985
|
+
gas?: bigint;
|
|
1986
|
+
gasPrice?: bigint;
|
|
1987
|
+
maxFeePerGas?: bigint;
|
|
1988
|
+
maxPriorityFeePerGas?: bigint;
|
|
1989
|
+
nonce?: number;
|
|
1990
|
+
value?: bigint;
|
|
1991
|
+
}): Promise<`0x${string}`> {
|
|
1992
|
+
if (!this.contract.write) {
|
|
1993
|
+
throw new Error('Wallet client is required for write operations');
|
|
1994
|
+
}
|
|
1995
|
+
return this.contract.write._acceptAdmin(options) as Promise<`0x${string}`>;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* _addReserves
|
|
2000
|
+
* nonpayable
|
|
2001
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2002
|
+
*/
|
|
2003
|
+
async _addReserves(addAmount: bigint, options?: {
|
|
2004
|
+
accessList?: import('viem').AccessList;
|
|
2005
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2006
|
+
chain?: import('viem').Chain | null;
|
|
2007
|
+
dataSuffix?: `0x${string}`;
|
|
2008
|
+
gas?: bigint;
|
|
2009
|
+
gasPrice?: bigint;
|
|
2010
|
+
maxFeePerGas?: bigint;
|
|
2011
|
+
maxPriorityFeePerGas?: bigint;
|
|
2012
|
+
nonce?: number;
|
|
2013
|
+
value?: bigint;
|
|
2014
|
+
}): Promise<`0x${string}`> {
|
|
2015
|
+
if (!this.contract.write) {
|
|
2016
|
+
throw new Error('Wallet client is required for write operations');
|
|
2017
|
+
}
|
|
2018
|
+
return this.contract.write._addReserves([addAmount] as const, options) as Promise<`0x${string}`>;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* _becomeImplementation
|
|
2023
|
+
* nonpayable
|
|
2024
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2025
|
+
*/
|
|
2026
|
+
async _becomeImplementation(data: `0x${string}`, options?: {
|
|
2027
|
+
accessList?: import('viem').AccessList;
|
|
2028
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2029
|
+
chain?: import('viem').Chain | null;
|
|
2030
|
+
dataSuffix?: `0x${string}`;
|
|
2031
|
+
gas?: bigint;
|
|
2032
|
+
gasPrice?: bigint;
|
|
2033
|
+
maxFeePerGas?: bigint;
|
|
2034
|
+
maxPriorityFeePerGas?: bigint;
|
|
2035
|
+
nonce?: number;
|
|
2036
|
+
value?: bigint;
|
|
2037
|
+
}): Promise<`0x${string}`> {
|
|
2038
|
+
if (!this.contract.write) {
|
|
2039
|
+
throw new Error('Wallet client is required for write operations');
|
|
2040
|
+
}
|
|
2041
|
+
return this.contract.write._becomeImplementation([data] as const, options) as Promise<`0x${string}`>;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* _delegateCompLikeTo
|
|
2046
|
+
* nonpayable
|
|
2047
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2048
|
+
*/
|
|
2049
|
+
async _delegateCompLikeTo(compLikeDelegatee: `0x${string}`, options?: {
|
|
2050
|
+
accessList?: import('viem').AccessList;
|
|
2051
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2052
|
+
chain?: import('viem').Chain | null;
|
|
2053
|
+
dataSuffix?: `0x${string}`;
|
|
2054
|
+
gas?: bigint;
|
|
2055
|
+
gasPrice?: bigint;
|
|
2056
|
+
maxFeePerGas?: bigint;
|
|
2057
|
+
maxPriorityFeePerGas?: bigint;
|
|
2058
|
+
nonce?: number;
|
|
2059
|
+
value?: bigint;
|
|
2060
|
+
}): Promise<`0x${string}`> {
|
|
2061
|
+
if (!this.contract.write) {
|
|
2062
|
+
throw new Error('Wallet client is required for write operations');
|
|
2063
|
+
}
|
|
2064
|
+
return this.contract.write._delegateCompLikeTo([compLikeDelegatee] as const, options) as Promise<`0x${string}`>;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* _reduceReserves
|
|
2069
|
+
* nonpayable
|
|
2070
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2071
|
+
*/
|
|
2072
|
+
async _reduceReserves(reduceAmount: bigint, options?: {
|
|
2073
|
+
accessList?: import('viem').AccessList;
|
|
2074
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2075
|
+
chain?: import('viem').Chain | null;
|
|
2076
|
+
dataSuffix?: `0x${string}`;
|
|
2077
|
+
gas?: bigint;
|
|
2078
|
+
gasPrice?: bigint;
|
|
2079
|
+
maxFeePerGas?: bigint;
|
|
2080
|
+
maxPriorityFeePerGas?: bigint;
|
|
2081
|
+
nonce?: number;
|
|
2082
|
+
value?: bigint;
|
|
2083
|
+
}): Promise<`0x${string}`> {
|
|
2084
|
+
if (!this.contract.write) {
|
|
2085
|
+
throw new Error('Wallet client is required for write operations');
|
|
2086
|
+
}
|
|
2087
|
+
return this.contract.write._reduceReserves([reduceAmount] as const, options) as Promise<`0x${string}`>;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
/**
|
|
2091
|
+
* _resignImplementation
|
|
2092
|
+
* nonpayable
|
|
2093
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2094
|
+
*/
|
|
2095
|
+
async _resignImplementation(options?: {
|
|
2096
|
+
accessList?: import('viem').AccessList;
|
|
2097
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2098
|
+
chain?: import('viem').Chain | null;
|
|
2099
|
+
dataSuffix?: `0x${string}`;
|
|
2100
|
+
gas?: bigint;
|
|
2101
|
+
gasPrice?: bigint;
|
|
2102
|
+
maxFeePerGas?: bigint;
|
|
2103
|
+
maxPriorityFeePerGas?: bigint;
|
|
2104
|
+
nonce?: number;
|
|
2105
|
+
value?: bigint;
|
|
2106
|
+
}): Promise<`0x${string}`> {
|
|
2107
|
+
if (!this.contract.write) {
|
|
2108
|
+
throw new Error('Wallet client is required for write operations');
|
|
2109
|
+
}
|
|
2110
|
+
return this.contract.write._resignImplementation(options) as Promise<`0x${string}`>;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* _setComptroller
|
|
2115
|
+
* nonpayable
|
|
2116
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2117
|
+
*/
|
|
2118
|
+
async _setComptroller(newComptroller: `0x${string}`, options?: {
|
|
2119
|
+
accessList?: import('viem').AccessList;
|
|
2120
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2121
|
+
chain?: import('viem').Chain | null;
|
|
2122
|
+
dataSuffix?: `0x${string}`;
|
|
2123
|
+
gas?: bigint;
|
|
2124
|
+
gasPrice?: bigint;
|
|
2125
|
+
maxFeePerGas?: bigint;
|
|
2126
|
+
maxPriorityFeePerGas?: bigint;
|
|
2127
|
+
nonce?: number;
|
|
2128
|
+
value?: bigint;
|
|
2129
|
+
}): Promise<`0x${string}`> {
|
|
2130
|
+
if (!this.contract.write) {
|
|
2131
|
+
throw new Error('Wallet client is required for write operations');
|
|
2132
|
+
}
|
|
2133
|
+
return this.contract.write._setComptroller([newComptroller] as const, options) as Promise<`0x${string}`>;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* _setInterestRateModel
|
|
2138
|
+
* nonpayable
|
|
2139
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2140
|
+
*/
|
|
2141
|
+
async _setInterestRateModel(newInterestRateModel: `0x${string}`, options?: {
|
|
2142
|
+
accessList?: import('viem').AccessList;
|
|
2143
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2144
|
+
chain?: import('viem').Chain | null;
|
|
2145
|
+
dataSuffix?: `0x${string}`;
|
|
2146
|
+
gas?: bigint;
|
|
2147
|
+
gasPrice?: bigint;
|
|
2148
|
+
maxFeePerGas?: bigint;
|
|
2149
|
+
maxPriorityFeePerGas?: bigint;
|
|
2150
|
+
nonce?: number;
|
|
2151
|
+
value?: bigint;
|
|
2152
|
+
}): Promise<`0x${string}`> {
|
|
2153
|
+
if (!this.contract.write) {
|
|
2154
|
+
throw new Error('Wallet client is required for write operations');
|
|
2155
|
+
}
|
|
2156
|
+
return this.contract.write._setInterestRateModel([newInterestRateModel] as const, options) as Promise<`0x${string}`>;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* _setPendingAdmin
|
|
2161
|
+
* nonpayable
|
|
2162
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2163
|
+
*/
|
|
2164
|
+
async _setPendingAdmin(newPendingAdmin: `0x${string}`, options?: {
|
|
2165
|
+
accessList?: import('viem').AccessList;
|
|
2166
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2167
|
+
chain?: import('viem').Chain | null;
|
|
2168
|
+
dataSuffix?: `0x${string}`;
|
|
2169
|
+
gas?: bigint;
|
|
2170
|
+
gasPrice?: bigint;
|
|
2171
|
+
maxFeePerGas?: bigint;
|
|
2172
|
+
maxPriorityFeePerGas?: bigint;
|
|
2173
|
+
nonce?: number;
|
|
2174
|
+
value?: bigint;
|
|
2175
|
+
}): Promise<`0x${string}`> {
|
|
2176
|
+
if (!this.contract.write) {
|
|
2177
|
+
throw new Error('Wallet client is required for write operations');
|
|
2178
|
+
}
|
|
2179
|
+
return this.contract.write._setPendingAdmin([newPendingAdmin] as const, options) as Promise<`0x${string}`>;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
/**
|
|
2183
|
+
* _setReserveFactor
|
|
2184
|
+
* nonpayable
|
|
2185
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2186
|
+
*/
|
|
2187
|
+
async _setReserveFactor(newReserveFactorMantissa: bigint, options?: {
|
|
2188
|
+
accessList?: import('viem').AccessList;
|
|
2189
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2190
|
+
chain?: import('viem').Chain | null;
|
|
2191
|
+
dataSuffix?: `0x${string}`;
|
|
2192
|
+
gas?: bigint;
|
|
2193
|
+
gasPrice?: bigint;
|
|
2194
|
+
maxFeePerGas?: bigint;
|
|
2195
|
+
maxPriorityFeePerGas?: bigint;
|
|
2196
|
+
nonce?: number;
|
|
2197
|
+
value?: bigint;
|
|
2198
|
+
}): Promise<`0x${string}`> {
|
|
2199
|
+
if (!this.contract.write) {
|
|
2200
|
+
throw new Error('Wallet client is required for write operations');
|
|
2201
|
+
}
|
|
2202
|
+
return this.contract.write._setReserveFactor([newReserveFactorMantissa] as const, options) as Promise<`0x${string}`>;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* _setWhitelist
|
|
2207
|
+
* nonpayable
|
|
2208
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2209
|
+
*/
|
|
2210
|
+
async _setWhitelist(newWhitelist: `0x${string}`, options?: {
|
|
2211
|
+
accessList?: import('viem').AccessList;
|
|
2212
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2213
|
+
chain?: import('viem').Chain | null;
|
|
2214
|
+
dataSuffix?: `0x${string}`;
|
|
2215
|
+
gas?: bigint;
|
|
2216
|
+
gasPrice?: bigint;
|
|
2217
|
+
maxFeePerGas?: bigint;
|
|
2218
|
+
maxPriorityFeePerGas?: bigint;
|
|
2219
|
+
nonce?: number;
|
|
2220
|
+
value?: bigint;
|
|
2221
|
+
}): Promise<`0x${string}`> {
|
|
2222
|
+
if (!this.contract.write) {
|
|
2223
|
+
throw new Error('Wallet client is required for write operations');
|
|
2224
|
+
}
|
|
2225
|
+
return this.contract.write._setWhitelist([newWhitelist] as const, options) as Promise<`0x${string}`>;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* accrueInterest
|
|
2230
|
+
* nonpayable
|
|
2231
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2232
|
+
*/
|
|
2233
|
+
async accrueInterest(options?: {
|
|
2234
|
+
accessList?: import('viem').AccessList;
|
|
2235
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2236
|
+
chain?: import('viem').Chain | null;
|
|
2237
|
+
dataSuffix?: `0x${string}`;
|
|
2238
|
+
gas?: bigint;
|
|
2239
|
+
gasPrice?: bigint;
|
|
2240
|
+
maxFeePerGas?: bigint;
|
|
2241
|
+
maxPriorityFeePerGas?: bigint;
|
|
2242
|
+
nonce?: number;
|
|
2243
|
+
value?: bigint;
|
|
2244
|
+
}): Promise<`0x${string}`> {
|
|
2245
|
+
if (!this.contract.write) {
|
|
2246
|
+
throw new Error('Wallet client is required for write operations');
|
|
2247
|
+
}
|
|
2248
|
+
return this.contract.write.accrueInterest(options) as Promise<`0x${string}`>;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* approve
|
|
2253
|
+
* nonpayable
|
|
2254
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2255
|
+
*/
|
|
2256
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
2257
|
+
accessList?: import('viem').AccessList;
|
|
2258
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2259
|
+
chain?: import('viem').Chain | null;
|
|
2260
|
+
dataSuffix?: `0x${string}`;
|
|
2261
|
+
gas?: bigint;
|
|
2262
|
+
gasPrice?: bigint;
|
|
2263
|
+
maxFeePerGas?: bigint;
|
|
2264
|
+
maxPriorityFeePerGas?: bigint;
|
|
2265
|
+
nonce?: number;
|
|
2266
|
+
value?: bigint;
|
|
2267
|
+
}): Promise<`0x${string}`> {
|
|
2268
|
+
if (!this.contract.write) {
|
|
2269
|
+
throw new Error('Wallet client is required for write operations');
|
|
2270
|
+
}
|
|
2271
|
+
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* balanceOfUnderlying
|
|
2276
|
+
* nonpayable
|
|
2277
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2278
|
+
*/
|
|
2279
|
+
async balanceOfUnderlying(owner: `0x${string}`, options?: {
|
|
2280
|
+
accessList?: import('viem').AccessList;
|
|
2281
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2282
|
+
chain?: import('viem').Chain | null;
|
|
2283
|
+
dataSuffix?: `0x${string}`;
|
|
2284
|
+
gas?: bigint;
|
|
2285
|
+
gasPrice?: bigint;
|
|
2286
|
+
maxFeePerGas?: bigint;
|
|
2287
|
+
maxPriorityFeePerGas?: bigint;
|
|
2288
|
+
nonce?: number;
|
|
2289
|
+
value?: bigint;
|
|
2290
|
+
}): Promise<`0x${string}`> {
|
|
2291
|
+
if (!this.contract.write) {
|
|
2292
|
+
throw new Error('Wallet client is required for write operations');
|
|
2293
|
+
}
|
|
2294
|
+
return this.contract.write.balanceOfUnderlying([owner] as const, options) as Promise<`0x${string}`>;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* borrow
|
|
2299
|
+
* nonpayable
|
|
2300
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2301
|
+
*/
|
|
2302
|
+
async borrow(borrowAmount: bigint, options?: {
|
|
2303
|
+
accessList?: import('viem').AccessList;
|
|
2304
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2305
|
+
chain?: import('viem').Chain | null;
|
|
2306
|
+
dataSuffix?: `0x${string}`;
|
|
2307
|
+
gas?: bigint;
|
|
2308
|
+
gasPrice?: bigint;
|
|
2309
|
+
maxFeePerGas?: bigint;
|
|
2310
|
+
maxPriorityFeePerGas?: bigint;
|
|
2311
|
+
nonce?: number;
|
|
2312
|
+
value?: bigint;
|
|
2313
|
+
}): Promise<`0x${string}`> {
|
|
2314
|
+
if (!this.contract.write) {
|
|
2315
|
+
throw new Error('Wallet client is required for write operations');
|
|
2316
|
+
}
|
|
2317
|
+
return this.contract.write.borrow([borrowAmount] as const, options) as Promise<`0x${string}`>;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* borrowBalanceCurrent
|
|
2322
|
+
* nonpayable
|
|
2323
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2324
|
+
*/
|
|
2325
|
+
async borrowBalanceCurrent(account: `0x${string}`, options?: {
|
|
2326
|
+
accessList?: import('viem').AccessList;
|
|
2327
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2328
|
+
chain?: import('viem').Chain | null;
|
|
2329
|
+
dataSuffix?: `0x${string}`;
|
|
2330
|
+
gas?: bigint;
|
|
2331
|
+
gasPrice?: bigint;
|
|
2332
|
+
maxFeePerGas?: bigint;
|
|
2333
|
+
maxPriorityFeePerGas?: bigint;
|
|
2334
|
+
nonce?: number;
|
|
2335
|
+
value?: bigint;
|
|
2336
|
+
}): Promise<`0x${string}`> {
|
|
2337
|
+
if (!this.contract.write) {
|
|
2338
|
+
throw new Error('Wallet client is required for write operations');
|
|
2339
|
+
}
|
|
2340
|
+
return this.contract.write.borrowBalanceCurrent([account] as const, options) as Promise<`0x${string}`>;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* exchangeRateCurrent
|
|
2345
|
+
* nonpayable
|
|
2346
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2347
|
+
*/
|
|
2348
|
+
async exchangeRateCurrent(options?: {
|
|
2349
|
+
accessList?: import('viem').AccessList;
|
|
2350
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2351
|
+
chain?: import('viem').Chain | null;
|
|
2352
|
+
dataSuffix?: `0x${string}`;
|
|
2353
|
+
gas?: bigint;
|
|
2354
|
+
gasPrice?: bigint;
|
|
2355
|
+
maxFeePerGas?: bigint;
|
|
2356
|
+
maxPriorityFeePerGas?: bigint;
|
|
2357
|
+
nonce?: number;
|
|
2358
|
+
value?: bigint;
|
|
2359
|
+
}): Promise<`0x${string}`> {
|
|
2360
|
+
if (!this.contract.write) {
|
|
2361
|
+
throw new Error('Wallet client is required for write operations');
|
|
2362
|
+
}
|
|
2363
|
+
return this.contract.write.exchangeRateCurrent(options) as Promise<`0x${string}`>;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
async initialize(underlying_: `0x${string}`, comptroller_: `0x${string}`, interestRateModel_: `0x${string}`, initialExchangeRateMantissa_: bigint, name_: string, symbol_: string, decimals_: bigint, options?: {
|
|
2367
|
+
accessList?: import('viem').AccessList;
|
|
2368
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2369
|
+
chain?: import('viem').Chain | null;
|
|
2370
|
+
dataSuffix?: `0x${string}`;
|
|
2371
|
+
gas?: bigint;
|
|
2372
|
+
gasPrice?: bigint;
|
|
2373
|
+
maxFeePerGas?: bigint;
|
|
2374
|
+
maxPriorityFeePerGas?: bigint;
|
|
2375
|
+
nonce?: number;
|
|
2376
|
+
value?: bigint;
|
|
2377
|
+
}): Promise<`0x${string}`>;
|
|
2378
|
+
async initialize(comptroller_: `0x${string}`, interestRateModel_: `0x${string}`, initialExchangeRateMantissa_: bigint, name_: string, symbol_: string, decimals_: bigint, options?: {
|
|
2379
|
+
accessList?: import('viem').AccessList;
|
|
2380
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2381
|
+
chain?: import('viem').Chain | null;
|
|
2382
|
+
dataSuffix?: `0x${string}`;
|
|
2383
|
+
gas?: bigint;
|
|
2384
|
+
gasPrice?: bigint;
|
|
2385
|
+
maxFeePerGas?: bigint;
|
|
2386
|
+
maxPriorityFeePerGas?: bigint;
|
|
2387
|
+
nonce?: number;
|
|
2388
|
+
value?: bigint;
|
|
2389
|
+
}): Promise<`0x${string}`>;
|
|
2390
|
+
async initialize(...args: any[]): Promise<`0x${string}`> {
|
|
2391
|
+
if (!this.contract.write) {
|
|
2392
|
+
throw new Error('Wallet client is required for write operations');
|
|
2393
|
+
}
|
|
2394
|
+
return this.contract.write.initialize(args as any) as Promise<`0x${string}`>;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* liquidateBorrow
|
|
2399
|
+
* nonpayable
|
|
2400
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2401
|
+
*/
|
|
2402
|
+
async liquidateBorrow(borrower: `0x${string}`, repayAmount: bigint, cTokenCollateral: `0x${string}`, options?: {
|
|
2403
|
+
accessList?: import('viem').AccessList;
|
|
2404
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2405
|
+
chain?: import('viem').Chain | null;
|
|
2406
|
+
dataSuffix?: `0x${string}`;
|
|
2407
|
+
gas?: bigint;
|
|
2408
|
+
gasPrice?: bigint;
|
|
2409
|
+
maxFeePerGas?: bigint;
|
|
2410
|
+
maxPriorityFeePerGas?: bigint;
|
|
2411
|
+
nonce?: number;
|
|
2412
|
+
value?: bigint;
|
|
2413
|
+
}): Promise<`0x${string}`> {
|
|
2414
|
+
if (!this.contract.write) {
|
|
2415
|
+
throw new Error('Wallet client is required for write operations');
|
|
2416
|
+
}
|
|
2417
|
+
return this.contract.write.liquidateBorrow([borrower, repayAmount, cTokenCollateral] as const, options) as Promise<`0x${string}`>;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
/**
|
|
2421
|
+
* mint
|
|
2422
|
+
* nonpayable
|
|
2423
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2424
|
+
*/
|
|
2425
|
+
async mint(mintAmount: bigint, options?: {
|
|
2426
|
+
accessList?: import('viem').AccessList;
|
|
2427
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2428
|
+
chain?: import('viem').Chain | null;
|
|
2429
|
+
dataSuffix?: `0x${string}`;
|
|
2430
|
+
gas?: bigint;
|
|
2431
|
+
gasPrice?: bigint;
|
|
2432
|
+
maxFeePerGas?: bigint;
|
|
2433
|
+
maxPriorityFeePerGas?: bigint;
|
|
2434
|
+
nonce?: number;
|
|
2435
|
+
value?: bigint;
|
|
2436
|
+
}): Promise<`0x${string}`> {
|
|
2437
|
+
if (!this.contract.write) {
|
|
2438
|
+
throw new Error('Wallet client is required for write operations');
|
|
2439
|
+
}
|
|
2440
|
+
return this.contract.write.mint([mintAmount] as const, options) as Promise<`0x${string}`>;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
/**
|
|
2444
|
+
* redeem
|
|
2445
|
+
* nonpayable
|
|
2446
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2447
|
+
*/
|
|
2448
|
+
async redeem(redeemTokens: bigint, options?: {
|
|
2449
|
+
accessList?: import('viem').AccessList;
|
|
2450
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2451
|
+
chain?: import('viem').Chain | null;
|
|
2452
|
+
dataSuffix?: `0x${string}`;
|
|
2453
|
+
gas?: bigint;
|
|
2454
|
+
gasPrice?: bigint;
|
|
2455
|
+
maxFeePerGas?: bigint;
|
|
2456
|
+
maxPriorityFeePerGas?: bigint;
|
|
2457
|
+
nonce?: number;
|
|
2458
|
+
value?: bigint;
|
|
2459
|
+
}): Promise<`0x${string}`> {
|
|
2460
|
+
if (!this.contract.write) {
|
|
2461
|
+
throw new Error('Wallet client is required for write operations');
|
|
2462
|
+
}
|
|
2463
|
+
return this.contract.write.redeem([redeemTokens] as const, options) as Promise<`0x${string}`>;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
/**
|
|
2467
|
+
* redeemUnderlying
|
|
2468
|
+
* nonpayable
|
|
2469
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2470
|
+
*/
|
|
2471
|
+
async redeemUnderlying(redeemAmount: bigint, options?: {
|
|
2472
|
+
accessList?: import('viem').AccessList;
|
|
2473
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2474
|
+
chain?: import('viem').Chain | null;
|
|
2475
|
+
dataSuffix?: `0x${string}`;
|
|
2476
|
+
gas?: bigint;
|
|
2477
|
+
gasPrice?: bigint;
|
|
2478
|
+
maxFeePerGas?: bigint;
|
|
2479
|
+
maxPriorityFeePerGas?: bigint;
|
|
2480
|
+
nonce?: number;
|
|
2481
|
+
value?: bigint;
|
|
2482
|
+
}): Promise<`0x${string}`> {
|
|
2483
|
+
if (!this.contract.write) {
|
|
2484
|
+
throw new Error('Wallet client is required for write operations');
|
|
2485
|
+
}
|
|
2486
|
+
return this.contract.write.redeemUnderlying([redeemAmount] as const, options) as Promise<`0x${string}`>;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
/**
|
|
2490
|
+
* repayBorrow
|
|
2491
|
+
* nonpayable
|
|
2492
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2493
|
+
*/
|
|
2494
|
+
async repayBorrow(repayAmount: bigint, options?: {
|
|
2495
|
+
accessList?: import('viem').AccessList;
|
|
2496
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2497
|
+
chain?: import('viem').Chain | null;
|
|
2498
|
+
dataSuffix?: `0x${string}`;
|
|
2499
|
+
gas?: bigint;
|
|
2500
|
+
gasPrice?: bigint;
|
|
2501
|
+
maxFeePerGas?: bigint;
|
|
2502
|
+
maxPriorityFeePerGas?: bigint;
|
|
2503
|
+
nonce?: number;
|
|
2504
|
+
value?: bigint;
|
|
2505
|
+
}): Promise<`0x${string}`> {
|
|
2506
|
+
if (!this.contract.write) {
|
|
2507
|
+
throw new Error('Wallet client is required for write operations');
|
|
2508
|
+
}
|
|
2509
|
+
return this.contract.write.repayBorrow([repayAmount] as const, options) as Promise<`0x${string}`>;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
/**
|
|
2513
|
+
* repayBorrowBehalf
|
|
2514
|
+
* nonpayable
|
|
2515
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2516
|
+
*/
|
|
2517
|
+
async repayBorrowBehalf(borrower: `0x${string}`, repayAmount: bigint, options?: {
|
|
2518
|
+
accessList?: import('viem').AccessList;
|
|
2519
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2520
|
+
chain?: import('viem').Chain | null;
|
|
2521
|
+
dataSuffix?: `0x${string}`;
|
|
2522
|
+
gas?: bigint;
|
|
2523
|
+
gasPrice?: bigint;
|
|
2524
|
+
maxFeePerGas?: bigint;
|
|
2525
|
+
maxPriorityFeePerGas?: bigint;
|
|
2526
|
+
nonce?: number;
|
|
2527
|
+
value?: bigint;
|
|
2528
|
+
}): Promise<`0x${string}`> {
|
|
2529
|
+
if (!this.contract.write) {
|
|
2530
|
+
throw new Error('Wallet client is required for write operations');
|
|
2531
|
+
}
|
|
2532
|
+
return this.contract.write.repayBorrowBehalf([borrower, repayAmount] as const, options) as Promise<`0x${string}`>;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* seize
|
|
2537
|
+
* nonpayable
|
|
2538
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2539
|
+
*/
|
|
2540
|
+
async seize(liquidator: `0x${string}`, borrower: `0x${string}`, seizeTokens: bigint, options?: {
|
|
2541
|
+
accessList?: import('viem').AccessList;
|
|
2542
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2543
|
+
chain?: import('viem').Chain | null;
|
|
2544
|
+
dataSuffix?: `0x${string}`;
|
|
2545
|
+
gas?: bigint;
|
|
2546
|
+
gasPrice?: bigint;
|
|
2547
|
+
maxFeePerGas?: bigint;
|
|
2548
|
+
maxPriorityFeePerGas?: bigint;
|
|
2549
|
+
nonce?: number;
|
|
2550
|
+
value?: bigint;
|
|
2551
|
+
}): Promise<`0x${string}`> {
|
|
2552
|
+
if (!this.contract.write) {
|
|
2553
|
+
throw new Error('Wallet client is required for write operations');
|
|
2554
|
+
}
|
|
2555
|
+
return this.contract.write.seize([liquidator, borrower, seizeTokens] as const, options) as Promise<`0x${string}`>;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
/**
|
|
2559
|
+
* sweepToken
|
|
2560
|
+
* nonpayable
|
|
2561
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2562
|
+
*/
|
|
2563
|
+
async sweepToken(token: `0x${string}`, options?: {
|
|
2564
|
+
accessList?: import('viem').AccessList;
|
|
2565
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2566
|
+
chain?: import('viem').Chain | null;
|
|
2567
|
+
dataSuffix?: `0x${string}`;
|
|
2568
|
+
gas?: bigint;
|
|
2569
|
+
gasPrice?: bigint;
|
|
2570
|
+
maxFeePerGas?: bigint;
|
|
2571
|
+
maxPriorityFeePerGas?: bigint;
|
|
2572
|
+
nonce?: number;
|
|
2573
|
+
value?: bigint;
|
|
2574
|
+
}): Promise<`0x${string}`> {
|
|
2575
|
+
if (!this.contract.write) {
|
|
2576
|
+
throw new Error('Wallet client is required for write operations');
|
|
2577
|
+
}
|
|
2578
|
+
return this.contract.write.sweepToken([token] as const, options) as Promise<`0x${string}`>;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
/**
|
|
2582
|
+
* totalBorrowsCurrent
|
|
2583
|
+
* nonpayable
|
|
2584
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2585
|
+
*/
|
|
2586
|
+
async totalBorrowsCurrent(options?: {
|
|
2587
|
+
accessList?: import('viem').AccessList;
|
|
2588
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2589
|
+
chain?: import('viem').Chain | null;
|
|
2590
|
+
dataSuffix?: `0x${string}`;
|
|
2591
|
+
gas?: bigint;
|
|
2592
|
+
gasPrice?: bigint;
|
|
2593
|
+
maxFeePerGas?: bigint;
|
|
2594
|
+
maxPriorityFeePerGas?: bigint;
|
|
2595
|
+
nonce?: number;
|
|
2596
|
+
value?: bigint;
|
|
2597
|
+
}): Promise<`0x${string}`> {
|
|
2598
|
+
if (!this.contract.write) {
|
|
2599
|
+
throw new Error('Wallet client is required for write operations');
|
|
2600
|
+
}
|
|
2601
|
+
return this.contract.write.totalBorrowsCurrent(options) as Promise<`0x${string}`>;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* transfer
|
|
2606
|
+
* nonpayable
|
|
2607
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2608
|
+
*/
|
|
2609
|
+
async transfer(dst: `0x${string}`, amount: bigint, options?: {
|
|
2610
|
+
accessList?: import('viem').AccessList;
|
|
2611
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2612
|
+
chain?: import('viem').Chain | null;
|
|
2613
|
+
dataSuffix?: `0x${string}`;
|
|
2614
|
+
gas?: bigint;
|
|
2615
|
+
gasPrice?: bigint;
|
|
2616
|
+
maxFeePerGas?: bigint;
|
|
2617
|
+
maxPriorityFeePerGas?: bigint;
|
|
2618
|
+
nonce?: number;
|
|
2619
|
+
value?: bigint;
|
|
2620
|
+
}): Promise<`0x${string}`> {
|
|
2621
|
+
if (!this.contract.write) {
|
|
2622
|
+
throw new Error('Wallet client is required for write operations');
|
|
2623
|
+
}
|
|
2624
|
+
return this.contract.write.transfer([dst, amount] as const, options) as Promise<`0x${string}`>;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* transferFrom
|
|
2629
|
+
* nonpayable
|
|
2630
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2631
|
+
*/
|
|
2632
|
+
async transferFrom(src: `0x${string}`, dst: `0x${string}`, amount: bigint, options?: {
|
|
2633
|
+
accessList?: import('viem').AccessList;
|
|
2634
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2635
|
+
chain?: import('viem').Chain | null;
|
|
2636
|
+
dataSuffix?: `0x${string}`;
|
|
2637
|
+
gas?: bigint;
|
|
2638
|
+
gasPrice?: bigint;
|
|
2639
|
+
maxFeePerGas?: bigint;
|
|
2640
|
+
maxPriorityFeePerGas?: bigint;
|
|
2641
|
+
nonce?: number;
|
|
2642
|
+
value?: bigint;
|
|
2643
|
+
}): Promise<`0x${string}`> {
|
|
2644
|
+
if (!this.contract.write) {
|
|
2645
|
+
throw new Error('Wallet client is required for write operations');
|
|
2646
|
+
}
|
|
2647
|
+
return this.contract.write.transferFrom([src, dst, amount] as const, options) as Promise<`0x${string}`>;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
/**
|
|
2653
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
2654
|
+
*
|
|
2655
|
+
* @example
|
|
2656
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
2657
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
2658
|
+
* console.log('Would succeed:', result.result);
|
|
2659
|
+
*/
|
|
2660
|
+
get simulate() {
|
|
2661
|
+
const contract = this.contract;
|
|
2662
|
+
if (!contract.simulate) {
|
|
2663
|
+
throw new Error('Public client is required for simulation');
|
|
2664
|
+
}
|
|
2665
|
+
return {
|
|
2666
|
+
/**
|
|
2667
|
+
* Simulate _acceptAdmin
|
|
2668
|
+
* Returns gas estimate and result without sending transaction
|
|
2669
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2670
|
+
*/
|
|
2671
|
+
async _acceptAdmin(options?: {
|
|
2672
|
+
accessList?: import('viem').AccessList;
|
|
2673
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2674
|
+
chain?: import('viem').Chain | null;
|
|
2675
|
+
dataSuffix?: `0x${string}`;
|
|
2676
|
+
gas?: bigint;
|
|
2677
|
+
gasPrice?: bigint;
|
|
2678
|
+
maxFeePerGas?: bigint;
|
|
2679
|
+
maxPriorityFeePerGas?: bigint;
|
|
2680
|
+
nonce?: number;
|
|
2681
|
+
value?: bigint;
|
|
2682
|
+
}): Promise<bigint> {
|
|
2683
|
+
return contract.simulate._acceptAdmin(options) as Promise<bigint>;
|
|
2684
|
+
},
|
|
2685
|
+
/**
|
|
2686
|
+
* Simulate _addReserves
|
|
2687
|
+
* Returns gas estimate and result without sending transaction
|
|
2688
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2689
|
+
*/
|
|
2690
|
+
async _addReserves(addAmount: bigint, options?: {
|
|
2691
|
+
accessList?: import('viem').AccessList;
|
|
2692
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2693
|
+
chain?: import('viem').Chain | null;
|
|
2694
|
+
dataSuffix?: `0x${string}`;
|
|
2695
|
+
gas?: bigint;
|
|
2696
|
+
gasPrice?: bigint;
|
|
2697
|
+
maxFeePerGas?: bigint;
|
|
2698
|
+
maxPriorityFeePerGas?: bigint;
|
|
2699
|
+
nonce?: number;
|
|
2700
|
+
value?: bigint;
|
|
2701
|
+
}): Promise<bigint> {
|
|
2702
|
+
return contract.simulate._addReserves([addAmount] as const, options) as Promise<bigint>;
|
|
2703
|
+
},
|
|
2704
|
+
/**
|
|
2705
|
+
* Simulate _becomeImplementation
|
|
2706
|
+
* Returns gas estimate and result without sending transaction
|
|
2707
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2708
|
+
*/
|
|
2709
|
+
async _becomeImplementation(data: `0x${string}`, options?: {
|
|
2710
|
+
accessList?: import('viem').AccessList;
|
|
2711
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2712
|
+
chain?: import('viem').Chain | null;
|
|
2713
|
+
dataSuffix?: `0x${string}`;
|
|
2714
|
+
gas?: bigint;
|
|
2715
|
+
gasPrice?: bigint;
|
|
2716
|
+
maxFeePerGas?: bigint;
|
|
2717
|
+
maxPriorityFeePerGas?: bigint;
|
|
2718
|
+
nonce?: number;
|
|
2719
|
+
value?: bigint;
|
|
2720
|
+
}): Promise<void> {
|
|
2721
|
+
return contract.simulate._becomeImplementation([data] as const, options) as Promise<void>;
|
|
2722
|
+
},
|
|
2723
|
+
/**
|
|
2724
|
+
* Simulate _delegateCompLikeTo
|
|
2725
|
+
* Returns gas estimate and result without sending transaction
|
|
2726
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2727
|
+
*/
|
|
2728
|
+
async _delegateCompLikeTo(compLikeDelegatee: `0x${string}`, options?: {
|
|
2729
|
+
accessList?: import('viem').AccessList;
|
|
2730
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2731
|
+
chain?: import('viem').Chain | null;
|
|
2732
|
+
dataSuffix?: `0x${string}`;
|
|
2733
|
+
gas?: bigint;
|
|
2734
|
+
gasPrice?: bigint;
|
|
2735
|
+
maxFeePerGas?: bigint;
|
|
2736
|
+
maxPriorityFeePerGas?: bigint;
|
|
2737
|
+
nonce?: number;
|
|
2738
|
+
value?: bigint;
|
|
2739
|
+
}): Promise<void> {
|
|
2740
|
+
return contract.simulate._delegateCompLikeTo([compLikeDelegatee] as const, options) as Promise<void>;
|
|
2741
|
+
},
|
|
2742
|
+
/**
|
|
2743
|
+
* Simulate _reduceReserves
|
|
2744
|
+
* Returns gas estimate and result without sending transaction
|
|
2745
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2746
|
+
*/
|
|
2747
|
+
async _reduceReserves(reduceAmount: bigint, options?: {
|
|
2748
|
+
accessList?: import('viem').AccessList;
|
|
2749
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2750
|
+
chain?: import('viem').Chain | null;
|
|
2751
|
+
dataSuffix?: `0x${string}`;
|
|
2752
|
+
gas?: bigint;
|
|
2753
|
+
gasPrice?: bigint;
|
|
2754
|
+
maxFeePerGas?: bigint;
|
|
2755
|
+
maxPriorityFeePerGas?: bigint;
|
|
2756
|
+
nonce?: number;
|
|
2757
|
+
value?: bigint;
|
|
2758
|
+
}): Promise<bigint> {
|
|
2759
|
+
return contract.simulate._reduceReserves([reduceAmount] as const, options) as Promise<bigint>;
|
|
2760
|
+
},
|
|
2761
|
+
/**
|
|
2762
|
+
* Simulate _resignImplementation
|
|
2763
|
+
* Returns gas estimate and result without sending transaction
|
|
2764
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2765
|
+
*/
|
|
2766
|
+
async _resignImplementation(options?: {
|
|
2767
|
+
accessList?: import('viem').AccessList;
|
|
2768
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2769
|
+
chain?: import('viem').Chain | null;
|
|
2770
|
+
dataSuffix?: `0x${string}`;
|
|
2771
|
+
gas?: bigint;
|
|
2772
|
+
gasPrice?: bigint;
|
|
2773
|
+
maxFeePerGas?: bigint;
|
|
2774
|
+
maxPriorityFeePerGas?: bigint;
|
|
2775
|
+
nonce?: number;
|
|
2776
|
+
value?: bigint;
|
|
2777
|
+
}): Promise<void> {
|
|
2778
|
+
return contract.simulate._resignImplementation(options) as Promise<void>;
|
|
2779
|
+
},
|
|
2780
|
+
/**
|
|
2781
|
+
* Simulate _setComptroller
|
|
2782
|
+
* Returns gas estimate and result without sending transaction
|
|
2783
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2784
|
+
*/
|
|
2785
|
+
async _setComptroller(newComptroller: `0x${string}`, options?: {
|
|
2786
|
+
accessList?: import('viem').AccessList;
|
|
2787
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2788
|
+
chain?: import('viem').Chain | null;
|
|
2789
|
+
dataSuffix?: `0x${string}`;
|
|
2790
|
+
gas?: bigint;
|
|
2791
|
+
gasPrice?: bigint;
|
|
2792
|
+
maxFeePerGas?: bigint;
|
|
2793
|
+
maxPriorityFeePerGas?: bigint;
|
|
2794
|
+
nonce?: number;
|
|
2795
|
+
value?: bigint;
|
|
2796
|
+
}): Promise<bigint> {
|
|
2797
|
+
return contract.simulate._setComptroller([newComptroller] as const, options) as Promise<bigint>;
|
|
2798
|
+
},
|
|
2799
|
+
/**
|
|
2800
|
+
* Simulate _setInterestRateModel
|
|
2801
|
+
* Returns gas estimate and result without sending transaction
|
|
2802
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2803
|
+
*/
|
|
2804
|
+
async _setInterestRateModel(newInterestRateModel: `0x${string}`, options?: {
|
|
2805
|
+
accessList?: import('viem').AccessList;
|
|
2806
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2807
|
+
chain?: import('viem').Chain | null;
|
|
2808
|
+
dataSuffix?: `0x${string}`;
|
|
2809
|
+
gas?: bigint;
|
|
2810
|
+
gasPrice?: bigint;
|
|
2811
|
+
maxFeePerGas?: bigint;
|
|
2812
|
+
maxPriorityFeePerGas?: bigint;
|
|
2813
|
+
nonce?: number;
|
|
2814
|
+
value?: bigint;
|
|
2815
|
+
}): Promise<bigint> {
|
|
2816
|
+
return contract.simulate._setInterestRateModel([newInterestRateModel] as const, options) as Promise<bigint>;
|
|
2817
|
+
},
|
|
2818
|
+
/**
|
|
2819
|
+
* Simulate _setPendingAdmin
|
|
2820
|
+
* Returns gas estimate and result without sending transaction
|
|
2821
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2822
|
+
*/
|
|
2823
|
+
async _setPendingAdmin(newPendingAdmin: `0x${string}`, options?: {
|
|
2824
|
+
accessList?: import('viem').AccessList;
|
|
2825
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2826
|
+
chain?: import('viem').Chain | null;
|
|
2827
|
+
dataSuffix?: `0x${string}`;
|
|
2828
|
+
gas?: bigint;
|
|
2829
|
+
gasPrice?: bigint;
|
|
2830
|
+
maxFeePerGas?: bigint;
|
|
2831
|
+
maxPriorityFeePerGas?: bigint;
|
|
2832
|
+
nonce?: number;
|
|
2833
|
+
value?: bigint;
|
|
2834
|
+
}): Promise<bigint> {
|
|
2835
|
+
return contract.simulate._setPendingAdmin([newPendingAdmin] as const, options) as Promise<bigint>;
|
|
2836
|
+
},
|
|
2837
|
+
/**
|
|
2838
|
+
* Simulate _setReserveFactor
|
|
2839
|
+
* Returns gas estimate and result without sending transaction
|
|
2840
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2841
|
+
*/
|
|
2842
|
+
async _setReserveFactor(newReserveFactorMantissa: bigint, options?: {
|
|
2843
|
+
accessList?: import('viem').AccessList;
|
|
2844
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2845
|
+
chain?: import('viem').Chain | null;
|
|
2846
|
+
dataSuffix?: `0x${string}`;
|
|
2847
|
+
gas?: bigint;
|
|
2848
|
+
gasPrice?: bigint;
|
|
2849
|
+
maxFeePerGas?: bigint;
|
|
2850
|
+
maxPriorityFeePerGas?: bigint;
|
|
2851
|
+
nonce?: number;
|
|
2852
|
+
value?: bigint;
|
|
2853
|
+
}): Promise<bigint> {
|
|
2854
|
+
return contract.simulate._setReserveFactor([newReserveFactorMantissa] as const, options) as Promise<bigint>;
|
|
2855
|
+
},
|
|
2856
|
+
/**
|
|
2857
|
+
* Simulate _setWhitelist
|
|
2858
|
+
* Returns gas estimate and result without sending transaction
|
|
2859
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2860
|
+
*/
|
|
2861
|
+
async _setWhitelist(newWhitelist: `0x${string}`, options?: {
|
|
2862
|
+
accessList?: import('viem').AccessList;
|
|
2863
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2864
|
+
chain?: import('viem').Chain | null;
|
|
2865
|
+
dataSuffix?: `0x${string}`;
|
|
2866
|
+
gas?: bigint;
|
|
2867
|
+
gasPrice?: bigint;
|
|
2868
|
+
maxFeePerGas?: bigint;
|
|
2869
|
+
maxPriorityFeePerGas?: bigint;
|
|
2870
|
+
nonce?: number;
|
|
2871
|
+
value?: bigint;
|
|
2872
|
+
}): Promise<bigint> {
|
|
2873
|
+
return contract.simulate._setWhitelist([newWhitelist] as const, options) as Promise<bigint>;
|
|
2874
|
+
},
|
|
2875
|
+
/**
|
|
2876
|
+
* Simulate accrueInterest
|
|
2877
|
+
* Returns gas estimate and result without sending transaction
|
|
2878
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2879
|
+
*/
|
|
2880
|
+
async accrueInterest(options?: {
|
|
2881
|
+
accessList?: import('viem').AccessList;
|
|
2882
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2883
|
+
chain?: import('viem').Chain | null;
|
|
2884
|
+
dataSuffix?: `0x${string}`;
|
|
2885
|
+
gas?: bigint;
|
|
2886
|
+
gasPrice?: bigint;
|
|
2887
|
+
maxFeePerGas?: bigint;
|
|
2888
|
+
maxPriorityFeePerGas?: bigint;
|
|
2889
|
+
nonce?: number;
|
|
2890
|
+
value?: bigint;
|
|
2891
|
+
}): Promise<bigint> {
|
|
2892
|
+
return contract.simulate.accrueInterest(options) as Promise<bigint>;
|
|
2893
|
+
},
|
|
2894
|
+
/**
|
|
2895
|
+
* Simulate approve
|
|
2896
|
+
* Returns gas estimate and result without sending transaction
|
|
2897
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2898
|
+
*/
|
|
2899
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
2900
|
+
accessList?: import('viem').AccessList;
|
|
2901
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2902
|
+
chain?: import('viem').Chain | null;
|
|
2903
|
+
dataSuffix?: `0x${string}`;
|
|
2904
|
+
gas?: bigint;
|
|
2905
|
+
gasPrice?: bigint;
|
|
2906
|
+
maxFeePerGas?: bigint;
|
|
2907
|
+
maxPriorityFeePerGas?: bigint;
|
|
2908
|
+
nonce?: number;
|
|
2909
|
+
value?: bigint;
|
|
2910
|
+
}): Promise<boolean> {
|
|
2911
|
+
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
2912
|
+
},
|
|
2913
|
+
/**
|
|
2914
|
+
* Simulate balanceOfUnderlying
|
|
2915
|
+
* Returns gas estimate and result without sending transaction
|
|
2916
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2917
|
+
*/
|
|
2918
|
+
async balanceOfUnderlying(owner: `0x${string}`, options?: {
|
|
2919
|
+
accessList?: import('viem').AccessList;
|
|
2920
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2921
|
+
chain?: import('viem').Chain | null;
|
|
2922
|
+
dataSuffix?: `0x${string}`;
|
|
2923
|
+
gas?: bigint;
|
|
2924
|
+
gasPrice?: bigint;
|
|
2925
|
+
maxFeePerGas?: bigint;
|
|
2926
|
+
maxPriorityFeePerGas?: bigint;
|
|
2927
|
+
nonce?: number;
|
|
2928
|
+
value?: bigint;
|
|
2929
|
+
}): Promise<bigint> {
|
|
2930
|
+
return contract.simulate.balanceOfUnderlying([owner] as const, options) as Promise<bigint>;
|
|
2931
|
+
},
|
|
2932
|
+
/**
|
|
2933
|
+
* Simulate borrow
|
|
2934
|
+
* Returns gas estimate and result without sending transaction
|
|
2935
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2936
|
+
*/
|
|
2937
|
+
async borrow(borrowAmount: bigint, options?: {
|
|
2938
|
+
accessList?: import('viem').AccessList;
|
|
2939
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2940
|
+
chain?: import('viem').Chain | null;
|
|
2941
|
+
dataSuffix?: `0x${string}`;
|
|
2942
|
+
gas?: bigint;
|
|
2943
|
+
gasPrice?: bigint;
|
|
2944
|
+
maxFeePerGas?: bigint;
|
|
2945
|
+
maxPriorityFeePerGas?: bigint;
|
|
2946
|
+
nonce?: number;
|
|
2947
|
+
value?: bigint;
|
|
2948
|
+
}): Promise<bigint> {
|
|
2949
|
+
return contract.simulate.borrow([borrowAmount] as const, options) as Promise<bigint>;
|
|
2950
|
+
},
|
|
2951
|
+
/**
|
|
2952
|
+
* Simulate borrowBalanceCurrent
|
|
2953
|
+
* Returns gas estimate and result without sending transaction
|
|
2954
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2955
|
+
*/
|
|
2956
|
+
async borrowBalanceCurrent(account: `0x${string}`, options?: {
|
|
2957
|
+
accessList?: import('viem').AccessList;
|
|
2958
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2959
|
+
chain?: import('viem').Chain | null;
|
|
2960
|
+
dataSuffix?: `0x${string}`;
|
|
2961
|
+
gas?: bigint;
|
|
2962
|
+
gasPrice?: bigint;
|
|
2963
|
+
maxFeePerGas?: bigint;
|
|
2964
|
+
maxPriorityFeePerGas?: bigint;
|
|
2965
|
+
nonce?: number;
|
|
2966
|
+
value?: bigint;
|
|
2967
|
+
}): Promise<bigint> {
|
|
2968
|
+
return contract.simulate.borrowBalanceCurrent([account] as const, options) as Promise<bigint>;
|
|
2969
|
+
},
|
|
2970
|
+
/**
|
|
2971
|
+
* Simulate exchangeRateCurrent
|
|
2972
|
+
* Returns gas estimate and result without sending transaction
|
|
2973
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2974
|
+
*/
|
|
2975
|
+
async exchangeRateCurrent(options?: {
|
|
2976
|
+
accessList?: import('viem').AccessList;
|
|
2977
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2978
|
+
chain?: import('viem').Chain | null;
|
|
2979
|
+
dataSuffix?: `0x${string}`;
|
|
2980
|
+
gas?: bigint;
|
|
2981
|
+
gasPrice?: bigint;
|
|
2982
|
+
maxFeePerGas?: bigint;
|
|
2983
|
+
maxPriorityFeePerGas?: bigint;
|
|
2984
|
+
nonce?: number;
|
|
2985
|
+
value?: bigint;
|
|
2986
|
+
}): Promise<bigint> {
|
|
2987
|
+
return contract.simulate.exchangeRateCurrent(options) as Promise<bigint>;
|
|
2988
|
+
},
|
|
2989
|
+
/**
|
|
2990
|
+
* Simulate initialize
|
|
2991
|
+
* Returns gas estimate and result without sending transaction
|
|
2992
|
+
* Supports multiple overloads: (address, address, address, uint256, string, string, uint8), (address, address, uint256, string, string, uint8)
|
|
2993
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2994
|
+
*/
|
|
2995
|
+
async initialize(...args: any[]): Promise<any> {
|
|
2996
|
+
return contract.simulate.initialize(args as any) as Promise<any>;
|
|
2997
|
+
},
|
|
2998
|
+
/**
|
|
2999
|
+
* Simulate liquidateBorrow
|
|
3000
|
+
* Returns gas estimate and result without sending transaction
|
|
3001
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3002
|
+
*/
|
|
3003
|
+
async liquidateBorrow(borrower: `0x${string}`, repayAmount: bigint, cTokenCollateral: `0x${string}`, options?: {
|
|
3004
|
+
accessList?: import('viem').AccessList;
|
|
3005
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3006
|
+
chain?: import('viem').Chain | null;
|
|
3007
|
+
dataSuffix?: `0x${string}`;
|
|
3008
|
+
gas?: bigint;
|
|
3009
|
+
gasPrice?: bigint;
|
|
3010
|
+
maxFeePerGas?: bigint;
|
|
3011
|
+
maxPriorityFeePerGas?: bigint;
|
|
3012
|
+
nonce?: number;
|
|
3013
|
+
value?: bigint;
|
|
3014
|
+
}): Promise<bigint> {
|
|
3015
|
+
return contract.simulate.liquidateBorrow([borrower, repayAmount, cTokenCollateral] as const, options) as Promise<bigint>;
|
|
3016
|
+
},
|
|
3017
|
+
/**
|
|
3018
|
+
* Simulate mint
|
|
3019
|
+
* Returns gas estimate and result without sending transaction
|
|
3020
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3021
|
+
*/
|
|
3022
|
+
async mint(mintAmount: bigint, options?: {
|
|
3023
|
+
accessList?: import('viem').AccessList;
|
|
3024
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3025
|
+
chain?: import('viem').Chain | null;
|
|
3026
|
+
dataSuffix?: `0x${string}`;
|
|
3027
|
+
gas?: bigint;
|
|
3028
|
+
gasPrice?: bigint;
|
|
3029
|
+
maxFeePerGas?: bigint;
|
|
3030
|
+
maxPriorityFeePerGas?: bigint;
|
|
3031
|
+
nonce?: number;
|
|
3032
|
+
value?: bigint;
|
|
3033
|
+
}): Promise<bigint> {
|
|
3034
|
+
return contract.simulate.mint([mintAmount] as const, options) as Promise<bigint>;
|
|
3035
|
+
},
|
|
3036
|
+
/**
|
|
3037
|
+
* Simulate redeem
|
|
3038
|
+
* Returns gas estimate and result without sending transaction
|
|
3039
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3040
|
+
*/
|
|
3041
|
+
async redeem(redeemTokens: bigint, options?: {
|
|
3042
|
+
accessList?: import('viem').AccessList;
|
|
3043
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3044
|
+
chain?: import('viem').Chain | null;
|
|
3045
|
+
dataSuffix?: `0x${string}`;
|
|
3046
|
+
gas?: bigint;
|
|
3047
|
+
gasPrice?: bigint;
|
|
3048
|
+
maxFeePerGas?: bigint;
|
|
3049
|
+
maxPriorityFeePerGas?: bigint;
|
|
3050
|
+
nonce?: number;
|
|
3051
|
+
value?: bigint;
|
|
3052
|
+
}): Promise<bigint> {
|
|
3053
|
+
return contract.simulate.redeem([redeemTokens] as const, options) as Promise<bigint>;
|
|
3054
|
+
},
|
|
3055
|
+
/**
|
|
3056
|
+
* Simulate redeemUnderlying
|
|
3057
|
+
* Returns gas estimate and result without sending transaction
|
|
3058
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3059
|
+
*/
|
|
3060
|
+
async redeemUnderlying(redeemAmount: bigint, options?: {
|
|
3061
|
+
accessList?: import('viem').AccessList;
|
|
3062
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3063
|
+
chain?: import('viem').Chain | null;
|
|
3064
|
+
dataSuffix?: `0x${string}`;
|
|
3065
|
+
gas?: bigint;
|
|
3066
|
+
gasPrice?: bigint;
|
|
3067
|
+
maxFeePerGas?: bigint;
|
|
3068
|
+
maxPriorityFeePerGas?: bigint;
|
|
3069
|
+
nonce?: number;
|
|
3070
|
+
value?: bigint;
|
|
3071
|
+
}): Promise<bigint> {
|
|
3072
|
+
return contract.simulate.redeemUnderlying([redeemAmount] as const, options) as Promise<bigint>;
|
|
3073
|
+
},
|
|
3074
|
+
/**
|
|
3075
|
+
* Simulate repayBorrow
|
|
3076
|
+
* Returns gas estimate and result without sending transaction
|
|
3077
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3078
|
+
*/
|
|
3079
|
+
async repayBorrow(repayAmount: bigint, options?: {
|
|
3080
|
+
accessList?: import('viem').AccessList;
|
|
3081
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3082
|
+
chain?: import('viem').Chain | null;
|
|
3083
|
+
dataSuffix?: `0x${string}`;
|
|
3084
|
+
gas?: bigint;
|
|
3085
|
+
gasPrice?: bigint;
|
|
3086
|
+
maxFeePerGas?: bigint;
|
|
3087
|
+
maxPriorityFeePerGas?: bigint;
|
|
3088
|
+
nonce?: number;
|
|
3089
|
+
value?: bigint;
|
|
3090
|
+
}): Promise<bigint> {
|
|
3091
|
+
return contract.simulate.repayBorrow([repayAmount] as const, options) as Promise<bigint>;
|
|
3092
|
+
},
|
|
3093
|
+
/**
|
|
3094
|
+
* Simulate repayBorrowBehalf
|
|
3095
|
+
* Returns gas estimate and result without sending transaction
|
|
3096
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3097
|
+
*/
|
|
3098
|
+
async repayBorrowBehalf(borrower: `0x${string}`, repayAmount: bigint, options?: {
|
|
3099
|
+
accessList?: import('viem').AccessList;
|
|
3100
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3101
|
+
chain?: import('viem').Chain | null;
|
|
3102
|
+
dataSuffix?: `0x${string}`;
|
|
3103
|
+
gas?: bigint;
|
|
3104
|
+
gasPrice?: bigint;
|
|
3105
|
+
maxFeePerGas?: bigint;
|
|
3106
|
+
maxPriorityFeePerGas?: bigint;
|
|
3107
|
+
nonce?: number;
|
|
3108
|
+
value?: bigint;
|
|
3109
|
+
}): Promise<bigint> {
|
|
3110
|
+
return contract.simulate.repayBorrowBehalf([borrower, repayAmount] as const, options) as Promise<bigint>;
|
|
3111
|
+
},
|
|
3112
|
+
/**
|
|
3113
|
+
* Simulate seize
|
|
3114
|
+
* Returns gas estimate and result without sending transaction
|
|
3115
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3116
|
+
*/
|
|
3117
|
+
async seize(liquidator: `0x${string}`, borrower: `0x${string}`, seizeTokens: bigint, options?: {
|
|
3118
|
+
accessList?: import('viem').AccessList;
|
|
3119
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3120
|
+
chain?: import('viem').Chain | null;
|
|
3121
|
+
dataSuffix?: `0x${string}`;
|
|
3122
|
+
gas?: bigint;
|
|
3123
|
+
gasPrice?: bigint;
|
|
3124
|
+
maxFeePerGas?: bigint;
|
|
3125
|
+
maxPriorityFeePerGas?: bigint;
|
|
3126
|
+
nonce?: number;
|
|
3127
|
+
value?: bigint;
|
|
3128
|
+
}): Promise<bigint> {
|
|
3129
|
+
return contract.simulate.seize([liquidator, borrower, seizeTokens] as const, options) as Promise<bigint>;
|
|
3130
|
+
},
|
|
3131
|
+
/**
|
|
3132
|
+
* Simulate sweepToken
|
|
3133
|
+
* Returns gas estimate and result without sending transaction
|
|
3134
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3135
|
+
*/
|
|
3136
|
+
async sweepToken(token: `0x${string}`, options?: {
|
|
3137
|
+
accessList?: import('viem').AccessList;
|
|
3138
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3139
|
+
chain?: import('viem').Chain | null;
|
|
3140
|
+
dataSuffix?: `0x${string}`;
|
|
3141
|
+
gas?: bigint;
|
|
3142
|
+
gasPrice?: bigint;
|
|
3143
|
+
maxFeePerGas?: bigint;
|
|
3144
|
+
maxPriorityFeePerGas?: bigint;
|
|
3145
|
+
nonce?: number;
|
|
3146
|
+
value?: bigint;
|
|
3147
|
+
}): Promise<void> {
|
|
3148
|
+
return contract.simulate.sweepToken([token] as const, options) as Promise<void>;
|
|
3149
|
+
},
|
|
3150
|
+
/**
|
|
3151
|
+
* Simulate totalBorrowsCurrent
|
|
3152
|
+
* Returns gas estimate and result without sending transaction
|
|
3153
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3154
|
+
*/
|
|
3155
|
+
async totalBorrowsCurrent(options?: {
|
|
3156
|
+
accessList?: import('viem').AccessList;
|
|
3157
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3158
|
+
chain?: import('viem').Chain | null;
|
|
3159
|
+
dataSuffix?: `0x${string}`;
|
|
3160
|
+
gas?: bigint;
|
|
3161
|
+
gasPrice?: bigint;
|
|
3162
|
+
maxFeePerGas?: bigint;
|
|
3163
|
+
maxPriorityFeePerGas?: bigint;
|
|
3164
|
+
nonce?: number;
|
|
3165
|
+
value?: bigint;
|
|
3166
|
+
}): Promise<bigint> {
|
|
3167
|
+
return contract.simulate.totalBorrowsCurrent(options) as Promise<bigint>;
|
|
3168
|
+
},
|
|
3169
|
+
/**
|
|
3170
|
+
* Simulate transfer
|
|
3171
|
+
* Returns gas estimate and result without sending transaction
|
|
3172
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3173
|
+
*/
|
|
3174
|
+
async transfer(dst: `0x${string}`, amount: bigint, options?: {
|
|
3175
|
+
accessList?: import('viem').AccessList;
|
|
3176
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3177
|
+
chain?: import('viem').Chain | null;
|
|
3178
|
+
dataSuffix?: `0x${string}`;
|
|
3179
|
+
gas?: bigint;
|
|
3180
|
+
gasPrice?: bigint;
|
|
3181
|
+
maxFeePerGas?: bigint;
|
|
3182
|
+
maxPriorityFeePerGas?: bigint;
|
|
3183
|
+
nonce?: number;
|
|
3184
|
+
value?: bigint;
|
|
3185
|
+
}): Promise<boolean> {
|
|
3186
|
+
return contract.simulate.transfer([dst, amount] as const, options) as Promise<boolean>;
|
|
3187
|
+
},
|
|
3188
|
+
/**
|
|
3189
|
+
* Simulate transferFrom
|
|
3190
|
+
* Returns gas estimate and result without sending transaction
|
|
3191
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
3192
|
+
*/
|
|
3193
|
+
async transferFrom(src: `0x${string}`, dst: `0x${string}`, amount: bigint, options?: {
|
|
3194
|
+
accessList?: import('viem').AccessList;
|
|
3195
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
3196
|
+
chain?: import('viem').Chain | null;
|
|
3197
|
+
dataSuffix?: `0x${string}`;
|
|
3198
|
+
gas?: bigint;
|
|
3199
|
+
gasPrice?: bigint;
|
|
3200
|
+
maxFeePerGas?: bigint;
|
|
3201
|
+
maxPriorityFeePerGas?: bigint;
|
|
3202
|
+
nonce?: number;
|
|
3203
|
+
value?: bigint;
|
|
3204
|
+
}): Promise<boolean> {
|
|
3205
|
+
return contract.simulate.transferFrom([src, dst, amount] as const, options) as Promise<boolean>;
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
/**
|
|
3211
|
+
* Watch contract events
|
|
3212
|
+
*
|
|
3213
|
+
* @example
|
|
3214
|
+
* // Watch all Transfer events
|
|
3215
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
3216
|
+
* console.log('Transfer:', event);
|
|
3217
|
+
* });
|
|
3218
|
+
*
|
|
3219
|
+
* // Stop watching
|
|
3220
|
+
* unwatch();
|
|
3221
|
+
*/
|
|
3222
|
+
get watch() {
|
|
3223
|
+
return {
|
|
3224
|
+
/**
|
|
3225
|
+
* Watch AccrueInterest events
|
|
3226
|
+
* @param callback Function to call when event is emitted
|
|
3227
|
+
* @param filter Optional filter for indexed parameters
|
|
3228
|
+
* @returns Unwatch function to stop listening
|
|
3229
|
+
*/
|
|
3230
|
+
AccrueInterest: (callback: (event: { cashPrior: bigint; interestAccumulated: bigint; borrowIndex: bigint; totalBorrows: bigint }) => void) => {
|
|
3231
|
+
return this.publicClient.watchContractEvent({
|
|
3232
|
+
address: this.contractAddress,
|
|
3233
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3234
|
+
eventName: 'AccrueInterest',
|
|
3235
|
+
|
|
3236
|
+
onLogs: (logs: any[]) => {
|
|
3237
|
+
logs.forEach((log: any) => {
|
|
3238
|
+
callback(log.args as any);
|
|
3239
|
+
});
|
|
3240
|
+
},
|
|
3241
|
+
}) as () => void;
|
|
3242
|
+
},
|
|
3243
|
+
/**
|
|
3244
|
+
* Watch Approval events
|
|
3245
|
+
* @param callback Function to call when event is emitted
|
|
3246
|
+
* @param filter Optional filter for indexed parameters
|
|
3247
|
+
* @returns Unwatch function to stop listening
|
|
3248
|
+
*/
|
|
3249
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; amount: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
3250
|
+
return this.publicClient.watchContractEvent({
|
|
3251
|
+
address: this.contractAddress,
|
|
3252
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3253
|
+
eventName: 'Approval',
|
|
3254
|
+
args: filter,
|
|
3255
|
+
onLogs: (logs: any[]) => {
|
|
3256
|
+
logs.forEach((log: any) => {
|
|
3257
|
+
callback(log.args as any);
|
|
3258
|
+
});
|
|
3259
|
+
},
|
|
3260
|
+
}) as () => void;
|
|
3261
|
+
},
|
|
3262
|
+
/**
|
|
3263
|
+
* Watch Borrow events
|
|
3264
|
+
* @param callback Function to call when event is emitted
|
|
3265
|
+
* @param filter Optional filter for indexed parameters
|
|
3266
|
+
* @returns Unwatch function to stop listening
|
|
3267
|
+
*/
|
|
3268
|
+
Borrow: (callback: (event: { borrower: `0x${string}`; borrowAmount: bigint; accountBorrows: bigint; totalBorrows: bigint }) => void) => {
|
|
3269
|
+
return this.publicClient.watchContractEvent({
|
|
3270
|
+
address: this.contractAddress,
|
|
3271
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3272
|
+
eventName: 'Borrow',
|
|
3273
|
+
|
|
3274
|
+
onLogs: (logs: any[]) => {
|
|
3275
|
+
logs.forEach((log: any) => {
|
|
3276
|
+
callback(log.args as any);
|
|
3277
|
+
});
|
|
3278
|
+
},
|
|
3279
|
+
}) as () => void;
|
|
3280
|
+
},
|
|
3281
|
+
/**
|
|
3282
|
+
* Watch LiquidateBorrow events
|
|
3283
|
+
* @param callback Function to call when event is emitted
|
|
3284
|
+
* @param filter Optional filter for indexed parameters
|
|
3285
|
+
* @returns Unwatch function to stop listening
|
|
3286
|
+
*/
|
|
3287
|
+
LiquidateBorrow: (callback: (event: { liquidator: `0x${string}`; borrower: `0x${string}`; repayAmount: bigint; cTokenCollateral: `0x${string}`; seizeTokens: bigint }) => void) => {
|
|
3288
|
+
return this.publicClient.watchContractEvent({
|
|
3289
|
+
address: this.contractAddress,
|
|
3290
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3291
|
+
eventName: 'LiquidateBorrow',
|
|
3292
|
+
|
|
3293
|
+
onLogs: (logs: any[]) => {
|
|
3294
|
+
logs.forEach((log: any) => {
|
|
3295
|
+
callback(log.args as any);
|
|
3296
|
+
});
|
|
3297
|
+
},
|
|
3298
|
+
}) as () => void;
|
|
3299
|
+
},
|
|
3300
|
+
/**
|
|
3301
|
+
* Watch Mint events
|
|
3302
|
+
* @param callback Function to call when event is emitted
|
|
3303
|
+
* @param filter Optional filter for indexed parameters
|
|
3304
|
+
* @returns Unwatch function to stop listening
|
|
3305
|
+
*/
|
|
3306
|
+
Mint: (callback: (event: { minter: `0x${string}`; mintAmount: bigint; mintTokens: bigint }) => void) => {
|
|
3307
|
+
return this.publicClient.watchContractEvent({
|
|
3308
|
+
address: this.contractAddress,
|
|
3309
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3310
|
+
eventName: 'Mint',
|
|
3311
|
+
|
|
3312
|
+
onLogs: (logs: any[]) => {
|
|
3313
|
+
logs.forEach((log: any) => {
|
|
3314
|
+
callback(log.args as any);
|
|
3315
|
+
});
|
|
3316
|
+
},
|
|
3317
|
+
}) as () => void;
|
|
3318
|
+
},
|
|
3319
|
+
/**
|
|
3320
|
+
* Watch NewAdmin events
|
|
3321
|
+
* @param callback Function to call when event is emitted
|
|
3322
|
+
* @param filter Optional filter for indexed parameters
|
|
3323
|
+
* @returns Unwatch function to stop listening
|
|
3324
|
+
*/
|
|
3325
|
+
NewAdmin: (callback: (event: { oldAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
|
|
3326
|
+
return this.publicClient.watchContractEvent({
|
|
3327
|
+
address: this.contractAddress,
|
|
3328
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3329
|
+
eventName: 'NewAdmin',
|
|
3330
|
+
|
|
3331
|
+
onLogs: (logs: any[]) => {
|
|
3332
|
+
logs.forEach((log: any) => {
|
|
3333
|
+
callback(log.args as any);
|
|
3334
|
+
});
|
|
3335
|
+
},
|
|
3336
|
+
}) as () => void;
|
|
3337
|
+
},
|
|
3338
|
+
/**
|
|
3339
|
+
* Watch NewComptroller events
|
|
3340
|
+
* @param callback Function to call when event is emitted
|
|
3341
|
+
* @param filter Optional filter for indexed parameters
|
|
3342
|
+
* @returns Unwatch function to stop listening
|
|
3343
|
+
*/
|
|
3344
|
+
NewComptroller: (callback: (event: { oldComptroller: `0x${string}`; newComptroller: `0x${string}` }) => void) => {
|
|
3345
|
+
return this.publicClient.watchContractEvent({
|
|
3346
|
+
address: this.contractAddress,
|
|
3347
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3348
|
+
eventName: 'NewComptroller',
|
|
3349
|
+
|
|
3350
|
+
onLogs: (logs: any[]) => {
|
|
3351
|
+
logs.forEach((log: any) => {
|
|
3352
|
+
callback(log.args as any);
|
|
3353
|
+
});
|
|
3354
|
+
},
|
|
3355
|
+
}) as () => void;
|
|
3356
|
+
},
|
|
3357
|
+
/**
|
|
3358
|
+
* Watch NewMarketInterestRateModel events
|
|
3359
|
+
* @param callback Function to call when event is emitted
|
|
3360
|
+
* @param filter Optional filter for indexed parameters
|
|
3361
|
+
* @returns Unwatch function to stop listening
|
|
3362
|
+
*/
|
|
3363
|
+
NewMarketInterestRateModel: (callback: (event: { oldInterestRateModel: `0x${string}`; newInterestRateModel: `0x${string}` }) => void) => {
|
|
3364
|
+
return this.publicClient.watchContractEvent({
|
|
3365
|
+
address: this.contractAddress,
|
|
3366
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3367
|
+
eventName: 'NewMarketInterestRateModel',
|
|
3368
|
+
|
|
3369
|
+
onLogs: (logs: any[]) => {
|
|
3370
|
+
logs.forEach((log: any) => {
|
|
3371
|
+
callback(log.args as any);
|
|
3372
|
+
});
|
|
3373
|
+
},
|
|
3374
|
+
}) as () => void;
|
|
3375
|
+
},
|
|
3376
|
+
/**
|
|
3377
|
+
* Watch NewPendingAdmin events
|
|
3378
|
+
* @param callback Function to call when event is emitted
|
|
3379
|
+
* @param filter Optional filter for indexed parameters
|
|
3380
|
+
* @returns Unwatch function to stop listening
|
|
3381
|
+
*/
|
|
3382
|
+
NewPendingAdmin: (callback: (event: { oldPendingAdmin: `0x${string}`; newPendingAdmin: `0x${string}` }) => void) => {
|
|
3383
|
+
return this.publicClient.watchContractEvent({
|
|
3384
|
+
address: this.contractAddress,
|
|
3385
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3386
|
+
eventName: 'NewPendingAdmin',
|
|
3387
|
+
|
|
3388
|
+
onLogs: (logs: any[]) => {
|
|
3389
|
+
logs.forEach((log: any) => {
|
|
3390
|
+
callback(log.args as any);
|
|
3391
|
+
});
|
|
3392
|
+
},
|
|
3393
|
+
}) as () => void;
|
|
3394
|
+
},
|
|
3395
|
+
/**
|
|
3396
|
+
* Watch NewReserveFactor events
|
|
3397
|
+
* @param callback Function to call when event is emitted
|
|
3398
|
+
* @param filter Optional filter for indexed parameters
|
|
3399
|
+
* @returns Unwatch function to stop listening
|
|
3400
|
+
*/
|
|
3401
|
+
NewReserveFactor: (callback: (event: { oldReserveFactorMantissa: bigint; newReserveFactorMantissa: bigint }) => void) => {
|
|
3402
|
+
return this.publicClient.watchContractEvent({
|
|
3403
|
+
address: this.contractAddress,
|
|
3404
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3405
|
+
eventName: 'NewReserveFactor',
|
|
3406
|
+
|
|
3407
|
+
onLogs: (logs: any[]) => {
|
|
3408
|
+
logs.forEach((log: any) => {
|
|
3409
|
+
callback(log.args as any);
|
|
3410
|
+
});
|
|
3411
|
+
},
|
|
3412
|
+
}) as () => void;
|
|
3413
|
+
},
|
|
3414
|
+
/**
|
|
3415
|
+
* Watch NewWhitelist events
|
|
3416
|
+
* @param callback Function to call when event is emitted
|
|
3417
|
+
* @param filter Optional filter for indexed parameters
|
|
3418
|
+
* @returns Unwatch function to stop listening
|
|
3419
|
+
*/
|
|
3420
|
+
NewWhitelist: (callback: (event: { oldWhitelist: `0x${string}`; newWhitelist: `0x${string}` }) => void) => {
|
|
3421
|
+
return this.publicClient.watchContractEvent({
|
|
3422
|
+
address: this.contractAddress,
|
|
3423
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3424
|
+
eventName: 'NewWhitelist',
|
|
3425
|
+
|
|
3426
|
+
onLogs: (logs: any[]) => {
|
|
3427
|
+
logs.forEach((log: any) => {
|
|
3428
|
+
callback(log.args as any);
|
|
3429
|
+
});
|
|
3430
|
+
},
|
|
3431
|
+
}) as () => void;
|
|
3432
|
+
},
|
|
3433
|
+
/**
|
|
3434
|
+
* Watch Redeem events
|
|
3435
|
+
* @param callback Function to call when event is emitted
|
|
3436
|
+
* @param filter Optional filter for indexed parameters
|
|
3437
|
+
* @returns Unwatch function to stop listening
|
|
3438
|
+
*/
|
|
3439
|
+
Redeem: (callback: (event: { redeemer: `0x${string}`; redeemAmount: bigint; redeemTokens: bigint }) => void) => {
|
|
3440
|
+
return this.publicClient.watchContractEvent({
|
|
3441
|
+
address: this.contractAddress,
|
|
3442
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3443
|
+
eventName: 'Redeem',
|
|
3444
|
+
|
|
3445
|
+
onLogs: (logs: any[]) => {
|
|
3446
|
+
logs.forEach((log: any) => {
|
|
3447
|
+
callback(log.args as any);
|
|
3448
|
+
});
|
|
3449
|
+
},
|
|
3450
|
+
}) as () => void;
|
|
3451
|
+
},
|
|
3452
|
+
/**
|
|
3453
|
+
* Watch RepayBorrow events
|
|
3454
|
+
* @param callback Function to call when event is emitted
|
|
3455
|
+
* @param filter Optional filter for indexed parameters
|
|
3456
|
+
* @returns Unwatch function to stop listening
|
|
3457
|
+
*/
|
|
3458
|
+
RepayBorrow: (callback: (event: { payer: `0x${string}`; borrower: `0x${string}`; repayAmount: bigint; accountBorrows: bigint; totalBorrows: bigint }) => void) => {
|
|
3459
|
+
return this.publicClient.watchContractEvent({
|
|
3460
|
+
address: this.contractAddress,
|
|
3461
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3462
|
+
eventName: 'RepayBorrow',
|
|
3463
|
+
|
|
3464
|
+
onLogs: (logs: any[]) => {
|
|
3465
|
+
logs.forEach((log: any) => {
|
|
3466
|
+
callback(log.args as any);
|
|
3467
|
+
});
|
|
3468
|
+
},
|
|
3469
|
+
}) as () => void;
|
|
3470
|
+
},
|
|
3471
|
+
/**
|
|
3472
|
+
* Watch ReservesAdded events
|
|
3473
|
+
* @param callback Function to call when event is emitted
|
|
3474
|
+
* @param filter Optional filter for indexed parameters
|
|
3475
|
+
* @returns Unwatch function to stop listening
|
|
3476
|
+
*/
|
|
3477
|
+
ReservesAdded: (callback: (event: { benefactor: `0x${string}`; addAmount: bigint; newTotalReserves: bigint }) => void) => {
|
|
3478
|
+
return this.publicClient.watchContractEvent({
|
|
3479
|
+
address: this.contractAddress,
|
|
3480
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3481
|
+
eventName: 'ReservesAdded',
|
|
3482
|
+
|
|
3483
|
+
onLogs: (logs: any[]) => {
|
|
3484
|
+
logs.forEach((log: any) => {
|
|
3485
|
+
callback(log.args as any);
|
|
3486
|
+
});
|
|
3487
|
+
},
|
|
3488
|
+
}) as () => void;
|
|
3489
|
+
},
|
|
3490
|
+
/**
|
|
3491
|
+
* Watch ReservesReduced events
|
|
3492
|
+
* @param callback Function to call when event is emitted
|
|
3493
|
+
* @param filter Optional filter for indexed parameters
|
|
3494
|
+
* @returns Unwatch function to stop listening
|
|
3495
|
+
*/
|
|
3496
|
+
ReservesReduced: (callback: (event: { admin: `0x${string}`; reduceAmount: bigint; newTotalReserves: bigint }) => void) => {
|
|
3497
|
+
return this.publicClient.watchContractEvent({
|
|
3498
|
+
address: this.contractAddress,
|
|
3499
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3500
|
+
eventName: 'ReservesReduced',
|
|
3501
|
+
|
|
3502
|
+
onLogs: (logs: any[]) => {
|
|
3503
|
+
logs.forEach((log: any) => {
|
|
3504
|
+
callback(log.args as any);
|
|
3505
|
+
});
|
|
3506
|
+
},
|
|
3507
|
+
}) as () => void;
|
|
3508
|
+
},
|
|
3509
|
+
/**
|
|
3510
|
+
* Watch Transfer events
|
|
3511
|
+
* @param callback Function to call when event is emitted
|
|
3512
|
+
* @param filter Optional filter for indexed parameters
|
|
3513
|
+
* @returns Unwatch function to stop listening
|
|
3514
|
+
*/
|
|
3515
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; amount: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
3516
|
+
return this.publicClient.watchContractEvent({
|
|
3517
|
+
address: this.contractAddress,
|
|
3518
|
+
abi: CErc20Delegate_jsonAbi,
|
|
3519
|
+
eventName: 'Transfer',
|
|
3520
|
+
args: filter,
|
|
3521
|
+
onLogs: (logs: any[]) => {
|
|
3522
|
+
logs.forEach((log: any) => {
|
|
3523
|
+
callback(log.args as any);
|
|
3524
|
+
});
|
|
3525
|
+
},
|
|
3526
|
+
}) as () => void;
|
|
3527
|
+
}
|
|
3528
|
+
};
|
|
3529
|
+
}
|
|
3530
|
+
}
|