fireblocks_sdk/models/
vault_asset.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct VaultAsset {
16    #[serde(rename = "id")]
17    pub id: String,
18    /// The total wallet balance.  Total = available + pending + lockedAmount +
19    /// frozen - In EOS this value includes the network balance, self staking
20    /// and pending refund.  - For all other coins it is the balance as it
21    /// appears on the blockchain.
22    #[serde(rename = "total")]
23    pub total: String,
24    /// Deprecated - replaced by \"total\"
25    #[serde(rename = "balance", skip_serializing_if = "Option::is_none")]
26    pub balance: Option<String>,
27    /// Funds available for transfer. Equals: \"total\" minus \"lockedAmount\"
28    /// minus \"frozen\" minus \"pending\"
29    #[serde(rename = "available")]
30    pub available: String,
31    /// The cumulative balance of all transactions pending to be cleared
32    #[serde(rename = "pending")]
33    pub pending: String,
34    /// The cumulative frozen balance
35    #[serde(rename = "frozen")]
36    pub frozen: String,
37    /// Funds in outgoing transactions that are not yet published to the network
38    #[serde(rename = "lockedAmount")]
39    pub locked_amount: String,
40    /// Deprecated
41    #[serde(rename = "staked", skip_serializing_if = "Option::is_none")]
42    pub staked: Option<String>,
43    /// Deprecated
44    #[serde(rename = "totalStakedCPU", skip_serializing_if = "Option::is_none")]
45    pub total_staked_cpu: Option<f64>,
46    /// Deprecated
47    #[serde(rename = "totalStakedNetwork", skip_serializing_if = "Option::is_none")]
48    pub total_staked_network: Option<String>,
49    /// Deprecated
50    #[serde(rename = "selfStakedCPU", skip_serializing_if = "Option::is_none")]
51    pub self_staked_cpu: Option<String>,
52    /// Deprecated
53    #[serde(rename = "selfStakedNetwork", skip_serializing_if = "Option::is_none")]
54    pub self_staked_network: Option<String>,
55    /// Deprecated
56    #[serde(rename = "pendingRefundCPU", skip_serializing_if = "Option::is_none")]
57    pub pending_refund_cpu: Option<String>,
58    /// Deprecated
59    #[serde(
60        rename = "pendingRefundNetwork",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub pending_refund_network: Option<String>,
64    /// The height (number) of the block of the balance
65    #[serde(rename = "blockHeight", skip_serializing_if = "Option::is_none")]
66    pub block_height: Option<String>,
67    /// The hash of the block of the balance
68    #[serde(rename = "blockHash", skip_serializing_if = "Option::is_none")]
69    pub block_hash: Option<String>,
70    #[serde(rename = "rewardsInfo", skip_serializing_if = "Option::is_none")]
71    pub rewards_info: Option<models::RewardsInfo>,
72}
73
74impl VaultAsset {
75    pub fn new(
76        id: String,
77        total: String,
78        available: String,
79        pending: String,
80        frozen: String,
81        locked_amount: String,
82    ) -> VaultAsset {
83        VaultAsset {
84            id,
85            total,
86            balance: None,
87            available,
88            pending,
89            frozen,
90            locked_amount,
91            staked: None,
92            total_staked_cpu: None,
93            total_staked_network: None,
94            self_staked_cpu: None,
95            self_staked_network: None,
96            pending_refund_cpu: None,
97            pending_refund_network: None,
98            block_height: None,
99            block_hash: None,
100            rewards_info: None,
101        }
102    }
103}