Tradehub.Tx.CreateOrder (Tradehub v0.1.17) View Source

The payload message of the order/CreateOrder private endpoint.

Link to this section Summary

Types

Order types supported by the Tradehub

The shopping side of the order.

t()

Payload message

Time in force

Functions

Given the payload message as map/dictionary, validation, and convert to the raw message

Callback implementation for Tradehub.Tx.Type.type/0.

Validate the payload.

Link to this section Types

Specs

order_type() :: :limit

Order types supported by the Tradehub

Specs

side() :: :buy | :sell

The shopping side of the order.

Specs

t() :: %Tradehub.Tx.CreateOrder{
  is_post_only: boolean(),
  is_reduce_only: boolean(),
  market: String.t(),
  originator: Tradehub.Wallet.address(),
  price: String.t(),
  quantity: integer(),
  side: side(),
  stop_price: String.t(),
  time_in_force: time_in_force(),
  trigger_type: String.t(),
  type: order_type()
}

Payload message

Specs

time_in_force() :: :gtc | :fok | :ioc

Time in force

Link to this section Functions

Specs

compose!(map()) :: Tradehub.Tx.message()

Given the payload message as map/dictionary, validation, and convert to the raw message

Specs

type() :: String.t()

Callback implementation for Tradehub.Tx.Type.type/0.

Specs

validate!(t()) :: t()

Validate the payload.