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 Block {
    #[serde(rename = "commitment")]
    pub commitment: String,
    #[serde(rename = "height")]
    pub height: i64,
    #[serde(rename = "state_root")]
    pub state_root: String,
    #[serde(rename = "priority_operations")]
    pub priority_operations: i32,
    #[serde(rename = "on_chain_l2_operations")]
    pub on_chain_l2_operations: i32,
    #[serde(rename = "pending_on_chain_operations_pub_data")]
    pub pending_on_chain_operations_pub_data: String,
    #[serde(rename = "committed_tx_hash")]
    pub committed_tx_hash: String,
    #[serde(rename = "committed_at")]
    pub committed_at: i64,
    #[serde(rename = "verified_tx_hash")]
    pub verified_tx_hash: String,
    #[serde(rename = "verified_at")]
    pub verified_at: i64,
    #[serde(rename = "txs")]
    pub txs: Vec<models::Tx>,
    #[serde(rename = "status")]
    pub status: i64,
    #[serde(rename = "size")]
    pub size: i32,
}

impl Block {
    pub fn new(
        commitment: String,
        height: i64,
        state_root: String,
        priority_operations: i32,
        on_chain_l2_operations: i32,
        pending_on_chain_operations_pub_data: String,
        committed_tx_hash: String,
        committed_at: i64,
        verified_tx_hash: String,
        verified_at: i64,
        txs: Vec<models::Tx>,
        status: i64,
        size: i32,
    ) -> Block {
        Block {
            commitment,
            height,
            state_root,
            priority_operations,
            on_chain_l2_operations,
            pending_on_chain_operations_pub_data,
            committed_tx_hash,
            committed_at,
            verified_tx_hash,
            verified_at,
            txs,
            status,
            size,
        }
    }
}