pub struct DydxAdapterConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> DydxAdapterConfigBuilder<S>
impl<S: State> DydxAdapterConfigBuilder<S>
Sourcepub fn build(self) -> DydxAdapterConfigwhere
S: IsComplete,
pub fn build(self) -> DydxAdapterConfigwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn network(
self,
value: DydxNetwork,
) -> DydxAdapterConfigBuilder<SetNetwork<S>>where
S::Network: IsUnset,
pub fn network(
self,
value: DydxNetwork,
) -> DydxAdapterConfigBuilder<SetNetwork<S>>where
S::Network: IsUnset,
Sourcepub fn maybe_network(
self,
value: Option<DydxNetwork>,
) -> DydxAdapterConfigBuilder<SetNetwork<S>>where
S::Network: IsUnset,
pub fn maybe_network(
self,
value: Option<DydxNetwork>,
) -> DydxAdapterConfigBuilder<SetNetwork<S>>where
S::Network: IsUnset,
Sourcepub fn base_url(self, value: String) -> DydxAdapterConfigBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
pub fn base_url(self, value: String) -> DydxAdapterConfigBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
Sourcepub fn maybe_base_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
pub fn maybe_base_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
Sourcepub fn ws_url(self, value: String) -> DydxAdapterConfigBuilder<SetWsUrl<S>>where
S::WsUrl: IsUnset,
pub fn ws_url(self, value: String) -> DydxAdapterConfigBuilder<SetWsUrl<S>>where
S::WsUrl: IsUnset,
Sourcepub fn maybe_ws_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetWsUrl<S>>where
S::WsUrl: IsUnset,
pub fn maybe_ws_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetWsUrl<S>>where
S::WsUrl: IsUnset,
Sourcepub fn grpc_url(self, value: String) -> DydxAdapterConfigBuilder<SetGrpcUrl<S>>where
S::GrpcUrl: IsUnset,
pub fn grpc_url(self, value: String) -> DydxAdapterConfigBuilder<SetGrpcUrl<S>>where
S::GrpcUrl: IsUnset,
Sourcepub fn maybe_grpc_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetGrpcUrl<S>>where
S::GrpcUrl: IsUnset,
pub fn maybe_grpc_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetGrpcUrl<S>>where
S::GrpcUrl: IsUnset,
Sourcepub fn grpc_urls(
self,
value: Vec<String>,
) -> DydxAdapterConfigBuilder<SetGrpcUrls<S>>where
S::GrpcUrls: IsUnset,
pub fn grpc_urls(
self,
value: Vec<String>,
) -> DydxAdapterConfigBuilder<SetGrpcUrls<S>>where
S::GrpcUrls: IsUnset,
Optional (Some / Option setters). Default:
urls::grpc_urls(DydxNetwork::Mainnet)
.iter()
.map(|&s| s.to_string())
.collect()List of gRPC URLs with fallback support.
If provided, the client will attempt to connect to each URL in order until a successful connection is established. This is recommended for production use in DEX environments where nodes can fail.
Sourcepub fn maybe_grpc_urls(
self,
value: Option<Vec<String>>,
) -> DydxAdapterConfigBuilder<SetGrpcUrls<S>>where
S::GrpcUrls: IsUnset,
pub fn maybe_grpc_urls(
self,
value: Option<Vec<String>>,
) -> DydxAdapterConfigBuilder<SetGrpcUrls<S>>where
S::GrpcUrls: IsUnset,
Optional (Some / Option setters). Default:
urls::grpc_urls(DydxNetwork::Mainnet)
.iter()
.map(|&s| s.to_string())
.collect()List of gRPC URLs with fallback support.
If provided, the client will attempt to connect to each URL in order until a successful connection is established. This is recommended for production use in DEX environments where nodes can fail.
Sourcepub fn chain_id(self, value: String) -> DydxAdapterConfigBuilder<SetChainId<S>>where
S::ChainId: IsUnset,
pub fn chain_id(self, value: String) -> DydxAdapterConfigBuilder<SetChainId<S>>where
S::ChainId: IsUnset,
Sourcepub fn maybe_chain_id(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetChainId<S>>where
S::ChainId: IsUnset,
pub fn maybe_chain_id(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetChainId<S>>where
S::ChainId: IsUnset,
Sourcepub fn timeout_secs(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetTimeoutSecs<S>>where
S::TimeoutSecs: IsUnset,
pub fn timeout_secs(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetTimeoutSecs<S>>where
S::TimeoutSecs: IsUnset,
Sourcepub fn maybe_timeout_secs(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetTimeoutSecs<S>>where
S::TimeoutSecs: IsUnset,
pub fn maybe_timeout_secs(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetTimeoutSecs<S>>where
S::TimeoutSecs: IsUnset,
Sourcepub fn wallet_address(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetWalletAddress<S>>where
S::WalletAddress: IsUnset,
pub fn wallet_address(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetWalletAddress<S>>where
S::WalletAddress: IsUnset,
Sourcepub fn maybe_wallet_address(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetWalletAddress<S>>where
S::WalletAddress: IsUnset,
pub fn maybe_wallet_address(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetWalletAddress<S>>where
S::WalletAddress: IsUnset,
Sourcepub fn subaccount(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetSubaccount<S>>where
S::Subaccount: IsUnset,
pub fn subaccount(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetSubaccount<S>>where
S::Subaccount: IsUnset,
Sourcepub fn maybe_subaccount(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetSubaccount<S>>where
S::Subaccount: IsUnset,
pub fn maybe_subaccount(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetSubaccount<S>>where
S::Subaccount: IsUnset,
Sourcepub fn private_key(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetPrivateKey<S>>where
S::PrivateKey: IsUnset,
pub fn private_key(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetPrivateKey<S>>where
S::PrivateKey: IsUnset,
Sourcepub fn maybe_private_key(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetPrivateKey<S>>where
S::PrivateKey: IsUnset,
pub fn maybe_private_key(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetPrivateKey<S>>where
S::PrivateKey: IsUnset,
Sourcepub fn authenticator_ids(
self,
value: Vec<u64>,
) -> DydxAdapterConfigBuilder<SetAuthenticatorIds<S>>where
S::AuthenticatorIds: IsUnset,
pub fn authenticator_ids(
self,
value: Vec<u64>,
) -> DydxAdapterConfigBuilder<SetAuthenticatorIds<S>>where
S::AuthenticatorIds: IsUnset,
Optional (Some / Option setters).
Default: <Vec<u64> as Default>::default().
Authenticator IDs for permissioned key trading.
When provided, transactions will include a TxExtension to enable trading via sub-accounts using delegated signing keys. This is an advanced feature for institutional setups with separated hot/cold wallet architectures.
See https://docs.dydx.xyz/concepts/trading/authenticators for details on permissioned keys and authenticator configuration.
Sourcepub fn maybe_authenticator_ids(
self,
value: Option<Vec<u64>>,
) -> DydxAdapterConfigBuilder<SetAuthenticatorIds<S>>where
S::AuthenticatorIds: IsUnset,
pub fn maybe_authenticator_ids(
self,
value: Option<Vec<u64>>,
) -> DydxAdapterConfigBuilder<SetAuthenticatorIds<S>>where
S::AuthenticatorIds: IsUnset,
Optional (Some / Option setters).
Default: <Vec<u64> as Default>::default().
Authenticator IDs for permissioned key trading.
When provided, transactions will include a TxExtension to enable trading via sub-accounts using delegated signing keys. This is an advanced feature for institutional setups with separated hot/cold wallet architectures.
See https://docs.dydx.xyz/concepts/trading/authenticators for details on permissioned keys and authenticator configuration.
Sourcepub fn max_retries(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
pub fn max_retries(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
Sourcepub fn maybe_max_retries(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
pub fn maybe_max_retries(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
Sourcepub fn retry_delay_initial_ms(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetRetryDelayInitialMs<S>>where
S::RetryDelayInitialMs: IsUnset,
pub fn retry_delay_initial_ms(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetRetryDelayInitialMs<S>>where
S::RetryDelayInitialMs: IsUnset,
Sourcepub fn maybe_retry_delay_initial_ms(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetRetryDelayInitialMs<S>>where
S::RetryDelayInitialMs: IsUnset,
pub fn maybe_retry_delay_initial_ms(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetRetryDelayInitialMs<S>>where
S::RetryDelayInitialMs: IsUnset,
Sourcepub fn retry_delay_max_ms(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetRetryDelayMaxMs<S>>where
S::RetryDelayMaxMs: IsUnset,
pub fn retry_delay_max_ms(
self,
value: u64,
) -> DydxAdapterConfigBuilder<SetRetryDelayMaxMs<S>>where
S::RetryDelayMaxMs: IsUnset,
Sourcepub fn maybe_retry_delay_max_ms(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetRetryDelayMaxMs<S>>where
S::RetryDelayMaxMs: IsUnset,
pub fn maybe_retry_delay_max_ms(
self,
value: Option<u64>,
) -> DydxAdapterConfigBuilder<SetRetryDelayMaxMs<S>>where
S::RetryDelayMaxMs: IsUnset,
Sourcepub fn grpc_rate_limit_per_second(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetGrpcRateLimitPerSecond<S>>where
S::GrpcRateLimitPerSecond: IsUnset,
pub fn grpc_rate_limit_per_second(
self,
value: u32,
) -> DydxAdapterConfigBuilder<SetGrpcRateLimitPerSecond<S>>where
S::GrpcRateLimitPerSecond: IsUnset,
Optional (Some / Option setters). gRPC rate limit: maximum broadcast requests per second.
Controls the rate of gRPC broadcast_tx calls to prevent 429 (ResourceExhausted)
errors from validator nodes. Known provider limits:
- Polkachu: 300 req/min (~5 req/s)
- KingNodes: 250 req/min (~4.2 req/s)
- AutoStake: 4 req/s
Default: 4 requests per second (conservative, works across all public providers).
When None, rate limiting is disabled.
Sourcepub fn maybe_grpc_rate_limit_per_second(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetGrpcRateLimitPerSecond<S>>where
S::GrpcRateLimitPerSecond: IsUnset,
pub fn maybe_grpc_rate_limit_per_second(
self,
value: Option<u32>,
) -> DydxAdapterConfigBuilder<SetGrpcRateLimitPerSecond<S>>where
S::GrpcRateLimitPerSecond: IsUnset,
Optional (Some / Option setters). gRPC rate limit: maximum broadcast requests per second.
Controls the rate of gRPC broadcast_tx calls to prevent 429 (ResourceExhausted)
errors from validator nodes. Known provider limits:
- Polkachu: 300 req/min (~5 req/s)
- KingNodes: 250 req/min (~4.2 req/s)
- AutoStake: 4 req/s
Default: 4 requests per second (conservative, works across all public providers).
When None, rate limiting is disabled.
Sourcepub fn proxy_url(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetProxyUrl<S>>where
S::ProxyUrl: IsUnset,
pub fn proxy_url(
self,
value: String,
) -> DydxAdapterConfigBuilder<SetProxyUrl<S>>where
S::ProxyUrl: IsUnset,
Sourcepub fn maybe_proxy_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetProxyUrl<S>>where
S::ProxyUrl: IsUnset,
pub fn maybe_proxy_url(
self,
value: Option<String>,
) -> DydxAdapterConfigBuilder<SetProxyUrl<S>>where
S::ProxyUrl: IsUnset,
Sourcepub fn transport_backend(
self,
value: TransportBackend,
) -> DydxAdapterConfigBuilder<SetTransportBackend<S>>where
S::TransportBackend: IsUnset,
pub fn transport_backend(
self,
value: TransportBackend,
) -> DydxAdapterConfigBuilder<SetTransportBackend<S>>where
S::TransportBackend: IsUnset,
Sourcepub fn maybe_transport_backend(
self,
value: Option<TransportBackend>,
) -> DydxAdapterConfigBuilder<SetTransportBackend<S>>where
S::TransportBackend: IsUnset,
pub fn maybe_transport_backend(
self,
value: Option<TransportBackend>,
) -> DydxAdapterConfigBuilder<SetTransportBackend<S>>where
S::TransportBackend: IsUnset,
Auto Trait Implementations§
impl<S> Freeze for DydxAdapterConfigBuilder<S>
impl<S> RefUnwindSafe for DydxAdapterConfigBuilder<S>
impl<S> Send for DydxAdapterConfigBuilder<S>
impl<S> Sync for DydxAdapterConfigBuilder<S>
impl<S> Unpin for DydxAdapterConfigBuilder<S>
impl<S> UnsafeUnpin for DydxAdapterConfigBuilder<S>
impl<S> UnwindSafe for DydxAdapterConfigBuilder<S>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].