Skip to main content

ErpcClientConfig

Struct ErpcClientConfig 

Source
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: String

Optional JSON-RPC and price endpoint override.

§avalanche_endpoint: String

Optional Avalanche endpoint override.

§account_endpoint: String

Optional account endpoint override.

§user_endpoint: String

Optional user endpoint override.

§headers: Vec<(String, String)>

Extra request headers.

§timeout: Duration

Request 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: String

Hosted Base JSON-RPC endpoint override.

§base_rpc: Option<RpcEndpointConfig>

Optional caller-owned Base JSON-RPC endpoint.

§arbitrum_endpoint: String

Hosted Arbitrum One JSON-RPC endpoint override.

§arbitrum_rpc: Option<RpcEndpointConfig>

Optional caller-owned Arbitrum One JSON-RPC endpoint.

§polygon_endpoint: String

Hosted Polygon PoS mainnet JSON-RPC endpoint override.

§polygon_rpc: Option<RpcEndpointConfig>

Optional caller-owned Polygon PoS mainnet JSON-RPC endpoint.

§bsc_endpoint: String

Hosted BNB Smart Chain mainnet JSON-RPC endpoint override.

§bsc_rpc: Option<RpcEndpointConfig>

Optional caller-owned BNB Smart Chain mainnet JSON-RPC endpoint.

§optimism_endpoint: String

Hosted OP Mainnet JSON-RPC endpoint override.

§optimism_rpc: Option<RpcEndpointConfig>

Optional caller-owned OP Mainnet JSON-RPC endpoint.

§kaia_endpoint: String

Hosted Kaia mainnet JSON-RPC endpoint override.

§kaia_rpc: Option<RpcEndpointConfig>

Optional caller-owned Kaia mainnet JSON-RPC endpoint.

§soneium_endpoint: String

Hosted Soneium mainnet JSON-RPC endpoint override.

§soneium_rpc: Option<RpcEndpointConfig>

Optional caller-owned Soneium mainnet JSON-RPC endpoint.

§monad_endpoint: String

Hosted Monad mainnet JSON-RPC endpoint override.

§monad_rpc: Option<RpcEndpointConfig>

Optional caller-owned Monad mainnet JSON-RPC endpoint.

§hyperliquid_endpoint: String

Hosted Hyperliquid HyperEVM mainnet JSON-RPC endpoint override.

§hyperliquid_rpc: Option<RpcEndpointConfig>

Optional caller-owned Hyperliquid HyperEVM mainnet JSON-RPC endpoint.

§arc_endpoint: String

Hosted Arc mainnet JSON-RPC endpoint override.

§arc_rpc: Option<RpcEndpointConfig>

Optional caller-owned Arc mainnet JSON-RPC endpoint.

§robinhood_endpoint: String

Hosted Robinhood Chain Public Mainnet JSON-RPC endpoint override.

§robinhood_rpc: Option<RpcEndpointConfig>

Optional caller-owned Robinhood Chain Public Mainnet JSON-RPC endpoint.

§near_endpoint: String

Hosted NEAR mainnet endpoint override.

§near_rpc: Option<RpcEndpointConfig>

Optional caller-owned NEAR JSON-RPC endpoint.

§tron_endpoint: String

Hosted TRON mainnet endpoint override.

§tron_rpc: Option<RpcEndpointConfig>

Optional caller-owned TRON JSON-RPC endpoint.

§sui_endpoint: String

Hosted Sui binary gRPC-Web endpoint override.

§sui_grpc_web: Option<SuiGrpcWebEndpointConfig>

Optional caller-owned Sui binary gRPC-Web endpoint.

Implementations§

Source§

impl ErpcClientConfig

Source

pub fn new(api_key: impl Into<String>) -> Self

Starts a configuration with production endpoints and a 30-second timeout.

Source

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.

Source

pub fn api_key(&self) -> &str

Returns the API key without placing it in debug output.

Source

pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the JSON-RPC and price endpoint.

Source

pub fn with_avalanche_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the Avalanche endpoint.

Source

pub fn with_account_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the account endpoint.

Source

pub fn with_user_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the user endpoint.

Source

pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self

Adds an HTTP header after construction-time validation.

Source

pub const fn with_timeout(self, timeout: Duration) -> Self

Overrides the request timeout.

Source

pub fn with_solana_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Solana JSON-RPC endpoint.

Source

pub fn with_ethereum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Ethereum JSON-RPC endpoint.

Source

pub fn with_avalanche_c_rpc( self, endpoint: impl Into<RpcEndpointConfig>, ) -> Self

Selects a caller-owned Avalanche C-Chain JSON-RPC endpoint.

Source

pub fn with_avalanche_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Avalanche C-Chain JSON-RPC endpoint.

Source

pub fn with_bitcoin_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Bitcoin JSON-RPC endpoint.

Source

pub fn with_base_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Base JSON-RPC endpoint.

Source

pub fn with_base_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Base JSON-RPC endpoint.

Source

pub fn with_arbitrum_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Arbitrum One JSON-RPC endpoint.

Source

pub fn with_arbitrum_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Arbitrum One JSON-RPC endpoint.

Source

pub fn with_polygon_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Polygon PoS mainnet JSON-RPC endpoint.

Source

pub fn with_polygon_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Polygon PoS mainnet JSON-RPC endpoint.

Source

pub fn with_bsc_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted BNB Smart Chain mainnet JSON-RPC endpoint.

Source

pub fn with_bsc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned BNB Smart Chain mainnet JSON-RPC endpoint.

Source

pub fn with_optimism_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted OP Mainnet JSON-RPC endpoint.

Source

pub fn with_optimism_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned OP Mainnet JSON-RPC endpoint.

Source

pub fn with_kaia_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Kaia mainnet JSON-RPC endpoint.

Source

pub fn with_kaia_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Kaia mainnet JSON-RPC endpoint.

Source

pub fn with_soneium_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Soneium mainnet JSON-RPC endpoint.

Source

pub fn with_soneium_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Soneium mainnet JSON-RPC endpoint.

Source

pub fn with_monad_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Monad mainnet JSON-RPC endpoint.

Source

pub fn with_monad_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Monad mainnet JSON-RPC endpoint.

Source

pub fn with_hyperliquid_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Hyperliquid HyperEVM mainnet JSON-RPC endpoint.

Source

pub fn with_hyperliquid_rpc( self, endpoint: impl Into<RpcEndpointConfig>, ) -> Self

Selects a caller-owned Hyperliquid HyperEVM mainnet JSON-RPC endpoint.

Source

pub fn with_arc_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Arc mainnet JSON-RPC endpoint.

Source

pub fn with_arc_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Arc mainnet JSON-RPC endpoint.

Source

pub fn with_robinhood_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Robinhood Chain Public Mainnet JSON-RPC endpoint.

Source

pub fn with_robinhood_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned Robinhood Chain Public Mainnet JSON-RPC endpoint.

Source

pub fn with_near_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted NEAR endpoint.

Source

pub fn with_near_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned NEAR JSON-RPC endpoint.

Source

pub fn with_tron_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted TRON endpoint.

Source

pub fn with_tron_rpc(self, endpoint: impl Into<RpcEndpointConfig>) -> Self

Selects a caller-owned TRON JSON-RPC endpoint.

Source

pub fn with_sui_endpoint(self, endpoint: impl Into<String>) -> Self

Overrides the hosted Sui binary gRPC-Web endpoint.

Source

pub fn with_sui_grpc_web( self, endpoint: impl Into<SuiGrpcWebEndpointConfig>, ) -> Self

Selects a caller-owned Sui binary gRPC-Web endpoint.

Trait Implementations§

Source§

impl Clone for ErpcClientConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErpcClientConfig

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more