@defisaver/positions-sdk 0.0.45 → 0.0.47
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/cjs/aaveV2/index.js +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -0
- package/cjs/morphoAaveV2/index.js +1 -1
- package/cjs/setup.d.ts +1 -0
- package/cjs/setup.js +12 -0
- package/esm/aaveV2/index.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/morphoAaveV2/index.js +1 -1
- package/esm/setup.d.ts +1 -0
- package/esm/setup.js +7 -0
- package/package.json +2 -2
- package/src/aaveV2/index.ts +2 -2
- package/src/index.ts +2 -0
- package/src/morphoAaveV2/index.ts +2 -2
- package/src/setup.ts +8 -0
- package/src/types/morphoBlue.ts +1 -1
- package/yarn-error.log +0 -64
package/cjs/aaveV2/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const aave_1 = require("../markets/aave");
|
|
|
24
24
|
const aaveHelpers_1 = require("../helpers/aaveHelpers");
|
|
25
25
|
const priceService_1 = require("../services/priceService");
|
|
26
26
|
const getAaveV2MarketsData = (web3, network, selectedMarket, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const ethPrice = yield (0, priceService_1.getEthPrice)(
|
|
27
|
+
const ethPrice = yield (0, priceService_1.getEthPrice)(web3);
|
|
28
28
|
const _addresses = selectedMarket.assets.map(a => (0, tokens_1.getAssetInfo)((0, utils_1.ethToWeth)(a)).address);
|
|
29
29
|
const loanInfoContract = (0, contracts_1.AaveLoanInfoV2Contract)(web3, network);
|
|
30
30
|
const marketAddress = selectedMarket.providerAddress;
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.morphoBlue = exports.helpers = exports.markets = exports.moneymarket = exports.multicall = exports.staking = exports.exchange = exports.chickenBonds = exports.maker = exports.liquity = exports.curveUsd = exports.spark = exports.compoundV3 = exports.compoundV2 = exports.morphoAaveV3 = exports.morphoAaveV2 = exports.aaveV3 = exports.aaveV2 = void 0;
|
|
30
|
+
require("./setup");
|
|
30
31
|
const aaveV3 = __importStar(require("./aaveV3"));
|
|
31
32
|
exports.aaveV3 = aaveV3;
|
|
32
33
|
const morphoAaveV3 = __importStar(require("./morphoAaveV3"));
|
|
@@ -24,7 +24,7 @@ const aaveV3_1 = require("../aaveV3");
|
|
|
24
24
|
const aaveHelpers_1 = require("../helpers/aaveHelpers");
|
|
25
25
|
const priceService_1 = require("../services/priceService");
|
|
26
26
|
const getMorphoAaveV2MarketsData = (web3, network, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const ethPrice = yield (0, priceService_1.getEthPrice)(
|
|
27
|
+
const ethPrice = yield (0, priceService_1.getEthPrice)(web3);
|
|
28
28
|
const morphoAaveV2ViewContract = (0, contracts_1.MorphoAaveV2ViewContract)(web3, network);
|
|
29
29
|
const [contractData, morphoRewardsRes] = yield Promise.allSettled([
|
|
30
30
|
morphoAaveV2ViewContract.methods.getAllMarketsInfo().call(),
|
package/cjs/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/cjs/setup.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
7
|
+
decimal_js_1.default.set({
|
|
8
|
+
rounding: decimal_js_1.default.ROUND_DOWN,
|
|
9
|
+
toExpPos: 9e15,
|
|
10
|
+
toExpNeg: -9e15,
|
|
11
|
+
precision: 50,
|
|
12
|
+
});
|
package/esm/aaveV2/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { AAVE_V2 } from '../markets/aave';
|
|
|
18
18
|
import { aaveAnyGetAggregatedPositionData } from '../helpers/aaveHelpers';
|
|
19
19
|
import { getEthPrice } from '../services/priceService';
|
|
20
20
|
export const getAaveV2MarketsData = (web3, network, selectedMarket, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
const ethPrice = yield getEthPrice(
|
|
21
|
+
const ethPrice = yield getEthPrice(web3);
|
|
22
22
|
const _addresses = selectedMarket.assets.map(a => getAssetInfo(ethToWeth(a)).address);
|
|
23
23
|
const loanInfoContract = AaveLoanInfoV2Contract(web3, network);
|
|
24
24
|
const marketAddress = selectedMarket.providerAddress;
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { EMPTY_AAVE_DATA } from '../aaveV3';
|
|
|
18
18
|
import { aaveAnyGetAggregatedPositionData } from '../helpers/aaveHelpers';
|
|
19
19
|
import { getEthPrice } from '../services/priceService';
|
|
20
20
|
export const getMorphoAaveV2MarketsData = (web3, network, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
const ethPrice = yield getEthPrice(
|
|
21
|
+
const ethPrice = yield getEthPrice(web3);
|
|
22
22
|
const morphoAaveV2ViewContract = MorphoAaveV2ViewContract(web3, network);
|
|
23
23
|
const [contractData, morphoRewardsRes] = yield Promise.allSettled([
|
|
24
24
|
morphoAaveV2ViewContract.methods.getAllMarketsInfo().call(),
|
package/esm/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/setup.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@defisaver/tokens": "^1.5.
|
|
22
|
+
"@defisaver/tokens": "^1.5.7",
|
|
23
23
|
"@ethersproject/bignumber": "^5.7.0",
|
|
24
24
|
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
25
25
|
"decimal.js": "^10.4.3"
|
package/src/aaveV2/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { aaveAnyGetAggregatedPositionData } from '../helpers/aaveHelpers';
|
|
|
17
17
|
import { getEthPrice } from '../services/priceService';
|
|
18
18
|
|
|
19
19
|
export const getAaveV2MarketsData = async (web3: Web3, network: NetworkNumber, selectedMarket: AaveMarketInfo, mainnetWeb3: Web3) => {
|
|
20
|
-
const ethPrice = await getEthPrice(
|
|
20
|
+
const ethPrice = await getEthPrice(web3);
|
|
21
21
|
const _addresses = selectedMarket.assets.map(a => getAssetInfo(ethToWeth(a)).address);
|
|
22
22
|
const loanInfoContract = AaveLoanInfoV2Contract(web3, network);
|
|
23
23
|
const marketAddress = selectedMarket.providerAddress;
|
|
@@ -224,4 +224,4 @@ export const getAaveV2FullPositionData = async (web3: Web3, network: NetworkNumb
|
|
|
224
224
|
const marketData = await getAaveV2MarketsData(web3, network, market, mainnetWeb3);
|
|
225
225
|
const positionData = await getAaveV2AccountData(web3, network, address, marketData.assetsData, market);
|
|
226
226
|
return positionData;
|
|
227
|
-
};
|
|
227
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { aaveAnyGetAggregatedPositionData } from '../helpers/aaveHelpers';
|
|
|
17
17
|
import { getEthPrice } from '../services/priceService';
|
|
18
18
|
|
|
19
19
|
export const getMorphoAaveV2MarketsData = async (web3: Web3, network: NetworkNumber, mainnetWeb3: Web3): Promise<MorphoAaveV2MarketData> => {
|
|
20
|
-
const ethPrice = await getEthPrice(
|
|
20
|
+
const ethPrice = await getEthPrice(web3);
|
|
21
21
|
const morphoAaveV2ViewContract = MorphoAaveV2ViewContract(web3, network);
|
|
22
22
|
|
|
23
23
|
const [contractData, morphoRewardsRes] = await Promise.allSettled([
|
|
@@ -253,4 +253,4 @@ export const getMorphoAaveV2FullPositionData = async (web3: Web3, network: Netwo
|
|
|
253
253
|
const marketData = await getMorphoAaveV2MarketsData(web3, network, mainnetWeb3);
|
|
254
254
|
const positionData = await getMorphoAaveV2AccountData(web3, network, address, marketData.assetsData);
|
|
255
255
|
return positionData;
|
|
256
|
-
};
|
|
256
|
+
};
|
package/src/setup.ts
ADDED
package/src/types/morphoBlue.ts
CHANGED
package/yarn-error.log
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
Arguments:
|
|
2
|
-
/Users/stefan/.nvm/versions/node/v14.19.0/bin/node /usr/local/Cellar/yarn/1.22.19/libexec/bin/yarn.js
|
|
3
|
-
|
|
4
|
-
PATH:
|
|
5
|
-
/Users/stefan/.nvm/versions/node/v14.19.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Users/stefan/WebstormProjects/defisaver-positions-sdk/node_modules/.bin:/usr/local/go
|
|
6
|
-
|
|
7
|
-
Yarn version:
|
|
8
|
-
1.22.19
|
|
9
|
-
|
|
10
|
-
Node version:
|
|
11
|
-
14.19.0
|
|
12
|
-
|
|
13
|
-
Platform:
|
|
14
|
-
darwin x64
|
|
15
|
-
|
|
16
|
-
Trace:
|
|
17
|
-
Error: incorrect data check
|
|
18
|
-
at Zlib.zlibOnError [as onerror] (zlib.js:187:17)
|
|
19
|
-
|
|
20
|
-
npm manifest:
|
|
21
|
-
{
|
|
22
|
-
"name": "defisaver-positions-sdk",
|
|
23
|
-
"version": "0.0.1",
|
|
24
|
-
"description": "",
|
|
25
|
-
"main": "./cjs/index.js",
|
|
26
|
-
"module": "./esm/src/index.js",
|
|
27
|
-
"types": "./esm/src/index.d.ts",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build:esm": "rm -rf esm && tsc -p tsconfig.json",
|
|
30
|
-
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
31
|
-
"build": "npm run build:cjs && npm run build:esm",
|
|
32
|
-
"dev": "tsc -p tsconfig.cjs.json --watch",
|
|
33
|
-
"lint": "eslint src/ --fix",
|
|
34
|
-
"generate-contracts": "node scripts/generateContracts.js",
|
|
35
|
-
"test": "mocha tests/*",
|
|
36
|
-
"build-test": "npm run build && mocha tests/*"
|
|
37
|
-
},
|
|
38
|
-
"keywords": [],
|
|
39
|
-
"author": "",
|
|
40
|
-
"license": "ISC",
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@defisaver/tokens": "^1.4.56",
|
|
43
|
-
"decimal.js": "^10.4.3"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@defisaver/eslint-config": "^1.0.1",
|
|
47
|
-
"chai": "^4.3.8",
|
|
48
|
-
"dotenv": "^16.3.1",
|
|
49
|
-
"eslint": "^8.49.0",
|
|
50
|
-
"mocha": "^10.2.0",
|
|
51
|
-
"typechain": "^8.3.1",
|
|
52
|
-
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
53
|
-
"typescript": "^5.2.2"
|
|
54
|
-
},
|
|
55
|
-
"peerDependencies": {
|
|
56
|
-
"web3": "^1.10.2"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
yarn manifest:
|
|
61
|
-
No manifest
|
|
62
|
-
|
|
63
|
-
Lockfile:
|
|
64
|
-
No lockfile
|