px-core 0.1.7

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
18
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "lowercase")]
pub enum CryptoPriceSource {
    Binance,
    Chainlink,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct CryptoPrice {
    pub symbol: String,
    pub timestamp: u64,
    pub value: f64,
    pub source: CryptoPriceSource,
}