1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* 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,
}
}
}