rosetta_types/
amount.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Amount : Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct Amount {
15    /// Value of the transaction in atomic units represented as an arbitrary-sized signed integer.  For example, 1 BTC would be represented by a value of 100000000.
16    #[serde(rename = "value")]
17    pub value: String,
18    #[serde(rename = "currency")]
19    pub currency: crate::Currency,
20    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
21    pub metadata: Option<serde_json::Value>,
22}
23
24impl Amount {
25    /// Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
26    pub fn new(value: String, currency: crate::Currency) -> Amount {
27        Amount {
28            value,
29            currency,
30            metadata: None,
31        }
32    }
33}