@1delta/lender-registry 0.0.19 → 0.0.20

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/getters.d.ts CHANGED
@@ -14,6 +14,7 @@ export declare function isCompoundV2Type(lender: string): boolean;
14
14
  export declare function isCompoundV3Type(lender: string): boolean;
15
15
  export declare function isInit(lender: string): lender is Lender.INIT;
16
16
  export declare function isEulerType(lender: string): lender is Lender.EULER_V2;
17
+ export declare function isAaveV4Type(lender: string): boolean;
17
18
  export declare function lenderHasSubAccounts(lender: string): lender is Lender.INIT;
18
19
  export declare function aaveForkCannotPermit(lender: string): boolean;
19
20
  export declare function supportsSameAsset(lender: string): boolean;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './lenders.js';
2
- export { isAaveV2Type, isAaveV3Type, isAaveV32Type, isAaveType, isCompoundV3, extractLenderBeforeLastUnderscore, isMorphoBlue, isListaDao, isMorphoType, isVenusType, isCompoundV2Type, isCompoundV3Type, isInit, isEulerType, lenderHasSubAccounts, aaveForkCannotPermit, supportsSameAsset, isLista, isYLDR, isSumerType, isCompoundV2PerSecond, isTectonicType, isBenqiType, isMoonwellType, isCompoundV2PerTimestamp, isMultiMarket, isAave, isCompoundV2, } from './getters.js';
2
+ export { isAaveV2Type, isAaveV3Type, isAaveV32Type, isAaveType, isCompoundV3, extractLenderBeforeLastUnderscore, isMorphoBlue, isListaDao, isMorphoType, isVenusType, isCompoundV2Type, isCompoundV3Type, isInit, isEulerType, lenderHasSubAccounts, aaveForkCannotPermit, supportsSameAsset, isLista, isYLDR, isSumerType, isCompoundV2PerSecond, isTectonicType, isBenqiType, isMoonwellType, isCompoundV2PerTimestamp, isMultiMarket, isAave, isCompoundV2, isAaveV4Type, } from './getters.js';
package/dist/index.js CHANGED
@@ -150,6 +150,9 @@ var Lender = /* @__PURE__ */ ((Lender2) => {
150
150
  Lender2["LISTA_DAO"] = "LISTA_DAO";
151
151
  Lender2["SILO_V2"] = "SILO_V2";
152
152
  Lender2["EULER_V2"] = "EULER_V2";
153
+ Lender2["AAVE_V4_CORE"] = "AAVE_V4_CORE";
154
+ Lender2["AAVE_V4_PLUS"] = "AAVE_V4_PLUS";
155
+ Lender2["AAVE_V4_PRIME"] = "AAVE_V4_PRIME";
153
156
  Lender2["SWAYLEND_USDC"] = "SWAYLEND_USDC";
154
157
  return Lender2;
155
158
  })(Lender || {});
@@ -313,13 +316,19 @@ var MORPHO_BLUE_LENDERS = ["MORPHO_BLUE" /* MORPHO_BLUE */, "LISTA_DAO" /* LISTA
313
316
  var TECTONIC_LENDERS = ["TECTONIC" /* TECTONIC */, "TECTONIC_VENO" /* TECTONIC_VENO */, "TECTONIC_DEFI" /* TECTONIC_DEFI */];
314
317
  var BENQI_LENDERS = ["BENQI" /* BENQI */, "BENQI_AVALANCHE_ECOSYSTEM" /* BENQI_AVALANCHE_ECOSYSTEM */];
315
318
  var SILO_V2_LENDERS = ["SILO_V2" /* SILO_V2 */];
319
+ var AAVE_V4_LENDERS = [
320
+ "AAVE_V4_CORE" /* AAVE_V4_CORE */,
321
+ "AAVE_V4_PLUS" /* AAVE_V4_PLUS */,
322
+ "AAVE_V4_PRIME" /* AAVE_V4_PRIME */
323
+ ];
316
324
  var LenderGroups = /* @__PURE__ */ ((LenderGroups2) => {
317
325
  LenderGroups2[LenderGroups2["AaveV2"] = 0] = "AaveV2";
318
326
  LenderGroups2[LenderGroups2["AaveV3"] = 1] = "AaveV3";
319
- LenderGroups2[LenderGroups2["CompoundV2"] = 2] = "CompoundV2";
320
- LenderGroups2[LenderGroups2["CompoundV3"] = 3] = "CompoundV3";
321
- LenderGroups2[LenderGroups2["MorphoBlue"] = 4] = "MorphoBlue";
322
- LenderGroups2[LenderGroups2["SiloV2"] = 5] = "SiloV2";
327
+ LenderGroups2[LenderGroups2["AaveV4"] = 2] = "AaveV4";
328
+ LenderGroups2[LenderGroups2["CompoundV2"] = 3] = "CompoundV2";
329
+ LenderGroups2[LenderGroups2["CompoundV3"] = 4] = "CompoundV3";
330
+ LenderGroups2[LenderGroups2["MorphoBlue"] = 5] = "MorphoBlue";
331
+ LenderGroups2[LenderGroups2["SiloV2"] = 6] = "SiloV2";
323
332
  return LenderGroups2;
324
333
  })(LenderGroups || {});
325
334
  var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
@@ -329,6 +338,7 @@ var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
329
338
  LenderIds2[LenderIds2["UP_TO_COMPOUND_V2"] = 4e3] = "UP_TO_COMPOUND_V2";
330
339
  LenderIds2[LenderIds2["UP_TO_MORPHO"] = 5e3] = "UP_TO_MORPHO";
331
340
  LenderIds2[LenderIds2["UP_TO_SILO_V2"] = 6e3] = "UP_TO_SILO_V2";
341
+ LenderIds2[LenderIds2["UP_TO_AAVE_V4"] = 7e3] = "UP_TO_AAVE_V4";
332
342
  return LenderIds2;
333
343
  })(LenderIds || {});
334
344
  function getLenderId(lender) {
@@ -337,13 +347,15 @@ function getLenderId(lender) {
337
347
  return 2e3 /* UP_TO_AAVE_V2 */ - 1;
338
348
  case 1 /* AaveV3 */:
339
349
  return 1e3 /* UP_TO_AAVE_V3 */ - 1;
340
- case 2 /* CompoundV2 */:
350
+ case 2 /* AaveV4 */:
351
+ return 7e3 /* UP_TO_AAVE_V4 */ - 1;
352
+ case 3 /* CompoundV2 */:
341
353
  return 4e3 /* UP_TO_COMPOUND_V2 */ - 1;
342
- case 3 /* CompoundV3 */:
354
+ case 4 /* CompoundV3 */:
343
355
  return 3e3 /* UP_TO_COMPOUND_V3 */ - 1;
344
- case 4 /* MorphoBlue */:
356
+ case 5 /* MorphoBlue */:
345
357
  return 5e3 /* UP_TO_MORPHO */ - 1;
346
- case 5 /* SiloV2 */:
358
+ case 6 /* SiloV2 */:
347
359
  return 6e3 /* UP_TO_SILO_V2 */ - 1;
348
360
  default:
349
361
  throw new Error(`getLenderId: Unsupported lender ${lender}`);
@@ -354,16 +366,19 @@ function getLenderGroup(lender) {
354
366
  return AAVE_V2_LENDERS.includes(lender) ? 0 /* AaveV2 */ : 1 /* AaveV3 */;
355
367
  }
356
368
  if (COMPOUND_V2_LENDERS.includes(lender)) {
357
- return 2 /* CompoundV2 */;
369
+ return 3 /* CompoundV2 */;
358
370
  }
359
371
  if (COMPOUND_V3_LENDERS.includes(lender)) {
360
- return 3 /* CompoundV3 */;
372
+ return 4 /* CompoundV3 */;
361
373
  }
362
374
  if (MORPHO_BLUE_LENDERS.includes(lender)) {
363
- return 4 /* MorphoBlue */;
375
+ return 5 /* MorphoBlue */;
364
376
  }
365
377
  if (SILO_V2_LENDERS.includes(lender)) {
366
- return 5 /* SiloV2 */;
378
+ return 6 /* SiloV2 */;
379
+ }
380
+ if (AAVE_V4_LENDERS.includes(lender)) {
381
+ return 2 /* AaveV4 */;
367
382
  }
368
383
  throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
369
384
  }
@@ -414,6 +429,9 @@ function isInit(lender) {
414
429
  function isEulerType(lender) {
415
430
  return lender === "EULER_V2" /* EULER_V2 */;
416
431
  }
432
+ function isAaveV4Type(lender) {
433
+ return lender?.startsWith("AAVE_V4");
434
+ }
417
435
  function lenderHasSubAccounts(lender) {
418
436
  return isInit(lender);
419
437
  }
@@ -462,6 +480,7 @@ exports.AAVE_LENDERS = AAVE_LENDERS;
462
480
  exports.AAVE_V2_LENDERS = AAVE_V2_LENDERS;
463
481
  exports.AAVE_V32_LENDERS = AAVE_V32_LENDERS;
464
482
  exports.AAVE_V3_LENDERS = AAVE_V3_LENDERS;
483
+ exports.AAVE_V4_LENDERS = AAVE_V4_LENDERS;
465
484
  exports.BENQI_LENDERS = BENQI_LENDERS;
466
485
  exports.COMPOUND_V2_LENDERS = COMPOUND_V2_LENDERS;
467
486
  exports.COMPOUND_V3_LENDERS = COMPOUND_V3_LENDERS;
@@ -481,6 +500,7 @@ exports.isAaveType = isAaveType;
481
500
  exports.isAaveV2Type = isAaveV2Type;
482
501
  exports.isAaveV32Type = isAaveV32Type;
483
502
  exports.isAaveV3Type = isAaveV3Type;
503
+ exports.isAaveV4Type = isAaveV4Type;
484
504
  exports.isBenqiType = isBenqiType;
485
505
  exports.isCompoundV2 = isCompoundV2;
486
506
  exports.isCompoundV2PerSecond = isCompoundV2PerSecond;
package/dist/index.mjs CHANGED
@@ -148,6 +148,9 @@ var Lender = /* @__PURE__ */ ((Lender2) => {
148
148
  Lender2["LISTA_DAO"] = "LISTA_DAO";
149
149
  Lender2["SILO_V2"] = "SILO_V2";
150
150
  Lender2["EULER_V2"] = "EULER_V2";
151
+ Lender2["AAVE_V4_CORE"] = "AAVE_V4_CORE";
152
+ Lender2["AAVE_V4_PLUS"] = "AAVE_V4_PLUS";
153
+ Lender2["AAVE_V4_PRIME"] = "AAVE_V4_PRIME";
151
154
  Lender2["SWAYLEND_USDC"] = "SWAYLEND_USDC";
152
155
  return Lender2;
153
156
  })(Lender || {});
@@ -311,13 +314,19 @@ var MORPHO_BLUE_LENDERS = ["MORPHO_BLUE" /* MORPHO_BLUE */, "LISTA_DAO" /* LISTA
311
314
  var TECTONIC_LENDERS = ["TECTONIC" /* TECTONIC */, "TECTONIC_VENO" /* TECTONIC_VENO */, "TECTONIC_DEFI" /* TECTONIC_DEFI */];
312
315
  var BENQI_LENDERS = ["BENQI" /* BENQI */, "BENQI_AVALANCHE_ECOSYSTEM" /* BENQI_AVALANCHE_ECOSYSTEM */];
313
316
  var SILO_V2_LENDERS = ["SILO_V2" /* SILO_V2 */];
317
+ var AAVE_V4_LENDERS = [
318
+ "AAVE_V4_CORE" /* AAVE_V4_CORE */,
319
+ "AAVE_V4_PLUS" /* AAVE_V4_PLUS */,
320
+ "AAVE_V4_PRIME" /* AAVE_V4_PRIME */
321
+ ];
314
322
  var LenderGroups = /* @__PURE__ */ ((LenderGroups2) => {
315
323
  LenderGroups2[LenderGroups2["AaveV2"] = 0] = "AaveV2";
316
324
  LenderGroups2[LenderGroups2["AaveV3"] = 1] = "AaveV3";
317
- LenderGroups2[LenderGroups2["CompoundV2"] = 2] = "CompoundV2";
318
- LenderGroups2[LenderGroups2["CompoundV3"] = 3] = "CompoundV3";
319
- LenderGroups2[LenderGroups2["MorphoBlue"] = 4] = "MorphoBlue";
320
- LenderGroups2[LenderGroups2["SiloV2"] = 5] = "SiloV2";
325
+ LenderGroups2[LenderGroups2["AaveV4"] = 2] = "AaveV4";
326
+ LenderGroups2[LenderGroups2["CompoundV2"] = 3] = "CompoundV2";
327
+ LenderGroups2[LenderGroups2["CompoundV3"] = 4] = "CompoundV3";
328
+ LenderGroups2[LenderGroups2["MorphoBlue"] = 5] = "MorphoBlue";
329
+ LenderGroups2[LenderGroups2["SiloV2"] = 6] = "SiloV2";
321
330
  return LenderGroups2;
322
331
  })(LenderGroups || {});
323
332
  var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
@@ -327,6 +336,7 @@ var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
327
336
  LenderIds2[LenderIds2["UP_TO_COMPOUND_V2"] = 4e3] = "UP_TO_COMPOUND_V2";
328
337
  LenderIds2[LenderIds2["UP_TO_MORPHO"] = 5e3] = "UP_TO_MORPHO";
329
338
  LenderIds2[LenderIds2["UP_TO_SILO_V2"] = 6e3] = "UP_TO_SILO_V2";
339
+ LenderIds2[LenderIds2["UP_TO_AAVE_V4"] = 7e3] = "UP_TO_AAVE_V4";
330
340
  return LenderIds2;
331
341
  })(LenderIds || {});
332
342
  function getLenderId(lender) {
@@ -335,13 +345,15 @@ function getLenderId(lender) {
335
345
  return 2e3 /* UP_TO_AAVE_V2 */ - 1;
336
346
  case 1 /* AaveV3 */:
337
347
  return 1e3 /* UP_TO_AAVE_V3 */ - 1;
338
- case 2 /* CompoundV2 */:
348
+ case 2 /* AaveV4 */:
349
+ return 7e3 /* UP_TO_AAVE_V4 */ - 1;
350
+ case 3 /* CompoundV2 */:
339
351
  return 4e3 /* UP_TO_COMPOUND_V2 */ - 1;
340
- case 3 /* CompoundV3 */:
352
+ case 4 /* CompoundV3 */:
341
353
  return 3e3 /* UP_TO_COMPOUND_V3 */ - 1;
342
- case 4 /* MorphoBlue */:
354
+ case 5 /* MorphoBlue */:
343
355
  return 5e3 /* UP_TO_MORPHO */ - 1;
344
- case 5 /* SiloV2 */:
356
+ case 6 /* SiloV2 */:
345
357
  return 6e3 /* UP_TO_SILO_V2 */ - 1;
346
358
  default:
347
359
  throw new Error(`getLenderId: Unsupported lender ${lender}`);
@@ -352,16 +364,19 @@ function getLenderGroup(lender) {
352
364
  return AAVE_V2_LENDERS.includes(lender) ? 0 /* AaveV2 */ : 1 /* AaveV3 */;
353
365
  }
354
366
  if (COMPOUND_V2_LENDERS.includes(lender)) {
355
- return 2 /* CompoundV2 */;
367
+ return 3 /* CompoundV2 */;
356
368
  }
357
369
  if (COMPOUND_V3_LENDERS.includes(lender)) {
358
- return 3 /* CompoundV3 */;
370
+ return 4 /* CompoundV3 */;
359
371
  }
360
372
  if (MORPHO_BLUE_LENDERS.includes(lender)) {
361
- return 4 /* MorphoBlue */;
373
+ return 5 /* MorphoBlue */;
362
374
  }
363
375
  if (SILO_V2_LENDERS.includes(lender)) {
364
- return 5 /* SiloV2 */;
376
+ return 6 /* SiloV2 */;
377
+ }
378
+ if (AAVE_V4_LENDERS.includes(lender)) {
379
+ return 2 /* AaveV4 */;
365
380
  }
366
381
  throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
367
382
  }
@@ -412,6 +427,9 @@ function isInit(lender) {
412
427
  function isEulerType(lender) {
413
428
  return lender === "EULER_V2" /* EULER_V2 */;
414
429
  }
430
+ function isAaveV4Type(lender) {
431
+ return lender?.startsWith("AAVE_V4");
432
+ }
415
433
  function lenderHasSubAccounts(lender) {
416
434
  return isInit(lender);
417
435
  }
@@ -456,4 +474,4 @@ function isCompoundV2(lender) {
456
474
  return isCompoundV2Type(lender);
457
475
  }
458
476
 
459
- export { AAVE_LENDERS, AAVE_V2_LENDERS, AAVE_V32_LENDERS, AAVE_V3_LENDERS, BENQI_LENDERS, COMPOUND_V2_LENDERS, COMPOUND_V3_LENDERS, Lender, LenderGroups, LenderIds, MORPHO_BLUE_LENDERS, SILO_V2_LENDERS, TECTONIC_LENDERS, VENUS_LENDERS, aaveForkCannotPermit, extractLenderBeforeLastUnderscore, getLenderGroup, getLenderId, isAave, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isBenqiType, isCompoundV2, isCompoundV2PerSecond, isCompoundV2PerTimestamp, isCompoundV2Type, isCompoundV3, isCompoundV3Type, isEulerType, isInit, isLista, isListaDao, isMoonwellType, isMorphoBlue, isMorphoType, isMultiMarket, isSumerType, isTectonicType, isVenusType, isYLDR, lenderHasSubAccounts, supportsSameAsset };
477
+ export { AAVE_LENDERS, AAVE_V2_LENDERS, AAVE_V32_LENDERS, AAVE_V3_LENDERS, AAVE_V4_LENDERS, BENQI_LENDERS, COMPOUND_V2_LENDERS, COMPOUND_V3_LENDERS, Lender, LenderGroups, LenderIds, MORPHO_BLUE_LENDERS, SILO_V2_LENDERS, TECTONIC_LENDERS, VENUS_LENDERS, aaveForkCannotPermit, extractLenderBeforeLastUnderscore, getLenderGroup, getLenderId, isAave, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isAaveV4Type, isBenqiType, isCompoundV2, isCompoundV2PerSecond, isCompoundV2PerTimestamp, isCompoundV2Type, isCompoundV3, isCompoundV3Type, isEulerType, isInit, isLista, isListaDao, isMoonwellType, isMorphoBlue, isMorphoType, isMultiMarket, isSumerType, isTectonicType, isVenusType, isYLDR, lenderHasSubAccounts, supportsSameAsset };
package/dist/lenders.d.ts CHANGED
@@ -150,6 +150,9 @@ export declare enum Lender {
150
150
  LISTA_DAO = "LISTA_DAO",
151
151
  SILO_V2 = "SILO_V2",
152
152
  EULER_V2 = "EULER_V2",
153
+ AAVE_V4_CORE = "AAVE_V4_CORE",
154
+ AAVE_V4_PLUS = "AAVE_V4_PLUS",
155
+ AAVE_V4_PRIME = "AAVE_V4_PRIME",
153
156
  SWAYLEND_USDC = "SWAYLEND_USDC"
154
157
  }
155
158
  export declare const AAVE_V32_LENDERS: Lender[];
@@ -173,13 +176,16 @@ export declare const TECTONIC_LENDERS: Lender[];
173
176
  export declare const BENQI_LENDERS: Lender[];
174
177
  /** Silo lenders */
175
178
  export declare const SILO_V2_LENDERS: Lender[];
179
+ /** Aave V4 lenders */
180
+ export declare const AAVE_V4_LENDERS: Lender[];
176
181
  export declare enum LenderGroups {
177
182
  AaveV2 = 0,
178
183
  AaveV3 = 1,
179
- CompoundV2 = 2,
180
- CompoundV3 = 3,
181
- MorphoBlue = 4,
182
- SiloV2 = 5
184
+ AaveV4 = 2,
185
+ CompoundV2 = 3,
186
+ CompoundV3 = 4,
187
+ MorphoBlue = 5,
188
+ SiloV2 = 6
183
189
  }
184
190
  export declare enum LenderIds {
185
191
  UP_TO_AAVE_V3 = 1000,
@@ -187,7 +193,8 @@ export declare enum LenderIds {
187
193
  UP_TO_COMPOUND_V3 = 3000,
188
194
  UP_TO_COMPOUND_V2 = 4000,
189
195
  UP_TO_MORPHO = 5000,
190
- UP_TO_SILO_V2 = 6000
196
+ UP_TO_SILO_V2 = 6000,
197
+ UP_TO_AAVE_V4 = 7000
191
198
  }
192
199
  /** Get lenderId for lender enum */
193
200
  export declare function getLenderId(lender: LenderGroups): number;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.19",
7
+ "version": "0.0.20",
8
8
  "description": "Lenders as Enums for convenience",
9
9
  "files": [
10
10
  "dist"