pub struct UserBalance {
pub total: NearToken,
pub storage_locked: NearToken,
pub storage_usage: u64,
pub locked: NearToken,
}Expand description
Account balance on the NEAR blockchain.
This balance doesn’t include staked NEAR tokens or storage
Fields§
§total: NearTokenThe total amount of NEAR tokens in the account.
Please note that this is the total amount of NEAR tokens in the account, not the amount available for use.
storage_locked: NearTokenThe amount of NEAR tokens locked in the account for storage usage.
The storage lock equal to Self::storage_usage * STORAGE_COST_PER_BYTE
storage_usage: u64The storage usage by the account in bytes.
locked: NearTokenThe amount of NEAR tokens staked on a protocol level. Applicable for staking pools only in 99.99% of the cases.
The PoS allows particular users to stake funds to become a validator, but the protocol itself doesn’t allow other users to delegate tokens to the validator. This is why, the NEP-27 defines a Staking Pool smart contract that allows other users to delegate tokens to the validator.
Even though, the user can stake and become validator itself, it’s highly unlikely and this field will be 0 for almost all the users, and not 0 for StakingPool contracts.
Please note that this is not related to your delegations into the staking pools. To get your delegation information in the staking pools, use [near-api::Delegation]
Trait Implementations§
Source§impl Clone for UserBalance
impl Clone for UserBalance
Source§fn clone(&self) -> UserBalance
fn clone(&self) -> UserBalance
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more