pub enum Chain {
Show 17 variants
Polkadot,
Kusama,
Moonbeam,
Astar,
Acala,
Phala,
Bifrost,
Westend,
Paseo,
Ethereum,
BinanceSmartChain,
Polygon,
Avalanche,
Arbitrum,
Optimism,
ZkSync,
Base,
}Expand description
Supported blockchain networks
Variants§
Polkadot
Polkadot relay chain
Kusama
Kusama relay chain
Moonbeam
Moonbeam (Polkadot parachain with EVM)
Astar
Astar (Polkadot parachain with EVM)
Acala
Acala DeFi Hub
Phala
Phala Privacy Cloud
Bifrost
Bifrost Liquid Staking
Westend
Westend testnet
Paseo
Paseo testnet (default)
Ethereum
Ethereum mainnet
BinanceSmartChain
Binance Smart Chain
Polygon
Polygon
Avalanche
Avalanche C-Chain
Arbitrum
Arbitrum One
Optimism
Optimism
ZkSync
zkSync Era
Base
Base (Coinbase L2)
Implementations§
Source§impl Chain
impl Chain
Sourcepub fn chain_type(&self) -> ChainType
pub fn chain_type(&self) -> ChainType
Get the chain type
Sourcepub fn default_endpoint(&self) -> &str
pub fn default_endpoint(&self) -> &str
Get default RPC endpoint for the chain
Sourcepub fn rpc_endpoints(&self) -> Vec<&str>
pub fn rpc_endpoints(&self) -> Vec<&str>
Get multiple RPC endpoints for reliability and failover
Sourcepub fn supports_smart_contracts(&self) -> bool
pub fn supports_smart_contracts(&self) -> bool
Check if chain supports smart contracts
Sourcepub fn is_testnet(&self) -> bool
pub fn is_testnet(&self) -> bool
Check if this is a testnet
Sourcepub fn from_str_case_insensitive(s: &str) -> Option<Self>
pub fn from_str_case_insensitive(s: &str) -> Option<Self>
Parse chain from string (case-insensitive)
Sourcepub fn is_substrate_endpoint(endpoint: &str) -> bool
pub fn is_substrate_endpoint(endpoint: &str) -> bool
Check if an endpoint URL is for Substrate (WebSocket-based)
Sourcepub fn is_evm_endpoint(endpoint: &str) -> bool
pub fn is_evm_endpoint(endpoint: &str) -> bool
Check if an endpoint URL is for EVM (HTTP-based)
Sourcepub fn chain_id(&self) -> Option<u64>
pub fn chain_id(&self) -> Option<u64>
Get the chain ID for EVM-compatible chains
Returns None for pure Substrate chains that don’t have a chain ID concept. For EVM and Hybrid chains, returns the standard EIP-155 chain ID.
Sourcepub fn validate_chain_id(&self, chain_id: u64) -> Result<(), ValidationError>
pub fn validate_chain_id(&self, chain_id: u64) -> Result<(), ValidationError>
Validate that a given chain ID matches this chain
Returns an error if the chain ID doesn’t match the expected value. For Substrate-only chains, returns an error indicating chain ID is not applicable.