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