Struct KIAddOrder

Source
pub struct KIAddOrder { /* private fields */ }
Expand description

Request builder for the Add Standard Order endpoint

Implementations§

Source§

impl KIAddOrder

Source

pub fn build( pair: KAssetPair, tradetype: TradeType, ordertype: OrderType, volume: f64, ) -> Self

Constructor returning a KrakenInput builder for the add standard order endpoint

  • pair - asset pair for order
  • tradetype - TradeType
  • ordertype - OrderType
  • volume - order volume in lots
Source

pub fn with_pair(self, pair: KAssetPair) -> Self

Update the asset pair for this order. Useful for templating

Source

pub fn with_transaction_type(self, tradetype: TradeType) -> Self

Update the transaction/trade type for this order. Useful for templating

Source

pub fn with_order_type(self, ordertype: OrderType) -> Self

Update the order type for this order. Useful for templating. Note that OrderType encodes the desired price (limit price, stop loss trigger price etc.)

Source

pub fn with_volume(self, volume: f64) -> Self

Update the order volume in lots

Source

pub fn with_leverage(self, leverage: Leverage) -> Self

Amount of leverage for this order. Subject to margin trading restrictions

Source

pub fn with_order_flags<T>(self, flags: T) -> Self
where T: IntoIterator<Item = OrderFlags>,

Order flags to set. Accepts any iterable collection of OrderFlags

Source

pub fn start_in(self, secs: u32) -> Self

Scedule the order start time for secs seconds from now

Source

pub fn start_at(self, timestamp: u64) -> Self

Scedule the order start time for the Unix timestamp in seconds

Source

pub fn expire_in(self, secs: u32) -> Self

Order to expire in secs seconds

Source

pub fn expire_at(self, timestamp: u64) -> Self

Order to expire at the Unix timestamp in seconds

Source

pub fn with_userref(self, userref: u32) -> Self

User supplied unsigned 32 bit integer which Kraken will use to demarcate this order for future reference

Source

pub fn validate(self, validate: bool) -> Self

Validate inputs on Kraken’s servers. Don’t submit order

Source

pub fn with_closing_order(self, ordertype: OrderType) -> Self

Closing order to add to the system when this order gets filled

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more