pub struct ErpcClientConfig {Show 38 fields
pub endpoint: String,
pub avalanche_endpoint: String,
pub account_endpoint: String,
pub user_endpoint: String,
pub headers: Vec<(String, String)>,
pub timeout: Duration,
pub solana_rpc: Option<RpcEndpointConfig>,
pub ethereum_rpc: Option<RpcEndpointConfig>,
pub avalanche_c_rpc: Option<RpcEndpointConfig>,
pub bitcoin_rpc: Option<RpcEndpointConfig>,
pub base_endpoint: String,
pub base_rpc: Option<RpcEndpointConfig>,
pub arbitrum_endpoint: String,
pub arbitrum_rpc: Option<RpcEndpointConfig>,
pub polygon_endpoint: String,
pub polygon_rpc: Option<RpcEndpointConfig>,
pub bsc_endpoint: String,
pub bsc_rpc: Option<RpcEndpointConfig>,
pub optimism_endpoint: String,
pub optimism_rpc: Option<RpcEndpointConfig>,
pub kaia_endpoint: String,
pub kaia_rpc: Option<RpcEndpointConfig>,
pub soneium_endpoint: String,
pub soneium_rpc: Option<RpcEndpointConfig>,
pub monad_endpoint: String,
pub monad_rpc: Option<RpcEndpointConfig>,
pub hyperliquid_endpoint: String,
pub hyperliquid_rpc: Option<RpcEndpointConfig>,
pub arc_endpoint: String,
pub arc_rpc: Option<RpcEndpointConfig>,
pub robinhood_endpoint: String,
pub robinhood_rpc: Option<RpcEndpointConfig>,
pub near_endpoint: String,
pub near_rpc: Option<RpcEndpointConfig>,
pub tron_endpoint: String,
pub tron_rpc: Option<RpcEndpointConfig>,
pub sui_endpoint: String,
pub sui_grpc_web: Option<SuiGrpcWebEndpointConfig>,
/* private fields */
}Expand description
Configuration used to create an crate::ErpcClient.
Fields§
§endpoint: StringOptional JSON-RPC and price endpoint override.
avalanche_endpoint: StringOptional Avalanche endpoint override.
account_endpoint: StringOptional account endpoint override.
user_endpoint: StringOptional user endpoint override.
headers: Vec<(String, String)>Extra request headers.
timeout: DurationRequest timeout.
solana_rpc: Option<RpcEndpointConfig>Optional caller-owned Solana JSON-RPC endpoint.
ethereum_rpc: Option<RpcEndpointConfig>Optional caller-owned Ethereum JSON-RPC endpoint.
avalanche_c_rpc: Option<RpcEndpointConfig>Optional caller-owned Avalanche C-Chain JSON-RPC endpoint.
bitcoin_rpc: Option<RpcEndpointConfig>Optional caller-owned Bitcoin JSON-RPC endpoint.
base_endpoint: StringHosted Base JSON-RPC endpoint override.
base_rpc: Option<RpcEndpointConfig>Optional caller-owned Base JSON-RPC endpoint.
arbitrum_endpoint: StringHosted Arbitrum One JSON-RPC endpoint override.
arbitrum_rpc: Option<RpcEndpointConfig>Optional caller-owned Arbitrum One JSON-RPC endpoint.
polygon_endpoint: StringHosted Polygon PoS mainnet JSON-RPC endpoint override.
polygon_rpc: Option<RpcEndpointConfig>Optional caller-owned Polygon PoS mainnet JSON-RPC endpoint.
bsc_endpoint: StringHosted BNB Smart Chain mainnet JSON-RPC endpoint override.
bsc_rpc: Option<RpcEndpointConfig>Optional caller-owned BNB Smart Chain mainnet JSON-RPC endpoint.
optimism_endpoint: StringHosted OP Mainnet JSON-RPC endpoint override.
optimism_rpc: Option<RpcEndpointConfig>Optional caller-owned OP Mainnet JSON-RPC endpoint.
kaia_endpoint: StringHosted Kaia mainnet JSON-RPC endpoint override.
kaia_rpc: Option<RpcEndpointConfig>Optional caller-owned Kaia mainnet JSON-RPC endpoint.
soneium_endpoint: StringHosted Soneium mainnet JSON-RPC endpoint override.
soneium_rpc: Option<RpcEndpointConfig>Optional caller-owned Soneium mainnet JSON-RPC endpoint.
monad_endpoint: StringHosted Monad mainnet JSON-RPC endpoint override.
monad_rpc: Option<RpcEndpointConfig>Optional caller-owned Monad mainnet JSON-RPC endpoint.
hyperliquid_endpoint: StringHosted Hyperliquid HyperEVM mainnet JSON-RPC endpoint override.
hyperliquid_rpc: Option<RpcEndpointConfig>Optional caller-owned Hyperliquid HyperEVM mainnet JSON-RPC endpoint.
arc_endpoint: StringHosted Arc mainnet JSON-RPC endpoint override.
arc_rpc: Option<RpcEndpointConfig>Optional caller-owned Arc mainnet JSON-RPC endpoint.
robinhood_endpoint: StringHosted Robinhood Chain Public Mainnet JSON-RPC endpoint override.
robinhood_rpc: Option<RpcEndpointConfig>Optional caller-owned Robinhood Chain Public Mainnet JSON-RPC endpoint.
near_endpoint: StringHosted NEAR mainnet endpoint override.
near_rpc: Option<RpcEndpointConfig>Optional caller-owned NEAR JSON-RPC endpoint.
tron_endpoint: StringHosted TRON mainnet endpoint override.
tron_rpc: Option<RpcEndpointConfig>Optional caller-owned TRON JSON-RPC endpoint.
sui_endpoint: StringHosted Sui binary gRPC-Web endpoint override.
sui_grpc_web: Option<SuiGrpcWebEndpointConfig>Optional caller-owned Sui binary gRPC-Web endpoint.
Implementations§
Source§impl ErpcClientConfig
impl ErpcClientConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Starts a configuration with production endpoints and a 30-second timeout.
Sourcepub fn for_rpc() -> Self
pub fn for_rpc() -> Self
Starts a keyless configuration for one or more direct RPC endpoints.
Construction succeeds before an override is attached so callers can
build a configuration fluently. crate::ErpcClient::new rejects it
when no valid direct endpoint is configured.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the JSON-RPC and price endpoint.
Sourcepub fn with_avalanche_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_avalanche_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the Avalanche endpoint.
Sourcepub fn with_account_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_account_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the account endpoint.
Sourcepub fn with_user_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_user_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the user endpoint.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Adds an HTTP header after construction-time validation.
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Overrides the request timeout.
Sourcepub fn with_solana_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_solana_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Solana JSON-RPC endpoint.
Sourcepub fn with_ethereum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_ethereum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Ethereum JSON-RPC endpoint.
Sourcepub fn with_avalanche_c_rpc(
self,
endpoint: impl Into<RpcEndpointConfig>,
) -> Self
pub fn with_avalanche_c_rpc( self, endpoint: impl Into<RpcEndpointConfig>, ) -> Self
Selects a caller-owned Avalanche C-Chain JSON-RPC endpoint.
Sourcepub fn with_avalanche_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_avalanche_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Avalanche C-Chain JSON-RPC endpoint.
Sourcepub fn with_bitcoin_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_bitcoin_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Bitcoin JSON-RPC endpoint.
Sourcepub fn with_base_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_base_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Base JSON-RPC endpoint.
Sourcepub fn with_base_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_base_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Base JSON-RPC endpoint.
Sourcepub fn with_arbitrum_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_arbitrum_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Arbitrum One JSON-RPC endpoint.
Sourcepub fn with_arbitrum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_arbitrum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Arbitrum One JSON-RPC endpoint.
Sourcepub fn with_polygon_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_polygon_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Polygon PoS mainnet JSON-RPC endpoint.
Sourcepub fn with_polygon_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_polygon_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Polygon PoS mainnet JSON-RPC endpoint.
Sourcepub fn with_bsc_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_bsc_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted BNB Smart Chain mainnet JSON-RPC endpoint.
Sourcepub fn with_bsc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_bsc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned BNB Smart Chain mainnet JSON-RPC endpoint.
Sourcepub fn with_optimism_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_optimism_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted OP Mainnet JSON-RPC endpoint.
Sourcepub fn with_optimism_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_optimism_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned OP Mainnet JSON-RPC endpoint.
Sourcepub fn with_kaia_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_kaia_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Kaia mainnet JSON-RPC endpoint.
Sourcepub fn with_kaia_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_kaia_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Kaia mainnet JSON-RPC endpoint.
Sourcepub fn with_soneium_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_soneium_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Soneium mainnet JSON-RPC endpoint.
Sourcepub fn with_soneium_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_soneium_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Soneium mainnet JSON-RPC endpoint.
Sourcepub fn with_monad_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_monad_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Monad mainnet JSON-RPC endpoint.
Sourcepub fn with_monad_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_monad_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Monad mainnet JSON-RPC endpoint.
Sourcepub fn with_hyperliquid_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_hyperliquid_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Hyperliquid HyperEVM mainnet JSON-RPC endpoint.
Sourcepub fn with_hyperliquid_rpc(
self,
endpoint: impl Into<RpcEndpointConfig>,
) -> Self
pub fn with_hyperliquid_rpc( self, endpoint: impl Into<RpcEndpointConfig>, ) -> Self
Selects a caller-owned Hyperliquid HyperEVM mainnet JSON-RPC endpoint.
Sourcepub fn with_arc_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_arc_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Arc mainnet JSON-RPC endpoint.
Sourcepub fn with_arc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_arc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Arc mainnet JSON-RPC endpoint.
Sourcepub fn with_robinhood_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_robinhood_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Robinhood Chain Public Mainnet JSON-RPC endpoint.
Sourcepub fn with_robinhood_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_robinhood_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned Robinhood Chain Public Mainnet JSON-RPC endpoint.
Sourcepub fn with_near_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_near_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted NEAR endpoint.
Sourcepub fn with_near_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_near_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned NEAR JSON-RPC endpoint.
Sourcepub fn with_tron_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_tron_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted TRON endpoint.
Sourcepub fn with_tron_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
pub fn with_tron_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self
Selects a caller-owned TRON JSON-RPC endpoint.
Sourcepub fn with_sui_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_sui_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the hosted Sui binary gRPC-Web endpoint.
Sourcepub fn with_sui_grpc_web(
self,
endpoint: impl Into<SuiGrpcWebEndpointConfig>,
) -> Self
pub fn with_sui_grpc_web( self, endpoint: impl Into<SuiGrpcWebEndpointConfig>, ) -> Self
Selects a caller-owned Sui binary gRPC-Web endpoint.