Exchange v0.2.1 Exchange.Order View Source

A struct representing an Order to be placed in the Exchange

side: :buy, :sell type: :market, :limit

trader_id: Alchemist or the user_id expiration_time: unix timestamp in milliseconds when the order expires

Link to this section Summary

Functions

Decodes the payload to an Order struct

Link to this section Types

Specs

order() :: %Exchange.Order{
  acknowledged_at: term(),
  exp_time: integer() | atom(),
  initial_size: size_in_grams(),
  modified_at: term(),
  order_id: String.t(),
  price: price_in_cents(),
  side: atom(),
  size: size_in_grams(),
  ticker: atom(),
  trader_id: String.t(),
  type: atom()
}

Specs

price_in_cents() :: integer()

Specs

size_in_grams() :: integer()

Link to this section Functions

Link to this function

decode_from_jason(order)

View Source

Specs

decode_from_jason(map()) :: order()

Decodes the payload to an Order struct

Parameters

  • payload: map with necessary parameters to populate the struct