pub struct OrdersClient<'a> { /* private fields */ }Implementations§
Source§impl<'a> OrdersClient<'a>
impl<'a> OrdersClient<'a>
pub fn new(client: &'a PolymarketUsClient) -> Self
Sourcepub async fn create(
&self,
body: &PlaceOrderRequest,
) -> Result<PlaceOrderResponse, PolymarketUsError>
pub async fn create( &self, body: &PlaceOrderRequest, ) -> Result<PlaceOrderResponse, PolymarketUsError>
Create a new order
Sourcepub async fn place(
&self,
body: &PlaceOrderRequest,
) -> Result<PlaceOrderResponse, PolymarketUsError>
pub async fn place( &self, body: &PlaceOrderRequest, ) -> Result<PlaceOrderResponse, PolymarketUsError>
Place an order (alternative endpoint)
Sourcepub async fn place_batch(
&self,
body: &BatchedOrderRequest,
) -> Result<BatchedOrderResponse, PolymarketUsError>
pub async fn place_batch( &self, body: &BatchedOrderRequest, ) -> Result<BatchedOrderResponse, PolymarketUsError>
Place multiple orders atomically
Sourcepub async fn open<Q: Serialize>(
&self,
query: Option<&Q>,
) -> Result<GetOpenOrdersResponse, PolymarketUsError>
pub async fn open<Q: Serialize>( &self, query: Option<&Q>, ) -> Result<GetOpenOrdersResponse, PolymarketUsError>
Get all open orders
Sourcepub async fn retrieve(
&self,
order_id: &str,
) -> Result<PlaceOrderResponse, PolymarketUsError>
pub async fn retrieve( &self, order_id: &str, ) -> Result<PlaceOrderResponse, PolymarketUsError>
Get order by ID
Sourcepub async fn cancel(
&self,
order_id: &str,
body: &CancelOrderParams,
) -> Result<(), PolymarketUsError>
pub async fn cancel( &self, order_id: &str, body: &CancelOrderParams, ) -> Result<(), PolymarketUsError>
Cancel an order
Sourcepub async fn cancel_trading(
&self,
order_id: &str,
) -> Result<CancelOrderResponse, PolymarketUsError>
pub async fn cancel_trading( &self, order_id: &str, ) -> Result<CancelOrderResponse, PolymarketUsError>
Cancel order by trading endpoint
Sourcepub async fn cancel_all(
&self,
body: &CancelAllOrdersParams,
) -> Result<CancelAllOrdersResponse, PolymarketUsError>
pub async fn cancel_all( &self, body: &CancelAllOrdersParams, ) -> Result<CancelAllOrdersResponse, PolymarketUsError>
Cancel all open orders
Sourcepub async fn modify(
&self,
order_id: &str,
body: &ModifyOrderRequest,
) -> Result<(), PolymarketUsError>
pub async fn modify( &self, order_id: &str, body: &ModifyOrderRequest, ) -> Result<(), PolymarketUsError>
Modify an open order
Sourcepub async fn preview(
&self,
body: &PreviewOrderRequest,
) -> Result<PreviewOrderResponse, PolymarketUsError>
pub async fn preview( &self, body: &PreviewOrderRequest, ) -> Result<PreviewOrderResponse, PolymarketUsError>
Preview an order
Sourcepub async fn close_position(
&self,
body: &ClosePositionRequest,
) -> Result<ClosePositionResponse, PolymarketUsError>
pub async fn close_position( &self, body: &ClosePositionRequest, ) -> Result<ClosePositionResponse, PolymarketUsError>
Close a position
Trait Implementations§
Source§impl<'a> Clone for OrdersClient<'a>
impl<'a> Clone for OrdersClient<'a>
Source§fn clone(&self) -> OrdersClient<'a>
fn clone(&self) -> OrdersClient<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> !RefUnwindSafe for OrdersClient<'a>
impl<'a> !UnwindSafe for OrdersClient<'a>
impl<'a> Freeze for OrdersClient<'a>
impl<'a> Send for OrdersClient<'a>
impl<'a> Sync for OrdersClient<'a>
impl<'a> Unpin for OrdersClient<'a>
impl<'a> UnsafeUnpin for OrdersClient<'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
Mutably borrows from an owned value. Read more