pub struct HoprBlockchainReader<C>(/* private fields */);Expand description
A simplified version of HoprBlockchainConnector
which only implements HOPR Chain API partially, allowing for read-only operations.
This object specifically implements only the following traits:
The implementation is currently realized using the Blokli client and acts as a partial HOPR Chain API compatible
wrapper for blokli_client::BlokliClient.
This object is useful for bootstrapping purposes that usually precede construction of the full connector.
Implementations§
Source§impl<C> HoprBlockchainReader<C>
impl<C> HoprBlockchainReader<C>
Trait Implementations§
Source§impl<C> ChainReadSafeOperations for HoprBlockchainReader<C>
impl<C> ChainReadSafeOperations for HoprBlockchainReader<C>
type Error = ConnectorError
Source§fn safe_allowance<'life0, 'async_trait, Cy, A>(
&'life0 self,
safe_address: A,
) -> Pin<Box<dyn Future<Output = Result<Balance<Cy>, Self::Error>> + Send + 'async_trait>>
fn safe_allowance<'life0, 'async_trait, Cy, A>( &'life0 self, safe_address: A, ) -> Pin<Box<dyn Future<Output = Result<Balance<Cy>, Self::Error>> + Send + 'async_trait>>
Returns the native or token currency Safe allowance.
Source§fn safe_info<'life0, 'async_trait>(
&'life0 self,
selector: SafeSelector,
) -> Pin<Box<dyn Future<Output = Result<Option<DeployedSafe>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn safe_info<'life0, 'async_trait>(
&'life0 self,
selector: SafeSelector,
) -> Pin<Box<dyn Future<Output = Result<Option<DeployedSafe>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn await_safe_deployment<'life0, 'async_trait>(
&'life0 self,
selector: SafeSelector,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<DeployedSafe, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn await_safe_deployment<'life0, 'async_trait>(
&'life0 self,
selector: SafeSelector,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<DeployedSafe, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn predict_module_address<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
nonce: u64,
owner: &'life1 Address,
safe_address: &'life2 Address,
) -> Pin<Box<dyn Future<Output = Result<Address, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn predict_module_address<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
nonce: u64,
owner: &'life1 Address,
safe_address: &'life2 Address,
) -> Pin<Box<dyn Future<Output = Result<Address, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Predicts the Module address based on the given
nonce, owner and safe_address of the Safe.Source§impl<C> ChainValues for HoprBlockchainReader<C>
impl<C> ChainValues for HoprBlockchainReader<C>
type Error = ConnectorError
Source§fn balance<'life0, 'async_trait, Cy, A>(
&'life0 self,
address: A,
) -> Pin<Box<dyn Future<Output = Result<Balance<Cy>, Self::Error>> + Send + 'async_trait>>
fn balance<'life0, 'async_trait, Cy, A>( &'life0 self, address: A, ) -> Pin<Box<dyn Future<Output = Result<Balance<Cy>, Self::Error>> + Send + 'async_trait>>
Returns the native or token currency balance of the given on-chain account.
Source§fn domain_separators<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DomainSeparators, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn domain_separators<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DomainSeparators, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the domain separators of HOPR smart contracts.
Source§fn minimum_incoming_ticket_win_prob<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn minimum_incoming_ticket_win_prob<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the network-set minimum incoming ticket winning probability.
Source§fn minimum_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn minimum_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the network-set minimum ticket price.
Source§fn key_binding_fee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn key_binding_fee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the current key binding fee
used for new key-binding announcements.
Source§fn channel_closure_notice_period<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Duration, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn channel_closure_notice_period<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Duration, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the grace period for channel closure finalization.
Source§fn chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the information about the HOPR network on-chain deployment.
Source§fn outgoing_ticket_values<'life0, 'async_trait>(
&'life0 self,
cfg_out_wp: Option<WinningProbability>,
cfg_out_price: Option<Balance<WxHOPR>>,
) -> Pin<Box<dyn Future<Output = Result<(WinningProbability, Balance<WxHOPR>), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn outgoing_ticket_values<'life0, 'async_trait>(
&'life0 self,
cfg_out_wp: Option<WinningProbability>,
cfg_out_price: Option<Balance<WxHOPR>>,
) -> Pin<Box<dyn Future<Output = Result<(WinningProbability, Balance<WxHOPR>), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Convenience function to determine the winning probability and ticket price for outgoing
tickets.
Auto Trait Implementations§
impl<C> Freeze for HoprBlockchainReader<C>
impl<C> RefUnwindSafe for HoprBlockchainReader<C>where
C: RefUnwindSafe,
impl<C> Send for HoprBlockchainReader<C>
impl<C> Sync for HoprBlockchainReader<C>
impl<C> Unpin for HoprBlockchainReader<C>
impl<C> UnwindSafe for HoprBlockchainReader<C>where
C: RefUnwindSafe,
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, E> HoprStaticChainApi for Twhere
T: ChainReadSafeOperations<Error = E> + ChainValues<Error = E>,
E: Error + Send + Sync + 'static,
impl<T, E> HoprStaticChainApi for Twhere
T: ChainReadSafeOperations<Error = E> + ChainValues<Error = E>,
E: Error + Send + Sync + 'static,
type ChainError = E
§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