rosetta_types/coin_change.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/// CoinChange : CoinChange is used to represent a change in state of a some coin identified by a coin_identifier. This object is part of the Operation model and must be populated for UTXO-based blockchains. Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate this model).
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct CoinChange {
15 #[serde(rename = "coin_identifier")]
16 pub coin_identifier: crate::CoinIdentifier,
17 #[serde(rename = "coin_action")]
18 pub coin_action: crate::CoinAction,
19}
20
21impl CoinChange {
22 /// CoinChange is used to represent a change in state of a some coin identified by a coin_identifier. This object is part of the Operation model and must be populated for UTXO-based blockchains. Coincidentally, this abstraction of UTXOs allows for supporting both account-based transfers and UTXO-based transfers on the same blockchain (when a transfer is account-based, don't populate this model).
23 pub fn new(
24 coin_identifier: crate::CoinIdentifier,
25 coin_action: crate::CoinAction,
26 ) -> CoinChange {
27 CoinChange {
28 coin_identifier,
29 coin_action,
30 }
31 }
32}