pub struct TxSubmitClientBuilder { /* private fields */ }Expand description
High-level builder for common TxSubmitClient configurations.
Implementations§
Source§impl TxSubmitClientBuilder
impl TxSubmitClientBuilder
Sourcepub fn with_blockhash_provider(
self,
provider: Arc<dyn RecentBlockhashProvider>,
) -> Self
pub fn with_blockhash_provider( self, provider: Arc<dyn RecentBlockhashProvider>, ) -> Self
Sets the explicit blockhash provider.
Sourcepub fn with_blockhash_via_rpc(
self,
rpc_url: impl Into<String>,
) -> Result<Self, SubmitTransportError>
pub fn with_blockhash_via_rpc( self, rpc_url: impl Into<String>, ) -> Result<Self, SubmitTransportError>
Uses one RPC endpoint as an on-demand blockhash source for unsigned submits.
§Errors
Returns SubmitTransportError when the RPC-backed provider cannot be created.
Sourcepub fn with_leader_provider(self, provider: Arc<dyn LeaderProvider>) -> Self
pub fn with_leader_provider(self, provider: Arc<dyn LeaderProvider>) -> Self
Sets the explicit leader provider.
Sourcepub fn without_leaders(self) -> Self
pub fn without_leaders(self) -> Self
Resets the leader source to an empty static provider.
Sourcepub fn with_backups(self, backups: Vec<LeaderTarget>) -> Self
pub fn with_backups(self, backups: Vec<LeaderTarget>) -> Self
Sets optional backup validators.
Sourcepub const fn with_routing_policy(self, policy: RoutingPolicy) -> Self
pub const fn with_routing_policy(self, policy: RoutingPolicy) -> Self
Sets the direct routing policy.
Sourcepub fn with_rpc_defaults(
self,
rpc_url: impl Into<String>,
) -> Result<Self, SubmitTransportError>
pub fn with_rpc_defaults( self, rpc_url: impl Into<String>, ) -> Result<Self, SubmitTransportError>
Uses one RPC endpoint for both on-demand blockhash refresh and RPC submission.
§Errors
Returns SubmitTransportError when the blockhash provider or RPC transport cannot be
created.
Sourcepub fn with_rpc_transport(self, transport: Arc<dyn RpcSubmitTransport>) -> Self
pub fn with_rpc_transport(self, transport: Arc<dyn RpcSubmitTransport>) -> Self
Sets the explicit RPC submit transport.
Sourcepub fn with_jito_defaults(
self,
rpc_url: impl Into<String>,
) -> Result<Self, SubmitTransportError>
pub fn with_jito_defaults( self, rpc_url: impl Into<String>, ) -> Result<Self, SubmitTransportError>
Uses the default Jito JSON-RPC transport and one RPC endpoint for on-demand blockhashes.
§Errors
Returns SubmitTransportError when the blockhash provider or Jito transport cannot be
created.
Sourcepub fn with_jito_transport(
self,
transport: Arc<dyn JitoSubmitTransport>,
) -> Self
pub fn with_jito_transport( self, transport: Arc<dyn JitoSubmitTransport>, ) -> Self
Sets the explicit Jito submit transport.
Sourcepub fn with_direct_udp(self) -> Self
pub fn with_direct_udp(self) -> Self
Uses the default UDP direct transport.
Sourcepub fn with_direct_transport(
self,
transport: Arc<dyn DirectSubmitTransport>,
) -> Self
pub fn with_direct_transport( self, transport: Arc<dyn DirectSubmitTransport>, ) -> Self
Sets the explicit direct submit transport.
Sourcepub fn with_rpc_config(self, config: RpcSubmitConfig) -> Self
pub fn with_rpc_config(self, config: RpcSubmitConfig) -> Self
Sets the RPC submit tuning.
Sourcepub const fn with_jito_config(self, config: JitoSubmitConfig) -> Self
pub const fn with_jito_config(self, config: JitoSubmitConfig) -> Self
Sets the Jito submit tuning.
Sourcepub const fn with_direct_config(self, config: DirectSubmitConfig) -> Self
pub const fn with_direct_config(self, config: DirectSubmitConfig) -> Self
Sets the direct submit tuning.
Sourcepub const fn with_reliability(self, reliability: SubmitReliability) -> Self
pub const fn with_reliability(self, reliability: SubmitReliability) -> Self
Applies a direct/hybrid reliability preset.
Sourcepub fn with_flow_safety_source(
self,
source: Arc<dyn TxFlowSafetySource>,
) -> Self
pub fn with_flow_safety_source( self, source: Arc<dyn TxFlowSafetySource>, ) -> Self
Sets the toxic-flow guard source.
Sourcepub const fn with_guard_policy(self, policy: TxSubmitGuardPolicy) -> Self
pub const fn with_guard_policy(self, policy: TxSubmitGuardPolicy) -> Self
Sets the toxic-flow guard policy.
Sourcepub fn with_outcome_reporter(
self,
reporter: Arc<dyn TxSubmitOutcomeReporter>,
) -> Self
pub fn with_outcome_reporter( self, reporter: Arc<dyn TxSubmitOutcomeReporter>, ) -> Self
Sets an optional external outcome reporter.
Sourcepub fn build(self) -> TxSubmitClient
pub fn build(self) -> TxSubmitClient
Builds the configured TxSubmitClient.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxSubmitClientBuilder
impl !RefUnwindSafe for TxSubmitClientBuilder
impl Send for TxSubmitClientBuilder
impl Sync for TxSubmitClientBuilder
impl Unpin for TxSubmitClientBuilder
impl UnsafeUnpin for TxSubmitClientBuilder
impl !UnwindSafe for TxSubmitClientBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more