pub struct MorphoClientConfig {
pub api_config: Option<ClientConfig>,
pub rpc_url: Option<String>,
pub private_key: Option<String>,
pub auto_approve: bool,
}Expand description
Configuration for the unified MorphoClient.
Fields§
§api_config: Option<ClientConfig>API configuration.
rpc_url: Option<String>RPC URL for on-chain interactions.
private_key: Option<String>Private key for signing transactions.
auto_approve: boolWhether to automatically approve tokens before deposit if allowance is insufficient. When true, approves the exact minimal amount needed for the deposit. Defaults to true.
Implementations§
Source§impl MorphoClientConfig
impl MorphoClientConfig
Sourcepub fn with_api_config(self, config: ClientConfig) -> Self
pub fn with_api_config(self, config: ClientConfig) -> Self
Set the API configuration.
Sourcepub fn with_rpc_url(self, rpc_url: impl Into<String>) -> Self
pub fn with_rpc_url(self, rpc_url: impl Into<String>) -> Self
Set the RPC URL.
Sourcepub fn with_private_key(self, private_key: impl Into<String>) -> Self
pub fn with_private_key(self, private_key: impl Into<String>) -> Self
Set the private key.
Sourcepub fn with_auto_approve(self, auto_approve: bool) -> Self
pub fn with_auto_approve(self, auto_approve: bool) -> Self
Set whether to automatically approve tokens before deposit. When true, approves the exact minimal amount needed for the deposit. Defaults to true.
Trait Implementations§
Source§impl Clone for MorphoClientConfig
impl Clone for MorphoClientConfig
Source§fn clone(&self) -> MorphoClientConfig
fn clone(&self) -> MorphoClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MorphoClientConfig
impl Debug for MorphoClientConfig
Auto Trait Implementations§
impl Freeze for MorphoClientConfig
impl RefUnwindSafe for MorphoClientConfig
impl Send for MorphoClientConfig
impl Sync for MorphoClientConfig
impl Unpin for MorphoClientConfig
impl UnwindSafe for MorphoClientConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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