helium_api/models/account.rs
1use super::{Hnt, Hst, Iot, Mobile};
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Serialize, Deserialize, Debug)]
6/// Represents a wallet on the blockchain.
7pub struct Account {
8 /// The wallet address is the base58 check-encoded public key of
9 /// the wallet.
10 pub address: String,
11 /// Block height of the API when query was made. When null, there
12 /// is no on-chain record of this account.
13 pub block: Option<u64>,
14 /// The latest HNT balance of the wallet at block height
15 pub balance: Hnt,
16 /// The latest staked_balance of the wallet at block height
17 #[serde(deserialize_with = "Hnt::deserialize")]
18 pub staked_balance: Hnt,
19 /// The data credit balance of the wallet known at block height
20 pub dc_balance: u64,
21 /// The security token balance of the wallet at block height
22 #[serde(deserialize_with = "Hst::deserialize")]
23 pub sec_balance: Hst,
24 /// The current nonce for the account
25 pub nonce: u64,
26 #[serde(default)]
27 /// The latest IOT balance of the wallet at block height
28 pub iot_balance: Iot,
29 #[serde(default)]
30 /// The latest MOB balance of the wallet at block height
31 pub mobile_balance: Mobile,
32 /// The current sec_nonce for the account
33 pub sec_nonce: u64,
34 /// The current dc_nonce for the account
35 pub dc_nonce: u64,
36 /// The speculative nonce for the account
37 #[serde(default)]
38 pub speculative_nonce: u64,
39 /// The speculative security nonce for the account
40 #[serde(default)]
41 pub speculative_sec_nonce: u64,
42}