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 TransactionUserTransaction {
    /// 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>,
    /// 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 = "sender")]
    pub sender: 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 = "sequence_number")]
    pub sequence_number: 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 = "max_gas_amount")]
    pub max_gas_amount: 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_unit_price")]
    pub gas_unit_price: 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 = "expiration_timestamp_secs")]
    pub expiration_timestamp_secs: String,
    #[serde(rename = "payload")]
    pub payload: Box<models::TransactionPayload>,
    #[serde(rename = "signature", skip_serializing_if = "Option::is_none")]
    pub signature: Option<Box<models::TransactionSignature>>,
    /// Events generated by the transaction
    #[serde(rename = "events")]
    pub events: Vec<models::Event>,
    /// 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 = "type")]
    pub r#type: Type,
}

impl TransactionUserTransaction {
    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>, sender: String, sequence_number: String, max_gas_amount: String, gas_unit_price: String, expiration_timestamp_secs: String, payload: models::TransactionPayload, events: Vec<models::Event>, timestamp: String, r#type: Type) -> TransactionUserTransaction {
        TransactionUserTransaction {
            version,
            hash,
            state_change_hash,
            event_root_hash,
            state_checkpoint_hash: None,
            gas_used,
            success,
            vm_status,
            accumulator_root_hash,
            changes,
            sender,
            sequence_number,
            max_gas_amount,
            gas_unit_price,
            expiration_timestamp_secs,
            payload: Box::new(payload),
            signature: None,
            events,
            timestamp,
            r#type,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "user_transaction")]
    UserTransaction,
}

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