pub struct OrderRequest {Show 16 fields
pub market: String,
pub side: Side,
pub order_type: OrderType,
pub amount: Option<String>,
pub amount_quote: Option<String>,
pub price: Option<String>,
pub time_in_force: Option<String>,
pub self_trade_prevention: Option<String>,
pub post_only: Option<bool>,
pub disable_market_protection: Option<bool>,
pub response_required: Option<bool>,
pub trigger_type: Option<String>,
pub trigger_reference: Option<String>,
pub trigger_amount: Option<String>,
pub client_order_id: Option<String>,
pub operator_id: Option<i64>,
}Expand description
Request body for POST /order.
Fields§
§market: String§side: Side§order_type: OrderType§amount: Option<String>§amount_quote: Option<String>§price: Option<String>§time_in_force: Option<String>§self_trade_prevention: Option<String>§post_only: Option<bool>§disable_market_protection: Option<bool>§response_required: Option<bool>§trigger_type: Option<String>§trigger_reference: Option<String>§trigger_amount: Option<String>§client_order_id: Option<String>§operator_id: Option<i64>Implementations§
Source§impl OrderRequest
impl OrderRequest
Sourcepub fn new(market: impl Into<String>, side: Side, order_type: OrderType) -> Self
pub fn new(market: impl Into<String>, side: Side, order_type: OrderType) -> Self
Creates an order request with only the required fields set.
Sourcepub fn limit(
market: impl Into<String>,
side: Side,
amount: impl Into<String>,
price: impl Into<String>,
) -> Self
pub fn limit( market: impl Into<String>, side: Side, amount: impl Into<String>, price: impl Into<String>, ) -> Self
Creates a limit order request.
Sourcepub fn market_amount(
market: impl Into<String>,
side: Side,
amount: impl Into<String>,
) -> Self
pub fn market_amount( market: impl Into<String>, side: Side, amount: impl Into<String>, ) -> Self
Creates a market order for an amount of the base asset.
Sourcepub fn market_amount_quote(
market: impl Into<String>,
side: Side,
amount_quote: impl Into<String>,
) -> Self
pub fn market_amount_quote( market: impl Into<String>, side: Side, amount_quote: impl Into<String>, ) -> Self
Creates a market order for an amount of the quote asset.
pub fn amount(self, amount: impl Into<String>) -> Self
pub fn amount_quote(self, amount_quote: impl Into<String>) -> Self
pub fn price(self, price: impl Into<String>) -> Self
pub fn time_in_force(self, tif: impl Into<String>) -> Self
pub fn self_trade_prevention(self, stp: impl Into<String>) -> Self
pub fn post_only(self, post_only: bool) -> Self
pub fn disable_market_protection(self, disable: bool) -> Self
pub fn trigger( self, trigger_type: impl Into<String>, reference: impl Into<String>, amount: impl Into<String>, ) -> Self
pub fn client_order_id(self, id: impl Into<String>) -> Self
pub fn operator_id(self, id: i64) -> Self
Trait Implementations§
Source§impl Clone for OrderRequest
impl Clone for OrderRequest
Source§impl Debug for OrderRequest
impl Debug for OrderRequest
Auto Trait Implementations§
impl Freeze for OrderRequest
impl RefUnwindSafe for OrderRequest
impl Send for OrderRequest
impl Sync for OrderRequest
impl Unpin for OrderRequest
impl UnsafeUnpin for OrderRequest
impl UnwindSafe for OrderRequest
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