polymarket-bindings 0.1.1

API bindings and normalized models for the Polymarket Rust SDK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde::Deserialize;

use crate::de::deserialize_decimalish;

#[derive(Debug, Deserialize)]
pub struct MidpointResponse {
    #[serde(deserialize_with = "deserialize_decimalish")]
    pub mid: Option<String>,
}

impl MidpointResponse {
    pub fn into_mid(self) -> Result<String, String> {
        self.mid.ok_or_else(|| "missing midpoint".to_string())
    }
}