Skip to main content

DeriveExecClientConfigBuilder

Struct DeriveExecClientConfigBuilder 

Source
pub struct DeriveExecClientConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> DeriveExecClientConfigBuilder<S>

Source

pub fn build(self) -> DeriveExecClientConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn wallet_address( self, value: String, ) -> DeriveExecClientConfigBuilder<SetWalletAddress<S>>
where S::WalletAddress: IsUnset,

Optional (Some / Option setters). Derive Chain smart-contract wallet address (X-LYRAWALLET). Falls back to DERIVE_WALLET_ADDRESS (or DERIVE_TESTNET_WALLET_ADDRESS on testnet) when unset.

Source

pub fn maybe_wallet_address( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetWalletAddress<S>>
where S::WalletAddress: IsUnset,

Optional (Some / Option setters). Derive Chain smart-contract wallet address (X-LYRAWALLET). Falls back to DERIVE_WALLET_ADDRESS (or DERIVE_TESTNET_WALLET_ADDRESS on testnet) when unset.

Source

pub fn session_key( self, value: String, ) -> DeriveExecClientConfigBuilder<SetSessionKey<S>>
where S::SessionKey: IsUnset,

Optional (Some / Option setters). secp256k1 session-key private key in hex (with or without 0x prefix). Falls back to DERIVE_SESSION_PRIVATE_KEY (or DERIVE_TESTNET_SESSION_PRIVATE_KEY on testnet) when unset.

Source

pub fn maybe_session_key( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetSessionKey<S>>
where S::SessionKey: IsUnset,

Optional (Some / Option setters). secp256k1 session-key private key in hex (with or without 0x prefix). Falls back to DERIVE_SESSION_PRIVATE_KEY (or DERIVE_TESTNET_SESSION_PRIVATE_KEY on testnet) when unset.

Source

pub fn subaccount_id( self, value: u64, ) -> DeriveExecClientConfigBuilder<SetSubaccountId<S>>
where S::SubaccountId: IsUnset,

Optional (Some / Option setters). Subaccount identifier. Falls back to DERIVE_SUBACCOUNT_ID (or DERIVE_TESTNET_SUBACCOUNT_ID on testnet) when unset.

Source

pub fn maybe_subaccount_id( self, value: Option<u64>, ) -> DeriveExecClientConfigBuilder<SetSubaccountId<S>>
where S::SubaccountId: IsUnset,

Optional (Some / Option setters). Subaccount identifier. Falls back to DERIVE_SUBACCOUNT_ID (or DERIVE_TESTNET_SUBACCOUNT_ID on testnet) when unset.

Source

pub fn base_url_rest( self, value: String, ) -> DeriveExecClientConfigBuilder<SetBaseUrlRest<S>>
where S::BaseUrlRest: IsUnset,

Optional (Some / Option setters). Override for the REST API base URL.

Source

pub fn maybe_base_url_rest( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetBaseUrlRest<S>>
where S::BaseUrlRest: IsUnset,

Optional (Some / Option setters). Override for the REST API base URL.

Source

pub fn base_url_ws( self, value: String, ) -> DeriveExecClientConfigBuilder<SetBaseUrlWs<S>>
where S::BaseUrlWs: IsUnset,

Optional (Some / Option setters). Override for the WebSocket URL.

Source

pub fn maybe_base_url_ws( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetBaseUrlWs<S>>
where S::BaseUrlWs: IsUnset,

Optional (Some / Option setters). Override for the WebSocket URL.

Source

pub fn proxy_url( self, value: String, ) -> DeriveExecClientConfigBuilder<SetProxyUrl<S>>
where S::ProxyUrl: IsUnset,

Optional (Some / Option setters). Optional proxy URL for HTTP and WebSocket transports.

Source

pub fn maybe_proxy_url( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetProxyUrl<S>>
where S::ProxyUrl: IsUnset,

Optional (Some / Option setters). Optional proxy URL for HTTP and WebSocket transports.

Source

pub fn environment( self, value: DeriveEnvironment, ) -> DeriveExecClientConfigBuilder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). Default: <DeriveEnvironment as Default>::default().

The Derive environment to connect to.

Source

pub fn maybe_environment( self, value: Option<DeriveEnvironment>, ) -> DeriveExecClientConfigBuilder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). Default: <DeriveEnvironment as Default>::default().

The Derive environment to connect to.

Source

pub fn http_timeout_secs( self, value: u64, ) -> DeriveExecClientConfigBuilder<SetHttpTimeoutSecs<S>>
where S::HttpTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 10.

HTTP timeout in seconds.

Source

pub fn maybe_http_timeout_secs( self, value: Option<u64>, ) -> DeriveExecClientConfigBuilder<SetHttpTimeoutSecs<S>>
where S::HttpTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 10.

HTTP timeout in seconds.

Source

pub fn max_retries( self, value: u32, ) -> DeriveExecClientConfigBuilder<SetMaxRetries<S>>
where S::MaxRetries: IsUnset,

Optional (Some / Option setters). Default: 3.

Maximum number of retry attempts for HTTP requests.

Source

pub fn maybe_max_retries( self, value: Option<u32>, ) -> DeriveExecClientConfigBuilder<SetMaxRetries<S>>
where S::MaxRetries: IsUnset,

Optional (Some / Option setters). Default: 3.

Maximum number of retry attempts for HTTP requests.

Source

pub fn retry_delay_initial_ms( self, value: u64, ) -> DeriveExecClientConfigBuilder<SetRetryDelayInitialMs<S>>
where S::RetryDelayInitialMs: IsUnset,

Optional (Some / Option setters). Default: 100.

Initial retry delay in milliseconds.

Source

pub fn maybe_retry_delay_initial_ms( self, value: Option<u64>, ) -> DeriveExecClientConfigBuilder<SetRetryDelayInitialMs<S>>
where S::RetryDelayInitialMs: IsUnset,

Optional (Some / Option setters). Default: 100.

Initial retry delay in milliseconds.

Source

pub fn retry_delay_max_ms( self, value: u64, ) -> DeriveExecClientConfigBuilder<SetRetryDelayMaxMs<S>>
where S::RetryDelayMaxMs: IsUnset,

Optional (Some / Option setters). Default: 5000.

Maximum retry delay in milliseconds.

Source

pub fn maybe_retry_delay_max_ms( self, value: Option<u64>, ) -> DeriveExecClientConfigBuilder<SetRetryDelayMaxMs<S>>
where S::RetryDelayMaxMs: IsUnset,

Optional (Some / Option setters). Default: 5000.

Maximum retry delay in milliseconds.

Source

pub fn max_fee_per_contract( self, value: Decimal, ) -> DeriveExecClientConfigBuilder<SetMaxFeePerContract<S>>
where S::MaxFeePerContract: IsUnset,

Optional (Some / Option setters). Per-contract USDC fee cap signed into every order.

Source

pub fn maybe_max_fee_per_contract( self, value: Option<Decimal>, ) -> DeriveExecClientConfigBuilder<SetMaxFeePerContract<S>>
where S::MaxFeePerContract: IsUnset,

Optional (Some / Option setters). Per-contract USDC fee cap signed into every order.

Source

pub fn transport_backend( self, value: TransportBackend, ) -> DeriveExecClientConfigBuilder<SetTransportBackend<S>>
where S::TransportBackend: IsUnset,

Optional (Some / Option setters). Default: <TransportBackend as Default>::default().

WebSocket transport backend (defaults to Sockudo when that feature is enabled).

Source

pub fn maybe_transport_backend( self, value: Option<TransportBackend>, ) -> DeriveExecClientConfigBuilder<SetTransportBackend<S>>
where S::TransportBackend: IsUnset,

Optional (Some / Option setters). Default: <TransportBackend as Default>::default().

WebSocket transport backend (defaults to Sockudo when that feature is enabled).

Source

pub fn domain_separator( self, value: String, ) -> DeriveExecClientConfigBuilder<SetDomainSeparator<S>>
where S::DomainSeparator: IsUnset,

Optional (Some / Option setters). Override for the EIP-712 domain separator. Falls back to the constant for the configured environment when unset. The shipped constants are placeholders that must be replaced or overridden before signing.

Source

pub fn maybe_domain_separator( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetDomainSeparator<S>>
where S::DomainSeparator: IsUnset,

Optional (Some / Option setters). Override for the EIP-712 domain separator. Falls back to the constant for the configured environment when unset. The shipped constants are placeholders that must be replaced or overridden before signing.

Source

pub fn action_typehash( self, value: String, ) -> DeriveExecClientConfigBuilder<SetActionTypehash<S>>
where S::ActionTypehash: IsUnset,

Optional (Some / Option setters). Override for the EIP-712 action typehash. Falls back to the shipped crate::common::consts::ACTION_TYPEHASH when unset.

Source

pub fn maybe_action_typehash( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetActionTypehash<S>>
where S::ActionTypehash: IsUnset,

Optional (Some / Option setters). Override for the EIP-712 action typehash. Falls back to the shipped crate::common::consts::ACTION_TYPEHASH when unset.

Source

pub fn trade_module_address( self, value: String, ) -> DeriveExecClientConfigBuilder<SetTradeModuleAddress<S>>
where S::TradeModuleAddress: IsUnset,

Optional (Some / Option setters). Override for the Trade module contract address. Falls back to the shipped per-environment constant when unset.

Source

pub fn maybe_trade_module_address( self, value: Option<String>, ) -> DeriveExecClientConfigBuilder<SetTradeModuleAddress<S>>
where S::TradeModuleAddress: IsUnset,

Optional (Some / Option setters). Override for the Trade module contract address. Falls back to the shipped per-environment constant when unset.

Source

pub fn signature_expiry_secs( self, value: u64, ) -> DeriveExecClientConfigBuilder<SetSignatureExpirySecs<S>>
where S::SignatureExpirySecs: IsUnset,

Optional (Some / Option setters). Default: 600.

Signature expiry TTL in seconds for normal orders and replaces (added to the wall clock before signing). Must be greater than the venue minimum (crate::common::consts::MIN_SIGNATURE_TTL, 300s).

Source

pub fn maybe_signature_expiry_secs( self, value: Option<u64>, ) -> DeriveExecClientConfigBuilder<SetSignatureExpirySecs<S>>
where S::SignatureExpirySecs: IsUnset,

Optional (Some / Option setters). Default: 600.

Signature expiry TTL in seconds for normal orders and replaces (added to the wall clock before signing). Must be greater than the venue minimum (crate::common::consts::MIN_SIGNATURE_TTL, 300s).

Source

pub fn market_order_slippage_bps( self, value: u32, ) -> DeriveExecClientConfigBuilder<SetMarketOrderSlippageBps<S>>
where S::MarketOrderSlippageBps: IsUnset,

Optional (Some / Option setters). Default: 50.

Slippage bound applied to market orders when deriving a worst-acceptable limit price from the cached top-of-book quote. Expressed in basis points (1 bp = 0.01%). Defaults to 50 bp = 0.5%.

Source

pub fn maybe_market_order_slippage_bps( self, value: Option<u32>, ) -> DeriveExecClientConfigBuilder<SetMarketOrderSlippageBps<S>>
where S::MarketOrderSlippageBps: IsUnset,

Optional (Some / Option setters). Default: 50.

Slippage bound applied to market orders when deriving a worst-acceptable limit price from the cached top-of-book quote. Expressed in basis points (1 bp = 0.01%). Defaults to 50 bp = 0.5%.

Source

pub fn max_matching_requests_per_second( self, value: u32, ) -> DeriveExecClientConfigBuilder<SetMaxMatchingRequestsPerSecond<S>>
where S::MaxMatchingRequestsPerSecond: IsUnset,

Optional (Some / Option setters). Maximum matching-engine requests per second for order writes sent over the WebSocket (create/cancel/replace). Defaults to the Trader-tier limit of 1 when unset; raise it for Market Maker accounts with higher negotiated limits. See https://docs.derive.xyz/reference/rate-limits.

Source

pub fn maybe_max_matching_requests_per_second( self, value: Option<u32>, ) -> DeriveExecClientConfigBuilder<SetMaxMatchingRequestsPerSecond<S>>
where S::MaxMatchingRequestsPerSecond: IsUnset,

Optional (Some / Option setters). Maximum matching-engine requests per second for order writes sent over the WebSocket (create/cancel/replace). Defaults to the Trader-tier limit of 1 when unset; raise it for Market Maker accounts with higher negotiated limits. See https://docs.derive.xyz/reference/rate-limits.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> Ungil for T
where T: Send,

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