pub struct Dex {
pub chain: Chain,
pub name: Cow<'static, str>,
pub factory: Cow<'static, str>,
pub pool_created_event: Cow<'static, str>,
pub swap_created_event: Cow<'static, str>,
pub mint_created_event: Cow<'static, str>,
pub burn_created_event: Cow<'static, str>,
pub amm_type: AmmType,
/* private fields */
}
Expand description
Represents a decentralized exchange (DEX) in a blockchain ecosystem.
Fields§
§chain: Chain
The blockchain network where this DEX operates.
name: Cow<'static, str>
The name of the DEX protocol.
factory: Cow<'static, str>
The blockchain address of the DEX factory contract.
pool_created_event: Cow<'static, str>
The event signature or identifier used to detect pool creation events.
swap_created_event: Cow<'static, str>
The event signature or identifier used to detect swap events.
mint_created_event: Cow<'static, str>
The event signature or identifier used to detect mint events.
burn_created_event: Cow<'static, str>
The event signature or identifier used to detect burn events.
amm_type: AmmType
The type of automated market maker (AMM) algorithm used by this DEX.
Implementations§
Source§impl Dex
impl Dex
Sourcepub fn new(
chain: Chain,
name: impl Into<Cow<'static, str>>,
factory: impl Into<Cow<'static, str>>,
amm_type: AmmType,
pool_created_event: impl Into<Cow<'static, str>>,
swap_created_event: impl Into<Cow<'static, str>>,
mint_created_event: impl Into<Cow<'static, str>>,
burn_created_event: impl Into<Cow<'static, str>>,
) -> Self
pub fn new( chain: Chain, name: impl Into<Cow<'static, str>>, factory: impl Into<Cow<'static, str>>, amm_type: AmmType, pool_created_event: impl Into<Cow<'static, str>>, swap_created_event: impl Into<Cow<'static, str>>, mint_created_event: impl Into<Cow<'static, str>>, burn_created_event: impl Into<Cow<'static, str>>, ) -> Self
Creates a new Dex
instance with the specified properties.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dex
impl<'de> Deserialize<'de> for Dex
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Dex
Auto Trait Implementations§
impl Freeze for Dex
impl RefUnwindSafe for Dex
impl Send for Dex
impl Sync for Dex
impl Unpin for Dex
impl UnwindSafe for Dex
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> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
Adds separators according to the given
SeparatorPolicy
. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Inserts a comma every three digits from the right. Read more
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Inserts a space every three digits from the right. Read more
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Inserts a period every three digits from the right. Read more
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Inserts an underscore every three digits from the right. Read more