@defisaver/positions-sdk 2.1.161-portfolio-api-dev → 2.1.161-portfolio-api-1-dev
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/portfolio/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
2
|
-
import { PortfolioPositionsData } from '../types';
|
|
2
|
+
import { PortfolioMarketsData, PortfolioPositionsData } from '../types';
|
|
3
3
|
export declare function getPortfolioData(provider: EthereumProvider, network: NetworkNumber, defaultProvider: EthereumProvider, addresses: EthAddress[], isSim?: boolean): Promise<{
|
|
4
4
|
positions: PortfolioPositionsData;
|
|
5
5
|
stakingPositions: any;
|
|
6
6
|
rewardsData: any;
|
|
7
|
-
markets:
|
|
7
|
+
markets: PortfolioMarketsData;
|
|
8
8
|
}>;
|
|
9
9
|
export * from './discovery';
|
package/cjs/types/portfolio.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
-
import { AaveV4AccountData, AaveV4SpokesType } from './aaveV4';
|
|
1
|
+
import { AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { AaveV4AccountData, AaveV4SpokeData, AaveV4SpokesType } from './aaveV4';
|
|
3
3
|
import { EthAddress } from './common';
|
|
4
|
-
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
|
-
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
4
|
+
import { CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
|
+
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
6
6
|
import { FluidVaultData } from './fluid';
|
|
7
7
|
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import {
|
|
8
|
+
import { LiquityV2MarketData } from './liquityV2';
|
|
9
|
+
import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
9
10
|
import { CdpData } from './maker';
|
|
10
|
-
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
11
|
-
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
12
|
-
import { SparkPositionData, SparkVersions } from './spark';
|
|
11
|
+
import { MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { MorphoMidnightMarketInfo, MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
|
+
import { SparkMarketsData, SparkPositionData, SparkVersions } from './spark';
|
|
13
14
|
export interface PortfolioProtocolData<T> {
|
|
14
15
|
error: string;
|
|
15
16
|
data: T | null;
|
|
@@ -59,3 +60,17 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
59
60
|
export interface PortfolioPositionsData {
|
|
60
61
|
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
61
62
|
}
|
|
63
|
+
/** The `markets` getPortfolioData returns: every market it read, by protocol, keyed by market or spoke. */
|
|
64
|
+
export interface PortfolioMarketsData {
|
|
65
|
+
morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
|
|
66
|
+
morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
|
|
67
|
+
compoundV3MarketsData: Record<string, CompoundV3MarketsData>;
|
|
68
|
+
sparkMarketsData: Record<string, SparkMarketsData>;
|
|
69
|
+
aaveV3MarketsData: Record<string, AaveV3MarketData>;
|
|
70
|
+
aaveV2MarketsData: Record<string, AaveV2MarketData>;
|
|
71
|
+
compoundV2MarketsData: Record<string, CompoundV2MarketsData>;
|
|
72
|
+
crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData>;
|
|
73
|
+
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
74
|
+
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
75
|
+
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
76
|
+
}
|
package/esm/portfolio/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
|
|
2
|
-
import { PortfolioPositionsData } from '../types';
|
|
2
|
+
import { PortfolioMarketsData, PortfolioPositionsData } from '../types';
|
|
3
3
|
export declare function getPortfolioData(provider: EthereumProvider, network: NetworkNumber, defaultProvider: EthereumProvider, addresses: EthAddress[], isSim?: boolean): Promise<{
|
|
4
4
|
positions: PortfolioPositionsData;
|
|
5
5
|
stakingPositions: any;
|
|
6
6
|
rewardsData: any;
|
|
7
|
-
markets:
|
|
7
|
+
markets: PortfolioMarketsData;
|
|
8
8
|
}>;
|
|
9
9
|
export * from './discovery';
|
package/esm/types/portfolio.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
-
import { AaveV4AccountData, AaveV4SpokesType } from './aaveV4';
|
|
1
|
+
import { AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { AaveV4AccountData, AaveV4SpokeData, AaveV4SpokesType } from './aaveV4';
|
|
3
3
|
import { EthAddress } from './common';
|
|
4
|
-
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
|
-
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
4
|
+
import { CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
|
+
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
6
6
|
import { FluidVaultData } from './fluid';
|
|
7
7
|
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import {
|
|
8
|
+
import { LiquityV2MarketData } from './liquityV2';
|
|
9
|
+
import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
9
10
|
import { CdpData } from './maker';
|
|
10
|
-
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
11
|
-
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
12
|
-
import { SparkPositionData, SparkVersions } from './spark';
|
|
11
|
+
import { MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { MorphoMidnightMarketInfo, MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
|
+
import { SparkMarketsData, SparkPositionData, SparkVersions } from './spark';
|
|
13
14
|
export interface PortfolioProtocolData<T> {
|
|
14
15
|
error: string;
|
|
15
16
|
data: T | null;
|
|
@@ -59,3 +60,17 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
59
60
|
export interface PortfolioPositionsData {
|
|
60
61
|
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
61
62
|
}
|
|
63
|
+
/** The `markets` getPortfolioData returns: every market it read, by protocol, keyed by market or spoke. */
|
|
64
|
+
export interface PortfolioMarketsData {
|
|
65
|
+
morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
|
|
66
|
+
morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
|
|
67
|
+
compoundV3MarketsData: Record<string, CompoundV3MarketsData>;
|
|
68
|
+
sparkMarketsData: Record<string, SparkMarketsData>;
|
|
69
|
+
aaveV3MarketsData: Record<string, AaveV3MarketData>;
|
|
70
|
+
aaveV2MarketsData: Record<string, AaveV2MarketData>;
|
|
71
|
+
compoundV2MarketsData: Record<string, CompoundV2MarketsData>;
|
|
72
|
+
crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData>;
|
|
73
|
+
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
74
|
+
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
75
|
+
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
76
|
+
}
|
package/package.json
CHANGED
package/src/portfolio/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
LlamaLendGlobalMarketData,
|
|
28
28
|
MorphoBlueMarketInfo,
|
|
29
29
|
MorphoMidnightMarketInfo,
|
|
30
|
+
PortfolioMarketsData,
|
|
30
31
|
PortfolioPositionsData,
|
|
31
32
|
SparkMarketsData,
|
|
32
33
|
} from '../types';
|
|
@@ -55,7 +56,7 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
55
56
|
positions: PortfolioPositionsData;
|
|
56
57
|
stakingPositions: any;
|
|
57
58
|
rewardsData: any;
|
|
58
|
-
markets:
|
|
59
|
+
markets: PortfolioMarketsData;
|
|
59
60
|
}> {
|
|
60
61
|
const isMainnet = network === NetworkNumber.Eth;
|
|
61
62
|
const isFluidSupported = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Plasma].includes(network);
|
|
@@ -96,7 +97,7 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
|
|
|
96
97
|
const liquityV2MarketsData: Record<string, LiquityV2MarketData> = {};
|
|
97
98
|
const aaveV4SpokesData: Record<string, AaveV4SpokeData> = {};
|
|
98
99
|
|
|
99
|
-
const markets = {
|
|
100
|
+
const markets: PortfolioMarketsData = {
|
|
100
101
|
morphoMarketsData,
|
|
101
102
|
morphoMidnightMarketsData,
|
|
102
103
|
compoundV3MarketsData,
|
package/src/types/portfolio.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions,
|
|
3
|
+
} from './aave';
|
|
4
|
+
import { AaveV4AccountData, AaveV4SpokeData, AaveV4SpokesType } from './aaveV4';
|
|
3
5
|
import { EthAddress } from './common';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
+
import {
|
|
7
|
+
CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions,
|
|
8
|
+
} from './compound';
|
|
9
|
+
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
6
10
|
import { FluidVaultData } from './fluid';
|
|
7
11
|
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
-
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
12
|
+
import { LiquityV2MarketData, LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
13
|
+
import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
14
|
import { CdpData } from './maker';
|
|
11
|
-
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
-
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
|
-
import { SparkPositionData, SparkVersions } from './spark';
|
|
15
|
+
import { MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
16
|
+
import { MorphoMidnightMarketInfo, MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
17
|
+
import { SparkMarketsData, SparkPositionData, SparkVersions } from './spark';
|
|
14
18
|
|
|
15
19
|
export interface PortfolioProtocolData<T> {
|
|
16
20
|
error: string,
|
|
@@ -62,4 +66,19 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
62
66
|
|
|
63
67
|
export interface PortfolioPositionsData {
|
|
64
68
|
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The `markets` getPortfolioData returns: every market it read, by protocol, keyed by market or spoke. */
|
|
72
|
+
export interface PortfolioMarketsData {
|
|
73
|
+
morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
|
|
74
|
+
morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
|
|
75
|
+
compoundV3MarketsData: Record<string, CompoundV3MarketsData>;
|
|
76
|
+
sparkMarketsData: Record<string, SparkMarketsData>;
|
|
77
|
+
aaveV3MarketsData: Record<string, AaveV3MarketData>;
|
|
78
|
+
aaveV2MarketsData: Record<string, AaveV2MarketData>;
|
|
79
|
+
compoundV2MarketsData: Record<string, CompoundV2MarketsData>;
|
|
80
|
+
crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData>;
|
|
81
|
+
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
82
|
+
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
83
|
+
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
65
84
|
}
|