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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more