pub struct VaultOperatorClient { /* private fields */ }Expand description
Vault operator session on /vault; every reconnect re-runs StartVaultAuth.
Implementations§
Source§impl VaultOperatorClient
impl VaultOperatorClient
pub fn spawn(config: VaultOperatorConfig) -> Result<Self, VaultClientError>
pub fn vault_pda(&self) -> &Address32
pub fn operator_pubkey(&self) -> Address32
Sourcepub fn auth(&self) -> Option<VaultAuthSuccessData>
pub fn auth(&self) -> Option<VaultAuthSuccessData>
None before authentication and after it ends.
pub fn permissions(&self) -> Option<VaultDelegatePermissions>
pub fn can_maker(&self) -> bool
Sourcepub fn can_write_buys(&self) -> bool
pub fn can_write_buys(&self) -> bool
Ready to quote buy RFQs, the vault writing what the wallet buys.
pub fn can_taker(&self) -> bool
pub fn subscribe_vault_auth(&self) -> Receiver<Option<VaultAuthSuccessData>>
pub fn sign_quote( &self, quote: &QuoteBuilder<'_>, ) -> Result<QuoteMessage, QuoteBuildError>
Sourcepub async fn quote_in_epoch(
&self,
payload: QuoteMessage,
connection_epoch: u64,
) -> Result<(), ManagedWsError>
pub async fn quote_in_epoch( &self, payload: QuoteMessage, connection_epoch: u64, ) -> Result<(), ManagedWsError>
Send only in connection_epoch, the epoch whose recovery the strategy
applied; a reconnect in between rejects the quote with NotReady.
pub fn try_quote_in_epoch( &self, payload: QuoteMessage, connection_epoch: u64, ) -> Result<SendTicket, ManagedWsError>
pub async fn replace_in_epoch( &self, payload: ReplaceQuoteMessage, connection_epoch: u64, ) -> Result<(), ManagedWsError>
pub async fn batch_quotes_in_epoch( &self, payload: BatchQuotesMessage, connection_epoch: u64, ) -> Result<(), ManagedWsError>
pub async fn cancel_quote( &self, payload: CancelQuoteData, ) -> Result<(), ManagedWsError>
pub async fn cancel_all_quotes( &self, payload: CancelAllQuotesMessage, ) -> Result<(), ManagedWsError>
Sourcepub async fn rfq_request(
&self,
payload: RfqRequestMessage,
) -> Result<(), VaultRequestError>
pub async fn rfq_request( &self, payload: RfqRequestMessage, ) -> Result<(), VaultRequestError>
Resolves on the server’s receipt; RfqCreated still arrives as a push.
pub async fn cancel_rfq( &self, payload: CancelRfqData, ) -> Result<(), ManagedWsError>
pub async fn accept_quote( &self, payload: AcceptQuoteMessage, ) -> Result<(), VaultRequestError>
Sourcepub fn verify_and_sign_sponsored_tx(
&self,
to_sign: &SponsoredTxToSignData,
intent: &VaultOpenIntent<'_>,
tables: &[AddressLookupTableAccount],
bounds: ComputeBudgetBounds,
) -> Result<SubmitSignedSponsoredTxData, VaultTxError>
pub fn verify_and_sign_sponsored_tx( &self, to_sign: &SponsoredTxToSignData, intent: &VaultOpenIntent<'_>, tables: &[AddressLookupTableAccount], bounds: ComputeBudgetBounds, ) -> Result<SubmitSignedSponsoredTxData, VaultTxError>
Signs only if the served transaction opens exactly intent within bounds.
pub async fn submit_signed_sponsored_tx( &self, payload: SubmitSignedSponsoredTxData, ) -> Result<(), VaultRequestError>
pub async fn swap_quote( &self, payload: SwapQuoteData, ) -> Result<SwapQuoteResultData, VaultRequestError>
Sourcepub fn verify_and_sign_swap(
&self,
intent: &VaultSwapIntent<'_>,
tables: &[AddressLookupTableAccount],
bounds: ComputeBudgetBounds,
) -> Result<SwapSubmitData, VaultTxError>
pub fn verify_and_sign_swap( &self, intent: &VaultSwapIntent<'_>, tables: &[AddressLookupTableAccount], bounds: ComputeBudgetBounds, ) -> Result<SwapSubmitData, VaultTxError>
Signs only if the served swap carries exactly the requested and quoted terms within bounds.
Sourcepub async fn swap_submit_in_epoch(
&self,
payload: SwapSubmitData,
connection_epoch: u64,
gate: &impl SendGate,
) -> Result<SwapSubmitResultData, VaultRequestError>
pub async fn swap_submit_in_epoch( &self, payload: SwapSubmitData, connection_epoch: u64, gate: &impl SendGate, ) -> Result<SwapSubmitResultData, VaultRequestError>
Submits only in connection_epoch and only if gate admits it; resolves on
the durable enqueue receipt. VaultRequestError::delivery classifies failures.
Sourcepub async fn swap_status(
&self,
execution_id: OrderId,
) -> Result<SwapStatusMessage, VaultRequestError>
pub async fn swap_status( &self, execution_id: OrderId, ) -> Result<SwapStatusMessage, VaultRequestError>
Terminal outcomes also arrive as SwapSettled pushes.
pub async fn subscribe( &self, payload: SubscribeData, ) -> Result<(), ManagedWsError>
pub async fn unsubscribe( &self, payload: UnsubscribeData, ) -> Result<(), ManagedWsError>
pub fn subscribe_messages(&self) -> ManagedMessageReceiver
pub fn subscribe_reference_changes(&self) -> ReferenceChangeReceiver
pub fn subscribe_projections(&self) -> VaultProjectionReceiver
pub fn subscribe_events(&self) -> Receiver<ManagedWsEvent>
pub fn state(&self) -> ManagedWsState
pub async fn wait_until_ready(&self) -> Result<u64, WaitUntilReadyError>
pub const fn raw(&self) -> &ManagedWsHandle
pub fn into_raw(self) -> ManagedWsHandle
pub async fn close(&self) -> Result<(), ManagedWsError>
Source§impl VaultOperatorClient
impl VaultOperatorClient
Sourcepub async fn sell_rfq<D: SaleDesk>(
&self,
chain: &ChainClient,
sale: &VaultSale,
connection_epoch: u64,
gate: &(impl SendGate + Sync),
desk: &mut D,
) -> Result<SaleOutcome, SaleError<D::Error>>
pub async fn sell_rfq<D: SaleDesk>( &self, chain: &ChainClient, sale: &VaultSale, connection_epoch: u64, gate: &(impl SendGate + Sync), desk: &mut D, ) -> Result<SaleOutcome, SaleError<D::Error>>
Sells sale in connection_epoch: requests the RFQ, offers each quote to
desk, accepts the first it takes, verifies and signs the served
transaction against the chain counterparty, and submits it. Every send
goes through gate.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for VaultOperatorClient
impl !UnwindSafe for VaultOperatorClient
impl Freeze for VaultOperatorClient
impl Send for VaultOperatorClient
impl Sync for VaultOperatorClient
impl Unpin for VaultOperatorClient
impl UnsafeUnpin for VaultOperatorClient
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> 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> ⓘ
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