Add account state function to wallet
@@ -2,7 +2,7 @@ use models::node::{AccountId, Address};
use crate::{
credentials::WalletCredentials, error::ClientError, ethereum::EthereumProvider, operations::*,
- provider::Provider, signer::Signer, tokens_cache::TokensCache,
+ provider::Provider, signer::Signer, tokens_cache::TokensCache, types::AccountInfo,
};
#[derive(Debug)]
@@ -51,6 +51,11 @@ impl Wallet {
self.signer.address
}
+ /// Returns account state info
+ pub async fn account_info(&self) -> Result<AccountInfo, ClientError> {
+ self.provider.account_info(self.address()).await
+ }
+
/// Returns the current account ID.
/// Result may be `None` if the signing key was not set for account via `ChangePubKey` transaction.
pub fn account_id(&self) -> Option<AccountId> {
