pub struct NetworkConfig {
pub network_name: String,
pub rpc_endpoints: Vec<RPCEndpoint>,
pub linkdrop_account_id: Option<AccountId>,
pub near_social_db_contract_account_id: Option<AccountId>,
pub faucet_url: Option<Url>,
pub meta_transaction_relayer_url: Option<Url>,
pub fastnear_url: Option<Url>,
pub staking_pools_factory_account_id: Option<AccountId>,
}Expand description
Configuration for a NEAR network including RPC endpoints and network-specific settings.
§Multiple RPC endpoints
This struct is used to configure multiple RPC endpoints for a NEAR network. It allows for failover between endpoints in case of a failure.
§Example
use near_api::*;
let config = NetworkConfig {
rpc_endpoints: vec![RPCEndpoint::mainnet(), RPCEndpoint::new("https://near.lava.build".parse()?)],
..NetworkConfig::mainnet()
};Fields§
§network_name: StringHuman readable name of the network (e.g. “mainnet”, “testnet”)
rpc_endpoints: Vec<RPCEndpoint>List of RPC endpoints to use with failover
linkdrop_account_id: Option<AccountId>Account ID used for linkdrop functionality
Account ID of the NEAR Social contract
faucet_url: Option<Url>URL of the network’s faucet service
meta_transaction_relayer_url: Option<Url>URL for the meta transaction relayer service
fastnear_url: Option<Url>§staking_pools_factory_account_id: Option<AccountId>Account ID of the staking pools factory
Implementations§
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkConfig
impl Debug for NetworkConfig
Source§impl<'de> Deserialize<'de> for NetworkConfig
impl<'de> Deserialize<'de> for NetworkConfig
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 NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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