XandApiClientTrait

Trait XandApiClientTrait 

Source
pub trait XandApiClientTrait: Send + Sync {
Show 25 methods // Required methods 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 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_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_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_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; fn get_address_transactions<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, paging: Option<Paging>, ) -> Pin<Box<dyn Future<Output = Result<TransactionHistoryPage, XandApiClientError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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; 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 propose_action<'life0, 'async_trait>( &'life0 self, issuer: Address, admin_txn: AdministrativeTransaction, ) -> 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; 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_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_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_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_authority_keys<'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_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_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_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_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_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_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 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; // Provided methods 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_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 with_timeout(self, timeout: Duration) -> WithTimeout<Self> where Self: Sized { ... }
}
Expand description

Trait that exposes all of the functionality provided by the xand-api as a simple client interface

Required Methods§

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,

Submit a transaction to the API, where it will be signed and then sent to the blockchain

Returns a stream of transaction status updates

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,

Fetch the details of a particular transaction

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,

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,

Fetch the balance (in USD cents) held by an address

If the balance is unavailable (e.g. the requester cannot read it), Ok(None) is returned.

TODO: Should also be &Address

Source

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<TransactionHistoryPage, 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,

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,

Request the current pending redeem requests

Source

fn propose_action<'life0, 'async_trait>( &'life0 self, issuer: Address, admin_txn: 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,

Submit vote on specific proposal by id

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,

Gets the most current block and timestamp with a staleness indicator

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,

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,

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,

Get list of members

Source

fn get_authority_keys<'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 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,

Get trustee 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,

Get Limited Agent address if one exists

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,

Get allowlisted CIDR blocks per address

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,

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,

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,

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,

Health check

Provided Methods§

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,

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,

Submits a transaction and returns its final status (which, in the case of a valid transaction, should eventually be Finalized).

You should generally prefer submit_transaction_wait over this, unless you must absolutely be sure the transaction was finalized (EX: you are the trust).

Source

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.

Implementors§