pub struct ProtocolComponent {
pub id: ComponentId,
pub protocol_system: String,
pub protocol_type_name: String,
pub chain: Chain,
pub tokens: Vec<Address>,
pub contract_addresses: Vec<Address>,
pub static_attributes: HashMap<AttrStoreKey, StoreVal>,
pub change: ChangeType,
pub creation_tx: TxHash,
pub created_at: NaiveDateTime,
}Expand description
ProtocolComponent provides detailed descriptions of a component of a protocol,
for example, swap pools that enables the exchange of two tokens.
A ProtocolComponent can be associated with an Account, and it has an identifier (id) that
can be either the on-chain address or a custom one. It belongs to a specific ProtocolSystem
and has a ProtocolTypeID that associates it with a ProtocolType that describes its behaviour
e.g., swap, lend, bridge. The component is associated with a specific Chain and holds
information about tradable tokens, related contract IDs, and static attributes.
Every values of a ProtocolComponent must be static, they can’t ever be changed after creation.
The dynamic values associated to a component must be given using ProtocolComponentState.
Fields§
§id: ComponentId§protocol_system: String§protocol_type_name: String§chain: Chain§tokens: Vec<Address>§contract_addresses: Vec<Address>§static_attributes: HashMap<AttrStoreKey, StoreVal>§change: ChangeType§creation_tx: TxHash§created_at: NaiveDateTimeImplementations§
Trait Implementations§
Source§impl Clone for ProtocolComponent
impl Clone for ProtocolComponent
Source§fn clone(&self) -> ProtocolComponent
fn clone(&self) -> ProtocolComponent
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolComponent
impl Debug for ProtocolComponent
Source§impl DeepSizeOf for ProtocolComponent
impl DeepSizeOf for ProtocolComponent
Source§fn deep_size_of_children(&self, ctx: &mut Context) -> usize
fn deep_size_of_children(&self, ctx: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl Default for ProtocolComponent
impl Default for ProtocolComponent
Source§fn default() -> ProtocolComponent
fn default() -> ProtocolComponent
Source§impl<'de> Deserialize<'de> for ProtocolComponent
impl<'de> Deserialize<'de> for ProtocolComponent
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>,
Source§impl From<ProtocolComponent> for ProtocolComponent
impl From<ProtocolComponent> for ProtocolComponent
Source§fn from(value: ProtocolComponent) -> Self
fn from(value: ProtocolComponent) -> Self
Source§impl PartialEq for ProtocolComponent
impl PartialEq for ProtocolComponent
Source§impl Serialize for ProtocolComponent
impl Serialize for ProtocolComponent
impl StructuralPartialEq for ProtocolComponent
Auto Trait Implementations§
impl !Freeze for ProtocolComponent
impl RefUnwindSafe for ProtocolComponent
impl Send for ProtocolComponent
impl Sync for ProtocolComponent
impl Unpin for ProtocolComponent
impl UnwindSafe for ProtocolComponent
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)