@1delta/lender-registry 0.0.15 → 0.0.17
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 +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -4
- package/dist/index.mjs +12 -5
- package/dist/lenders.d.ts +1 -0
- package/package.json +1 -1
package/dist/getters.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare function isVenusType(lender: string): boolean;
|
|
|
13
13
|
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
|
+
export declare function isEulerType(lender: string): lender is Lender.EULER_V2;
|
|
16
17
|
export declare function lenderHasSubAccounts(lender: string): lender is Lender.INIT;
|
|
17
18
|
export declare function aaveForkCannotPermit(lender: string): boolean;
|
|
18
19
|
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, lenderHasSubAccounts, aaveForkCannotPermit, supportsSameAsset, isLista, isYLDR, isSumerType, isTectonicType, isBenqiType, 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, isTectonicType, isBenqiType, isMultiMarket, isAave, isCompoundV2, } from './getters.js';
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,7 @@ var Lender = /* @__PURE__ */ ((Lender2) => {
|
|
|
113
113
|
Lender2["ENCLABS_PT_ETH"] = "ENCLABS_PT_ETH";
|
|
114
114
|
Lender2["ENCLABS_SONIC_ECO"] = "ENCLABS_SONIC_ECO";
|
|
115
115
|
Lender2["TAKARA"] = "TAKARA";
|
|
116
|
+
Lender2["UNITUS"] = "UNITUS";
|
|
116
117
|
Lender2["BENQI"] = "BENQI";
|
|
117
118
|
Lender2["BENQI_AVALANCE_ECOSYSTEM"] = "BENQI_AVALANCE_ECOSYSTEM";
|
|
118
119
|
Lender2["KEOM"] = "KEOM";
|
|
@@ -293,7 +294,8 @@ var COMPOUND_V2_LENDERS = [
|
|
|
293
294
|
"WE_PIGGY" /* WE_PIGGY */,
|
|
294
295
|
"CREAM_FINANCE" /* CREAM_FINANCE */,
|
|
295
296
|
"CAPY_FI" /* CAPY_FI */,
|
|
296
|
-
"GAMMA" /* GAMMA
|
|
297
|
+
"GAMMA" /* GAMMA */,
|
|
298
|
+
"UNITUS" /* UNITUS */
|
|
297
299
|
];
|
|
298
300
|
var COMPOUND_V3_LENDERS = [
|
|
299
301
|
"COMPOUND_V3_USDC" /* COMPOUND_V3_USDC */,
|
|
@@ -344,7 +346,7 @@ function getLenderId(lender) {
|
|
|
344
346
|
case 5 /* SiloV2 */:
|
|
345
347
|
return 6e3 /* UP_TO_SILO_V2 */ - 1;
|
|
346
348
|
default:
|
|
347
|
-
throw new Error(
|
|
349
|
+
throw new Error(`getLenderId: Unsupported lender ${lender}`);
|
|
348
350
|
}
|
|
349
351
|
}
|
|
350
352
|
function getLenderGroup(lender) {
|
|
@@ -363,7 +365,7 @@ function getLenderGroup(lender) {
|
|
|
363
365
|
if (SILO_V2_LENDERS.includes(lender)) {
|
|
364
366
|
return 5 /* SiloV2 */;
|
|
365
367
|
}
|
|
366
|
-
throw new Error(
|
|
368
|
+
throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
|
|
367
369
|
}
|
|
368
370
|
|
|
369
371
|
// src/getters.ts
|
|
@@ -384,7 +386,9 @@ function isCompoundV3(lender) {
|
|
|
384
386
|
}
|
|
385
387
|
function extractLenderBeforeLastUnderscore(str) {
|
|
386
388
|
const idx = str.lastIndexOf("_");
|
|
387
|
-
|
|
389
|
+
if (idx === -1) return str;
|
|
390
|
+
if (str.indexOf("_") === idx) return str;
|
|
391
|
+
return str.slice(0, idx);
|
|
388
392
|
}
|
|
389
393
|
function isMorphoBlue(lender) {
|
|
390
394
|
return lender?.startsWith("MORPHO_BLUE");
|
|
@@ -407,6 +411,9 @@ function isCompoundV3Type(lender) {
|
|
|
407
411
|
function isInit(lender) {
|
|
408
412
|
return lender === "INIT" /* INIT */;
|
|
409
413
|
}
|
|
414
|
+
function isEulerType(lender) {
|
|
415
|
+
return lender === "EULER_V2" /* EULER_V2 */;
|
|
416
|
+
}
|
|
410
417
|
function lenderHasSubAccounts(lender) {
|
|
411
418
|
return isInit(lender);
|
|
412
419
|
}
|
|
@@ -470,6 +477,7 @@ exports.isCompoundV2 = isCompoundV2;
|
|
|
470
477
|
exports.isCompoundV2Type = isCompoundV2Type;
|
|
471
478
|
exports.isCompoundV3 = isCompoundV3;
|
|
472
479
|
exports.isCompoundV3Type = isCompoundV3Type;
|
|
480
|
+
exports.isEulerType = isEulerType;
|
|
473
481
|
exports.isInit = isInit;
|
|
474
482
|
exports.isLista = isLista;
|
|
475
483
|
exports.isListaDao = isListaDao;
|
package/dist/index.mjs
CHANGED
|
@@ -111,6 +111,7 @@ var Lender = /* @__PURE__ */ ((Lender2) => {
|
|
|
111
111
|
Lender2["ENCLABS_PT_ETH"] = "ENCLABS_PT_ETH";
|
|
112
112
|
Lender2["ENCLABS_SONIC_ECO"] = "ENCLABS_SONIC_ECO";
|
|
113
113
|
Lender2["TAKARA"] = "TAKARA";
|
|
114
|
+
Lender2["UNITUS"] = "UNITUS";
|
|
114
115
|
Lender2["BENQI"] = "BENQI";
|
|
115
116
|
Lender2["BENQI_AVALANCE_ECOSYSTEM"] = "BENQI_AVALANCE_ECOSYSTEM";
|
|
116
117
|
Lender2["KEOM"] = "KEOM";
|
|
@@ -291,7 +292,8 @@ var COMPOUND_V2_LENDERS = [
|
|
|
291
292
|
"WE_PIGGY" /* WE_PIGGY */,
|
|
292
293
|
"CREAM_FINANCE" /* CREAM_FINANCE */,
|
|
293
294
|
"CAPY_FI" /* CAPY_FI */,
|
|
294
|
-
"GAMMA" /* GAMMA
|
|
295
|
+
"GAMMA" /* GAMMA */,
|
|
296
|
+
"UNITUS" /* UNITUS */
|
|
295
297
|
];
|
|
296
298
|
var COMPOUND_V3_LENDERS = [
|
|
297
299
|
"COMPOUND_V3_USDC" /* COMPOUND_V3_USDC */,
|
|
@@ -342,7 +344,7 @@ function getLenderId(lender) {
|
|
|
342
344
|
case 5 /* SiloV2 */:
|
|
343
345
|
return 6e3 /* UP_TO_SILO_V2 */ - 1;
|
|
344
346
|
default:
|
|
345
|
-
throw new Error(
|
|
347
|
+
throw new Error(`getLenderId: Unsupported lender ${lender}`);
|
|
346
348
|
}
|
|
347
349
|
}
|
|
348
350
|
function getLenderGroup(lender) {
|
|
@@ -361,7 +363,7 @@ function getLenderGroup(lender) {
|
|
|
361
363
|
if (SILO_V2_LENDERS.includes(lender)) {
|
|
362
364
|
return 5 /* SiloV2 */;
|
|
363
365
|
}
|
|
364
|
-
throw new Error(
|
|
366
|
+
throw new Error(`getLenderGroup: Unsupported lender ${lender}`);
|
|
365
367
|
}
|
|
366
368
|
|
|
367
369
|
// src/getters.ts
|
|
@@ -382,7 +384,9 @@ function isCompoundV3(lender) {
|
|
|
382
384
|
}
|
|
383
385
|
function extractLenderBeforeLastUnderscore(str) {
|
|
384
386
|
const idx = str.lastIndexOf("_");
|
|
385
|
-
|
|
387
|
+
if (idx === -1) return str;
|
|
388
|
+
if (str.indexOf("_") === idx) return str;
|
|
389
|
+
return str.slice(0, idx);
|
|
386
390
|
}
|
|
387
391
|
function isMorphoBlue(lender) {
|
|
388
392
|
return lender?.startsWith("MORPHO_BLUE");
|
|
@@ -405,6 +409,9 @@ function isCompoundV3Type(lender) {
|
|
|
405
409
|
function isInit(lender) {
|
|
406
410
|
return lender === "INIT" /* INIT */;
|
|
407
411
|
}
|
|
412
|
+
function isEulerType(lender) {
|
|
413
|
+
return lender === "EULER_V2" /* EULER_V2 */;
|
|
414
|
+
}
|
|
408
415
|
function lenderHasSubAccounts(lender) {
|
|
409
416
|
return isInit(lender);
|
|
410
417
|
}
|
|
@@ -440,4 +447,4 @@ function isCompoundV2(lender) {
|
|
|
440
447
|
return isCompoundV2Type(lender);
|
|
441
448
|
}
|
|
442
449
|
|
|
443
|
-
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, isCompoundV2Type, isCompoundV3, isCompoundV3Type, isInit, isLista, isListaDao, isMorphoBlue, isMorphoType, isMultiMarket, isSumerType, isTectonicType, isVenusType, isYLDR, lenderHasSubAccounts, supportsSameAsset };
|
|
450
|
+
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, isCompoundV2Type, isCompoundV3, isCompoundV3Type, isEulerType, isInit, isLista, isListaDao, isMorphoBlue, isMorphoType, isMultiMarket, isSumerType, isTectonicType, isVenusType, isYLDR, lenderHasSubAccounts, supportsSameAsset };
|
package/dist/lenders.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export declare enum Lender {
|
|
|
112
112
|
ENCLABS_PT_ETH = "ENCLABS_PT_ETH",
|
|
113
113
|
ENCLABS_SONIC_ECO = "ENCLABS_SONIC_ECO",
|
|
114
114
|
TAKARA = "TAKARA",
|
|
115
|
+
UNITUS = "UNITUS",
|
|
115
116
|
BENQI = "BENQI",
|
|
116
117
|
BENQI_AVALANCE_ECOSYSTEM = "BENQI_AVALANCE_ECOSYSTEM",
|
|
117
118
|
KEOM = "KEOM",
|