@defisaver/positions-sdk 2.1.41 → 2.1.43-aave-v4-dev-1
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 +64 -64
- package/cjs/aaveV4/index.d.ts +7 -0
- package/cjs/aaveV4/index.js +99 -0
- package/cjs/config/contracts.d.ts +1069 -0
- package/cjs/config/contracts.js +9 -0
- package/cjs/contracts.d.ts +18265 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/markets/aaveV4/index.d.ts +6 -0
- package/cjs/markets/aaveV4/index.js +20 -0
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/savings/morphoVaults/index.js +17 -17
- package/cjs/savings/morphoVaults/options.js +2 -2
- package/cjs/types/aaveV4.d.ts +73 -0
- package/cjs/types/aaveV4.js +11 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/esm/aaveV4/index.d.ts +7 -0
- package/esm/aaveV4/index.js +90 -0
- package/esm/config/contracts.d.ts +1069 -0
- package/esm/config/contracts.js +8 -0
- package/esm/contracts.d.ts +18265 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/markets/aaveV4/index.d.ts +6 -0
- package/esm/markets/aaveV4/index.js +15 -0
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/savings/morphoVaults/index.js +17 -17
- package/esm/savings/morphoVaults/options.js +2 -2
- package/esm/types/aaveV4.d.ts +73 -0
- package/esm/types/aaveV4.js +8 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/package.json +48 -48
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +625 -625
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/aaveV4/index.ts +90 -0
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/ethena.ts +61 -61
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1303 -1295
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +174 -172
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1800 -1800
- package/src/helpers/aaveHelpers/index.ts +187 -187
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +158 -158
- package/src/index.ts +51 -49
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +703 -703
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +118 -118
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/aaveV4/index.ts +17 -0
- package/src/markets/compound/index.ts +243 -243
- package/src/markets/compound/marketsAssets.ts +97 -97
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2900 -2900
- package/src/markets/index.ts +26 -25
- package/src/markets/liquityV2/index.ts +102 -102
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +971 -971
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +85 -85
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +598 -598
- package/src/savings/index.ts +95 -95
- package/src/savings/makerDsr/index.ts +53 -53
- package/src/savings/makerDsr/options.ts +9 -9
- package/src/savings/morphoVaults/index.ts +80 -80
- package/src/savings/morphoVaults/options.ts +193 -193
- package/src/savings/skyOptions/index.ts +95 -95
- package/src/savings/skyOptions/options.ts +10 -10
- package/src/savings/sparkSavingsVaults/index.ts +60 -60
- package/src/savings/sparkSavingsVaults/options.ts +35 -35
- package/src/savings/yearnV3Vaults/index.ts +61 -61
- package/src/savings/yearnV3Vaults/options.ts +55 -55
- package/src/savings/yearnVaults/index.ts +73 -73
- package/src/savings/yearnVaults/options.ts +32 -32
- package/src/services/priceService.ts +278 -278
- package/src/services/utils.ts +115 -115
- package/src/services/viem.ts +34 -34
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +458 -458
- package/src/staking/eligibility.ts +53 -53
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +186 -186
- package/src/types/aave.ts +196 -196
- package/src/types/aaveV4.ts +81 -0
- package/src/types/claiming.ts +114 -114
- package/src/types/common.ts +107 -107
- package/src/types/compound.ts +144 -144
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +483 -483
- package/src/types/index.ts +16 -15
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +200 -200
- package/src/types/portfolio.ts +60 -60
- package/src/types/savings/index.ts +23 -23
- package/src/types/savings/makerDsr.ts +13 -13
- package/src/types/savings/morphoVaults.ts +32 -32
- package/src/types/savings/sky.ts +14 -14
- package/src/types/savings/sparkSavingsVaults.ts +15 -15
- package/src/types/savings/yearnV3Vaults.ts +17 -17
- package/src/types/savings/yearnVaults.ts +14 -14
- package/src/types/spark.ts +134 -134
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
package/.mocharc.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"require": "ts-node/register",
|
|
3
|
-
"extension": ["ts"]
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"require": "ts-node/register",
|
|
3
|
+
"extension": ["ts"]
|
|
4
|
+
}
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v20.17.0
|
|
1
|
+
v20.17.0
|
package/README.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# DeFi Saver Positions SDK
|
|
2
|
-
|
|
3
|
-
Supported protocols:
|
|
4
|
-
- [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
|
|
5
|
-
- [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
|
|
6
|
-
- [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
|
|
7
|
-
- [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
|
|
8
|
-
- [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
|
|
9
|
-
- [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
|
|
10
|
-
- [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
|
|
11
|
-
- [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
|
|
12
|
-
|
|
13
|
-
## Setup
|
|
14
|
-
Supported Node version is v10.
|
|
15
|
-
|
|
16
|
-
- run `npm install` (first time)
|
|
17
|
-
- run `npm run build`
|
|
18
|
-
|
|
19
|
-
`build` command will generate contracts and build ejs and esm folders
|
|
20
|
-
|
|
21
|
-
## How to use
|
|
22
|
-
[All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
|
|
23
|
-
|
|
24
|
-
This is a Compound V3 example, and every other protocol is similar
|
|
25
|
-
```js
|
|
26
|
-
import { compoundV3 } from '@defisaver/positions-sdk';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// every protocol has market data and user data getters
|
|
30
|
-
const {
|
|
31
|
-
getCompoundV3MarketsData,
|
|
32
|
-
getCompoundV3AccountData,
|
|
33
|
-
} = compoundV3;
|
|
34
|
-
|
|
35
|
-
const provider = 'Your RPC provider';
|
|
36
|
-
|
|
37
|
-
const user = '0x123...';
|
|
38
|
-
|
|
39
|
-
const { assetsData } = await getCompoundV3MarketsData(
|
|
40
|
-
provider, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
|
|
41
|
-
1, // network
|
|
42
|
-
selectedMarket, // market object like in /src/markets/compound/index.ts
|
|
43
|
-
provider, // this must be mainnet rpc - used for getting prices onchain and calculating apys
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const userData = await getCompoundV3AccountData(
|
|
47
|
-
provider,
|
|
48
|
-
1, // network
|
|
49
|
-
userAddress, // EOA or DSProxy
|
|
50
|
-
'', // proxy address of the user, or just empty string if checking for EOA
|
|
51
|
-
{
|
|
52
|
-
selectedMarket, // market object as in /src/markets/compound/index.ts
|
|
53
|
-
assetsData,
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
|
|
59
|
-
|
|
60
|
-
## Testing
|
|
61
|
-
|
|
62
|
-
`npm run test` - Run all tests
|
|
63
|
-
|
|
64
|
-
`npm run test-single --name=your_test_name` - Run single test for specified name e.g. for MyTest.js test name is MyTest
|
|
1
|
+
# DeFi Saver Positions SDK
|
|
2
|
+
|
|
3
|
+
Supported protocols:
|
|
4
|
+
- [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
|
|
5
|
+
- [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
|
|
6
|
+
- [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
|
|
7
|
+
- [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
|
|
8
|
+
- [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
|
|
9
|
+
- [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
|
|
10
|
+
- [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
|
|
11
|
+
- [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
Supported Node version is v10.
|
|
15
|
+
|
|
16
|
+
- run `npm install` (first time)
|
|
17
|
+
- run `npm run build`
|
|
18
|
+
|
|
19
|
+
`build` command will generate contracts and build ejs and esm folders
|
|
20
|
+
|
|
21
|
+
## How to use
|
|
22
|
+
[All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
|
|
23
|
+
|
|
24
|
+
This is a Compound V3 example, and every other protocol is similar
|
|
25
|
+
```js
|
|
26
|
+
import { compoundV3 } from '@defisaver/positions-sdk';
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// every protocol has market data and user data getters
|
|
30
|
+
const {
|
|
31
|
+
getCompoundV3MarketsData,
|
|
32
|
+
getCompoundV3AccountData,
|
|
33
|
+
} = compoundV3;
|
|
34
|
+
|
|
35
|
+
const provider = 'Your RPC provider';
|
|
36
|
+
|
|
37
|
+
const user = '0x123...';
|
|
38
|
+
|
|
39
|
+
const { assetsData } = await getCompoundV3MarketsData(
|
|
40
|
+
provider, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
|
|
41
|
+
1, // network
|
|
42
|
+
selectedMarket, // market object like in /src/markets/compound/index.ts
|
|
43
|
+
provider, // this must be mainnet rpc - used for getting prices onchain and calculating apys
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const userData = await getCompoundV3AccountData(
|
|
47
|
+
provider,
|
|
48
|
+
1, // network
|
|
49
|
+
userAddress, // EOA or DSProxy
|
|
50
|
+
'', // proxy address of the user, or just empty string if checking for EOA
|
|
51
|
+
{
|
|
52
|
+
selectedMarket, // market object as in /src/markets/compound/index.ts
|
|
53
|
+
assetsData,
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
|
|
59
|
+
|
|
60
|
+
## Testing
|
|
61
|
+
|
|
62
|
+
`npm run test` - Run all tests
|
|
63
|
+
|
|
64
|
+
`npm run test-single --name=your_test_name` - Run single test for specified name e.g. for MyTest.js test name is MyTest
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Client } from 'viem';
|
|
2
|
+
import { AaveV4SpokeData, AaveV4SpokeInfo } from '../types';
|
|
3
|
+
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
4
|
+
export declare function _getAaveV4SpokeData(provider: Client, network: NetworkNumber, market: AaveV4SpokeInfo, blockNumber?: 'latest' | number): Promise<AaveV4SpokeData>;
|
|
5
|
+
export declare function getAaveV4SpokeData(provider: EthereumProvider, network: NetworkNumber, spoke: AaveV4SpokeInfo, blockNumber?: 'latest' | number): Promise<AaveV4SpokeData>;
|
|
6
|
+
export declare function _getAaveV4AccountData(provider: Client, network: NetworkNumber, marketData: AaveV4SpokeData, address: EthAddress, blockNumber?: 'latest' | number): Promise<any>;
|
|
7
|
+
export declare function getAaveV4AccountData(provider: EthereumProvider, network: NetworkNumber, marketData: AaveV4SpokeData, address: EthAddress, blockNumber?: 'latest' | number): Promise<any>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports._getAaveV4SpokeData = _getAaveV4SpokeData;
|
|
16
|
+
exports.getAaveV4SpokeData = getAaveV4SpokeData;
|
|
17
|
+
exports._getAaveV4AccountData = _getAaveV4AccountData;
|
|
18
|
+
exports.getAaveV4AccountData = getAaveV4AccountData;
|
|
19
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
20
|
+
const tokens_1 = require("@defisaver/tokens");
|
|
21
|
+
const viem_1 = require("../services/viem");
|
|
22
|
+
const contracts_1 = require("../contracts");
|
|
23
|
+
const fetchHubData = (viewContract, hubAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const hubData = yield viewContract.read.getHubAllAssetsData([hubAddress]);
|
|
25
|
+
console.log('hubData', hubData);
|
|
26
|
+
return {
|
|
27
|
+
assets: hubData.reduce((acc, assetOnChainData) => {
|
|
28
|
+
acc[assetOnChainData.assetId] = {
|
|
29
|
+
assetId: assetOnChainData.assetId,
|
|
30
|
+
drawnRate: assetOnChainData.drawnRate,
|
|
31
|
+
};
|
|
32
|
+
return acc;
|
|
33
|
+
}, {}),
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const formatReserveAsset = (reserveAsset, hubAsset, oracleDecimals) => {
|
|
37
|
+
const assetInfo = (0, tokens_1.getAssetInfoByAddress)(reserveAsset.underlying);
|
|
38
|
+
return ({
|
|
39
|
+
symbol: assetInfo.symbol,
|
|
40
|
+
underlying: reserveAsset.underlying,
|
|
41
|
+
hub: reserveAsset.hub,
|
|
42
|
+
assetId: reserveAsset.assetId,
|
|
43
|
+
paused: reserveAsset.paused,
|
|
44
|
+
frozen: reserveAsset.frozen,
|
|
45
|
+
borrowable: reserveAsset.borrowable,
|
|
46
|
+
collateralRisk: new decimal_js_1.default(reserveAsset.collateralRisk).div(10000).toNumber(),
|
|
47
|
+
collateralFactor: new decimal_js_1.default(reserveAsset.collateralFactor).div(10000).toNumber(),
|
|
48
|
+
liquidationFee: new decimal_js_1.default(reserveAsset.liquidationFee).div(10000).toNumber(),
|
|
49
|
+
price: new decimal_js_1.default(reserveAsset.price).div(new decimal_js_1.default(10).pow(oracleDecimals)).toString(),
|
|
50
|
+
totalSupplied: (0, tokens_1.assetAmountInEth)(reserveAsset.totalSupplied.toString(), assetInfo.symbol),
|
|
51
|
+
totalDrawn: (0, tokens_1.assetAmountInEth)(reserveAsset.totalDrawn.toString(), assetInfo.symbol),
|
|
52
|
+
totalPremium: (0, tokens_1.assetAmountInEth)(reserveAsset.totalPremium.toString(), assetInfo.symbol),
|
|
53
|
+
totalDebt: (0, tokens_1.assetAmountInEth)(reserveAsset.totalDebt.toString(), assetInfo.symbol),
|
|
54
|
+
supplyCap: (0, tokens_1.assetAmountInEth)(reserveAsset.supplyCap.toString(), assetInfo.symbol),
|
|
55
|
+
borrowCap: (0, tokens_1.assetAmountInEth)(reserveAsset.borrowCap.toString(), assetInfo.symbol),
|
|
56
|
+
spokeActive: reserveAsset.spokeActive,
|
|
57
|
+
spokePaused: reserveAsset.spokePaused,
|
|
58
|
+
drawnRate: new decimal_js_1.default(hubAsset.drawnRate).div(new decimal_js_1.default(10).pow(27)).toString(),
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
function _getAaveV4SpokeData(provider_1, network_1, market_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* (provider, network, market, blockNumber = 'latest') {
|
|
63
|
+
const viewContract = (0, contracts_1.AaveV4ViewContractViem)(provider, network, blockNumber);
|
|
64
|
+
const hubsData = {};
|
|
65
|
+
const [spokeData] = yield Promise.all([
|
|
66
|
+
viewContract.read.getSpokeDataFull([market.address]),
|
|
67
|
+
...market.hubs.map((hubAddress) => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
hubsData[hubAddress] = yield fetchHubData(viewContract, hubAddress);
|
|
69
|
+
})),
|
|
70
|
+
]);
|
|
71
|
+
const reserveAssetsArray = spokeData[1].map((reserveAssetOnChain) => formatReserveAsset(reserveAssetOnChain, hubsData[reserveAssetOnChain.hub].assets[reserveAssetOnChain.assetId], +spokeData[0].oracleDecimals.toString()));
|
|
72
|
+
return {
|
|
73
|
+
assetsData: reserveAssetsArray.reduce((acc, reserveAsset) => {
|
|
74
|
+
acc[reserveAsset.symbol] = reserveAsset;
|
|
75
|
+
return acc;
|
|
76
|
+
}, {}),
|
|
77
|
+
oracle: spokeData[0].oracle,
|
|
78
|
+
oracleDecimals: +spokeData[0].oracleDecimals.toString(),
|
|
79
|
+
address: market.address,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function getAaveV4SpokeData(provider_1, network_1, spoke_1) {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* (provider, network, spoke, blockNumber = 'latest') {
|
|
85
|
+
return _getAaveV4SpokeData((0, viem_1.getViemProvider)(provider, network), network, spoke, blockNumber);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function _getAaveV4AccountData(provider_1, network_1, marketData_1, address_1) {
|
|
89
|
+
return __awaiter(this, arguments, void 0, function* (provider, network, marketData, address, blockNumber = 'latest') {
|
|
90
|
+
const viewContract = (0, contracts_1.AaveV4ViewContractViem)(provider, network, blockNumber);
|
|
91
|
+
const loanData = yield viewContract.read.getLoanData([marketData.address, address]);
|
|
92
|
+
console.log('loanData', loanData);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function getAaveV4AccountData(provider_1, network_1, marketData_1, address_1) {
|
|
96
|
+
return __awaiter(this, arguments, void 0, function* (provider, network, marketData, address, blockNumber = 'latest') {
|
|
97
|
+
return _getAaveV4AccountData((0, viem_1.getViemProvider)(provider, network), network, marketData, address, blockNumber);
|
|
98
|
+
});
|
|
99
|
+
}
|