import { Portfolio } from '.'; import { HistoricalValue } from '../historical-value'; import { AssetAmountValue, Coin } from '../market'; import { PercentageOutOfOne } from '../types'; export interface PortfolioCurrentValue extends Portfolio { /** Current total value of the portfolio */ currentValue: number; } export interface PortfolioStatus extends PortfolioCurrentValue { /** Following fields will be calculated when recipe data is retrived */ currentValue: number; /** Total gain/loss since the last interval. */ gainLoss: number; /** A percentage out of 1 */ percentageChange: PercentageOutOfOne; /** Historical values in the portfolio. */ valueHistory: HistoricalValue[]; /** Current amount/value pairs per asset. */ perAssetStatuses: PortfolioAssetStatus[]; } export interface PortfolioAssetStatus extends AssetAmountValue { /** Previous amount of the asset in the past interval */ previousAmount: number; /** Previous value of the asset in the past interval */ previousValue: number; /** The gain/loss of the value in magnitude */ gainLoss: number; /** The change in percentage between the old and new */ percentageChange: PercentageOutOfOne; /** Information about the coin, if present. */ coin?: Coin; } /** MultiplePortfolioStatuses maps IDs to portfolio status objects, along with a total portfolio status. */ export interface MultiplePortfolioStatuses { totalPortfolio: PortfolioStatus; perPortfolio: PortfolioStatus[]; }