@1delta/lender-registry 0.0.19 → 0.0.21

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
@@ -316,10 +316,11 @@ var SILO_V2_LENDERS = ["SILO_V2" /* SILO_V2 */];
316
316
  var LenderGroups = /* @__PURE__ */ ((LenderGroups2) => {
317
317
  LenderGroups2[LenderGroups2["AaveV2"] = 0] = "AaveV2";
318
318
  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";
319
+ LenderGroups2[LenderGroups2["AaveV4"] = 2] = "AaveV4";
320
+ LenderGroups2[LenderGroups2["CompoundV2"] = 3] = "CompoundV2";
321
+ LenderGroups2[LenderGroups2["CompoundV3"] = 4] = "CompoundV3";
322
+ LenderGroups2[LenderGroups2["MorphoBlue"] = 5] = "MorphoBlue";
323
+ LenderGroups2[LenderGroups2["SiloV2"] = 6] = "SiloV2";
323
324
  return LenderGroups2;
324
325
  })(LenderGroups || {});
325
326
  var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
@@ -329,6 +330,7 @@ var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
329
330
  LenderIds2[LenderIds2["UP_TO_COMPOUND_V2"] = 4e3] = "UP_TO_COMPOUND_V2";
330
331
  LenderIds2[LenderIds2["UP_TO_MORPHO"] = 5e3] = "UP_TO_MORPHO";
331
332
  LenderIds2[LenderIds2["UP_TO_SILO_V2"] = 6e3] = "UP_TO_SILO_V2";
333
+ LenderIds2[LenderIds2["UP_TO_AAVE_V4"] = 7e3] = "UP_TO_AAVE_V4";
332
334
  return LenderIds2;
333
335
  })(LenderIds || {});
334
336
  function getLenderId(lender) {
@@ -337,13 +339,15 @@ function getLenderId(lender) {
337
339
  return 2e3 /* UP_TO_AAVE_V2 */ - 1;
338
340
  case 1 /* AaveV3 */:
339
341
  return 1e3 /* UP_TO_AAVE_V3 */ - 1;
340
- case 2 /* CompoundV2 */:
342
+ case 2 /* AaveV4 */:
343
+ return 7e3 /* UP_TO_AAVE_V4 */ - 1;
344
+ case 3 /* CompoundV2 */:
341
345
  return 4e3 /* UP_TO_COMPOUND_V2 */ - 1;
342
- case 3 /* CompoundV3 */:
346
+ case 4 /* CompoundV3 */:
343
347
  return 3e3 /* UP_TO_COMPOUND_V3 */ - 1;
344
- case 4 /* MorphoBlue */:
348
+ case 5 /* MorphoBlue */:
345
349
  return 5e3 /* UP_TO_MORPHO */ - 1;
346
- case 5 /* SiloV2 */:
350
+ case 6 /* SiloV2 */:
347
351
  return 6e3 /* UP_TO_SILO_V2 */ - 1;
348
352
  default:
349
353
  throw new Error(`getLenderId: Unsupported lender ${lender}`);
@@ -354,16 +358,19 @@ function getLenderGroup(lender) {
354
358
  return AAVE_V2_LENDERS.includes(lender) ? 0 /* AaveV2 */ : 1 /* AaveV3 */;
355
359
  }
356
360
  if (COMPOUND_V2_LENDERS.includes(lender)) {
357
- return 2 /* CompoundV2 */;
361
+ return 3 /* CompoundV2 */;
358
362
  }
359
363
  if (COMPOUND_V3_LENDERS.includes(lender)) {
360
- return 3 /* CompoundV3 */;
364
+ return 4 /* CompoundV3 */;
361
365
  }
362
366
  if (MORPHO_BLUE_LENDERS.includes(lender)) {
363
- return 4 /* MorphoBlue */;
367
+ return 5 /* MorphoBlue */;
364
368
  }
365
369
  if (SILO_V2_LENDERS.includes(lender)) {
366
- return 5 /* SiloV2 */;
370
+ return 6 /* SiloV2 */;
371
+ }
372
+ if (lender.startsWith("AAVE_V4")) {
373
+ return 2 /* AaveV4 */;
367
374
  }
368
375
  throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
369
376
  }
@@ -414,6 +421,9 @@ function isInit(lender) {
414
421
  function isEulerType(lender) {
415
422
  return lender === "EULER_V2" /* EULER_V2 */;
416
423
  }
424
+ function isAaveV4Type(lender) {
425
+ return lender?.startsWith("AAVE_V4");
426
+ }
417
427
  function lenderHasSubAccounts(lender) {
418
428
  return isInit(lender);
419
429
  }
@@ -481,6 +491,7 @@ exports.isAaveType = isAaveType;
481
491
  exports.isAaveV2Type = isAaveV2Type;
482
492
  exports.isAaveV32Type = isAaveV32Type;
483
493
  exports.isAaveV3Type = isAaveV3Type;
494
+ exports.isAaveV4Type = isAaveV4Type;
484
495
  exports.isBenqiType = isBenqiType;
485
496
  exports.isCompoundV2 = isCompoundV2;
486
497
  exports.isCompoundV2PerSecond = isCompoundV2PerSecond;
package/dist/index.mjs CHANGED
@@ -314,10 +314,11 @@ var SILO_V2_LENDERS = ["SILO_V2" /* SILO_V2 */];
314
314
  var LenderGroups = /* @__PURE__ */ ((LenderGroups2) => {
315
315
  LenderGroups2[LenderGroups2["AaveV2"] = 0] = "AaveV2";
316
316
  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";
317
+ LenderGroups2[LenderGroups2["AaveV4"] = 2] = "AaveV4";
318
+ LenderGroups2[LenderGroups2["CompoundV2"] = 3] = "CompoundV2";
319
+ LenderGroups2[LenderGroups2["CompoundV3"] = 4] = "CompoundV3";
320
+ LenderGroups2[LenderGroups2["MorphoBlue"] = 5] = "MorphoBlue";
321
+ LenderGroups2[LenderGroups2["SiloV2"] = 6] = "SiloV2";
321
322
  return LenderGroups2;
322
323
  })(LenderGroups || {});
323
324
  var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
@@ -327,6 +328,7 @@ var LenderIds = /* @__PURE__ */ ((LenderIds2) => {
327
328
  LenderIds2[LenderIds2["UP_TO_COMPOUND_V2"] = 4e3] = "UP_TO_COMPOUND_V2";
328
329
  LenderIds2[LenderIds2["UP_TO_MORPHO"] = 5e3] = "UP_TO_MORPHO";
329
330
  LenderIds2[LenderIds2["UP_TO_SILO_V2"] = 6e3] = "UP_TO_SILO_V2";
331
+ LenderIds2[LenderIds2["UP_TO_AAVE_V4"] = 7e3] = "UP_TO_AAVE_V4";
330
332
  return LenderIds2;
331
333
  })(LenderIds || {});
332
334
  function getLenderId(lender) {
@@ -335,13 +337,15 @@ function getLenderId(lender) {
335
337
  return 2e3 /* UP_TO_AAVE_V2 */ - 1;
336
338
  case 1 /* AaveV3 */:
337
339
  return 1e3 /* UP_TO_AAVE_V3 */ - 1;
338
- case 2 /* CompoundV2 */:
340
+ case 2 /* AaveV4 */:
341
+ return 7e3 /* UP_TO_AAVE_V4 */ - 1;
342
+ case 3 /* CompoundV2 */:
339
343
  return 4e3 /* UP_TO_COMPOUND_V2 */ - 1;
340
- case 3 /* CompoundV3 */:
344
+ case 4 /* CompoundV3 */:
341
345
  return 3e3 /* UP_TO_COMPOUND_V3 */ - 1;
342
- case 4 /* MorphoBlue */:
346
+ case 5 /* MorphoBlue */:
343
347
  return 5e3 /* UP_TO_MORPHO */ - 1;
344
- case 5 /* SiloV2 */:
348
+ case 6 /* SiloV2 */:
345
349
  return 6e3 /* UP_TO_SILO_V2 */ - 1;
346
350
  default:
347
351
  throw new Error(`getLenderId: Unsupported lender ${lender}`);
@@ -352,16 +356,19 @@ function getLenderGroup(lender) {
352
356
  return AAVE_V2_LENDERS.includes(lender) ? 0 /* AaveV2 */ : 1 /* AaveV3 */;
353
357
  }
354
358
  if (COMPOUND_V2_LENDERS.includes(lender)) {
355
- return 2 /* CompoundV2 */;
359
+ return 3 /* CompoundV2 */;
356
360
  }
357
361
  if (COMPOUND_V3_LENDERS.includes(lender)) {
358
- return 3 /* CompoundV3 */;
362
+ return 4 /* CompoundV3 */;
359
363
  }
360
364
  if (MORPHO_BLUE_LENDERS.includes(lender)) {
361
- return 4 /* MorphoBlue */;
365
+ return 5 /* MorphoBlue */;
362
366
  }
363
367
  if (SILO_V2_LENDERS.includes(lender)) {
364
- return 5 /* SiloV2 */;
368
+ return 6 /* SiloV2 */;
369
+ }
370
+ if (lender.startsWith("AAVE_V4")) {
371
+ return 2 /* AaveV4 */;
365
372
  }
366
373
  throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
367
374
  }
@@ -412,6 +419,9 @@ function isInit(lender) {
412
419
  function isEulerType(lender) {
413
420
  return lender === "EULER_V2" /* EULER_V2 */;
414
421
  }
422
+ function isAaveV4Type(lender) {
423
+ return lender?.startsWith("AAVE_V4");
424
+ }
415
425
  function lenderHasSubAccounts(lender) {
416
426
  return isInit(lender);
417
427
  }
@@ -456,4 +466,4 @@ function isCompoundV2(lender) {
456
466
  return isCompoundV2Type(lender);
457
467
  }
458
468
 
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 };
469
+ 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, 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
@@ -173,13 +173,19 @@ export declare const TECTONIC_LENDERS: Lender[];
173
173
  export declare const BENQI_LENDERS: Lender[];
174
174
  /** Silo lenders */
175
175
  export declare const SILO_V2_LENDERS: Lender[];
176
+ /**
177
+ * Aave V4 has no enum-level lenders; per-spoke lender keys are synthesized
178
+ * at runtime as `AAVE_V4_<SPOKE_HEX>`. Use `lender.startsWith('AAVE_V4')`
179
+ * (via `isAaveV4Type`) for membership tests.
180
+ */
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.21",
8
8
  "description": "Lenders as Enums for convenience",
9
9
  "files": [
10
10
  "dist"