algonaut_algod 0.6.0

API endpoint for algod operations.
Documentation
/*
 * Algod REST API.
 *
 * API endpoint for algod operations.
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: contact@algorand.com
 * Generated by: https://openapi-generator.tech
 */

use algonaut_model::transaction::ApiSignedTransaction;

/// DryrunRequest : Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct DryrunRequest {
    #[serde(rename = "accounts")]
    pub accounts: Vec<crate::models::Account>,
    #[serde(rename = "apps")]
    pub apps: Vec<crate::models::Application>,
    /// LatestTimestamp is available to some TEAL scripts. Defaults to the latest confirmed timestamp this algod is attached to.
    #[serde(rename = "latest-timestamp")]
    pub latest_timestamp: u64,
    /// ProtocolVersion specifies a specific version string to operate under, otherwise whatever the current protocol of the network this algod is running in.
    #[serde(rename = "protocol-version")]
    pub protocol_version: String,
    /// Round is available to some TEAL scripts. Defaults to the current round on the network this algod is attached to.
    #[serde(rename = "round")]
    pub round: u64,
    #[serde(rename = "sources")]
    pub sources: Vec<crate::models::DryrunSource>,
    #[serde(rename = "txns")]
    pub txns: Vec<ApiSignedTransaction>,
}

impl DryrunRequest {
    /// Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information.
    pub fn new(
        accounts: Vec<crate::models::Account>,
        apps: Vec<crate::models::Application>,
        latest_timestamp: u64,
        protocol_version: String,
        round: u64,
        sources: Vec<crate::models::DryrunSource>,
        txns: Vec<ApiSignedTransaction>,
    ) -> DryrunRequest {
        DryrunRequest {
            accounts,
            apps,
            latest_timestamp,
            protocol_version,
            round,
            sources,
            txns,
        }
    }
}