pub struct OrderStreamClient {
pub client: Client,
pub base_url: Url,
pub boundless_market_address: Address,
pub chain_id: u64,
pub api_key: Option<String>,
}target_os=zkvm only.Expand description
Client for interacting with the order stream server
Fields§
§client: ClientHTTP client
base_url: UrlBase URL of the order stream server
boundless_market_address: AddressAddress of the market contract
chain_id: u64Chain ID of the network
api_key: Option<String>Optional API key for authenticated requests
Implementations§
Source§impl OrderStreamClient
impl OrderStreamClient
Sourcepub fn new(
base_url: Url,
boundless_market_address: Address,
chain_id: u64,
) -> Self
pub fn new( base_url: Url, boundless_market_address: Address, chain_id: u64, ) -> Self
Create a new client
Sourcepub fn new_with_api_key(
base_url: Url,
boundless_market_address: Address,
chain_id: u64,
api_key: String,
) -> Self
pub fn new_with_api_key( base_url: Url, boundless_market_address: Address, chain_id: u64, api_key: String, ) -> Self
Create a new client with API key
Sourcepub async fn submit_request(
&self,
request: &ProofRequest,
signer: &impl Signer,
) -> Result<Order>
pub async fn submit_request( &self, request: &ProofRequest, signer: &impl Signer, ) -> Result<Order>
Submit a proof request to the order stream server
Sourcepub async fn fetch_order(
&self,
id: U256,
request_digest: Option<B256>,
) -> Result<Order>
pub async fn fetch_order( &self, id: U256, request_digest: Option<B256>, ) -> Result<Order>
Fetch an order from the order stream server.
If multiple orders are found, the request_digest must be provided to select the correct order.
Sourcepub async fn fetch_order_with_timestamp(
&self,
id: U256,
request_digest: Option<B256>,
) -> Result<(Order, DateTime<Utc>)>
pub async fn fetch_order_with_timestamp( &self, id: U256, request_digest: Option<B256>, ) -> Result<(Order, DateTime<Utc>)>
Fetch an order with its creation timestamp from the order stream server.
Returns both the Order and the timestamp when it was created.
If multiple orders are found, the request_digest must be provided to select the correct order.
Sourcepub async fn get_nonce(&self, address: Address) -> Result<Nonce>
pub async fn get_nonce(&self, address: Address) -> Result<Nonce>
Get the nonce from the order stream service for websocket auth
Sourcepub async fn list_orders_by_creation(
&self,
after: Option<DateTime<Utc>>,
limit: u64,
) -> Result<Vec<OrderData>>
pub async fn list_orders_by_creation( &self, after: Option<DateTime<Utc>>, limit: u64, ) -> Result<Vec<OrderData>>
List orders sorted by creation time descending (most recent first)
Returns orders created after the given timestamp (if provided), up to the specified limit.
If after is None, returns the most recent orders.
Sourcepub async fn list_orders_v2(
&self,
cursor: Option<String>,
limit: Option<u64>,
sort: Option<SortDirection>,
before: Option<DateTime<Utc>>,
after: Option<DateTime<Utc>>,
) -> Result<ListOrdersV2Response>
pub async fn list_orders_v2( &self, cursor: Option<String>, limit: Option<u64>, sort: Option<SortDirection>, before: Option<DateTime<Utc>>, after: Option<DateTime<Utc>>, ) -> Result<ListOrdersV2Response>
List orders with cursor-based pagination and flexible filtering (v2)
Provides cursor-based pagination for stable results, bidirectional sorting, and timestamp range filtering. This is the recommended method for paginating through orders as it handles concurrent inserts correctly.
§Arguments
cursor- Opaque cursor string from previous response for paginationlimit- Maximum number of orders to returnsort- Sort direction (Asc for oldest first, Desc for newest first)before- Optional timestamp to filter orders created before this time (EXCLUSIVE:created_at < before)after- Optional timestamp to filter orders created after this time (EXCLUSIVE:created_at > after)
§Boundary Semantics
Both before and after parameters use exclusive comparison operators:
before: Returns orders wherecreated_at < before(does NOT include orders at the exact timestamp)after: Returns orders wherecreated_at > after(does NOT include orders at the exact timestamp)
To include orders at a specific timestamp boundary, add/subtract a small time delta (e.g., 1 second).
Sourcepub async fn connect_async(
&self,
signer: &impl Signer,
) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>>
pub async fn connect_async( &self, signer: &impl Signer, ) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>>
Return a WebSocket stream connected to the order stream server
An authentication message is sent to the server via the X-Auth-Data header.
The authentication message must contain a valid claim of an address holding a (pre-configured)
minimum balance on the boundless market in order to connect to the server.
Only one connection per address is allowed.
Trait Implementations§
Source§impl Clone for OrderStreamClient
impl Clone for OrderStreamClient
Source§fn clone(&self) -> OrderStreamClient
fn clone(&self) -> OrderStreamClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OrderStreamClient
impl !RefUnwindSafe for OrderStreamClient
impl Send for OrderStreamClient
impl Sync for OrderStreamClient
impl Unpin for OrderStreamClient
impl !UnwindSafe for OrderStreamClient
Blanket Implementations§
Source§impl<L, I> Adapt<L> for Iwhere
L: Layer<I>,
impl<L, I> Adapt<L> for Iwhere
L: Layer<I>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.