fireblocks_sdk/models/delegation.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 Delegation {
16 /// The unique identifier of the staking position
17 #[serde(rename = "id")]
18 pub id: String,
19 /// The source vault account to stake from
20 #[serde(rename = "vaultAccountId")]
21 pub vault_account_id: String,
22 /// The destination validator address name
23 #[serde(rename = "validatorName")]
24 pub validator_name: String,
25 /// The destination validator provider name
26 #[serde(rename = "providerName")]
27 pub provider_name: String,
28 /// The protocol identifier (e.g. \"ETH\"/ \"SOL\") to use
29 #[serde(rename = "chainDescriptor")]
30 pub chain_descriptor: String,
31 /// Amount of tokens to stake, measured in the staked asset unit.
32 #[serde(rename = "amount")]
33 pub amount: String,
34 /// The amount staked in the position, measured in the staked asset unit.
35 #[serde(rename = "rewardsAmount")]
36 pub rewards_amount: String,
37 /// When was the request made (ISO Date).
38 #[serde(rename = "dateCreated")]
39 pub date_created: String,
40 /// When has the position last changed (ISO Date).
41 #[serde(rename = "dateUpdated")]
42 pub date_updated: String,
43 /// The current status.
44 #[serde(rename = "status")]
45 pub status: String,
46 /// An array of transaction objects related to this position. Each object
47 /// includes a 'txId' representing the transaction ID and a 'completed'
48 /// boolean indicating if the transaction was completed.
49 #[serde(rename = "relatedTransactions")]
50 pub related_transactions: Vec<models::RelatedTransaction>,
51 /// The destination address of the staking transaction.
52 #[serde(rename = "validatorAddress")]
53 pub validator_address: String,
54 #[serde(rename = "providerId")]
55 pub provider_id: models::StakingProvider,
56 /// An array of available actions that can be performed. for example,
57 /// actions like \"unstake\" or \"withdraw\".
58 #[serde(rename = "availableActions")]
59 pub available_actions: Vec<String>,
60 /// Indicates whether there is an ongoing action for this position (true if
61 /// ongoing, false if not).
62 #[serde(rename = "inProgress")]
63 pub in_progress: bool,
64 /// The transaction ID of the ongoing request
65 #[serde(rename = "inProgressTxId", skip_serializing_if = "Option::is_none")]
66 pub in_progress_tx_id: Option<String>,
67 #[serde(rename = "blockchainPositionInfo")]
68 pub blockchain_position_info: models::SolanaBlockchainData,
69 /// An array of partial unstake requests for this position, relevant only
70 /// for the Lido provider. Each object includes the status of the unstake
71 /// request, a boolean indicating whether the action is in progress, the
72 /// amount of tokens to unstake, and the transaction ID of the request. With
73 /// Lido, a position may have multiple partial unstake requests in different
74 /// states. This field is optional and not applicable for other providers.
75 #[serde(rename = "relatedRequests", skip_serializing_if = "Option::is_none")]
76 pub related_requests: Option<Vec<models::RelatedRequest>>,
77}
78
79impl Delegation {
80 pub fn new(
81 id: String,
82 vault_account_id: String,
83 validator_name: String,
84 provider_name: String,
85 chain_descriptor: String,
86 amount: String,
87 rewards_amount: String,
88 date_created: String,
89 date_updated: String,
90 status: String,
91 related_transactions: Vec<models::RelatedTransaction>,
92 validator_address: String,
93 provider_id: models::StakingProvider,
94 available_actions: Vec<String>,
95 in_progress: bool,
96 blockchain_position_info: models::SolanaBlockchainData,
97 ) -> Delegation {
98 Delegation {
99 id,
100 vault_account_id,
101 validator_name,
102 provider_name,
103 chain_descriptor,
104 amount,
105 rewards_amount,
106 date_created,
107 date_updated,
108 status,
109 related_transactions,
110 validator_address,
111 provider_id,
112 available_actions,
113 in_progress,
114 in_progress_tx_id: None,
115 blockchain_position_info,
116 related_requests: None,
117 }
118 }
119}