@emberai/onchain-actions-registry 1.0.0-alpha.3
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/dist/aave-lending-plugin/adapter.d.ts +56 -0
- package/dist/aave-lending-plugin/adapter.d.ts.map +1 -0
- package/dist/aave-lending-plugin/adapter.js +326 -0
- package/dist/aave-lending-plugin/adapter.js.map +1 -0
- package/dist/aave-lending-plugin/chain.d.ts +30 -0
- package/dist/aave-lending-plugin/chain.d.ts.map +1 -0
- package/dist/aave-lending-plugin/chain.js +36 -0
- package/dist/aave-lending-plugin/chain.js.map +1 -0
- package/dist/aave-lending-plugin/dataProvider.d.ts +19 -0
- package/dist/aave-lending-plugin/dataProvider.d.ts.map +1 -0
- package/dist/aave-lending-plugin/dataProvider.js +18 -0
- package/dist/aave-lending-plugin/dataProvider.js.map +1 -0
- package/dist/aave-lending-plugin/errors.d.ts +13 -0
- package/dist/aave-lending-plugin/errors.d.ts.map +1 -0
- package/dist/aave-lending-plugin/errors.js +366 -0
- package/dist/aave-lending-plugin/errors.js.map +1 -0
- package/dist/aave-lending-plugin/index.d.ts +24 -0
- package/dist/aave-lending-plugin/index.d.ts.map +1 -0
- package/dist/aave-lending-plugin/index.js +136 -0
- package/dist/aave-lending-plugin/index.js.map +1 -0
- package/dist/aave-lending-plugin/market.d.ts +11 -0
- package/dist/aave-lending-plugin/market.d.ts.map +1 -0
- package/dist/aave-lending-plugin/market.js +22 -0
- package/dist/aave-lending-plugin/market.js.map +1 -0
- package/dist/aave-lending-plugin/populateTransaction.d.ts +4 -0
- package/dist/aave-lending-plugin/populateTransaction.d.ts.map +1 -0
- package/dist/aave-lending-plugin/populateTransaction.js +31 -0
- package/dist/aave-lending-plugin/populateTransaction.js.map +1 -0
- package/dist/aave-lending-plugin/userSummary.d.ts +15 -0
- package/dist/aave-lending-plugin/userSummary.d.ts.map +1 -0
- package/dist/aave-lending-plugin/userSummary.js +62 -0
- package/dist/aave-lending-plugin/userSummary.js.map +1 -0
- package/dist/chainConfig.d.ts +10 -0
- package/dist/chainConfig.d.ts.map +1 -0
- package/dist/chainConfig.js +2 -0
- package/dist/chainConfig.js.map +1 -0
- package/dist/core/actions/index.d.ts +6 -0
- package/dist/core/actions/index.d.ts.map +1 -0
- package/dist/core/actions/index.js +2 -0
- package/dist/core/actions/index.js.map +1 -0
- package/dist/core/actions/lending.d.ts +22 -0
- package/dist/core/actions/lending.d.ts.map +1 -0
- package/dist/core/actions/lending.js +2 -0
- package/dist/core/actions/lending.js.map +1 -0
- package/dist/core/actions/liquidity.d.ts +14 -0
- package/dist/core/actions/liquidity.d.ts.map +1 -0
- package/dist/core/actions/liquidity.js +2 -0
- package/dist/core/actions/liquidity.js.map +1 -0
- package/dist/core/actions/perpetuals.d.ts +6 -0
- package/dist/core/actions/perpetuals.d.ts.map +1 -0
- package/dist/core/actions/perpetuals.js +2 -0
- package/dist/core/actions/perpetuals.js.map +1 -0
- package/dist/core/actions/swap.d.ts +10 -0
- package/dist/core/actions/swap.d.ts.map +1 -0
- package/dist/core/actions/swap.js +2 -0
- package/dist/core/actions/swap.js.map +1 -0
- package/dist/core/actions/types.d.ts +70 -0
- package/dist/core/actions/types.d.ts.map +1 -0
- package/dist/core/actions/types.js +2 -0
- package/dist/core/actions/types.js.map +1 -0
- package/dist/core/index.d.ts +41 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/pluginType.d.ts +25 -0
- package/dist/core/pluginType.d.ts.map +1 -0
- package/dist/core/pluginType.js +2 -0
- package/dist/core/pluginType.js.map +1 -0
- package/dist/core/queries/index.d.ts +4 -0
- package/dist/core/queries/index.d.ts.map +1 -0
- package/dist/core/queries/index.js +4 -0
- package/dist/core/queries/index.js.map +1 -0
- package/dist/core/queries/lending.d.ts +12 -0
- package/dist/core/queries/lending.d.ts.map +1 -0
- package/dist/core/queries/lending.js +2 -0
- package/dist/core/queries/lending.js.map +1 -0
- package/dist/core/queries/liquidity.d.ts +17 -0
- package/dist/core/queries/liquidity.d.ts.map +1 -0
- package/dist/core/queries/liquidity.js +2 -0
- package/dist/core/queries/liquidity.js.map +1 -0
- package/dist/core/queries/perpetuals.d.ts +10 -0
- package/dist/core/queries/perpetuals.d.ts.map +1 -0
- package/dist/core/queries/perpetuals.js +2 -0
- package/dist/core/queries/perpetuals.js.map +1 -0
- package/dist/core/schemas/core.d.ts +315 -0
- package/dist/core/schemas/core.d.ts.map +1 -0
- package/dist/core/schemas/core.js +76 -0
- package/dist/core/schemas/core.js.map +1 -0
- package/dist/core/schemas/enums.d.ts +37 -0
- package/dist/core/schemas/enums.d.ts.map +1 -0
- package/dist/core/schemas/enums.js +36 -0
- package/dist/core/schemas/enums.js.map +1 -0
- package/dist/core/schemas/index.d.ts +9 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +9 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/schemas/lending.d.ts +903 -0
- package/dist/core/schemas/lending.d.ts.map +1 -0
- package/dist/core/schemas/lending.js +71 -0
- package/dist/core/schemas/lending.js.map +1 -0
- package/dist/core/schemas/liquidity.d.ts +604 -0
- package/dist/core/schemas/liquidity.d.ts.map +1 -0
- package/dist/core/schemas/liquidity.js +74 -0
- package/dist/core/schemas/liquidity.js.map +1 -0
- package/dist/core/schemas/perpetuals.d.ts +974 -0
- package/dist/core/schemas/perpetuals.d.ts.map +1 -0
- package/dist/core/schemas/perpetuals.js +116 -0
- package/dist/core/schemas/perpetuals.js.map +1 -0
- package/dist/core/schemas/requests.d.ts +218 -0
- package/dist/core/schemas/requests.d.ts.map +1 -0
- package/dist/core/schemas/requests.js +15 -0
- package/dist/core/schemas/requests.js.map +1 -0
- package/dist/core/schemas/swap.d.ts +451 -0
- package/dist/core/schemas/swap.d.ts.map +1 -0
- package/dist/core/schemas/swap.js +37 -0
- package/dist/core/schemas/swap.js.map +1 -0
- package/dist/core/schemas/wallet.d.ts +69 -0
- package/dist/core/schemas/wallet.d.ts.map +1 -0
- package/dist/core/schemas/wallet.js +9 -0
- package/dist/core/schemas/wallet.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +24 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +38 -0
- package/dist/registry.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// based on https://github.com/aave-dao/aave-v3-origin/blob/083bd38a137b42b5df04e22ad4c9e72454365d0d/src/contracts/protocol/libraries/helpers/Errors.sol
|
|
2
|
+
class AaveError extends Error {
|
|
3
|
+
description;
|
|
4
|
+
message;
|
|
5
|
+
constructor(code, name, description) {
|
|
6
|
+
const message = name + ` (${code}): ` + description;
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = 'AaveError';
|
|
9
|
+
this.description = description;
|
|
10
|
+
this.message = message;
|
|
11
|
+
// Ensures proper prototype chain in transpiled JavaScript
|
|
12
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export const AAVE_ERROR_CODES = {
|
|
16
|
+
'1': {
|
|
17
|
+
name: 'CALLER_NOT_POOL_ADMIN',
|
|
18
|
+
description: 'The caller of the function is not a pool admin',
|
|
19
|
+
},
|
|
20
|
+
'2': {
|
|
21
|
+
name: 'CALLER_NOT_EMERGENCY_ADMIN',
|
|
22
|
+
description: 'The caller of the function is not an emergency admin',
|
|
23
|
+
},
|
|
24
|
+
'3': {
|
|
25
|
+
name: 'CALLER_NOT_POOL_OR_EMERGENCY_ADMIN',
|
|
26
|
+
description: 'The caller of the function is not a pool or emergency admin',
|
|
27
|
+
},
|
|
28
|
+
'4': {
|
|
29
|
+
name: 'CALLER_NOT_RISK_OR_POOL_ADMIN',
|
|
30
|
+
description: 'The caller of the function is not a risk or pool admin',
|
|
31
|
+
},
|
|
32
|
+
'5': {
|
|
33
|
+
name: 'CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN',
|
|
34
|
+
description: 'The caller of the function is not an asset listing or pool admin',
|
|
35
|
+
},
|
|
36
|
+
'6': {
|
|
37
|
+
name: 'CALLER_NOT_BRIDGE',
|
|
38
|
+
description: 'The caller of the function is not a bridge',
|
|
39
|
+
},
|
|
40
|
+
'7': {
|
|
41
|
+
name: 'ADDRESSES_PROVIDER_NOT_REGISTERED',
|
|
42
|
+
description: 'Pool addresses provider is not registered',
|
|
43
|
+
},
|
|
44
|
+
'8': {
|
|
45
|
+
name: 'INVALID_ADDRESSES_PROVIDER_ID',
|
|
46
|
+
description: 'Invalid id for the pool addresses provider',
|
|
47
|
+
},
|
|
48
|
+
'9': { name: 'NOT_CONTRACT', description: 'Address is not a contract' },
|
|
49
|
+
'10': {
|
|
50
|
+
name: 'CALLER_NOT_POOL_CONFIGURATOR',
|
|
51
|
+
description: 'The caller of the function is not the pool configurator',
|
|
52
|
+
},
|
|
53
|
+
'11': {
|
|
54
|
+
name: 'CALLER_NOT_ATOKEN',
|
|
55
|
+
description: 'The caller of the function is not an AToken',
|
|
56
|
+
},
|
|
57
|
+
'12': {
|
|
58
|
+
name: 'INVALID_ADDRESSES_PROVIDER',
|
|
59
|
+
description: 'The address of the pool addresses provider is invalid',
|
|
60
|
+
},
|
|
61
|
+
'13': {
|
|
62
|
+
name: 'INVALID_FLASHLOAN_EXECUTOR_RETURN',
|
|
63
|
+
description: 'Invalid return value of the flashloan executor function',
|
|
64
|
+
},
|
|
65
|
+
'14': {
|
|
66
|
+
name: 'RESERVE_ALREADY_ADDED',
|
|
67
|
+
description: 'Reserve has already been added to reserve list',
|
|
68
|
+
},
|
|
69
|
+
'15': {
|
|
70
|
+
name: 'NO_MORE_RESERVES_ALLOWED',
|
|
71
|
+
description: 'Maximum amount of reserves in the pool reached',
|
|
72
|
+
},
|
|
73
|
+
'16': {
|
|
74
|
+
name: 'EMODE_CATEGORY_RESERVED',
|
|
75
|
+
description: 'Zero eMode category is reserved for volatile heterogeneous assets',
|
|
76
|
+
},
|
|
77
|
+
'17': {
|
|
78
|
+
name: 'INVALID_EMODE_CATEGORY_ASSIGNMENT',
|
|
79
|
+
description: 'Invalid eMode category assignment to asset',
|
|
80
|
+
},
|
|
81
|
+
'18': {
|
|
82
|
+
name: 'RESERVE_LIQUIDITY_NOT_ZERO',
|
|
83
|
+
description: 'The liquidity of the reserve needs to be 0',
|
|
84
|
+
},
|
|
85
|
+
'19': {
|
|
86
|
+
name: 'FLASHLOAN_PREMIUM_INVALID',
|
|
87
|
+
description: 'Invalid flashloan premium',
|
|
88
|
+
},
|
|
89
|
+
'20': {
|
|
90
|
+
name: 'INVALID_RESERVE_PARAMS',
|
|
91
|
+
description: 'Invalid risk parameters for the reserve',
|
|
92
|
+
},
|
|
93
|
+
'21': {
|
|
94
|
+
name: 'INVALID_EMODE_CATEGORY_PARAMS',
|
|
95
|
+
description: 'Invalid risk parameters for the eMode category',
|
|
96
|
+
},
|
|
97
|
+
'22': {
|
|
98
|
+
name: 'BRIDGE_PROTOCOL_FEE_INVALID',
|
|
99
|
+
description: 'Invalid bridge protocol fee',
|
|
100
|
+
},
|
|
101
|
+
'23': {
|
|
102
|
+
name: 'CALLER_MUST_BE_POOL',
|
|
103
|
+
description: 'The caller of this function must be a pool',
|
|
104
|
+
},
|
|
105
|
+
'24': { name: 'INVALID_MINT_AMOUNT', description: 'Invalid amount to mint' },
|
|
106
|
+
'25': { name: 'INVALID_BURN_AMOUNT', description: 'Invalid amount to burn' },
|
|
107
|
+
'26': {
|
|
108
|
+
name: 'INVALID_AMOUNT',
|
|
109
|
+
description: 'Amount must be greater than 0',
|
|
110
|
+
},
|
|
111
|
+
'27': {
|
|
112
|
+
name: 'RESERVE_INACTIVE',
|
|
113
|
+
description: 'Action requires an active reserve',
|
|
114
|
+
},
|
|
115
|
+
'28': {
|
|
116
|
+
name: 'RESERVE_FROZEN',
|
|
117
|
+
description: 'Action cannot be performed because the reserve is frozen',
|
|
118
|
+
},
|
|
119
|
+
'29': {
|
|
120
|
+
name: 'RESERVE_PAUSED',
|
|
121
|
+
description: 'Action cannot be performed because the reserve is paused',
|
|
122
|
+
},
|
|
123
|
+
'30': {
|
|
124
|
+
name: 'BORROWING_NOT_ENABLED',
|
|
125
|
+
description: 'Borrowing is not enabled',
|
|
126
|
+
},
|
|
127
|
+
'32': {
|
|
128
|
+
name: 'NOT_ENOUGH_AVAILABLE_USER_BALANCE',
|
|
129
|
+
description: 'User cannot withdraw more than the available balance',
|
|
130
|
+
},
|
|
131
|
+
'33': {
|
|
132
|
+
name: 'INVALID_INTEREST_RATE_MODE_SELECTED',
|
|
133
|
+
description: 'Invalid interest rate mode selected',
|
|
134
|
+
},
|
|
135
|
+
'34': {
|
|
136
|
+
name: 'COLLATERAL_BALANCE_IS_ZERO',
|
|
137
|
+
description: 'The collateral balance is 0',
|
|
138
|
+
},
|
|
139
|
+
'35': {
|
|
140
|
+
name: 'HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD',
|
|
141
|
+
description: 'Health factor is lesser than the liquidation threshold',
|
|
142
|
+
},
|
|
143
|
+
'36': {
|
|
144
|
+
name: 'COLLATERAL_CANNOT_COVER_NEW_BORROW',
|
|
145
|
+
description: 'There is not enough collateral to cover a new borrow',
|
|
146
|
+
},
|
|
147
|
+
'37': {
|
|
148
|
+
name: 'COLLATERAL_SAME_AS_BORROWING_CURRENCY',
|
|
149
|
+
description: 'Collateral is (mostly) the same currency that is being borrowed',
|
|
150
|
+
},
|
|
151
|
+
'39': {
|
|
152
|
+
name: 'NO_DEBT_OF_SELECTED_TYPE',
|
|
153
|
+
description: 'For repayment of a specific type of debt, the user needs to have debt that type',
|
|
154
|
+
},
|
|
155
|
+
'40': {
|
|
156
|
+
name: 'NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF',
|
|
157
|
+
description: 'To repay on behalf of a user an explicit amount to repay is needed',
|
|
158
|
+
},
|
|
159
|
+
'42': {
|
|
160
|
+
name: 'NO_OUTSTANDING_VARIABLE_DEBT',
|
|
161
|
+
description: 'User does not have outstanding variable rate debt on this reserve',
|
|
162
|
+
},
|
|
163
|
+
'43': {
|
|
164
|
+
name: 'UNDERLYING_BALANCE_ZERO',
|
|
165
|
+
description: 'The underlying balance needs to be greater than 0',
|
|
166
|
+
},
|
|
167
|
+
'44': {
|
|
168
|
+
name: 'INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET',
|
|
169
|
+
description: 'Interest rate rebalance conditions were not met',
|
|
170
|
+
},
|
|
171
|
+
'45': {
|
|
172
|
+
name: 'HEALTH_FACTOR_NOT_BELOW_THRESHOLD',
|
|
173
|
+
description: 'Health factor is not below the threshold',
|
|
174
|
+
},
|
|
175
|
+
'46': {
|
|
176
|
+
name: 'COLLATERAL_CANNOT_BE_LIQUIDATED',
|
|
177
|
+
description: 'The collateral chosen cannot be liquidated',
|
|
178
|
+
},
|
|
179
|
+
'47': {
|
|
180
|
+
name: 'SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER',
|
|
181
|
+
description: 'User did not borrow the specified currency',
|
|
182
|
+
},
|
|
183
|
+
'49': {
|
|
184
|
+
name: 'INCONSISTENT_FLASHLOAN_PARAMS',
|
|
185
|
+
description: 'Inconsistent flashloan parameters',
|
|
186
|
+
},
|
|
187
|
+
'50': { name: 'BORROW_CAP_EXCEEDED', description: 'Borrow cap is exceeded' },
|
|
188
|
+
'51': { name: 'SUPPLY_CAP_EXCEEDED', description: 'Supply cap is exceeded' },
|
|
189
|
+
'52': {
|
|
190
|
+
name: 'UNBACKED_MINT_CAP_EXCEEDED',
|
|
191
|
+
description: 'Unbacked mint cap is exceeded',
|
|
192
|
+
},
|
|
193
|
+
'53': {
|
|
194
|
+
name: 'DEBT_CEILING_EXCEEDED',
|
|
195
|
+
description: 'Debt ceiling is exceeded',
|
|
196
|
+
},
|
|
197
|
+
'54': {
|
|
198
|
+
name: 'UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO',
|
|
199
|
+
description: 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)',
|
|
200
|
+
},
|
|
201
|
+
'56': {
|
|
202
|
+
name: 'VARIABLE_DEBT_SUPPLY_NOT_ZERO',
|
|
203
|
+
description: 'Variable debt supply is not zero',
|
|
204
|
+
},
|
|
205
|
+
'57': { name: 'LTV_VALIDATION_FAILED', description: 'Ltv validation failed' },
|
|
206
|
+
'58': {
|
|
207
|
+
name: 'INCONSISTENT_EMODE_CATEGORY',
|
|
208
|
+
description: 'Inconsistent eMode category',
|
|
209
|
+
},
|
|
210
|
+
'59': {
|
|
211
|
+
name: 'PRICE_ORACLE_SENTINEL_CHECK_FAILED',
|
|
212
|
+
description: 'Price oracle sentinel validation failed',
|
|
213
|
+
},
|
|
214
|
+
'60': {
|
|
215
|
+
name: 'ASSET_NOT_BORROWABLE_IN_ISOLATION',
|
|
216
|
+
description: 'Asset is not borrowable in isolation mode',
|
|
217
|
+
},
|
|
218
|
+
'61': {
|
|
219
|
+
name: 'RESERVE_ALREADY_INITIALIZED',
|
|
220
|
+
description: 'Reserve has already been initialized',
|
|
221
|
+
},
|
|
222
|
+
'62': {
|
|
223
|
+
name: 'USER_IN_ISOLATION_MODE_OR_LTV_ZERO',
|
|
224
|
+
description: 'User is in isolation mode or ltv is zero',
|
|
225
|
+
},
|
|
226
|
+
'63': {
|
|
227
|
+
name: 'INVALID_LTV',
|
|
228
|
+
description: 'Invalid ltv parameter for the reserve',
|
|
229
|
+
},
|
|
230
|
+
'64': {
|
|
231
|
+
name: 'INVALID_LIQ_THRESHOLD',
|
|
232
|
+
description: 'Invalid liquidity threshold parameter for the reserve',
|
|
233
|
+
},
|
|
234
|
+
'65': {
|
|
235
|
+
name: 'INVALID_LIQ_BONUS',
|
|
236
|
+
description: 'Invalid liquidity bonus parameter for the reserve',
|
|
237
|
+
},
|
|
238
|
+
'66': {
|
|
239
|
+
name: 'INVALID_DECIMALS',
|
|
240
|
+
description: 'Invalid decimals parameter of the underlying asset of the reserve',
|
|
241
|
+
},
|
|
242
|
+
'67': {
|
|
243
|
+
name: 'INVALID_RESERVE_FACTOR',
|
|
244
|
+
description: 'Invalid reserve factor parameter for the reserve',
|
|
245
|
+
},
|
|
246
|
+
'68': {
|
|
247
|
+
name: 'INVALID_BORROW_CAP',
|
|
248
|
+
description: 'Invalid borrow cap for the reserve',
|
|
249
|
+
},
|
|
250
|
+
'69': {
|
|
251
|
+
name: 'INVALID_SUPPLY_CAP',
|
|
252
|
+
description: 'Invalid supply cap for the reserve',
|
|
253
|
+
},
|
|
254
|
+
'70': {
|
|
255
|
+
name: 'INVALID_LIQUIDATION_PROTOCOL_FEE',
|
|
256
|
+
description: 'Invalid liquidation protocol fee for the reserve',
|
|
257
|
+
},
|
|
258
|
+
'71': {
|
|
259
|
+
name: 'INVALID_EMODE_CATEGORY',
|
|
260
|
+
description: 'Invalid eMode category for the reserve',
|
|
261
|
+
},
|
|
262
|
+
'72': {
|
|
263
|
+
name: 'INVALID_UNBACKED_MINT_CAP',
|
|
264
|
+
description: 'Invalid unbacked mint cap for the reserve',
|
|
265
|
+
},
|
|
266
|
+
'73': {
|
|
267
|
+
name: 'INVALID_DEBT_CEILING',
|
|
268
|
+
description: 'Invalid debt ceiling for the reserve',
|
|
269
|
+
},
|
|
270
|
+
'74': { name: 'INVALID_RESERVE_INDEX', description: 'Invalid reserve index' },
|
|
271
|
+
'75': {
|
|
272
|
+
name: 'ACL_ADMIN_CANNOT_BE_ZERO',
|
|
273
|
+
description: 'ACL admin cannot be set to the zero address',
|
|
274
|
+
},
|
|
275
|
+
'76': {
|
|
276
|
+
name: 'INCONSISTENT_PARAMS_LENGTH',
|
|
277
|
+
description: 'Array parameters that should be equal length are not',
|
|
278
|
+
},
|
|
279
|
+
'77': {
|
|
280
|
+
name: 'ZERO_ADDRESS_NOT_VALID',
|
|
281
|
+
description: 'Zero address not valid',
|
|
282
|
+
},
|
|
283
|
+
'78': { name: 'INVALID_EXPIRATION', description: 'Invalid expiration' },
|
|
284
|
+
'79': { name: 'INVALID_SIGNATURE', description: 'Invalid signature' },
|
|
285
|
+
'80': {
|
|
286
|
+
name: 'OPERATION_NOT_SUPPORTED',
|
|
287
|
+
description: 'Operation not supported',
|
|
288
|
+
},
|
|
289
|
+
'81': {
|
|
290
|
+
name: 'DEBT_CEILING_NOT_ZERO',
|
|
291
|
+
description: 'Debt ceiling is not zero',
|
|
292
|
+
},
|
|
293
|
+
'82': { name: 'ASSET_NOT_LISTED', description: 'Asset is not listed' },
|
|
294
|
+
'83': {
|
|
295
|
+
name: 'INVALID_OPTIMAL_USAGE_RATIO',
|
|
296
|
+
description: 'Invalid optimal usage ratio',
|
|
297
|
+
},
|
|
298
|
+
'85': {
|
|
299
|
+
name: 'UNDERLYING_CANNOT_BE_RESCUED',
|
|
300
|
+
description: 'The underlying asset cannot be rescued',
|
|
301
|
+
},
|
|
302
|
+
'86': {
|
|
303
|
+
name: 'ADDRESSES_PROVIDER_ALREADY_ADDED',
|
|
304
|
+
description: 'Reserve has already been added to reserve list',
|
|
305
|
+
},
|
|
306
|
+
'87': {
|
|
307
|
+
name: 'POOL_ADDRESSES_DO_NOT_MATCH',
|
|
308
|
+
description: 'The token implementation pool address and the pool address provided by the initializing pool do not match',
|
|
309
|
+
},
|
|
310
|
+
'89': {
|
|
311
|
+
name: 'SILOED_BORROWING_VIOLATION',
|
|
312
|
+
description: 'User is trying to borrow multiple assets including a siloed one',
|
|
313
|
+
},
|
|
314
|
+
'90': {
|
|
315
|
+
name: 'RESERVE_DEBT_NOT_ZERO',
|
|
316
|
+
description: 'The total debt of the reserve needs to be 0',
|
|
317
|
+
},
|
|
318
|
+
'91': {
|
|
319
|
+
name: 'FLASHLOAN_DISABLED',
|
|
320
|
+
description: 'FlashLoaning for this asset is disabled',
|
|
321
|
+
},
|
|
322
|
+
'92': {
|
|
323
|
+
name: 'INVALID_MAX_RATE',
|
|
324
|
+
description: 'The expect maximum borrow rate is invalid',
|
|
325
|
+
},
|
|
326
|
+
'93': {
|
|
327
|
+
name: 'WITHDRAW_TO_ATOKEN',
|
|
328
|
+
description: 'Withdrawing to the aToken is not allowed',
|
|
329
|
+
},
|
|
330
|
+
'94': {
|
|
331
|
+
name: 'SUPPLY_TO_ATOKEN',
|
|
332
|
+
description: 'Supplying to the aToken is not allowed',
|
|
333
|
+
},
|
|
334
|
+
'95': {
|
|
335
|
+
name: 'SLOPE_2_MUST_BE_GTE_SLOPE_1',
|
|
336
|
+
description: 'Variable interest rate slope 2 can not be lower than slope 1',
|
|
337
|
+
},
|
|
338
|
+
'96': {
|
|
339
|
+
name: 'CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN',
|
|
340
|
+
description: 'The caller of the function is not a risk, pool or emergency admin',
|
|
341
|
+
},
|
|
342
|
+
'97': {
|
|
343
|
+
name: 'LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED',
|
|
344
|
+
description: 'Liquidation grace sentinel validation failed',
|
|
345
|
+
},
|
|
346
|
+
'98': {
|
|
347
|
+
name: 'INVALID_GRACE_PERIOD',
|
|
348
|
+
description: 'Grace period above a valid range',
|
|
349
|
+
},
|
|
350
|
+
'99': {
|
|
351
|
+
name: 'INVALID_FREEZE_STATE',
|
|
352
|
+
description: 'Reserve is already in the passed freeze state',
|
|
353
|
+
},
|
|
354
|
+
'100': {
|
|
355
|
+
name: 'NOT_BORROWABLE_IN_EMODE',
|
|
356
|
+
description: 'Asset not borrowable in eMode',
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
export function getAaveError(code) {
|
|
360
|
+
const err = AAVE_ERROR_CODES[code];
|
|
361
|
+
if (err) {
|
|
362
|
+
return new AaveError(code, err.name, err.description);
|
|
363
|
+
}
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/aave-lending-pl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AAI,EAAE,yCAAyC;QAC/C,WAAW,EAAE,8CAA8C;KAC5D;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,kCAAkC;KAChD;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,+CAA+C;KAC7D;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,+BAA+B;KAC7C;CACF,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ActionDefinition, EmberPlugin, LendingActions } from '../core/index.js';
|
|
2
|
+
import { AAVEAdapter, type AAVEAdapterParams } from './adapter.js';
|
|
3
|
+
import type { ChainConfig } from '../chainConfig.js';
|
|
4
|
+
import type { PublicEmberPluginRegistry } from '../registry.js';
|
|
5
|
+
/**
|
|
6
|
+
* Get the AAVE Ember plugin.
|
|
7
|
+
* @param params - Configuration parameters for the AAVEAdapter, including chainId and rpcUrl.
|
|
8
|
+
* @returns The AAVE Ember plugin.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAaveEmberPlugin(params: AAVEAdapterParams): Promise<EmberPlugin<'lending'>>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the AAVE actions for the lending protocol.
|
|
13
|
+
* @param adapter - An instance of AAVEAdapter to interact with the AAVE protocol.
|
|
14
|
+
* @returns An array of action definitions for the AAVE lending protocol.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAaveActions(adapter: AAVEAdapter): Promise<ActionDefinition<LendingActions>[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Register the AAVE plugin for the specified chain configuration.
|
|
19
|
+
* @param chainConfig - The chain configuration to check for AAVE support.
|
|
20
|
+
* @param registry - The public Ember plugin registry to register the plugin with.
|
|
21
|
+
* @returns A promise that resolves when the plugin is registered.
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerAave(chainConfig: ChainConfig, registry: PublicEmberPluginRegistry): void;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/aave-lending-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAejC;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,CA2G7C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,yBAAyB,QAazF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { AAVEAdapter } from './adapter.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the AAVE Ember plugin.
|
|
4
|
+
* @param params - Configuration parameters for the AAVEAdapter, including chainId and rpcUrl.
|
|
5
|
+
* @returns The AAVE Ember plugin.
|
|
6
|
+
*/
|
|
7
|
+
export async function getAaveEmberPlugin(params) {
|
|
8
|
+
const adapter = new AAVEAdapter(params);
|
|
9
|
+
return {
|
|
10
|
+
id: `AAVE_CHAIN_${params.chainId}`,
|
|
11
|
+
type: 'lending',
|
|
12
|
+
name: `AAVE lending for ${params.chainId}`,
|
|
13
|
+
description: 'Aave V3 lending protocol',
|
|
14
|
+
website: 'https://aave.com',
|
|
15
|
+
x: 'https://x.com/aave',
|
|
16
|
+
actions: await getAaveActions(adapter),
|
|
17
|
+
queries: {
|
|
18
|
+
getPositions: adapter.getUserSummary.bind(adapter),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the AAVE actions for the lending protocol.
|
|
24
|
+
* @param adapter - An instance of AAVEAdapter to interact with the AAVE protocol.
|
|
25
|
+
* @returns An array of action definitions for the AAVE lending protocol.
|
|
26
|
+
*/
|
|
27
|
+
export async function getAaveActions(adapter) {
|
|
28
|
+
const reservesResponse = await adapter.getReserves();
|
|
29
|
+
const underlyingAssets = reservesResponse.reservesData.map(reserve => reserve.underlyingAsset);
|
|
30
|
+
const aTokens = reservesResponse.reservesData.map(reserve => reserve.aTokenAddress);
|
|
31
|
+
const borrowableAssets = reservesResponse.reservesData
|
|
32
|
+
.filter(reserve => reserve.borrowingEnabled)
|
|
33
|
+
.map(reserve => reserve.underlyingAsset);
|
|
34
|
+
return [
|
|
35
|
+
// Supply any of the underlying assets to get aTokens
|
|
36
|
+
{
|
|
37
|
+
type: 'lending-supply',
|
|
38
|
+
name: `AAVE lending pools in chain ${adapter.chain.id}`,
|
|
39
|
+
inputTokens: async () => Promise.resolve([
|
|
40
|
+
{
|
|
41
|
+
chainId: adapter.chain.id.toString(),
|
|
42
|
+
tokens: underlyingAssets,
|
|
43
|
+
},
|
|
44
|
+
]),
|
|
45
|
+
outputTokens: async () => Promise.resolve([
|
|
46
|
+
{
|
|
47
|
+
chainId: adapter.chain.id.toString(),
|
|
48
|
+
tokens: aTokens,
|
|
49
|
+
},
|
|
50
|
+
]),
|
|
51
|
+
callback: adapter.createSupplyTransaction.bind(adapter),
|
|
52
|
+
},
|
|
53
|
+
// Borrow any of the borrowable assets if you have some alpha tokens as collateral
|
|
54
|
+
{
|
|
55
|
+
type: 'lending-borrow',
|
|
56
|
+
name: `AAVE borrow in chain ${adapter.chain.id}`,
|
|
57
|
+
inputTokens: async () => Promise.resolve([
|
|
58
|
+
{
|
|
59
|
+
chainId: adapter.chain.id.toString(),
|
|
60
|
+
tokens: aTokens,
|
|
61
|
+
},
|
|
62
|
+
]),
|
|
63
|
+
outputTokens: async () => Promise.resolve([
|
|
64
|
+
{
|
|
65
|
+
chainId: adapter.chain.id.toString(),
|
|
66
|
+
tokens: borrowableAssets,
|
|
67
|
+
},
|
|
68
|
+
]),
|
|
69
|
+
callback: adapter.createBorrowTransaction.bind(adapter),
|
|
70
|
+
},
|
|
71
|
+
// Repay your borrow with the underlying asset
|
|
72
|
+
{
|
|
73
|
+
type: 'lending-repay',
|
|
74
|
+
name: `AAVE repay in chain ${adapter.chain.id}`,
|
|
75
|
+
inputTokens: async () => Promise.resolve([
|
|
76
|
+
{
|
|
77
|
+
chainId: adapter.chain.id.toString(),
|
|
78
|
+
tokens: borrowableAssets,
|
|
79
|
+
},
|
|
80
|
+
]),
|
|
81
|
+
// Empty output tokens as this doesn't generate any token
|
|
82
|
+
outputTokens: async () => Promise.resolve([]),
|
|
83
|
+
callback: adapter.createRepayTransaction.bind(adapter),
|
|
84
|
+
},
|
|
85
|
+
// Repay your borrow with aTokens
|
|
86
|
+
{
|
|
87
|
+
type: 'lending-repay',
|
|
88
|
+
name: `AAVE repay with aTokens in chain ${adapter.chain.id}`,
|
|
89
|
+
inputTokens: async () => Promise.resolve([
|
|
90
|
+
{
|
|
91
|
+
chainId: adapter.chain.id.toString(),
|
|
92
|
+
tokens: aTokens,
|
|
93
|
+
},
|
|
94
|
+
]),
|
|
95
|
+
// Empty output tokens as this doesn't generate any token
|
|
96
|
+
outputTokens: async () => Promise.resolve([]),
|
|
97
|
+
callback: adapter.createRepayTransactionWithATokens.bind(adapter),
|
|
98
|
+
},
|
|
99
|
+
// Withdraw from your aTokens to get the underlying asset back
|
|
100
|
+
{
|
|
101
|
+
type: 'lending-withdraw',
|
|
102
|
+
name: `AAVE withdraw in chain ${adapter.chain.id}`,
|
|
103
|
+
inputTokens: async () => Promise.resolve([
|
|
104
|
+
{
|
|
105
|
+
chainId: adapter.chain.id.toString(),
|
|
106
|
+
tokens: aTokens,
|
|
107
|
+
},
|
|
108
|
+
]),
|
|
109
|
+
outputTokens: async () => Promise.resolve([
|
|
110
|
+
{
|
|
111
|
+
chainId: adapter.chain.id.toString(),
|
|
112
|
+
tokens: underlyingAssets,
|
|
113
|
+
},
|
|
114
|
+
]),
|
|
115
|
+
callback: adapter.createWithdrawTransaction.bind(adapter),
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Register the AAVE plugin for the specified chain configuration.
|
|
121
|
+
* @param chainConfig - The chain configuration to check for AAVE support.
|
|
122
|
+
* @param registry - The public Ember plugin registry to register the plugin with.
|
|
123
|
+
* @returns A promise that resolves when the plugin is registered.
|
|
124
|
+
*/
|
|
125
|
+
export function registerAave(chainConfig, registry) {
|
|
126
|
+
const supportedChains = [1, 10, 42161, 137, 1101, 43114, 8453];
|
|
127
|
+
if (!supportedChains.includes(chainConfig.chainId)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
registry.registerDeferredPlugin(getAaveEmberPlugin({
|
|
131
|
+
chainId: chainConfig.chainId,
|
|
132
|
+
rpcUrl: chainConfig.rpcUrl,
|
|
133
|
+
wrappedNativeToken: chainConfig.wrappedNativeToken,
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/aave-lending-plugin/index.ts"],"names":[],"mappings":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CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,WAAwB,EAAE,QAAmC;IACxF,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/D,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,sBAAsB,CAC7B,kBAAkB,CAAC;QACjB,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;KACnD,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type AAVEMarket = {
|
|
2
|
+
AAVE_PROTOCOL_DATA_PROVIDER: string;
|
|
3
|
+
POOL: string;
|
|
4
|
+
POOL_ADDRESSES_PROVIDER: string;
|
|
5
|
+
UI_INCENTIVE_DATA_PROVIDER: string;
|
|
6
|
+
UI_POOL_DATA_PROVIDER: string;
|
|
7
|
+
WALLET_BALANCE_PROVIDER: string;
|
|
8
|
+
WETH_GATEWAY: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const getMarket: (chainId: number) => AAVEMarket;
|
|
11
|
+
//# sourceMappingURL=market.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market.d.ts","sourceRoot":"","sources":["../../src/aave-lending-plugin/market.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG;IACvB,2BAA2B,EAAE,MAAM,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB,EAAE,MAAM,CAAC;IAChC,0BAA0B,EAAE,MAAM,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAYF,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,KAAG,UAc3C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as markets from '@bgd-labs/aave-address-book';
|
|
2
|
+
const marketMap = {
|
|
3
|
+
1: 'AaveV3Ethereum',
|
|
4
|
+
11155111: 'AaveV3Sepolia',
|
|
5
|
+
42161: 'AaveV3Arbitrum',
|
|
6
|
+
421614: 'AaveV3ArbitrumSepolia',
|
|
7
|
+
8453: 'AaveV3Base',
|
|
8
|
+
137: 'AaveV3Polygon',
|
|
9
|
+
10: 'AaveV3Optimism',
|
|
10
|
+
};
|
|
11
|
+
export const getMarket = (chainId) => {
|
|
12
|
+
const marketKey = marketMap[chainId];
|
|
13
|
+
if (!marketKey) {
|
|
14
|
+
throw new Error(`AAVE: no market found for chain ID ${chainId}: modify providers/aave/market.ts`);
|
|
15
|
+
}
|
|
16
|
+
const market = markets[marketKey];
|
|
17
|
+
if (!market) {
|
|
18
|
+
throw new Error(`No such market: ${marketKey}`);
|
|
19
|
+
}
|
|
20
|
+
return market;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=market.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market.js","sourceRoot":"","sources":["../../src/aave-lending-plugin/market.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AAiBvD,MAAM,SAAS,GAAyC;IACtD,CAAC,EAAE,gBAAgB;IACnB,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,uBAAuB;IAC/B,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,eAAe;IACpB,EAAE,EAAE,gBAAgB;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAc,EAAE;IACvD,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,sCAAsC,OAAO,mCAAmC,CACjF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAA0B,CAAC;IAC3D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EthereumTransactionTypeExtended } from '@aave/contract-helpers';
|
|
2
|
+
import { type PopulatedTransaction } from 'ethers';
|
|
3
|
+
export declare function populateTransaction(tx: EthereumTransactionTypeExtended): Promise<PopulatedTransaction>;
|
|
4
|
+
//# sourceMappingURL=populateTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populateTransaction.d.ts","sourceRoot":"","sources":["../../src/aave-lending-plugin/populateTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,KAAK,oBAAoB,EAAU,MAAM,QAAQ,CAAC;AAG3D,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,+BAA+B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CA0B/B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { getAaveError } from './errors.js';
|
|
3
|
+
export async function populateTransaction(tx) {
|
|
4
|
+
let txData = null;
|
|
5
|
+
try {
|
|
6
|
+
txData = await tx.tx();
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
11
|
+
// error reason looks like 'execution reverted: revert: 32', with the aave
|
|
12
|
+
// domain error code at the very end
|
|
13
|
+
const errorCode = (e.reason || '').split(' ').pop();
|
|
14
|
+
// If we end up passing garbage to getAaveError, it does not matter - it will return null
|
|
15
|
+
const aaveError = getAaveError(errorCode);
|
|
16
|
+
if (aaveError !== null) {
|
|
17
|
+
throw aaveError;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// we can hope that the LLM will provide an analysis of the error on the fly
|
|
21
|
+
throw e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
value: ethers.BigNumber.from(txData.value || 0),
|
|
26
|
+
from: txData.from,
|
|
27
|
+
to: txData.to,
|
|
28
|
+
data: txData.data,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=populateTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populateTransaction.js","sourceRoot":"","sources":["../../src/aave-lending-plugin/populateTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAAmC;IAEnC,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvB,uDAAuD;IACzD,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,sDAAsD;QAEtD,0EAA0E;QAC1E,oCAAoC;QACpC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACpD,yFAAyF;QACzF,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,MAAM,SAAS,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,4EAA4E;YAC5E,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;QAC/C,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReservesDataHumanized, UserReserveDataHumanized } from '@aave/contract-helpers';
|
|
2
|
+
import { type FormatUserSummaryResponse, type FormatReserveUSDResponse } from '@aave/math-utils';
|
|
3
|
+
export declare class UserSummary {
|
|
4
|
+
reserves: FormatUserSummaryResponse<FormatReserveUSDResponse>;
|
|
5
|
+
/**
|
|
6
|
+
* @param userReservesResponse - The response from getUserReservesHumanized.
|
|
7
|
+
* @param reservesResponse - The response from getReservesHumanized.
|
|
8
|
+
*/
|
|
9
|
+
constructor(userReservesResponse: {
|
|
10
|
+
userReserves: UserReserveDataHumanized[];
|
|
11
|
+
userEmodeCategoryId: number;
|
|
12
|
+
}, reservesResponse: ReservesDataHumanized);
|
|
13
|
+
toHumanReadable(): string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=userSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userSummary.d.ts","sourceRoot":"","sources":["../../src/aave-lending-plugin/userSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,kBAAkB,CAAC;AAQ1B,qBAAa,WAAW;IACf,QAAQ,EAAE,yBAAyB,CAAC,wBAAwB,CAAC,CAAC;IAErE;;;OAGG;gBAED,oBAAoB,EAAE;QACpB,YAAY,EAAE,wBAAwB,EAAE,CAAC;QACzC,mBAAmB,EAAE,MAAM,CAAC;KAC7B,EACD,gBAAgB,EAAE,qBAAqB;IAyBlC,eAAe,IAAI,MAAM;CA8BjC"}
|