coinbase_mesh/models/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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Amount : Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Amount {
17 /// 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.
18 #[serde(rename = "value")]
19 pub value: String,
20 #[serde(rename = "currency")]
21 pub currency: Box<models::Currency>,
22 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
23 pub metadata: Option<serde_json::Value>,
24}
25
26impl Amount {
27 /// Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.
28 pub fn new(value: String, currency: models::Currency) -> Amount {
29 Amount {
30 value,
31 currency: Box::new(currency),
32 metadata: None,
33 }
34 }
35}
36