pub struct Monitor {
pub name: String,
pub networks: Vec<String>,
pub paused: bool,
pub addresses: Vec<AddressWithSpec>,
pub match_conditions: MatchConditions,
pub trigger_conditions: Vec<TriggerConditions>,
pub triggers: Vec<String>,
}
Expand description
Configuration for monitoring specific blockchain activity.
A Monitor defines what blockchain activity to watch for through a combination of:
- Network targets (which chains to monitor)
- Contract addresses to watch
- Conditions to match (functions, events, transactions)
- Triggers conditions refers to a custom filter script that being executed apply extra filters to the matched transactions before triggering the notifications
- Triggers to execute when conditions are met
Fields§
§name: String
Unique name identifying this monitor
networks: Vec<String>
List of network slugs this monitor should watch
paused: bool
Whether this monitor is currently paused
addresses: Vec<AddressWithSpec>
Contract addresses to monitor, optionally with their contract specs
match_conditions: MatchConditions
Conditions that should trigger this monitor
trigger_conditions: Vec<TriggerConditions>
Conditions that should be met prior to triggering notifications
triggers: Vec<String>
IDs of triggers to execute when conditions match
Trait Implementations§
Source§impl ConfigLoader for Monitor
impl ConfigLoader for Monitor
Source§fn resolve_secrets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_secrets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve all secrets in the monitor configuration
Source§fn load_all<'life0, 'async_trait, T>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<T, ConfigError>> + Send + 'async_trait>>where
T: FromIterator<(String, Self)> + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn load_all<'life0, 'async_trait, T>(
path: Option<&'life0 Path>,
) -> Pin<Box<dyn Future<Output = Result<T, ConfigError>> + Send + 'async_trait>>where
T: FromIterator<(String, Self)> + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Load all monitor configurations from a directory
Reads and parses all JSON files in the specified directory (or default config directory) as monitor configurations.
Source§fn load_from_path<'life0, 'async_trait>(
path: &'life0 Path,
) -> Pin<Box<dyn Future<Output = Result<Self, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_from_path<'life0, 'async_trait>(
path: &'life0 Path,
) -> Pin<Box<dyn Future<Output = Result<Self, ConfigError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load a monitor configuration from a specific file
Reads and parses a single JSON file as a monitor configuration.
Source§fn validate_protocol(&self)
fn validate_protocol(&self)
Validate the safety of the protocols used in the monitor
Returns if safe, or logs a warning message if unsafe.
Source§fn is_json_file(path: &Path) -> bool
fn is_json_file(path: &Path) -> bool
Source§impl<'de> Deserialize<'de> for Monitor
impl<'de> Deserialize<'de> for Monitor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Monitor
Auto Trait Implementations§
impl Freeze for Monitor
impl RefUnwindSafe for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl UnwindSafe for Monitor
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
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> 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>
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>
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