pub struct ChainInfo {Show 14 fields
pub name: String,
pub chain: String,
pub icon: String,
pub rpc: Vec<String>,
pub features: Vec<ChainFeature>,
pub faucets: Vec<String>,
pub native_currency: Option<ChainCurrency>,
pub info_url: String,
pub short_name: String,
pub chain_id: u64,
pub network_id: u64,
pub slip44: Option<i64>,
pub ens: Option<ChainEns>,
pub explorers: Vec<ChainExplorer>,
}Expand description
Metadata for an EVM-compatible chain.
Fields§
§name: StringThe chain’s human-readable name.
chain: StringThe short chain identifier (e.g. ETH).
icon: StringAn icon identifier, if any.
rpc: Vec<String>Known RPC endpoints.
features: Vec<ChainFeature>Supported features.
faucets: Vec<String>Faucet URLs.
native_currency: Option<ChainCurrency>The native currency.
info_url: StringAn informational URL.
short_name: StringA short name (e.g. eth).
chain_id: u64The numeric chain id.
network_id: u64The network id.
slip44: Option<i64>SLIP-44 coin type, if any.
ens: Option<ChainEns>ENS registry information, if any.
explorers: Vec<ChainExplorer>Known block explorers.
Implementations§
Source§impl ChainInfo
impl ChainInfo
Sourcepub fn has_feature(&self, feat: &str) -> bool
pub fn has_feature(&self, feat: &str) -> bool
Reports whether the chain supports the named feature.
Sourcepub fn transaction_url(&self, tx_hash: &str) -> Option<String>
pub fn transaction_url(&self, tx_hash: &str) -> Option<String>
Returns a URL to view tx_hash on the chain’s first explorer, or None
if no explorer is configured.
Sourcepub fn explorer_url(&self) -> Option<&str>
pub fn explorer_url(&self) -> Option<&str>
Returns the URL of the chain’s first block explorer, or None.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChainInfo
impl<'de> Deserialize<'de> for ChainInfo
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
Auto Trait Implementations§
impl Freeze for ChainInfo
impl RefUnwindSafe for ChainInfo
impl Send for ChainInfo
impl Sync for ChainInfo
impl Unpin for ChainInfo
impl UnsafeUnpin for ChainInfo
impl UnwindSafe for ChainInfo
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