pub struct ChainClient { /* private fields */ }Implementations§
Source§impl ChainClient
impl ChainClient
pub fn program_id(&self) -> Pubkey
pub fn new( rpc_url: &str, program_id: Pubkey, commitment: CommitmentConfig, ) -> Self
pub async fn fund_position( &self, args: FundPositionArgs, maker_owner: &(dyn Signer + Sync), fee_payer: Option<&(dyn Signer + Sync)>, ) -> Result<Signature, ChainError>
pub async fn build_fund_position_ixs( &self, args: &FundPositionArgs, fee_payer: Pubkey, ) -> Result<Vec<Instruction>, ChainError>
pub async fn fetch_position_info( &self, position_pda: &Pubkey, ) -> Result<PositionInfo, ChainError>
pub async fn fetch_market_info( &self, market_pda: &Pubkey, ) -> Result<MarketInfo, ChainError>
pub async fn fetch_market_quote_mint( &self, market_pda: &Pubkey, ) -> Result<Pubkey, ChainError>
Sourcepub async fn fetch_token_balance(
&self,
token_account: &Pubkey,
) -> Result<u64, ChainError>
pub async fn fetch_token_balance( &self, token_account: &Pubkey, ) -> Result<u64, ChainError>
Fetch the raw token balance (u64 atoms) of a token account.
Sourcepub async fn address_lookup_tables(
&self,
keys: &[Pubkey],
) -> Result<Vec<AddressLookupTableAccount>, ChainError>
pub async fn address_lookup_tables( &self, keys: &[Pubkey], ) -> Result<Vec<AddressLookupTableAccount>, ChainError>
Active lookup tables by key, for verifying served v0 transactions.
pub async fn send_instructions_with_options( &self, instructions: Vec<Instruction>, fee_payer: &(dyn Signer + Sync), extra_signers: &[&(dyn Signer + Sync)], options: SendOptions, ) -> Result<Signature, ChainError>
Source§impl ChainClient
impl ChainClient
Sourcepub async fn unfunded_positions(
&self,
vault: &Pubkey,
) -> Result<Vec<(Pubkey, PositionInfo)>, ChainError>
pub async fn unfunded_positions( &self, vault: &Pubkey, ) -> Result<Vec<(Pubkey, PositionInfo)>, ChainError>
Positions the vault bought as a maker that still await
VaultFundMakerPosition, read from the program’s accounts.
Sourcepub async fn pending_capital_requests(
&self,
vault: &Pubkey,
) -> Result<PendingCapitalRequests, ChainError>
pub async fn pending_capital_requests( &self, vault: &Pubkey, ) -> Result<PendingCapitalRequests, ChainError>
The vault’s nonzero queued deposits and withdrawals, read from the program’s accounts.
Auto Trait Implementations§
impl !RefUnwindSafe for ChainClient
impl !UnwindSafe for ChainClient
impl Freeze for ChainClient
impl Send for ChainClient
impl Sync for ChainClient
impl Unpin for ChainClient
impl UnsafeUnpin for ChainClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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