px-core 0.3.0

Core traits, models, and errors for OpenPX prediction market SDK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

use super::{Event, Market, Series};

/// A market plus its parent event and series.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct MarketLineage {
    /// The market itself.
    pub market: Market,
    /// Parent event; `null` if the market is standalone or the parent is missing upstream.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event: Option<Event>,
    /// Parent series; `null` if the event is standalone or the parent is missing upstream.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub series: Option<Series>,
}