@defisaver/positions-sdk 1.0.3 → 1.0.5
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +69 -69
- package/cjs/aaveV3/index.js +7 -7
- package/cjs/curveUsd/index.js +8 -1
- package/cjs/fluid/index.d.ts +2 -0
- package/cjs/helpers/aaveHelpers/index.js +6 -0
- package/cjs/helpers/compoundHelpers/index.js +2 -0
- package/cjs/helpers/eulerHelpers/index.js +2 -0
- package/cjs/helpers/fluidHelpers/index.js +2 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +68 -66
- package/cjs/helpers/sparkHelpers/index.js +6 -0
- package/cjs/staking/staking.d.ts +2 -1
- package/cjs/staking/staking.js +3 -7
- package/cjs/types/aave.d.ts +4 -0
- package/cjs/types/compound.d.ts +2 -0
- package/cjs/types/curveUsd.d.ts +1 -0
- package/cjs/types/euler.d.ts +2 -0
- package/cjs/types/fluid.d.ts +2 -0
- package/cjs/types/morphoBlue.d.ts +2 -0
- package/cjs/types/spark.d.ts +4 -0
- package/esm/aaveV3/index.js +7 -7
- package/esm/curveUsd/index.js +10 -3
- package/esm/fluid/index.d.ts +2 -0
- package/esm/helpers/aaveHelpers/index.js +6 -0
- package/esm/helpers/compoundHelpers/index.js +2 -0
- package/esm/helpers/eulerHelpers/index.js +2 -0
- package/esm/helpers/fluidHelpers/index.js +2 -0
- package/esm/helpers/morphoBlueHelpers/index.js +68 -66
- package/esm/helpers/sparkHelpers/index.js +6 -0
- package/esm/staking/staking.d.ts +2 -1
- package/esm/staking/staking.js +3 -6
- package/esm/types/aave.d.ts +4 -0
- package/esm/types/compound.d.ts +2 -0
- package/esm/types/curveUsd.d.ts +1 -0
- package/esm/types/euler.d.ts +2 -0
- package/esm/types/fluid.d.ts +2 -0
- package/esm/types/morphoBlue.d.ts +2 -0
- package/esm/types/spark.d.ts +4 -0
- package/package.json +54 -52
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +624 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1147 -1147
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +134 -134
- package/src/curveUsd/index.ts +239 -230
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/fluid/index.ts +354 -354
- package/src/helpers/aaveHelpers/index.ts +204 -198
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +248 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +234 -232
- package/src/helpers/fluidHelpers/index.ts +56 -53
- package/src/helpers/index.ts +11 -11
- package/src/helpers/liquityV2Helpers/index.ts +80 -80
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +367 -365
- package/src/helpers/sparkHelpers/index.ts +155 -150
- package/src/index.ts +52 -52
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +295 -295
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +44 -44
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2012 -2012
- package/src/markets/index.ts +27 -27
- package/src/markets/liquityV2/index.ts +54 -54
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +630 -630
- package/src/morphoBlue/index.ts +202 -202
- package/src/multicall/index.ts +33 -33
- package/src/services/priceService.ts +91 -91
- package/src/services/utils.ts +59 -59
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +460 -460
- package/src/staking/staking.ts +217 -220
- package/src/types/aave.ts +275 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +133 -131
- package/src/types/curveUsd.ts +119 -118
- package/src/types/euler.ts +173 -171
- package/src/types/fluid.ts +268 -266
- package/src/types/index.ts +11 -11
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -119
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +194 -192
- package/src/types/spark.ts +135 -131
|
@@ -143,6 +143,8 @@ export const getEulerV2AggregatedData = (_a) => {
|
|
|
143
143
|
}
|
|
144
144
|
payload.liquidationPrice = calcLeverageLiqPrice(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
145
145
|
}
|
|
146
|
+
payload.minCollRatio = new Dec(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
147
|
+
payload.collLiquidationRatio = new Dec(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
146
148
|
return payload;
|
|
147
149
|
};
|
|
148
150
|
export const getEulerV2BorrowRate = (interestRate) => {
|
|
@@ -30,5 +30,7 @@ export const getFluidAggregatedData = ({ usedAssets, assetsData, marketData, })
|
|
|
30
30
|
}
|
|
31
31
|
payload.liquidationPrice = calcLeverageLiqPrice(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
32
32
|
}
|
|
33
|
+
payload.minCollRatio = new Dec(payload.suppliedUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
34
|
+
payload.collLiquidationRatio = new Dec(payload.suppliedUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
33
35
|
return payload;
|
|
34
36
|
};
|
|
@@ -51,6 +51,8 @@ export const getMorphoBlueAggregatedPositionData = ({ usedAssets, assetsData, ma
|
|
|
51
51
|
}
|
|
52
52
|
payload.liquidationPrice = calcLeverageLiqPrice(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
53
53
|
}
|
|
54
|
+
payload.minCollRatio = new Dec(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
55
|
+
payload.collLiquidationRatio = new Dec(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
54
56
|
return payload;
|
|
55
57
|
};
|
|
56
58
|
const compound = (ratePerSeconds) => {
|
|
@@ -105,73 +107,73 @@ export const getApyAfterValuesEstimation = (selectedMarket, actions, web3, netwo
|
|
|
105
107
|
return { borrowRate, supplyRate };
|
|
106
108
|
});
|
|
107
109
|
const API_URL = 'https://blue-api.morpho.org/graphql';
|
|
108
|
-
const MARKET_QUERY = `
|
|
109
|
-
query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
|
|
110
|
-
marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
|
|
111
|
-
reallocatableLiquidityAssets
|
|
112
|
-
targetBorrowUtilization
|
|
113
|
-
loanAsset {
|
|
114
|
-
address
|
|
115
|
-
decimals
|
|
116
|
-
priceUsd
|
|
117
|
-
}
|
|
118
|
-
state {
|
|
119
|
-
liquidityAssets
|
|
120
|
-
borrowAssets
|
|
121
|
-
supplyAssets
|
|
122
|
-
}
|
|
123
|
-
publicAllocatorSharedLiquidity {
|
|
124
|
-
assets
|
|
125
|
-
vault {
|
|
126
|
-
address
|
|
127
|
-
name
|
|
128
|
-
}
|
|
129
|
-
allocationMarket {
|
|
130
|
-
uniqueKey
|
|
131
|
-
loanAsset {
|
|
132
|
-
address
|
|
133
|
-
}
|
|
134
|
-
collateralAsset {
|
|
135
|
-
address
|
|
136
|
-
}
|
|
137
|
-
irmAddress
|
|
138
|
-
oracle {
|
|
139
|
-
address
|
|
140
|
-
}
|
|
141
|
-
lltv
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
loanAsset {
|
|
145
|
-
address
|
|
146
|
-
}
|
|
147
|
-
collateralAsset {
|
|
148
|
-
address
|
|
149
|
-
}
|
|
150
|
-
oracle {
|
|
151
|
-
address
|
|
152
|
-
}
|
|
153
|
-
irmAddress
|
|
154
|
-
lltv
|
|
155
|
-
}
|
|
156
|
-
}
|
|
110
|
+
const MARKET_QUERY = `
|
|
111
|
+
query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
|
|
112
|
+
marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
|
|
113
|
+
reallocatableLiquidityAssets
|
|
114
|
+
targetBorrowUtilization
|
|
115
|
+
loanAsset {
|
|
116
|
+
address
|
|
117
|
+
decimals
|
|
118
|
+
priceUsd
|
|
119
|
+
}
|
|
120
|
+
state {
|
|
121
|
+
liquidityAssets
|
|
122
|
+
borrowAssets
|
|
123
|
+
supplyAssets
|
|
124
|
+
}
|
|
125
|
+
publicAllocatorSharedLiquidity {
|
|
126
|
+
assets
|
|
127
|
+
vault {
|
|
128
|
+
address
|
|
129
|
+
name
|
|
130
|
+
}
|
|
131
|
+
allocationMarket {
|
|
132
|
+
uniqueKey
|
|
133
|
+
loanAsset {
|
|
134
|
+
address
|
|
135
|
+
}
|
|
136
|
+
collateralAsset {
|
|
137
|
+
address
|
|
138
|
+
}
|
|
139
|
+
irmAddress
|
|
140
|
+
oracle {
|
|
141
|
+
address
|
|
142
|
+
}
|
|
143
|
+
lltv
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
loanAsset {
|
|
147
|
+
address
|
|
148
|
+
}
|
|
149
|
+
collateralAsset {
|
|
150
|
+
address
|
|
151
|
+
}
|
|
152
|
+
oracle {
|
|
153
|
+
address
|
|
154
|
+
}
|
|
155
|
+
irmAddress
|
|
156
|
+
lltv
|
|
157
|
+
}
|
|
158
|
+
}
|
|
157
159
|
`;
|
|
158
|
-
const REWARDS_QUERY = `
|
|
159
|
-
query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
|
|
160
|
-
marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
|
|
161
|
-
uniqueKey
|
|
162
|
-
state {
|
|
163
|
-
rewards {
|
|
164
|
-
amountPerSuppliedToken
|
|
165
|
-
supplyApr
|
|
166
|
-
amountPerBorrowedToken
|
|
167
|
-
borrowApr
|
|
168
|
-
asset {
|
|
169
|
-
address
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
160
|
+
const REWARDS_QUERY = `
|
|
161
|
+
query MarketByUniqueKey($uniqueKey: String!, $chainId: Int!) {
|
|
162
|
+
marketByUniqueKey(uniqueKey: $uniqueKey, chainId: $chainId) {
|
|
163
|
+
uniqueKey
|
|
164
|
+
state {
|
|
165
|
+
rewards {
|
|
166
|
+
amountPerSuppliedToken
|
|
167
|
+
supplyApr
|
|
168
|
+
amountPerBorrowedToken
|
|
169
|
+
borrowApr
|
|
170
|
+
asset {
|
|
171
|
+
address
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
175
177
|
`;
|
|
176
178
|
/**
|
|
177
179
|
* Get reallocatable liquidity to a given market and target borrow utilization
|
|
@@ -87,6 +87,12 @@ export const sparkGetAggregatedPositionData = (_a) => {
|
|
|
87
87
|
}
|
|
88
88
|
payload.liquidationPrice = calcLeverageLiqPrice(leveragedType, assetPrice, payload.borrowedUsd, payload.liquidationLimitUsd);
|
|
89
89
|
}
|
|
90
|
+
payload.minCollRatio = new Dec(payload.suppliedCollateralUsd).div(payload.borrowLimitUsd).mul(100).toString();
|
|
91
|
+
payload.collLiquidationRatio = new Dec(payload.suppliedCollateralUsd).div(payload.liquidationLimitUsd).mul(100).toString();
|
|
92
|
+
payload.healthRatio = new Dec(payload.suppliedCollateralUsd).mul(payload.liqPercent).div(payload.borrowedUsd).div(100)
|
|
93
|
+
.toString();
|
|
94
|
+
payload.healthLiquidationRatio = new Dec(payload.suppliedCollateralUsd).mul(payload.liqRatio).div(payload.borrowLimitUsd)
|
|
95
|
+
.toString();
|
|
90
96
|
return payload;
|
|
91
97
|
};
|
|
92
98
|
export const getApyAfterValuesEstimation = (selectedMarket, actions, web3) => __awaiter(void 0, void 0, void 0, function* () {
|
package/esm/staking/staking.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
|
+
import memoize from 'memoizee';
|
|
2
3
|
import { MMAssetsData, MMUsedAssets } from '../types/common';
|
|
3
4
|
export declare const STAKING_ASSETS: string[];
|
|
4
|
-
export declare const getStakingApy: (asset: string, web3: Web3, blockNumber?: 'latest' | number, fromBlock?: number | undefined) => Promise<string
|
|
5
|
+
export declare const getStakingApy: ((asset: string, web3: Web3, blockNumber?: 'latest' | number, fromBlock?: number | undefined) => Promise<string>) & memoize.Memoized<(asset: string, web3: Web3, blockNumber?: 'latest' | number, fromBlock?: number | undefined) => Promise<string>>;
|
|
5
6
|
export declare const calculateInterestEarned: (principal: string, interest: string, type: string, apy?: boolean) => number;
|
|
6
7
|
export declare const calculateNetApy: ({ usedAssets, assetsData, isMorpho }: {
|
|
7
8
|
usedAssets: MMUsedAssets;
|
package/esm/staking/staking.js
CHANGED
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import Dec from 'decimal.js';
|
|
11
|
+
import memoize from 'memoizee';
|
|
11
12
|
import { CbEthContract, LidoContract, PotContract, REthContract, wstETHContract, } from '../contracts';
|
|
12
13
|
import { NetworkNumber } from '../types/common';
|
|
13
14
|
import { BLOCKS_IN_A_YEAR, SECONDS_PER_YEAR, AVG_BLOCK_TIME } from '../constants';
|
|
@@ -104,14 +105,10 @@ const getApyFromDfsApi = (asset) => __awaiter(void 0, void 0, void 0, function*
|
|
|
104
105
|
if (!res.ok)
|
|
105
106
|
throw new Error(`Failed to fetch APY for ${asset}`);
|
|
106
107
|
const data = yield res.json();
|
|
107
|
-
// if our server returns apr, transform it into apy
|
|
108
|
-
if (['weETH'].includes(asset)) {
|
|
109
|
-
return aprToApy(data.apy);
|
|
110
|
-
}
|
|
111
108
|
return String(data.apy);
|
|
112
109
|
});
|
|
113
110
|
export const STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS'];
|
|
114
|
-
export const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefined) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
+
export const getStakingApy = memoize((asset, web3, blockNumber = 'latest', fromBlock = undefined) => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
112
|
try {
|
|
116
113
|
if (asset === 'stETH' || asset === 'wstETH')
|
|
117
114
|
return yield getStETHApy(web3, fromBlock, blockNumber);
|
|
@@ -144,7 +141,7 @@ export const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = u
|
|
|
144
141
|
console.error(`Failed to fetch APY for ${asset}`);
|
|
145
142
|
}
|
|
146
143
|
return '0';
|
|
147
|
-
});
|
|
144
|
+
}), { promise: true, maxAge: 2 * 60 * 1000 });
|
|
148
145
|
export const calculateInterestEarned = (principal, interest, type, apy = false) => {
|
|
149
146
|
let interval = 1;
|
|
150
147
|
if (+interest === 0)
|
package/esm/types/aave.d.ts
CHANGED
|
@@ -229,6 +229,10 @@ export interface AaveV3AggregatedPositionData {
|
|
|
229
229
|
leveragedAsset?: string;
|
|
230
230
|
leveragedLsdAssetRatio?: string;
|
|
231
231
|
liquidationPrice?: string;
|
|
232
|
+
minCollRatio?: string;
|
|
233
|
+
collLiquidationRatio?: string;
|
|
234
|
+
healthRatio?: string;
|
|
235
|
+
healthLiquidationRatio?: string;
|
|
232
236
|
}
|
|
233
237
|
export interface AaveHelperCommon {
|
|
234
238
|
usedAssets: any;
|
package/esm/types/compound.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ export interface CompoundAggregatedPositionData {
|
|
|
96
96
|
minRatio: string;
|
|
97
97
|
debtTooLow: boolean;
|
|
98
98
|
minDebt: string;
|
|
99
|
+
minCollRatio: string;
|
|
100
|
+
collLiquidationRatio: string;
|
|
99
101
|
}
|
|
100
102
|
export interface CompoundPositionData extends MMPositionData {
|
|
101
103
|
ratio: string;
|
package/esm/types/curveUsd.d.ts
CHANGED
package/esm/types/euler.d.ts
CHANGED
package/esm/types/fluid.d.ts
CHANGED
|
@@ -240,6 +240,8 @@ export interface FluidAggregatedVaultData {
|
|
|
240
240
|
leveragedAsset?: string;
|
|
241
241
|
liquidationPrice?: string;
|
|
242
242
|
leveragedLsdAssetRatio?: string;
|
|
243
|
+
minCollRatio?: string;
|
|
244
|
+
collLiquidationRatio?: string;
|
|
243
245
|
}
|
|
244
246
|
export interface BaseFluidVaultData {
|
|
245
247
|
owner: string;
|
|
@@ -122,6 +122,8 @@ export interface MorphoBlueAggregatedPositionData {
|
|
|
122
122
|
leveragedAsset?: string;
|
|
123
123
|
leveragedLsdAssetRatio?: string;
|
|
124
124
|
liquidationPrice?: string;
|
|
125
|
+
minCollRatio?: string;
|
|
126
|
+
collLiquidationRatio?: string;
|
|
125
127
|
}
|
|
126
128
|
export interface MorphoBluePositionData {
|
|
127
129
|
usedAssets: MMUsedAssets;
|
package/esm/types/spark.d.ts
CHANGED
|
@@ -97,6 +97,10 @@ export interface SparkAggregatedPositionData {
|
|
|
97
97
|
leveragedAsset?: string;
|
|
98
98
|
leveragedLsdAssetRatio?: string;
|
|
99
99
|
liquidationPrice?: string;
|
|
100
|
+
minCollRatio: string;
|
|
101
|
+
collLiquidationRatio: string;
|
|
102
|
+
healthRatio: string;
|
|
103
|
+
healthLiquidationRatio: string;
|
|
100
104
|
}
|
|
101
105
|
export interface SparkPositionData extends MMPositionData {
|
|
102
106
|
ratio: string;
|
package/package.json
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./cjs/index.js",
|
|
6
|
-
"module": "./esm/index.js",
|
|
7
|
-
"types": "./esm/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
-
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
-
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
-
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
-
"lint": "eslint src/ --fix",
|
|
14
|
-
"lint-check": "eslint src/",
|
|
15
|
-
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
-
"test": "mocha tests/*",
|
|
17
|
-
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
-
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
-
"build-test": "npm run build && npm run test",
|
|
20
|
-
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
-
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@defisaver/tokens": "^1.5.57",
|
|
27
|
-
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
-
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
-
"@types/lodash": "^4.17.15",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@
|
|
37
|
-
"@types/
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@defisaver/positions-sdk",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"types": "./esm/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
+
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
+
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
+
"lint": "eslint src/ --fix",
|
|
14
|
+
"lint-check": "eslint src/",
|
|
15
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
+
"test": "mocha tests/*",
|
|
17
|
+
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
+
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
+
"build-test": "npm run build && npm run test",
|
|
20
|
+
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@defisaver/tokens": "^1.5.57",
|
|
27
|
+
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
+
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
+
"@types/lodash": "^4.17.15",
|
|
30
|
+
"@types/memoizee": "^0.4.12",
|
|
31
|
+
"decimal.js": "^10.4.3",
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
|
+
"memoizee": "^0.4.17"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
37
|
+
"@types/chai": "^5.0.0",
|
|
38
|
+
"@types/mocha": "^10.0.9",
|
|
39
|
+
"@types/web3": "^1.0.20",
|
|
40
|
+
"chai": "^4.3.8",
|
|
41
|
+
"dotenv": "^16.3.1",
|
|
42
|
+
"eslint": "^8.49.0",
|
|
43
|
+
"eslint-plugin-import": "^2.31.0",
|
|
44
|
+
"mocha": "^10.2.0",
|
|
45
|
+
"nock": "^14.0.0",
|
|
46
|
+
"ts-node": "^10.9.2",
|
|
47
|
+
"typechain": "^8.3.1",
|
|
48
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
49
|
+
"typescript": "^5.2.2"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"web3": "^1.10.2"
|
|
53
|
+
}
|
|
54
|
+
}
|