1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* 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,
}
}
}