pub struct Client { /* private fields */ }
Implementations§
§impl Client
impl Client
pub fn new<T>(url: T) -> Clientwhere T: Into<String>,
pub fn new_with_retry<T>(url: T, retry: Retry) -> Clientwhere T: Into<String>,
pub fn last_known_state(&self) -> Option<State>
pub async fn wait_for_signed_transaction( &self, txn: &SignedTransaction, timeout: Option<Duration>, delay: Option<Duration> ) -> impl Future<Output = Result<Response<TransactionView>, WaitForTransactionError>>
pub async fn wait_for_transaction( &self, address: AccountAddress, seq: u64, expiration_time_secs: u64, txn_hash: HashValue, timeout: Option<Duration>, delay: Option<Duration> ) -> impl Future<Output = Result<Response<TransactionView>, WaitForTransactionError>>
pub async fn batch( &self, requests: Vec<MethodRequest, Global> ) -> impl Future<Output = Result<Vec<Result<Response<MethodResponse>, Error>, Global>, Error>>
pub async fn request( &self, request: MethodRequest ) -> impl Future<Output = Result<Response<MethodResponse>, Error>>
pub async fn submit( &self, txn: &SignedTransaction ) -> impl Future<Output = Result<Response<()>, Error>>
pub async fn get_metadata_by_version( &self, version: u64 ) -> impl Future<Output = Result<Response<MetadataView>, Error>>
pub async fn get_metadata( &self ) -> impl Future<Output = Result<Response<MetadataView>, Error>>
pub async fn get_account( &self, address: AccountAddress ) -> impl Future<Output = Result<Response<Option<AccountView>>, Error>>
pub async fn get_account_by_version( &self, address: AccountAddress, version: u64 ) -> impl Future<Output = Result<Response<Option<AccountView>>, Error>>
pub async fn get_transactions( &self, start_seq: u64, limit: u64, include_events: bool ) -> impl Future<Output = Result<Response<Vec<TransactionView, Global>>, Error>>
pub async fn get_account_transaction( &self, address: AccountAddress, seq: u64, include_events: bool ) -> impl Future<Output = Result<Response<Option<TransactionView>>, Error>>
pub async fn get_account_transactions( &self, address: AccountAddress, start_seq: u64, limit: u64, include_events: bool ) -> impl Future<Output = Result<Response<Vec<TransactionView, Global>>, Error>>
pub async fn get_events( &self, key: EventKey, start_seq: u64, limit: u64 ) -> impl Future<Output = Result<Response<Vec<EventView, Global>>, Error>>
pub async fn get_currencies( &self ) -> impl Future<Output = Result<Response<Vec<CurrencyInfoView, Global>>, Error>>
pub async fn get_network_status( &self ) -> impl Future<Output = Result<Response<u64>, Error>>
pub async fn get_state_proof( &self, from_version: u64 ) -> impl Future<Output = Result<Response<StateProofView>, Error>>
pub async fn get_accumulator_consistency_proof( &self, client_known_version: Option<u64>, ledger_version: Option<u64> ) -> impl Future<Output = Result<Response<AccumulatorConsistencyProofView>, Error>>
pub async fn get_account_state_with_proof( &self, address: AccountAddress, from_version: Option<u64>, to_version: Option<u64> ) -> impl Future<Output = Result<Response<AccountStateWithProofView>, Error>>
pub async fn get_transactions_with_proofs( &self, start_version: u64, limit: u64, include_events: bool ) -> impl Future<Output = Result<Response<Option<TransactionsWithProofsView>>, Error>>
pub async fn get_account_transactions_with_proofs( &self, address: AccountAddress, start_seq: u64, limit: u64, include_events: bool, ledger_version: Option<u64> ) -> impl Future<Output = Result<Response<AccountTransactionsWithProofView>, Error>>
pub async fn get_events_with_proofs( &self, key: EventKey, start_seq: u64, limit: u64 ) -> impl Future<Output = Result<Response<Vec<EventWithProofView, Global>>, Error>>
pub async fn get_event_by_version_with_proof( &self, key: EventKey, version: Option<u64> ) -> impl Future<Output = Result<Response<EventByVersionWithProofView>, Error>>
pub async fn get_deserialized_events<T>(
&self,
event_key: &EventKey,
start_seq: u64,
limit: u64
) -> impl Future<Output = Result<Response<Vec<Event<T>, Global>>, Error>>where
T: MoveStructType + DeserializeOwned,
pub async fn get_deserialized_events<T>( &self, event_key: &EventKey, start_seq: u64, limit: u64 ) -> impl Future<Output = Result<Response<Vec<Event<T>, Global>>, Error>>where T: MoveStructType + DeserializeOwned,
Return the events of type T
that have been emitted to event_key
since start_seq
, with a max of limit
results
Returns an empty vector if there are no such events
The type T
must match the event types associated with event_key
pub async fn get_deserialized_resource<T>(
&self,
address: AccountAddress
) -> impl Future<Output = Result<Response<Option<T>>, Error>>where
T: MoveResource,
pub async fn get_deserialized_resource<T>( &self, address: AccountAddress ) -> impl Future<Output = Result<Response<Option<T>>, Error>>where T: MoveResource,
Deserialize and return the resource value of type T
stored under address
Returns None if there is no such value