pub struct AptosClient { /* private fields */ }Implementations§
Source§impl AptosClient
impl AptosClient
pub fn new(network: AptosClientType) -> Self
Sourcepub async fn get_account_info(
&self,
address: &str,
) -> Result<AccountInfo, String>
pub async fn get_account_info( &self, address: &str, ) -> Result<AccountInfo, String>
get account info
Sourcepub async fn get_account_resource_vec(
&self,
address: &str,
) -> Result<Vec<Resource>, String>
pub async fn get_account_resource_vec( &self, address: &str, ) -> Result<Vec<Resource>, String>
get account resources vec
Sourcepub async fn get_account_resource(
&self,
address: &str,
resource_type: &str,
) -> Result<Option<Resource>, String>
pub async fn get_account_resource( &self, address: &str, resource_type: &str, ) -> Result<Option<Resource>, String>
get account resource
Sourcepub async fn get_account_module_vec(
&self,
address: &str,
) -> Result<Vec<Module>, String>
pub async fn get_account_module_vec( &self, address: &str, ) -> Result<Vec<Module>, String>
get account module vec
Sourcepub async fn get_account_module(
&self,
address: &str,
module_name: &str,
) -> Result<Option<Module>, String>
pub async fn get_account_module( &self, address: &str, module_name: &str, ) -> Result<Option<Module>, String>
get account module
Sourcepub async fn submit_transaction(
&self,
txn_payload: &Value,
) -> Result<Transaction, String>
pub async fn submit_transaction( &self, txn_payload: &Value, ) -> Result<Transaction, String>
submit transaction
Sourcepub async fn get_transaction_info(
&self,
txn_hash: &str,
) -> Result<Transaction, String>
pub async fn get_transaction_info( &self, txn_hash: &str, ) -> Result<Transaction, String>
get transaction info
Sourcepub async fn get_transaction_by_version(
&self,
version: u64,
) -> Result<Transaction, String>
pub async fn get_transaction_by_version( &self, version: u64, ) -> Result<Transaction, String>
get transaction by version
Sourcepub async fn get_account_transaction_vec(
&self,
address: &str,
limit: Option<u64>,
start: Option<u64>,
) -> Result<Vec<Transaction>, String>
pub async fn get_account_transaction_vec( &self, address: &str, limit: Option<u64>, start: Option<u64>, ) -> Result<Vec<Transaction>, String>
get account transaction vec
Sourcepub async fn get_chain_info(&self) -> Result<ChainInfo, String>
pub async fn get_chain_info(&self) -> Result<ChainInfo, String>
get chain info
Sourcepub async fn get_block_by_height(&self, height: u64) -> Result<Block, String>
pub async fn get_block_by_height(&self, height: u64) -> Result<Block, String>
get block by height
Sourcepub async fn get_block_by_version(&self, version: u64) -> Result<Block, String>
pub async fn get_block_by_version(&self, version: u64) -> Result<Block, String>
get block by version
Sourcepub async fn get_account_event_vec(
&self,
address: &str,
event_type: &str,
limit: Option<u64>,
start: Option<u64>,
) -> Result<Vec<Event>, String>
pub async fn get_account_event_vec( &self, address: &str, event_type: &str, limit: Option<u64>, start: Option<u64>, ) -> Result<Vec<Event>, String>
get account event vec
Sourcepub async fn get_table_item(
&self,
table_handle: &str,
key_type: &str,
value_type: &str,
key: &Value,
) -> Result<Value, String>
pub async fn get_table_item( &self, table_handle: &str, key_type: &str, value_type: &str, key: &Value, ) -> Result<Value, String>
get table item
Sourcepub async fn view(
&self,
view_request: &ViewRequest,
) -> Result<Vec<Value>, String>
pub async fn view( &self, view_request: &ViewRequest, ) -> Result<Vec<Value>, String>
view function
Sourcepub async fn estimate_gas_price(&self) -> Result<u64, String>
pub async fn estimate_gas_price(&self) -> Result<u64, String>
estimate gas price
Sourcepub async fn get_account_balance(&self, address: &str) -> Result<u64, String>
pub async fn get_account_balance(&self, address: &str) -> Result<u64, String>
get account balance
Sourcepub async fn get_token_balance(
&self,
address: &str,
token_type: &str,
) -> Result<u64, String>
pub async fn get_token_balance( &self, address: &str, token_type: &str, ) -> Result<u64, String>
get token balance
Sourcepub async fn waiting_transaction(
&self,
txn_hash: &str,
timeout_secs: u64,
) -> Result<Transaction, String>
pub async fn waiting_transaction( &self, txn_hash: &str, timeout_secs: u64, ) -> Result<Transaction, String>
waiting transaction
Sourcepub async fn is_transaction_successful(
&self,
txn_hash: &str,
) -> Result<bool, String>
pub async fn is_transaction_successful( &self, txn_hash: &str, ) -> Result<bool, String>
determine whether the transaction is successful
Sourcepub async fn get_apt_balance_by_account(
&self,
address: &str,
) -> Result<f64, String>
pub async fn get_apt_balance_by_account( &self, address: &str, ) -> Result<f64, String>
get apt balance by account
Trait Implementations§
Source§impl Clone for AptosClient
impl Clone for AptosClient
Source§fn clone(&self) -> AptosClient
fn clone(&self) -> AptosClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AptosClient
impl !RefUnwindSafe for AptosClient
impl Send for AptosClient
impl Sync for AptosClient
impl Unpin for AptosClient
impl !UnwindSafe for AptosClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more