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 LiquidationInfo {
    #[serde(rename = "positions")]
    pub positions: Vec<models::AccountPosition>,
    #[serde(rename = "risk_info_before")]
    pub risk_info_before: Box<models::RiskInfo>,
    #[serde(rename = "risk_info_after")]
    pub risk_info_after: Box<models::RiskInfo>,
    #[serde(rename = "mark_prices")]
    pub mark_prices: std::collections::HashMap<String, f64>,
}

impl LiquidationInfo {
    pub fn new(
        positions: Vec<models::AccountPosition>,
        risk_info_before: models::RiskInfo,
        risk_info_after: models::RiskInfo,
        mark_prices: std::collections::HashMap<String, f64>,
    ) -> LiquidationInfo {
        LiquidationInfo {
            positions,
            risk_info_before: Box::new(risk_info_before),
            risk_info_after: Box::new(risk_info_after),
            mark_prices,
        }
    }
}