multiversx_sdk_http/gateway_http_proxy/
http_account.rsuse anyhow::Result;
use multiversx_sdk::{
chain_core::types::Address,
data::{account::Account, esdt::EsdtBalance},
gateway::{
GetAccountEsdtRolesRequest, GetAccountEsdtTokensRequest, GetAccountRequest,
GetAccountStorageRequest,
},
};
use std::collections::HashMap;
use super::GatewayHttpProxy;
impl GatewayHttpProxy {
pub async fn get_account(&self, address: &Address) -> Result<Account> {
self.http_request(GetAccountRequest::new(address)).await
}
pub async fn get_account_esdt_roles(
&self,
address: &Address,
) -> Result<HashMap<String, Vec<String>>> {
self.http_request(GetAccountEsdtRolesRequest::new(address))
.await
}
pub async fn get_account_esdt_tokens(
&self,
address: &Address,
) -> Result<HashMap<String, EsdtBalance>> {
self.http_request(GetAccountEsdtTokensRequest::new(address))
.await
}
pub async fn get_account_storage_keys(
&self,
address: &Address,
) -> Result<HashMap<String, String>> {
self.http_request(GetAccountStorageRequest::new(address))
.await
}
}