fireblocks-sdk 2026.3.27

Rust implementation of the Fireblocks SDK
Documentation
// 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,
        }
    }
}