pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new_with_timeout(base_url: &str, timeout: u64) -> Result<Self, Error>
👎Deprecated: To be marked private in a future major release. Please use new_with_headers instead.
pub fn new_with_timeout(base_url: &str, timeout: u64) -> Result<Self, Error>
new_with_headers instead.Create a new client with a timeout in seconds
§Errors
Sourcepub fn new_with_headers(
base_url: &str,
additional_headers: HeaderMap,
) -> Result<Self, Error>
pub fn new_with_headers( base_url: &str, additional_headers: HeaderMap, ) -> Result<Self, Error>
Create a new client with additional headers
§Errors
pub fn base_url(&self) -> &str
pub fn client(&self) -> &HttpClient
Sourcepub async fn verify_network_passphrase(
&self,
expected: Option<&str>,
) -> Result<String, Error>
pub async fn verify_network_passphrase( &self, expected: Option<&str>, ) -> Result<String, Error>
§Errors
Sourcepub async fn get_network(&self) -> Result<GetNetworkResponse, Error>
pub async fn get_network(&self) -> Result<GetNetworkResponse, Error>
§Errors
Sourcepub async fn get_health(&self) -> Result<GetHealthResponse, Error>
pub async fn get_health(&self) -> Result<GetHealthResponse, Error>
§Errors
Sourcepub async fn get_latest_ledger(&self) -> Result<GetLatestLedgerResponse, Error>
pub async fn get_latest_ledger(&self) -> Result<GetLatestLedgerResponse, Error>
§Errors
Sourcepub async fn get_ledgers(
&self,
start: LedgerStart,
limit: Option<usize>,
format: Option<String>,
) -> Result<GetLedgersResponse, Error>
pub async fn get_ledgers( &self, start: LedgerStart, limit: Option<usize>, format: Option<String>, ) -> Result<GetLedgersResponse, Error>
§Errors
Sourcepub async fn get_account(&self, address: &str) -> Result<AccountEntry, Error>
pub async fn get_account(&self, address: &str) -> Result<AccountEntry, Error>
§Errors
Sourcepub async fn get_fee_stats(&self) -> Result<GetFeeStatsResponse, Error>
pub async fn get_fee_stats(&self) -> Result<GetFeeStatsResponse, Error>
Get network fee stats
§Errors
Sourcepub async fn get_version_info(&self) -> Result<GetVersionInfoResponse, Error>
pub async fn get_version_info(&self) -> Result<GetVersionInfoResponse, Error>
§Errors
Sourcepub async fn send_transaction(
&self,
tx: &TransactionEnvelope,
) -> Result<Hash, Error>
pub async fn send_transaction( &self, tx: &TransactionEnvelope, ) -> Result<Hash, Error>
Send a transaction to the network and get back the hash of the transaction.
§Errors
Sourcepub async fn send_transaction_polling(
&self,
tx: &TransactionEnvelope,
) -> Result<GetTransactionResponse, Error>
pub async fn send_transaction_polling( &self, tx: &TransactionEnvelope, ) -> Result<GetTransactionResponse, Error>
§Errors
Sourcepub async fn simulate_transaction_envelope(
&self,
tx: &TransactionEnvelope,
auth_mode: Option<AuthMode>,
) -> Result<SimulateTransactionResponse, Error>
pub async fn simulate_transaction_envelope( &self, tx: &TransactionEnvelope, auth_mode: Option<AuthMode>, ) -> Result<SimulateTransactionResponse, Error>
§Errors
Sourcepub async fn next_simulate_transaction_envelope(
&self,
tx: &TransactionEnvelope,
auth_mode: Option<AuthMode>,
resource_config: Option<ResourceConfig>,
) -> Result<SimulateTransactionResponse, Error>
pub async fn next_simulate_transaction_envelope( &self, tx: &TransactionEnvelope, auth_mode: Option<AuthMode>, resource_config: Option<ResourceConfig>, ) -> Result<SimulateTransactionResponse, Error>
Internal function, not to be used.
§Errors
Sourcepub async fn get_transaction(
&self,
tx_id: &Hash,
) -> Result<GetTransactionResponse, Error>
pub async fn get_transaction( &self, tx_id: &Hash, ) -> Result<GetTransactionResponse, Error>
§Errors
Sourcepub async fn get_transactions(
&self,
request: GetTransactionsRequest,
) -> Result<GetTransactionsResponse, Error>
pub async fn get_transactions( &self, request: GetTransactionsRequest, ) -> Result<GetTransactionsResponse, Error>
§Errors
Sourcepub async fn get_transaction_polling(
&self,
tx_id: &Hash,
timeout_s: Option<Duration>,
) -> Result<GetTransactionResponse, Error>
pub async fn get_transaction_polling( &self, tx_id: &Hash, timeout_s: Option<Duration>, ) -> Result<GetTransactionResponse, Error>
Poll the transaction status. Can provide a timeout in seconds, otherwise uses the default timeout.
It uses exponential backoff with a base of 1 second and a maximum of 30 seconds.
§Errors
Error::TransactionSubmissionTimeoutif the transaction status is not found within the timeoutError::TransactionSubmissionFailedif the transaction status is “FAILED”Error::UnexpectedTransactionStatusif the transaction status is not one of “SUCCESS”, “FAILED”, orNOT_FOUNDjson_rpseeErrors
Sourcepub async fn get_ledger_entries(
&self,
keys: &[LedgerKey],
) -> Result<GetLedgerEntriesResponse, Error>
pub async fn get_ledger_entries( &self, keys: &[LedgerKey], ) -> Result<GetLedgerEntriesResponse, Error>
§Errors
Sourcepub async fn get_full_ledger_entries(
&self,
ledger_keys: &[LedgerKey],
) -> Result<FullLedgerEntries, Error>
pub async fn get_full_ledger_entries( &self, ledger_keys: &[LedgerKey], ) -> Result<FullLedgerEntries, Error>
§Errors
Sourcepub async fn get_events(
&self,
start: EventStart,
event_type: Option<EventType>,
contract_ids: &[String],
topics: &[String],
limit: Option<usize>,
) -> Result<GetEventsResponse, Error>
pub async fn get_events( &self, start: EventStart, event_type: Option<EventType>, contract_ids: &[String], topics: &[String], limit: Option<usize>, ) -> Result<GetEventsResponse, Error>
§Errors
Sourcepub async fn get_contract_data(
&self,
contract_id: &[u8; 32],
) -> Result<ContractDataEntry, Error>
pub async fn get_contract_data( &self, contract_id: &[u8; 32], ) -> Result<ContractDataEntry, Error>
§Errors
Sourcepub async fn get_remote_wasm(
&self,
contract_id: &[u8; 32],
) -> Result<Vec<u8>, Error>
👎Deprecated: To be removed in future versions, use get_ledger_entries()
pub async fn get_remote_wasm( &self, contract_id: &[u8; 32], ) -> Result<Vec<u8>, Error>
§Errors
Sourcepub async fn get_remote_wasm_from_hash(
&self,
hash: Hash,
) -> Result<Vec<u8>, Error>
👎Deprecated: To be removed in future versions, use get_ledger_entries()
pub async fn get_remote_wasm_from_hash( &self, hash: Hash, ) -> Result<Vec<u8>, Error>
§Errors
Sourcepub async fn get_contract_instance(
&self,
contract_id: &[u8; 32],
) -> Result<ScContractInstance, Error>
pub async fn get_contract_instance( &self, contract_id: &[u8; 32], ) -> Result<ScContractInstance, Error>
Get the contract instance from the network. Could be normal contract or native Stellar Asset Contract (SAC)
§Errors
- Could fail to find contract or have a network error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more