arvo-api 0.5.0

The types of Arvo's engine API, generated from its protobuf contract. Messages only, no transport, so it builds for WebAssembly.
Documentation
// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PortfolioName {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The move between the two most recent valuations.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeView {
    #[prost(string, tag = "1")]
    pub from: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub to: ::prost::alloc::string::String,
    #[prost(double, tag = "3")]
    pub absolute: f64,
    #[prost(double, optional, tag = "4")]
    pub percent: ::core::option::Option<f64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HoldingView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    /// `None` when the source reported money without units — a collective
    /// trust in a 401(k) does exactly that.
    #[prost(double, optional, tag = "2")]
    pub quantity: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "3")]
    pub price: ::core::option::Option<f64>,
    #[prost(double, tag = "4")]
    pub market_value: f64,
    #[prost(double, optional, tag = "5")]
    pub cost_basis: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "6")]
    pub unrealized: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "7")]
    pub unrealized_pct: ::core::option::Option<f64>,
    #[prost(double, tag = "8")]
    pub weight: f64,
    /// "statement", "last_close" or "face" — so a price nobody verified is
    /// visibly different from one that came off a statement.
    #[prost(string, tag = "9")]
    pub priced_by: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportView {
    /// Role → the column heading used for it.
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<NamedText>,
    #[prost(string, repeated, tag = "2")]
    pub ignored: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint32, tag = "3")]
    pub rows_imported: u32,
    #[prost(string, repeated, tag = "4")]
    pub rows_skipped: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Cost basis came from a per-share column multiplied by quantity.
    #[prost(bool, tag = "5")]
    pub cost_basis_derived: bool,
}
/// A column and what it was read as.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NamedText {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioLibraryView {
    /// Shown so somebody with no holdings file knows where to put one.
    #[prost(string, tag = "1")]
    pub directory: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub portfolios: ::prost::alloc::vec::Vec<PortfolioView>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioView {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub as_of: ::prost::alloc::string::String,
    #[prost(double, tag = "3")]
    pub total_value: f64,
    #[prost(double, optional, tag = "4")]
    pub total_cost: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "5")]
    pub unrealized: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "6")]
    pub unrealized_pct: ::core::option::Option<f64>,
    /// How many holdings reported no cost basis. Normal for a 401(k).
    #[prost(uint32, tag = "7")]
    pub without_cost_basis: u32,
    #[prost(double, tag = "8")]
    pub cash: f64,
    #[prost(message, repeated, tag = "9")]
    pub holdings: ::prost::alloc::vec::Vec<HoldingView>,
    #[prost(string, repeated, tag = "10")]
    pub unpriced: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Value on every day this portfolio has been looked at. A holdings file
    /// says what you hold now; almost everything interesting is a change, and
    /// a single export cannot express one.
    #[prost(message, repeated, tag = "11")]
    pub value_history: ::prost::alloc::vec::Vec<ValuePoint>,
    /// `None` until a portfolio has been valued on two different days.
    #[prost(message, optional, tag = "12")]
    pub change: ::core::option::Option<ChangeView>,
    /// Holdings over their band or over the default ceiling, as sentences
    /// saying what to trim (#27). See `arvo_portfolio::bands`.
    #[prost(string, repeated, tag = "13")]
    pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// How the file was read. Shown, not hidden: an importer that guessed a
    /// column wrong produces a portfolio that looks entirely plausible, and
    /// this is the only thing that would reveal it.
    #[prost(message, optional, tag = "14")]
    pub import: ::core::option::Option<ImportView>,
    /// The vendor whose sync wrote this file (`robinhood`), or `None` for a
    /// file the person exported themselves. Says whether a refresh is a
    /// button or a matter of replacing the file.
    #[prost(string, optional, tag = "15")]
    pub source: ::core::option::Option<::prost::alloc::string::String>,
    /// Simulated money — a broker's paper account. Never added to a real
    /// total: one blended number would report a paper gain as wealth.
    #[prost(bool, tag = "16")]
    pub paper: bool,
    /// When the file was last written, as the file system says: the last
    /// sync for a synced account, the last export for an exported one.
    #[prost(string, optional, tag = "17")]
    pub refreshed_at: ::core::option::Option<::prost::alloc::string::String>,
}
/// One day on the value line.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ValuePoint {
    /// Seconds since the epoch, the same convention every other chart series
    /// uses. One convention rather than two: the portfolio chart reuses the
    /// research chart component, and a date string here against epoch seconds
    /// there is a mismatch the compiler cannot see and the reader meets as a
    /// deserialisation error at runtime.
    #[prost(int64, tag = "1")]
    pub time: i64,
    #[prost(double, tag = "2")]
    pub value: f64,
}