algonaut_indexer 0.7.0

Algorand ledger analytics API.
Documentation
/*
 * Indexer
 *
 * Algorand ledger analytics API.
 *
 * The version of the OpenAPI document: 2.0
 *
 * Generated by: https://openapi-generator.tech
 */

use algonaut_encoding::Bytes;

/// TransactionHeartbeat : Fields for a heartbeat transaction.  Definition: data/transactions/heartbeat.go : HeartbeatTxnFields

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TransactionHeartbeat {
    /// \\[hbad\\] HbAddress is the account this txn is proving onlineness for.
    #[serde(rename = "hb-address")]
    pub hb_address: String,
    /// \\[hbkd\\] HbKeyDilution must match HbAddress account's current KeyDilution.
    #[serde(rename = "hb-key-dilution")]
    pub hb_key_dilution: u64,
    #[serde(rename = "hb-proof")]
    pub hb_proof: Box<crate::models::HbProofFields>,
    /// \\[hbsd\\] HbSeed must be the block seed for the this transaction's firstValid block.
    #[serde(rename = "hb-seed")]
    pub hb_seed: Bytes,
    /// \\[hbvid\\] HbVoteID must match the HbAddress account's current VoteID.
    #[serde(rename = "hb-vote-id")]
    pub hb_vote_id: Bytes,
}

impl TransactionHeartbeat {
    /// Fields for a heartbeat transaction.  Definition: data/transactions/heartbeat.go : HeartbeatTxnFields
    pub fn new(
        hb_address: String,
        hb_key_dilution: u64,
        hb_proof: crate::models::HbProofFields,
        hb_seed: Bytes,
        hb_vote_id: Bytes,
    ) -> TransactionHeartbeat {
        TransactionHeartbeat {
            hb_address,
            hb_key_dilution,
            hb_proof: Box::new(hb_proof),
            hb_seed,
            hb_vote_id,
        }
    }
}