aptos-client-icp 0.0.1

The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
Documentation
/*
 * Aptos Node API
 *
 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
 *
 * The version of the OpenAPI document: 1.2.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Block : A Block with or without transactions  This contains the information about a transactions along with associated transactions if requested
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Block {
    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
    #[serde(rename = "block_height")]
    pub block_height: String,
    #[serde(rename = "block_hash")]
    pub block_hash: String,
    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
    #[serde(rename = "block_timestamp")]
    pub block_timestamp: String,
    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
    #[serde(rename = "first_version")]
    pub first_version: String,
    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
    #[serde(rename = "last_version")]
    pub last_version: String,
    /// The transactions in the block in sequential order
    #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
    pub transactions: Option<Vec<models::Transaction>>,
}

impl Block {
    /// A Block with or without transactions  This contains the information about a transactions along with associated transactions if requested
    pub fn new(block_height: String, block_hash: String, block_timestamp: String, first_version: String, last_version: String) -> Block {
        Block {
            block_height,
            block_hash,
            block_timestamp,
            first_version,
            last_version,
            transactions: None,
        }
    }
}