pub struct XandApiClient { /* private fields */ }
Expand description
Default implementation of the XandApiClientTrait
Implementations§
Source§impl XandApiClient
impl XandApiClient
Sourcepub async fn connect(url: &Url) -> Result<Self, XandApiClientError>
pub async fn connect(url: &Url) -> Result<Self, XandApiClientError>
Returns xand-api client for given.
Sourcepub async fn connect_with_jwt(
url: &Url,
jwt: String,
) -> Result<Self, XandApiClientError>
pub async fn connect_with_jwt( url: &Url, jwt: String, ) -> Result<Self, XandApiClientError>
Set up the client with a JWT that will be attached to all outgoing Authorization
headers.
Trait Implementations§
Source§impl XandApiClientTrait for XandApiClient
impl XandApiClientTrait for XandApiClient
Source§fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a transaction to the API, where it will be signed and then sent to the blockchain Read more
Source§fn get_transaction_details<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TransactionId,
) -> Pin<Box<dyn Future<Output = Result<Transaction, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_details<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TransactionId,
) -> Pin<Box<dyn Future<Output = Result<Transaction, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the details of a particular transaction
Source§fn get_current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Blockstamp, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Blockstamp, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the most current block and timestamp with a staleness indicator
Source§fn get_transaction_history<'life0, 'life1, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
filter: &'life1 TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_history<'life0, 'life1, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
filter: &'life1 TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query transaction history
Source§fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<u128>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<u128>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the balance (in USD cents) held by an address Read more
fn get_total_issuance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TotalIssuance, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_address_transactions<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_address_transactions<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch all transactions which are relevant to the provided address
Source§fn get_pending_create_requests<'life0, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_create_requests<'life0, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request the current pending create requests
Source§fn get_pending_redeem_requests<'life0, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_redeem_requests<'life0, 'async_trait>(
&'life0 self,
paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request the current pending redeem requests
Source§fn propose_action<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
proposed_action: AdministrativeTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn propose_action<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
proposed_action: AdministrativeTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a proposal for an action to be voted on by network
Source§fn vote_on_proposal<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
vote_proposal: VoteProposal,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn vote_on_proposal<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
vote_proposal: VoteProposal,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit vote on specific proposal by id
Source§fn get_proposal<'life0, 'async_trait>(
&'life0 self,
id: u32,
) -> Pin<Box<dyn Future<Output = Result<Proposal, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_proposal<'life0, 'async_trait>(
&'life0 self,
id: u32,
) -> Pin<Box<dyn Future<Output = Result<Proposal, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get specific proposal by id
Source§fn get_all_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Proposal>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Proposal>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all non-expired proposals
Source§fn get_members<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_members<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get list of members
Get list of validators
Source§fn get_trustee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_trustee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get trustee address
Source§fn get_allowlist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, CidrBlock)>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_allowlist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, CidrBlock)>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get allowlisted CIDR blocks per address
Source§fn get_limited_agent<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_limited_agent<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get Limited Agent address if one exists
Source§fn get_validator_emission_rate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionRate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_validator_emission_rate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionRate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current Validator emission rate setting
Source§fn get_validator_emission_progress<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionProgress, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_validator_emission_progress<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionProgress, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current progress of an individual validator toward an emission
Source§fn get_pending_create_request_expire_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_create_request_expire_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current pending create request expire time in milliseconds
Source§fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthResponse, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthResponse, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Source§fn submit_transaction_wait<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction_wait<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Like
submit_transaction
, but rather than returning a stream, returns a future that
completes once the the transaction has been committed or invalidated (not finalized).Source§fn submit_transaction_wait_final<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction_wait_final<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits a transaction and returns its final status (which, in the case of a valid
transaction, should eventually be
Finalized
). Read moreSource§fn with_timeout(self, timeout: Duration) -> WithTimeout<Self>where
Self: Sized,
fn with_timeout(self, timeout: Duration) -> WithTimeout<Self>where
Self: Sized,
Returns a client that behaves like
self
and applies the given timeout to every
asynchronous operation.Auto Trait Implementations§
impl Freeze for XandApiClient
impl !RefUnwindSafe for XandApiClient
impl Send for XandApiClient
impl Sync for XandApiClient
impl Unpin for XandApiClient
impl !UnwindSafe for XandApiClient
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request