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 EnrichedTx {
    #[serde(rename = "code")]
    pub code: i32,
    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(rename = "hash")]
    pub hash: String,
    #[serde(rename = "type")]
    pub r#type: i32,
    #[serde(rename = "info")]
    pub info: String,
    #[serde(rename = "event_info")]
    pub event_info: String,
    #[serde(rename = "status")]
    pub status: i64,
    #[serde(rename = "transaction_index")]
    pub transaction_index: i64,
    #[serde(rename = "l1_address")]
    pub l1_address: String,
    #[serde(rename = "account_index")]
    pub account_index: i64,
    #[serde(rename = "nonce")]
    pub nonce: i64,
    #[serde(rename = "expire_at")]
    pub expire_at: i64,
    #[serde(rename = "block_height")]
    pub block_height: i64,
    #[serde(rename = "queued_at")]
    pub queued_at: i64,
    #[serde(rename = "executed_at")]
    pub executed_at: i64,
    #[serde(rename = "sequence_index")]
    pub sequence_index: i64,
    #[serde(rename = "parent_hash")]
    pub parent_hash: String,
    #[serde(rename = "committed_at")]
    pub committed_at: i64,
    #[serde(rename = "verified_at")]
    pub verified_at: i64,
}

impl EnrichedTx {
    pub fn new(
        code: i32,
        hash: String,
        r#type: i32,
        info: String,
        event_info: String,
        status: i64,
        transaction_index: i64,
        l1_address: String,
        account_index: i64,
        nonce: i64,
        expire_at: i64,
        block_height: i64,
        queued_at: i64,
        executed_at: i64,
        sequence_index: i64,
        parent_hash: String,
        committed_at: i64,
        verified_at: i64,
    ) -> EnrichedTx {
        EnrichedTx {
            code,
            message: None,
            hash,
            r#type,
            info,
            event_info,
            status,
            transaction_index,
            l1_address,
            account_index,
            nonce,
            expire_at,
            block_height,
            queued_at,
            executed_at,
            sequence_index,
            parent_hash,
            committed_at,
            verified_at,
        }
    }
}