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_encoding::deserialize_bytes;

/// TealValue : Represents a TEAL value.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TealValue {
    /// \\[tb\\] bytes value.
    #[serde(
        rename = "bytes",
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "deserialize_bytes"
    )]
    pub bytes: Vec<u8>,
    /// \\[tt\\] value type. Value `1` refers to **bytes**, value `2` refers to **uint**
    #[serde(rename = "type")]
    pub value_type: u64,
    /// \\[ui\\] uint value.
    #[serde(rename = "uint")]
    pub uint: u64,
}

impl TealValue {
    /// Represents a TEAL value.
    pub fn new(bytes: Vec<u8>, value_type: u64, uint: u64) -> TealValue {
        TealValue {
            bytes,
            value_type,
            uint,
        }
    }
}