@curvefi/llamalend-api 1.0.39 → 1.0.40
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/lib/constants/llammas.d.ts +1 -1
- package/lib/constants/llammas.js +1 -1
- package/lib/constants/utils.d.ts +1 -1
- package/lib/external-api.d.ts +1 -1
- package/lib/llamalend.js +1 -1
- package/lib/mintMarkets/MintMarketTemplate.d.ts +1 -1
- package/lib/mintMarkets/MintMarketTemplate.js +2 -2
- package/lib/mintMarkets/interfaces/leverage.d.ts +1 -1
- package/lib/mintMarkets/mintMarketConstructor.d.ts +1 -1
- package/lib/mintMarkets/mintMarketConstructor.js +1 -1
- package/package.json +1 -1
- package/src/constants/llammas.ts +2 -2
- package/src/constants/utils.ts +1 -2
- package/src/external-api.ts +1 -1
- package/src/llamalend.ts +2 -2
- package/src/mintMarkets/MintMarketTemplate.ts +3 -3
- package/src/mintMarkets/interfaces/leverage.ts +2 -2
- package/src/mintMarkets/mintMarketConstructor.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IDict, ILlamma } from "../interfaces";
|
|
1
|
+
import { IDict, ILlamma } from "../interfaces.js";
|
|
2
2
|
export declare const LLAMMAS: IDict<ILlamma>;
|
package/lib/constants/llammas.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' with { type: 'json' };
|
|
2
2
|
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' with { type: 'json' };
|
|
3
|
-
import { lowerCaseLlammasAddresses } from "./utils";
|
|
3
|
+
import { lowerCaseLlammasAddresses } from "./utils.js";
|
|
4
4
|
export const LLAMMAS = lowerCaseLlammasAddresses({
|
|
5
5
|
sfrxeth: {
|
|
6
6
|
amm_address: '0x136e783846ef68C8Bd00a3369F787dF8d683a696',
|
package/lib/constants/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDict, ILlamma } from "../interfaces";
|
|
1
|
+
import { IDict, ILlamma } from "../interfaces.js";
|
|
2
2
|
export declare const lowerCaseValues: (dict: IDict<string>) => IDict<string>;
|
|
3
3
|
export declare const lowerCaseLlammasAddresses: (llammas: IDict<ILlamma>) => IDict<ILlamma>;
|
|
4
4
|
export declare const extractDecimals: (llammas: IDict<ILlamma>) => IDict<number>;
|
package/lib/external-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import memoize from "memoizee";
|
|
2
2
|
import type { Llamalend } from "./llamalend.js";
|
|
3
|
-
import { IDict, IExtendedPoolDataFromApi, IMarketData, INetworkName, IQuoteOdos, IPoolType } from "./interfaces";
|
|
3
|
+
import { IDict, IExtendedPoolDataFromApi, IMarketData, INetworkName, IQuoteOdos, IPoolType } from "./interfaces.js";
|
|
4
4
|
export declare const uncached_getAllPoolsFromApi: (network: INetworkName) => Promise<Record<IPoolType, IExtendedPoolDataFromApi>>;
|
|
5
5
|
export declare const createUsdPricesDict: (allTypesExtendedPoolData: IExtendedPoolDataFromApi[]) => IDict<number>;
|
|
6
6
|
type UserCollateral = {
|
package/lib/llamalend.js
CHANGED
|
@@ -38,7 +38,7 @@ import LeverageZapCrvUSDABI from "./constants/abis/crvUSD/LeverageZap.json" with
|
|
|
38
38
|
import DeleverageZapABI from "./constants/abis/crvUSD/DeleverageZap.json" with { type: 'json' };
|
|
39
39
|
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, ALIASES_BSC, ALIASES_FRAXTAL, ALIASES_SONIC, } from "./constants/aliases.js";
|
|
40
40
|
import { COINS_ETHEREUM, COINS_OPTIMISM, COINS_POLYGON, COINS_FANTOM, COINS_AVALANCHE, COINS_ARBITRUM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_SONIC, } from "./constants/coins.js";
|
|
41
|
-
import { LLAMMAS } from "./constants/llammas";
|
|
41
|
+
import { LLAMMAS } from "./constants/llammas.js";
|
|
42
42
|
import { L2Networks } from "./constants/L2Networks.js";
|
|
43
43
|
import { createCall, handleMultiCallResponse } from "./utils.js";
|
|
44
44
|
import { cacheKey, cacheStats } from "./cache/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import memoize from "memoizee";
|
|
2
2
|
import type { Llamalend } from "../llamalend.js";
|
|
3
|
-
import { IDict, ILlamma, TGas } from "../interfaces";
|
|
3
|
+
import { IDict, ILlamma, TGas } from "../interfaces.js";
|
|
4
4
|
import { ILeverageV2 } from "./interfaces/leverage.js";
|
|
5
5
|
export declare class MintMarketTemplate {
|
|
6
6
|
private llamalend;
|
|
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import memoize from "memoizee";
|
|
11
11
|
import BigNumber from "bignumber.js";
|
|
12
|
-
import { _getAddress, parseUnits, BN, toBN, fromBN, getBalances, ensureAllowance, hasAllowance, ensureAllowanceEstimateGas, isEth, _cutZeros, formatUnits, smartNumber, MAX_ALLOWANCE, MAX_ACTIVE_BAND, _mulBy1_3, DIGas, } from "../utils";
|
|
12
|
+
import { _getAddress, parseUnits, BN, toBN, fromBN, getBalances, ensureAllowance, hasAllowance, ensureAllowanceEstimateGas, isEth, _cutZeros, formatUnits, smartNumber, MAX_ALLOWANCE, MAX_ACTIVE_BAND, _mulBy1_3, DIGas, } from "../utils.js";
|
|
13
13
|
import { _getUserCollateralCrvUsd, _getUserCollateralCrvUsdFull } from "../external-api.js";
|
|
14
|
-
import { LeverageV2Module } from "./modules";
|
|
14
|
+
import { LeverageV2Module } from "./modules/index.js";
|
|
15
15
|
export class MintMarketTemplate {
|
|
16
16
|
constructor(id, llammaData, llamalend) {
|
|
17
17
|
var _a;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MintMarketTemplate } from "./MintMarketTemplate";
|
|
1
|
+
import { MintMarketTemplate } from "./MintMarketTemplate.js";
|
|
2
2
|
import type { Llamalend } from "../llamalend.js";
|
|
3
3
|
export declare const getMintMarket: (this: Llamalend, mintMarketId: string) => MintMarketTemplate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MintMarketTemplate } from "./MintMarketTemplate";
|
|
1
|
+
import { MintMarketTemplate } from "./MintMarketTemplate.js";
|
|
2
2
|
export const getMintMarket = function (mintMarketId) {
|
|
3
3
|
if (!(mintMarketId in this.mintMarkets)) {
|
|
4
4
|
const llammaData = this.constants.LLAMMAS[mintMarketId];
|
package/package.json
CHANGED
package/src/constants/llammas.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IDict, ILlamma } from "../interfaces";
|
|
1
|
+
import { IDict, ILlamma } from "../interfaces.js";
|
|
2
2
|
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' with {type: 'json'};
|
|
3
3
|
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' with {type: 'json'};
|
|
4
|
-
import { lowerCaseLlammasAddresses } from "./utils";
|
|
4
|
+
import { lowerCaseLlammasAddresses } from "./utils.js";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export const LLAMMAS: IDict<ILlamma> = lowerCaseLlammasAddresses({
|
package/src/constants/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {IDict, ILlamma} from "../interfaces";
|
|
1
|
+
import {IDict, ILlamma} from "../interfaces.js";
|
|
2
2
|
|
|
3
3
|
export const lowerCaseValues = (dict: IDict<string>): IDict<string> =>
|
|
4
4
|
Object.fromEntries(Object.entries(dict).map((entry) => [entry[0], entry[1].toLowerCase()]))
|
|
@@ -30,4 +30,3 @@ export const extractDecimals = (llammas: IDict<ILlamma>): IDict<number> => {
|
|
|
30
30
|
|
|
31
31
|
return DECIMALS
|
|
32
32
|
}
|
|
33
|
-
|
package/src/external-api.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
IQuoteOdos,
|
|
10
10
|
IResponseApi,
|
|
11
11
|
IPoolType,
|
|
12
|
-
} from "./interfaces";
|
|
12
|
+
} from "./interfaces.js";
|
|
13
13
|
|
|
14
14
|
const uncached_getPoolsFromApi = async (network: INetworkName, poolType: IPoolType): Promise<IExtendedPoolDataFromApi> => {
|
|
15
15
|
const api = "https://api.curve.finance/api";
|
package/src/llamalend.ts
CHANGED
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
COINS_FRAXTAL,
|
|
76
76
|
COINS_SONIC,
|
|
77
77
|
} from "./constants/coins.js";
|
|
78
|
-
import {LLAMMAS} from "./constants/llammas";
|
|
78
|
+
import {LLAMMAS} from "./constants/llammas.js";
|
|
79
79
|
import {L2Networks} from "./constants/L2Networks.js";
|
|
80
80
|
import {createCall, handleMultiCallResponse} from "./utils.js";
|
|
81
81
|
import {cacheKey, cacheStats} from "./cache/index.js";
|
|
@@ -814,4 +814,4 @@ class Llamalend implements ILlamalend {
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
-
export { Llamalend };
|
|
817
|
+
export { Llamalend };
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
MAX_ACTIVE_BAND,
|
|
20
20
|
_mulBy1_3,
|
|
21
21
|
DIGas,
|
|
22
|
-
} from "../utils";
|
|
23
|
-
import {IDict, ILlamma, TGas} from "../interfaces";
|
|
22
|
+
} from "../utils.js";
|
|
23
|
+
import {IDict, ILlamma, TGas} from "../interfaces.js";
|
|
24
24
|
import {_getUserCollateralCrvUsd, _getUserCollateralCrvUsdFull} from "../external-api.js";
|
|
25
25
|
import { ILeverageV2 } from "./interfaces/leverage.js";
|
|
26
|
-
import { LeverageV2Module } from "./modules";
|
|
26
|
+
import { LeverageV2Module } from "./modules/index.js";
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
export class MintMarketTemplate {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {IDict, TAmount, TGas} from "../../interfaces";
|
|
1
|
+
import {IDict, TAmount, TGas} from "../../interfaces.js";
|
|
2
2
|
|
|
3
3
|
export interface ILeverageV2 {
|
|
4
4
|
hasLeverage: () => boolean,
|
|
@@ -101,4 +101,4 @@ export interface ILeverageV2 {
|
|
|
101
101
|
repayApprove: (userCollateral: TAmount, userBorrowed: TAmount) => Promise<TGas>,
|
|
102
102
|
repay: (stateCollateral: TAmount, userCollateral: TAmount, userBorrowed: TAmount, slippage?: number) => Promise<number>,
|
|
103
103
|
}
|
|
104
|
-
}
|
|
104
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MintMarketTemplate} from "./MintMarketTemplate";
|
|
1
|
+
import { MintMarketTemplate} from "./MintMarketTemplate.js";
|
|
2
2
|
import type { Llamalend } from "../llamalend.js";
|
|
3
3
|
|
|
4
4
|
export const getMintMarket = function (this: Llamalend, mintMarketId: string): MintMarketTemplate {
|