ethereal_rust_sdk 0.1.6

Trading client for Ethereal exchange
Documentation
/*
 * Ethereal Exchange API
 *
 * Ethereal HTTP API for real-time trading, order management, and market data access.
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TradeStreamMessageDataInner : Single trade object.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TradeStreamMessageDataInner {
    /// Unique identifier of the trade.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Trade price as a decimal string.
    #[serde(rename = "price")]
    pub price: String,
    /// Filled quantity as a decimal string.
    #[serde(rename = "filled")]
    pub filled: String,
    #[serde(rename = "takerSide")]
    pub taker_side: models::TakerSide,
    /// Timestamp of when the trade was created (ms since Unix Epoch).
    #[serde(rename = "createdAt")]
    pub created_at: f64,
}

impl TradeStreamMessageDataInner {
    /// Single trade object.
    pub fn new(
        id: uuid::Uuid,
        price: String,
        filled: String,
        taker_side: models::TakerSide,
        created_at: f64,
    ) -> TradeStreamMessageDataInner {
        TradeStreamMessageDataInner {
            id,
            price,
            filled,
            taker_side,
            created_at,
        }
    }
}