fireblocks_sdk/models/
chain_info_response.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 ChainInfoResponse {
16    /// The protocol identifier (e.g. \"ETH\"/\"SOL\").
17    #[serde(rename = "chainDescriptor")]
18    pub chain_descriptor: String,
19    /// The current epoch number of the blockchain network.
20    #[serde(rename = "currentEpoch")]
21    pub current_epoch: f64,
22    /// The percentage of time that has elapsed within the current epoch,
23    /// represented as a decimal value between 0 and 1.
24    #[serde(rename = "epochElapsed")]
25    pub epoch_elapsed: f64,
26    /// The total duration in milliseconds of a single epoch.
27    #[serde(rename = "epochDuration")]
28    pub epoch_duration: f64,
29    #[serde(rename = "additionalInfo")]
30    pub additional_info: models::AdditionalInfo,
31}
32
33impl ChainInfoResponse {
34    pub fn new(
35        chain_descriptor: String,
36        current_epoch: f64,
37        epoch_elapsed: f64,
38        epoch_duration: f64,
39        additional_info: models::AdditionalInfo,
40    ) -> ChainInfoResponse {
41        ChainInfoResponse {
42            chain_descriptor,
43            current_epoch,
44            epoch_elapsed,
45            epoch_duration,
46            additional_info,
47        }
48    }
49}