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>
Sourcepub async fn fetch_position_info(
&self,
position_pda: &Pubkey,
) -> Result<PositionInfo, ChainError>
pub async fn fetch_position_info( &self, position_pda: &Pubkey, ) -> Result<PositionInfo, ChainError>
Fetch and parse a position account. Returns full position details for pre-flight validation.
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.
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>
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