pub struct ChainClient { /* private fields */ }Implementations§
Source§impl ChainClient
impl ChainClient
Sourcepub async fn fetch_accounts(
&self,
keys: &[Pubkey],
) -> Result<Vec<Option<Account>>, ChainError>
pub async fn fetch_accounts( &self, keys: &[Pubkey], ) -> Result<Vec<Option<Account>>, ChainError>
Chunked reads preserve input order, including missing accounts.
Sourcepub async fn maker_open_positions(
&self,
owner: &Pubkey,
) -> Result<Vec<(Pubkey, PositionInfo)>, ChainError>
pub async fn maker_open_positions( &self, owner: &Pubkey, ) -> Result<Vec<(Pubkey, PositionInfo)>, ChainError>
Startup/manual recovery only. Includes Open and Funded positions; absence is not proof of closure.
Sourcepub async fn maker_snapshot(
&self,
owner: &Pubkey,
positions: &[Pubkey],
premiums: &[PremiumToken],
) -> Result<MakerSnapshot, ChainError>
pub async fn maker_snapshot( &self, owner: &Pubkey, positions: &[Pubkey], premiums: &[PremiumToken], ) -> Result<MakerSnapshot, ChainError>
Two dependency rounds: positions + known premium ATAs, then unique markets. Chunks may observe different slots; this is not an atomic chain snapshot.
Source§impl ChainClient
impl ChainClient
Sourcepub async fn signature_statuses(
&self,
signatures: &[Signature],
) -> Result<Vec<ConfirmationStatus>, ChainError>
pub async fn signature_statuses( &self, signatures: &[Signature], ) -> Result<Vec<ConfirmationStatus>, ChainError>
One status read per chunk of at most 256 signatures, including history.
Sourcepub async fn confirm_signatures(
&self,
ws_url: &str,
signatures: &[Signature],
timeout: Duration,
) -> Result<Vec<ConfirmationStatus>, ChainError>
pub async fn confirm_signatures( &self, ws_url: &str, signatures: &[Signature], timeout: Duration, ) -> Result<Vec<ConfirmationStatus>, ChainError>
Wait on one Solana WS connection, then reconcile unresolved signatures in one chunked status pass on disconnect, subscription error, or deadline. No polling.
Source§impl ChainClient
impl ChainClient
pub fn rpc(&self) -> &RpcClient
pub fn from_rpc(rpc: RpcClient, program_id: Pubkey) -> Self
Sourcepub fn with_confirmation_ws_url(self, url: impl Into<String>) -> Self
pub fn with_confirmation_ws_url(self, url: impl Into<String>) -> Self
Use Solana signature subscriptions for confirming conveniences instead of the legacy RPC confirmation fallback. Batch submission remains submit-only.
pub fn program_id(&self) -> Pubkey
pub fn new( rpc_url: &str, program_id: Pubkey, commitment: CommitmentConfig, ) -> Self
Sourcepub async fn maker_deposit(
&self,
args: MakerDepositArgs,
maker_owner: &(dyn Signer + Sync),
fee_payer: Option<&(dyn Signer + Sync)>,
) -> Result<Signature, ChainError>
pub async fn maker_deposit( &self, args: MakerDepositArgs, maker_owner: &(dyn Signer + Sync), fee_payer: Option<&(dyn Signer + Sync)>, ) -> Result<Signature, ChainError>
Submit and wait for confirmation at the client commitment; execution failure is an error.
Sourcepub async fn maker_withdraw(
&self,
args: MakerWithdrawArgs,
maker_owner: &(dyn Signer + Sync),
fee_payer: Option<&(dyn Signer + Sync)>,
) -> Result<Signature, ChainError>
pub async fn maker_withdraw( &self, args: MakerWithdrawArgs, maker_owner: &(dyn Signer + Sync), fee_payer: Option<&(dyn Signer + Sync)>, ) -> Result<Signature, ChainError>
Submit and wait for confirmation at the client commitment; execution failure is an error.
Sourcepub async fn fund_position(
&self,
args: FundPositionArgs,
maker_owner: &(dyn Signer + Sync),
fee_payer: Option<&(dyn Signer + Sync)>,
) -> Result<Signature, ChainError>
pub async fn fund_position( &self, args: FundPositionArgs, maker_owner: &(dyn Signer + Sync), fee_payer: Option<&(dyn Signer + Sync)>, ) -> Result<Signature, ChainError>
Submit and wait for confirmation at the client commitment; execution failure is an error.
pub async fn build_maker_deposit_ixs( &self, args: &MakerDepositArgs, fee_payer: Pubkey, ) -> Result<Vec<Instruction>, ChainError>
pub async fn build_maker_withdraw_ixs( &self, args: &MakerWithdrawArgs, fee_payer: Pubkey, ) -> Result<Vec<Instruction>, 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>
Reads the canonical GlobalConfig PDA and returns its checked hot authority.
Vault opens use this key as both transaction fee payer and account 0, so accepting a venue-provided value would let the venue choose the signer.
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.
Sourcepub 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>
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>
Submit and wait for confirmation at the client commitment; execution failure is an error.
Sourcepub async fn send_instructions_with_blockhash(
&self,
instructions: Vec<Instruction>,
fee_payer: &(dyn Signer + Sync),
extra_signers: &[&(dyn Signer + Sync)],
options: SendOptions,
blockhash: Hash,
) -> Result<Signature, ChainError>
pub async fn send_instructions_with_blockhash( &self, instructions: Vec<Instruction>, fee_payer: &(dyn Signer + Sync), extra_signers: &[&(dyn Signer + Sync)], options: SendOptions, blockhash: Hash, ) -> Result<Signature, ChainError>
Submit without confirmation using a blockhash shared across the caller’s batch.
Source§impl ChainClient
impl ChainClient
pub async fn vault_manager( &self, vault: Pubkey, actor: Pubkey, ) -> Result<VaultManager, 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
FundPositionForVaultHolder, 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.
Source§impl ChainClient
impl ChainClient
pub async fn build_settle_position( &self, maker_owner: Pubkey, position_pda: Pubkey, ) -> Result<Instruction, ChainError>
pub async fn settle_position_sequence( &self, maker_owner: Pubkey, position_pda: Pubkey, ) -> Result<Vec<Instruction>, 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
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> ⓘ
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> ⓘ
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