pub struct BalanceAlertLayer { /* private fields */ }Implementations§
Source§impl BalanceAlertLayer
A ProviderLayer that can be added to an alloy Provider
to log warnings and errors when the balance of a given address
falls below certain thresholds.
impl BalanceAlertLayer
A ProviderLayer that can be added to an alloy Provider to log warnings and errors when the balance of a given address falls below certain thresholds.
This checks the balance after every transaction sent via send_transaction and errors, warns or trace logs accordingly
§Examples
ⓘ
let provider = ProviderBuilder::new()
.layer(BalanceAlertLayer::new(BalanceAlertConfig {
watch_address: wallet.default_signer().address(),
warn_threshold: parse_ether("0.1")?,
error_threshold: parse_ether("0.1")?,
}));pub fn new(config: BalanceAlertConfig) -> Self
Trait Implementations§
Source§impl Clone for BalanceAlertLayer
impl Clone for BalanceAlertLayer
Source§fn clone(&self) -> BalanceAlertLayer
fn clone(&self) -> BalanceAlertLayer
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 moreSource§impl Debug for BalanceAlertLayer
impl Debug for BalanceAlertLayer
Source§impl Default for BalanceAlertLayer
impl Default for BalanceAlertLayer
Source§fn default() -> BalanceAlertLayer
fn default() -> BalanceAlertLayer
Returns the “default value” for a type. Read more
Source§impl<P> ProviderLayer<P> for BalanceAlertLayerwhere
P: Provider,
impl<P> ProviderLayer<P> for BalanceAlertLayerwhere
P: Provider,
Auto Trait Implementations§
impl Freeze for BalanceAlertLayer
impl RefUnwindSafe for BalanceAlertLayer
impl Send for BalanceAlertLayer
impl Sync for BalanceAlertLayer
impl Unpin for BalanceAlertLayer
impl UnwindSafe for BalanceAlertLayer
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