Struct BlokliClient
pub struct BlokliClient { /* private fields */ }Expand description
Client implementation of the Blokli API.
The client implements the following Blokli API traits:
Implementations§
§impl BlokliClient
impl BlokliClient
pub fn new(base_url: Url, cfg: BlokliClientConfig) -> BlokliClient
Trait Implementations§
§impl BlokliQueryClient for BlokliClient
impl BlokliQueryClient for BlokliClient
§fn count_accounts<'life0, 'async_trait>(
&'life0 self,
selector: Option<AccountSelector>,
) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn count_accounts<'life0, 'async_trait>(
&'life0 self,
selector: Option<AccountSelector>,
) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Counts the number of accounts optionally matching the given
selector.§fn query_accounts<'life0, 'async_trait>(
&'life0 self,
selector: AccountSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_accounts<'life0, 'async_trait>(
&'life0 self,
selector: AccountSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the accounts matching the given
selector.§fn query_native_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<NativeBalance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn query_native_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<NativeBalance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Queries the native balance of the given account.
§fn query_token_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn query_token_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Queries the token balance of the given account.
§fn query_transaction_count<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<u64, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn query_transaction_count<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<u64, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Queries the number of transactions sent from the given account.
§fn query_safe_allowance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<SafeHoprAllowance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn query_safe_allowance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<SafeHoprAllowance, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Queries the safe allowance of the given account.
§fn count_channels<'life0, 'async_trait>(
&'life0 self,
selector: Option<ChannelSelector>,
) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn count_channels<'life0, 'async_trait>(
&'life0 self,
selector: Option<ChannelSelector>,
) -> Pin<Box<dyn Future<Output = Result<u32, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Counts the number of channels optionally matching the given
selector.§fn query_channels<'life0, 'async_trait>(
&'life0 self,
selector: ChannelSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<Channel>, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_channels<'life0, 'async_trait>(
&'life0 self,
selector: ChannelSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<Channel>, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the channels matching the given
selector.§fn query_transaction_status<'life0, 'async_trait>(
&'life0 self,
tx_id: String,
) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_transaction_status<'life0, 'async_trait>(
&'life0 self,
tx_id: String,
) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the status of the transaction given the
tx_id previously returned by
BlokliTransactionClient::submit_and_track_transaction.§fn query_chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the chain info.
§fn query_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the version of the Blokli API.
§fn query_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn query_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Queries the health of the Blokli server.
§impl BlokliSubscriptionClient for BlokliClient
impl BlokliSubscriptionClient for BlokliClient
§fn subscribe_channels(
&self,
selector: Option<ChannelSelector>,
) -> Result<impl Stream<Item = Result<Channel, BlokliClientError>> + Send, BlokliClientError>
fn subscribe_channels( &self, selector: Option<ChannelSelector>, ) -> Result<impl Stream<Item = Result<Channel, BlokliClientError>> + Send, BlokliClientError>
§fn subscribe_accounts(
&self,
selector: Option<AccountSelector>,
) -> Result<impl Stream<Item = Result<Account, BlokliClientError>> + Send, BlokliClientError>
fn subscribe_accounts( &self, selector: Option<AccountSelector>, ) -> Result<impl Stream<Item = Result<Account, BlokliClientError>> + Send, BlokliClientError>
§fn subscribe_graph(
&self,
) -> Result<impl Stream<Item = Result<OpenedChannelsGraphEntry, BlokliClientError>> + Send, BlokliClientError>
fn subscribe_graph( &self, ) -> Result<impl Stream<Item = Result<OpenedChannelsGraphEntry, BlokliClientError>> + Send, BlokliClientError>
Subscribes to updates of the entire channel graph.
§fn subscribe_ticket_params(
&self,
) -> Result<impl Stream<Item = Result<TicketParameters, BlokliClientError>> + Send, BlokliClientError>
fn subscribe_ticket_params( &self, ) -> Result<impl Stream<Item = Result<TicketParameters, BlokliClientError>> + Send, BlokliClientError>
Subscribes to updates of the ticket parameters.
§impl BlokliTransactionClient for BlokliClient
impl BlokliTransactionClient for BlokliClient
§fn submit_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn submit_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Submits a signed transaction to the chain without waiting for confirmation.
§fn submit_and_track_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn submit_and_track_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Submits a signed transaction to the chain and returns an ID that can be used to track the transaction
status via subscription or query.
§fn submit_and_confirm_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
num_confirmations: usize,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
fn submit_and_confirm_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
signed_tx: &'life1 [u8],
num_confirmations: usize,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BlokliClient: 'async_trait,
Submits a signed transaction to the chain and waits for the given number of confirmations.
§fn track_transaction<'life0, 'async_trait>(
&'life0 self,
tx_id: String,
client_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
fn track_transaction<'life0, 'async_trait>(
&'life0 self,
tx_id: String,
client_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Transaction, BlokliClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BlokliClient: 'async_trait,
Tracks the transaction given the
tx_id previously returned
by submit_and_track_transaction until it is confirmed
or fails.§impl Clone for BlokliClient
impl Clone for BlokliClient
§fn clone(&self) -> BlokliClient
fn clone(&self) -> BlokliClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BlokliClient
impl RefUnwindSafe for BlokliClient
impl Send for BlokliClient
impl Sync for BlokliClient
impl Unpin for BlokliClient
impl UnwindSafe for BlokliClient
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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