pub struct Aptos { /* private fields */ }Implementations§
Source§impl Aptos
impl Aptos
pub fn new(network: AptosType) -> Self
Sourcepub async fn get_chain_height(&self) -> Result<u64, String>
pub async fn get_chain_height(&self) -> Result<u64, String>
get chain height
Sourcepub async fn get_ledger_version(&self) -> Result<u64, String>
pub async fn get_ledger_version(&self) -> Result<u64, String>
get chain height
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<TransactionInfo, String>
pub async fn submit_transaction( &self, txn_payload: &Value, ) -> Result<TransactionInfo, String>
submit transaction
Sourcepub async fn get_transaction_info_by_hash(
&self,
tx_hash: &str,
) -> Result<TransactionInfo, String>
pub async fn get_transaction_info_by_hash( &self, tx_hash: &str, ) -> Result<TransactionInfo, String>
get transaction info
Sourcepub async fn get_transaction_info_by_version(
&self,
version: u64,
) -> Result<TransactionInfo, String>
pub async fn get_transaction_info_by_version( &self, version: u64, ) -> Result<TransactionInfo, String>
get transaction by version
Sourcepub async fn get_account_transaction_vec(
&self,
address: &str,
limit: Option<u64>,
start: Option<u64>,
) -> Result<Vec<TransactionInfo>, String>
pub async fn get_account_transaction_vec( &self, address: &str, limit: Option<u64>, start: Option<u64>, ) -> Result<Vec<TransactionInfo>, 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<TransactionInfo, String>
pub async fn waiting_transaction( &self, txn_hash: &str, timeout_secs: u64, ) -> Result<TransactionInfo, 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§
Auto Trait Implementations§
impl Freeze for Aptos
impl !RefUnwindSafe for Aptos
impl Send for Aptos
impl Sync for Aptos
impl Unpin for Aptos
impl !UnwindSafe for Aptos
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)