lighter-rust 0.2.0

A comprehensive Rust SDK for the Lighter trading platform with async/await, WebSocket support, and Ethereum wallet integration
/*
 *
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document:
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderBookDetail {
    #[serde(rename = "symbol")]
    pub symbol: String,
    #[serde(rename = "market_id")]
    pub market_id: i32,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "taker_fee")]
    pub taker_fee: String,
    #[serde(rename = "maker_fee")]
    pub maker_fee: String,
    #[serde(rename = "liquidation_fee")]
    pub liquidation_fee: String,
    #[serde(rename = "min_base_amount")]
    pub min_base_amount: String,
    #[serde(rename = "min_quote_amount")]
    pub min_quote_amount: String,
    #[serde(rename = "supported_size_decimals")]
    pub supported_size_decimals: i32,
    #[serde(rename = "supported_price_decimals")]
    pub supported_price_decimals: i32,
    #[serde(rename = "supported_quote_decimals")]
    pub supported_quote_decimals: i32,
    #[serde(rename = "size_decimals")]
    pub size_decimals: i32,
    #[serde(rename = "price_decimals")]
    pub price_decimals: i32,
    #[serde(rename = "quote_multiplier")]
    pub quote_multiplier: i64,
    #[serde(rename = "default_initial_margin_fraction")]
    pub default_initial_margin_fraction: i32,
    #[serde(rename = "min_initial_margin_fraction")]
    pub min_initial_margin_fraction: i32,
    #[serde(rename = "maintenance_margin_fraction")]
    pub maintenance_margin_fraction: i32,
    #[serde(rename = "closeout_margin_fraction")]
    pub closeout_margin_fraction: i32,
    #[serde(rename = "last_trade_price")]
    pub last_trade_price: f64,
    #[serde(rename = "daily_trades_count")]
    pub daily_trades_count: i64,
    #[serde(rename = "daily_base_token_volume")]
    pub daily_base_token_volume: f64,
    #[serde(rename = "daily_quote_token_volume")]
    pub daily_quote_token_volume: f64,
    #[serde(rename = "daily_price_low")]
    pub daily_price_low: f64,
    #[serde(rename = "daily_price_high")]
    pub daily_price_high: f64,
    #[serde(rename = "daily_price_change")]
    pub daily_price_change: f64,
    #[serde(rename = "open_interest")]
    pub open_interest: f64,
    #[serde(rename = "daily_chart")]
    pub daily_chart: std::collections::HashMap<String, f64>,
}

impl OrderBookDetail {
    pub fn new(
        symbol: String,
        market_id: i32,
        status: Status,
        taker_fee: String,
        maker_fee: String,
        liquidation_fee: String,
        min_base_amount: String,
        min_quote_amount: String,
        supported_size_decimals: i32,
        supported_price_decimals: i32,
        supported_quote_decimals: i32,
        size_decimals: i32,
        price_decimals: i32,
        quote_multiplier: i64,
        default_initial_margin_fraction: i32,
        min_initial_margin_fraction: i32,
        maintenance_margin_fraction: i32,
        closeout_margin_fraction: i32,
        last_trade_price: f64,
        daily_trades_count: i64,
        daily_base_token_volume: f64,
        daily_quote_token_volume: f64,
        daily_price_low: f64,
        daily_price_high: f64,
        daily_price_change: f64,
        open_interest: f64,
        daily_chart: std::collections::HashMap<String, f64>,
    ) -> OrderBookDetail {
        OrderBookDetail {
            symbol,
            market_id,
            status,
            taker_fee,
            maker_fee,
            liquidation_fee,
            min_base_amount,
            min_quote_amount,
            supported_size_decimals,
            supported_price_decimals,
            supported_quote_decimals,
            size_decimals,
            price_decimals,
            quote_multiplier,
            default_initial_margin_fraction,
            min_initial_margin_fraction,
            maintenance_margin_fraction,
            closeout_margin_fraction,
            last_trade_price,
            daily_trades_count,
            daily_base_token_volume,
            daily_quote_token_volume,
            daily_price_low,
            daily_price_high,
            daily_price_change,
            open_interest,
            daily_chart,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "inactive")]
    Inactive,
    #[serde(rename = "frozen")]
    Frozen,
    #[serde(rename = "active")]
    Active,
}

impl Default for Status {
    fn default() -> Status {
        Self::Inactive
    }
}