@defisaver/positions-sdk 2.1.22-dev-savings-3 → 2.1.22-dev-savings-4
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/savings/index.d.ts +2 -2
- package/cjs/savings/index.js +3 -6
- package/cjs/savings/morphoVaults/index.js +1 -0
- package/cjs/savings/yearnVaults/index.js +1 -0
- package/cjs/types/savings/index.d.ts +2 -8
- package/esm/savings/index.d.ts +2 -2
- package/esm/savings/index.js +3 -6
- package/esm/savings/morphoVaults/index.js +1 -0
- package/esm/savings/yearnVaults/index.js +1 -0
- package/esm/types/savings/index.d.ts +2 -8
- package/package.json +1 -1
- package/src/savings/index.ts +3 -6
- package/src/savings/morphoVaults/index.ts +1 -0
- package/src/savings/yearnVaults/index.ts +1 -0
- package/src/types/savings/index.ts +2 -8
package/cjs/savings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MorphoVaultType, YearnVaultType } from '../types';
|
|
2
2
|
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
3
3
|
import * as morphoVaults from './morphoVaults';
|
|
4
4
|
import * as yearnVaults from './yearnVaults';
|
|
5
5
|
export { morphoVaults, yearnVaults, };
|
|
6
|
-
export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<
|
|
6
|
+
export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<Partial<Record<MorphoVaultType | YearnVaultType, import("../types").SavingsVaultData>>>;
|
package/cjs/savings/index.js
CHANGED
|
@@ -50,20 +50,17 @@ exports.yearnVaults = yearnVaults;
|
|
|
50
50
|
const getSavingsData = (provider, network, accounts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
51
|
const morphoVaultsList = Object.keys(morphoVaults.morphoVaultsOptions.MORPHO_VAULTS);
|
|
52
52
|
const yearnVaultsList = Object.keys(yearnVaults.yearnVaultsOptions.YEARN_VAULTS);
|
|
53
|
-
const savingsData = {
|
|
54
|
-
morphoVaults: {},
|
|
55
|
-
yearnVaults: {},
|
|
56
|
-
};
|
|
53
|
+
const savingsData = {};
|
|
57
54
|
yield Promise.all([
|
|
58
55
|
...morphoVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
56
|
const vault = morphoVaults.morphoVaultsOptions.getMorphoVault(vaultKey);
|
|
60
57
|
const data = yield morphoVaults.getMorphoVaultData(provider, network, vault, accounts);
|
|
61
|
-
savingsData
|
|
58
|
+
savingsData[vaultKey] = data;
|
|
62
59
|
})),
|
|
63
60
|
...yearnVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
61
|
const vault = yearnVaults.yearnVaultsOptions.getYearnVault(vaultKey);
|
|
65
62
|
const data = yield yearnVaults.getYearnVaultData(provider, network, vault, accounts);
|
|
66
|
-
savingsData
|
|
63
|
+
savingsData[vaultKey] = data;
|
|
67
64
|
})),
|
|
68
65
|
]);
|
|
69
66
|
return savingsData;
|
|
@@ -8,12 +8,6 @@ export interface SavingsVaultData {
|
|
|
8
8
|
liquidity: string;
|
|
9
9
|
supplied: Record<EthAddress, string>;
|
|
10
10
|
asset: string;
|
|
11
|
+
optionType: string;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
morphoVaults: {
|
|
14
|
-
[key in MorphoVaultType]?: SavingsVaultData;
|
|
15
|
-
};
|
|
16
|
-
yearnVaults: {
|
|
17
|
-
[key in YearnVaultType]?: SavingsVaultData;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
13
|
+
export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType, SavingsVaultData>>;
|
package/esm/savings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MorphoVaultType, YearnVaultType } from '../types';
|
|
2
2
|
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
3
3
|
import * as morphoVaults from './morphoVaults';
|
|
4
4
|
import * as yearnVaults from './yearnVaults';
|
|
5
5
|
export { morphoVaults, yearnVaults, };
|
|
6
|
-
export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<
|
|
6
|
+
export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<Partial<Record<MorphoVaultType | YearnVaultType, import("../types").SavingsVaultData>>>;
|
package/esm/savings/index.js
CHANGED
|
@@ -13,20 +13,17 @@ export { morphoVaults, yearnVaults, };
|
|
|
13
13
|
export const getSavingsData = (provider, network, accounts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
const morphoVaultsList = Object.keys(morphoVaults.morphoVaultsOptions.MORPHO_VAULTS);
|
|
15
15
|
const yearnVaultsList = Object.keys(yearnVaults.yearnVaultsOptions.YEARN_VAULTS);
|
|
16
|
-
const savingsData = {
|
|
17
|
-
morphoVaults: {},
|
|
18
|
-
yearnVaults: {},
|
|
19
|
-
};
|
|
16
|
+
const savingsData = {};
|
|
20
17
|
yield Promise.all([
|
|
21
18
|
...morphoVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
19
|
const vault = morphoVaults.morphoVaultsOptions.getMorphoVault(vaultKey);
|
|
23
20
|
const data = yield morphoVaults.getMorphoVaultData(provider, network, vault, accounts);
|
|
24
|
-
savingsData
|
|
21
|
+
savingsData[vaultKey] = data;
|
|
25
22
|
})),
|
|
26
23
|
...yearnVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
24
|
const vault = yearnVaults.yearnVaultsOptions.getYearnVault(vaultKey);
|
|
28
25
|
const data = yield yearnVaults.getYearnVaultData(provider, network, vault, accounts);
|
|
29
|
-
savingsData
|
|
26
|
+
savingsData[vaultKey] = data;
|
|
30
27
|
})),
|
|
31
28
|
]);
|
|
32
29
|
return savingsData;
|
|
@@ -61,6 +61,7 @@ export const _getMorphoVaultData = (provider, network, morphoVault, accounts) =>
|
|
|
61
61
|
supplied,
|
|
62
62
|
liquidity,
|
|
63
63
|
asset: morphoVault.asset,
|
|
64
|
+
optionType: morphoVault.type,
|
|
64
65
|
};
|
|
65
66
|
});
|
|
66
67
|
export function getMorphoVaultData(provider, network, morphoVault, accounts) {
|
|
@@ -8,12 +8,6 @@ export interface SavingsVaultData {
|
|
|
8
8
|
liquidity: string;
|
|
9
9
|
supplied: Record<EthAddress, string>;
|
|
10
10
|
asset: string;
|
|
11
|
+
optionType: string;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
morphoVaults: {
|
|
14
|
-
[key in MorphoVaultType]?: SavingsVaultData;
|
|
15
|
-
};
|
|
16
|
-
yearnVaults: {
|
|
17
|
-
[key in YearnVaultType]?: SavingsVaultData;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
13
|
+
export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType, SavingsVaultData>>;
|
package/package.json
CHANGED
package/src/savings/index.ts
CHANGED
|
@@ -16,21 +16,18 @@ export const getSavingsData = async (
|
|
|
16
16
|
const morphoVaultsList = Object.keys(morphoVaults.morphoVaultsOptions.MORPHO_VAULTS) as MorphoVaultType[];
|
|
17
17
|
const yearnVaultsList = Object.keys(yearnVaults.yearnVaultsOptions.YEARN_VAULTS) as YearnVaultType[];
|
|
18
18
|
|
|
19
|
-
const savingsData: SavingsData = {
|
|
20
|
-
morphoVaults: {},
|
|
21
|
-
yearnVaults: {},
|
|
22
|
-
};
|
|
19
|
+
const savingsData: SavingsData = {};
|
|
23
20
|
|
|
24
21
|
await Promise.all([
|
|
25
22
|
...morphoVaultsList.map(async (vaultKey) => {
|
|
26
23
|
const vault = morphoVaults.morphoVaultsOptions.getMorphoVault(vaultKey);
|
|
27
24
|
const data = await morphoVaults.getMorphoVaultData(provider, network, vault, accounts);
|
|
28
|
-
savingsData
|
|
25
|
+
savingsData[vaultKey] = data;
|
|
29
26
|
}),
|
|
30
27
|
...yearnVaultsList.map(async (vaultKey) => {
|
|
31
28
|
const vault = yearnVaults.yearnVaultsOptions.getYearnVault(vaultKey);
|
|
32
29
|
const data = await yearnVaults.getYearnVaultData(provider, network, vault, accounts);
|
|
33
|
-
savingsData
|
|
30
|
+
savingsData[vaultKey] = data;
|
|
34
31
|
}),
|
|
35
32
|
]);
|
|
36
33
|
|
|
@@ -10,13 +10,7 @@ export interface SavingsVaultData {
|
|
|
10
10
|
liquidity: string,
|
|
11
11
|
supplied: Record<EthAddress, string>,
|
|
12
12
|
asset: string,
|
|
13
|
+
optionType: string,
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
-
morphoVaults: {
|
|
17
|
-
[key in MorphoVaultType]?: SavingsVaultData;
|
|
18
|
-
};
|
|
19
|
-
yearnVaults: {
|
|
20
|
-
[key in YearnVaultType]?: SavingsVaultData;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
16
|
+
export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType, SavingsVaultData>>;
|