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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionBlockMetadataTransaction {
    /// 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 = "version")]
    pub version: String,
    #[serde(rename = "hash")]
    pub hash: String,
    #[serde(rename = "state_change_hash")]
    pub state_change_hash: String,
    #[serde(rename = "event_root_hash")]
    pub event_root_hash: String,
    #[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
    pub state_checkpoint_hash: Option<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 = "gas_used")]
    pub gas_used: String,
    /// Whether the transaction was successful
    #[serde(rename = "success")]
    pub success: bool,
    /// The VM status of the transaction, can tell useful information in a failure
    #[serde(rename = "vm_status")]
    pub vm_status: String,
    #[serde(rename = "accumulator_root_hash")]
    pub accumulator_root_hash: String,
    /// Final state of resources changed by the transaction
    #[serde(rename = "changes")]
    pub changes: Vec<models::WriteSetChange>,
    #[serde(rename = "id")]
    pub id: 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 = "epoch")]
    pub epoch: 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 = "round")]
    pub round: String,
    /// The events emitted at the block creation
    #[serde(rename = "events")]
    pub events: Vec<models::Event>,
    /// Previous block votes
    #[serde(rename = "previous_block_votes_bitvec")]
    pub previous_block_votes_bitvec: Vec<i32>,
    /// A hex encoded 32 byte Aptos account address.  This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.  For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1. 
    #[serde(rename = "proposer")]
    pub proposer: String,
    /// The indices of the proposers who failed to propose
    #[serde(rename = "failed_proposer_indices")]
    pub failed_proposer_indices: Vec<i32>,
    /// 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 = "timestamp")]
    pub timestamp: String,
    #[serde(rename = "block_metadata_extension", skip_serializing_if = "Option::is_none")]
    pub block_metadata_extension: Option<Box<models::BlockMetadataTransactionBlockMetadataExtension>>,
    #[serde(rename = "type")]
    pub r#type: Type,
}

impl TransactionBlockMetadataTransaction {
    pub fn new(version: String, hash: String, state_change_hash: String, event_root_hash: String, gas_used: String, success: bool, vm_status: String, accumulator_root_hash: String, changes: Vec<models::WriteSetChange>, id: String, epoch: String, round: String, events: Vec<models::Event>, previous_block_votes_bitvec: Vec<i32>, proposer: String, failed_proposer_indices: Vec<i32>, timestamp: String, r#type: Type) -> TransactionBlockMetadataTransaction {
        TransactionBlockMetadataTransaction {
            version,
            hash,
            state_change_hash,
            event_root_hash,
            state_checkpoint_hash: None,
            gas_used,
            success,
            vm_status,
            accumulator_root_hash,
            changes,
            id,
            epoch,
            round,
            events,
            previous_block_votes_bitvec,
            proposer,
            failed_proposer_indices,
            timestamp,
            block_metadata_extension: None,
            r#type,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "block_metadata_transaction")]
    BlockMetadataTransaction,
}

impl Default for Type {
    fn default() -> Type {
        Self::BlockMetadataTransaction
    }
}