rosetta-types 0.4.0

Rosetta API request and response structs.
Documentation
/*
 * Rosetta
 *
 * Build Once. Integrate Your Blockchain Everywhere.
 *
 * The version of the OpenAPI document: 1.4.13
 *
 * Generated by: https://openapi-generator.tech
 */

/// Transaction : Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.

#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct Transaction {
    #[serde(rename = "transaction_identifier")]
    pub transaction_identifier: crate::TransactionIdentifier,
    #[serde(rename = "operations")]
    pub operations: Vec<crate::Operation>,
    #[serde(
        rename = "related_transactions",
        skip_serializing_if = "Option::is_none"
    )]
    pub related_transactions: Option<Vec<crate::RelatedTransaction>>,
    /// Transactions that are related to other transactions (like a cross-shard transaction) should include the tranaction_identifier of these transactions in the metadata.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
}

impl Transaction {
    /// Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.
    pub fn new(
        transaction_identifier: crate::TransactionIdentifier,
        operations: Vec<crate::Operation>,
    ) -> Transaction {
        Transaction {
            transaction_identifier,
            operations,
            related_transactions: None,
            metadata: None,
        }
    }
}