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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UserBalance
impl Debug for UserBalance
Source§impl Default for UserBalance
impl Default for UserBalance
Source§fn default() -> UserBalance
fn default() -> UserBalance
Source§impl<'de> Deserialize<'de> for UserBalance
impl<'de> Deserialize<'de> for UserBalance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for UserBalance
impl PartialEq for UserBalance
Source§impl Serialize for UserBalance
impl Serialize for UserBalance
impl Eq for UserBalance
impl StructuralPartialEq for UserBalance
Auto Trait Implementations§
impl Freeze for UserBalance
impl RefUnwindSafe for UserBalance
impl Send for UserBalance
impl Sync for UserBalance
impl Unpin for UserBalance
impl UnwindSafe for UserBalance
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)