Function validator_stake

Source
pub fn validator_stake(account_id: &AccountId) -> NearToken
Expand description

For a given account return its current stake. If the account is not a validator, returns 0.

ยงExamples

use near_sdk::env::validator_stake;
use near_sdk::{AccountId, NearToken};
use std::str::FromStr;

assert_eq!(
    validator_stake(&AccountId::from_str("bob.near").unwrap()),
    NearToken::from_yoctonear(0)
);