pub struct QuoteBuilder<'a> { /* private fields */ }Expand description
Accumulates the maker’s side of a quote, then signs it.
Implementations§
Source§impl QuoteBuilder<'_>
impl QuoteBuilder<'_>
Sourcepub const fn selected_terms(&self) -> OptionTerms
pub const fn selected_terms(&self) -> OptionTerms
Terms this builder will bind into the quote and signed preimage.
Sourcepub const fn terms(self, terms: OptionTerms) -> Self
pub const fn terms(self, terms: OptionTerms) -> Self
Quote alternative terms offered by the RFQ instead of its requested terms.
pub const fn price(self, price: Price) -> Self
pub const fn valid_until(self, valid_until: QuoteExpiry) -> Self
Sourcepub const fn min_valid_until(self, min_valid_until: QuoteExpiry) -> Self
pub const fn min_valid_until(self, min_valid_until: QuoteExpiry) -> Self
Earliest valid_until the venue accepts: now plus min_quote_validity_seconds
from GET /api/v1/venue.
Sourcepub fn venue(self, venue: &Venue) -> Self
pub fn venue(self, venue: &Venue) -> Self
Apply the venue’s quote window at the current clock: the floor
now + min_quote_validity_seconds, and valid_until − settlement_buffer_seconds
must be after now.
Sourcepub fn welcome(self, welcome: &WelcomeData) -> Self
pub fn welcome(self, welcome: &WelcomeData) -> Self
Self::venue from the session’s Welcome instead of HTTP.
pub const fn nonce(self, nonce: Nonce) -> Self
Sourcepub const fn maker_owner(self, owner: Address32) -> Self
pub const fn maker_owner(self, owner: Address32) -> Self
Maker owner in the signed preimage, required even when it signs itself.
Sourcepub fn preimage_args(&self) -> Result<OrderPreimageArgs, QuoteBuildError>
pub fn preimage_args(&self) -> Result<OrderPreimageArgs, QuoteBuildError>
Sourcepub fn sign<S: SignerLike + ?Sized>(
&self,
signer: &S,
) -> Result<QuoteMessage, QuoteBuildError>
pub fn sign<S: SignerLike + ?Sized>( &self, signer: &S, ) -> Result<QuoteMessage, QuoteBuildError>
Sign with a local key.
Reusable builder. Give each quote a fresh nonce to avoid duplicate order IDs.
§Errors
See QuoteBuildError.
Sourcepub async fn sign_with_async_signer<S: AsyncSignerLike + ?Sized>(
&self,
signer: &S,
) -> Result<QuoteMessage, QuoteBuildError>
pub async fn sign_with_async_signer<S: AsyncSignerLike + ?Sized>( &self, signer: &S, ) -> Result<QuoteMessage, QuoteBuildError>
Sign with a remote or hardware signer.
The returned signature is verified against the signer’s own public key before the quote is assembled.
§Errors
See QuoteBuildError.
pub fn spread_preimage_args( &self, ) -> Result<SpreadOrderPreimageArgs, QuoteBuildError>
Trait Implementations§
Source§impl<'a> Clone for QuoteBuilder<'a>
impl<'a> Clone for QuoteBuilder<'a>
Auto Trait Implementations§
impl<'a> Forget for QuoteBuilder<'a>
impl<'a> Freeze for QuoteBuilder<'a>
impl<'a> RefUnwindSafe for QuoteBuilder<'a>
impl<'a> Send for QuoteBuilder<'a>
impl<'a> Sync for QuoteBuilder<'a>
impl<'a> Unpin for QuoteBuilder<'a>
impl<'a> UnsafeUnpin for QuoteBuilder<'a>
impl<'a> UnwindSafe for QuoteBuilder<'a>
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