pub struct MorphoApiClient {
pub v1: VaultV1Client,
pub v2: VaultV2Client,
}Expand description
Combined client for querying both V1 and V2 vaults via the GraphQL API.
Fields§
§v1: VaultV1ClientV1 vault client.
v2: VaultV2ClientV2 vault client.
Implementations§
Source§impl MorphoApiClient
impl MorphoApiClient
Sourcepub fn with_config(config: ClientConfig) -> Self
pub fn with_config(config: ClientConfig) -> Self
Create a new combined vault client with custom configuration.
Sourcepub async fn get_vaults_by_chain(&self, chain: NamedChain) -> Result<Vec<Vault>>
pub async fn get_vaults_by_chain(&self, chain: NamedChain) -> Result<Vec<Vault>>
Get vaults (V1 and V2) on a specific chain as unified Vault type.
Sourcepub async fn get_whitelisted_vaults(
&self,
chain: Option<NamedChain>,
) -> Result<Vec<Vault>>
pub async fn get_whitelisted_vaults( &self, chain: Option<NamedChain>, ) -> Result<Vec<Vault>>
Get whitelisted vaults (V1 and V2) as unified Vault type.
Sourcepub async fn get_user_vault_positions(
&self,
address: &str,
chain: Option<NamedChain>,
) -> Result<UserVaultPositions>
pub async fn get_user_vault_positions( &self, address: &str, chain: Option<NamedChain>, ) -> Result<UserVaultPositions>
Get all vault positions (V1 and V2) for a user.
If chain is Some, queries only that chain.
If chain is None, queries all supported chains and aggregates results.
Sourcepub async fn get_user_account_overview(
&self,
address: &str,
chain: NamedChain,
) -> Result<UserAccountOverview>
pub async fn get_user_account_overview( &self, address: &str, chain: NamedChain, ) -> Result<UserAccountOverview>
Get complete account overview for a user on a specific chain.
Trait Implementations§
Source§impl Clone for MorphoApiClient
impl Clone for MorphoApiClient
Source§fn clone(&self) -> MorphoApiClient
fn clone(&self) -> MorphoApiClient
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 MorphoApiClient
impl Debug for MorphoApiClient
Auto Trait Implementations§
impl Freeze for MorphoApiClient
impl !RefUnwindSafe for MorphoApiClient
impl Send for MorphoApiClient
impl Sync for MorphoApiClient
impl Unpin for MorphoApiClient
impl !UnwindSafe for MorphoApiClient
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