Skip to content

Commit

Permalink
Merge pull request #90 from mushu8/master
Browse files Browse the repository at this point in the history
  • Loading branch information
dvcrn authored Jun 28, 2023
2 parents afcee1e + a67e1c6 commit 205bca7
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lib/binance/order_response.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
defmodule Binance.OrderResponse do
@moduledoc """
Response tructure for POST /api/v3/order endpoint.
All prices and quantities are string representation of floats with 8 decimals (eg: "orig_qty": "10.00000000")
"""

defstruct [
:client_order_id,
:executed_qty,
Expand All @@ -14,4 +19,33 @@ defmodule Binance.OrderResponse do
]

use ExConstructor

@typedoc """
side: "BUY" | "SELL"
"""
@type side :: String.t()

@typedoc """
status: "NEW" | "PARTIALLY_FILLED" | "FILLED" | "CANCELED" | "PENDING_CANCEL" | "REJECTED" | "EXPIRED"
"""
@type status :: String.t()

@typedoc """
type: "LIMIT" | "MARKET" | "STOP" | "STOP_MARKET" | "TAKE_PROFIT" | "TAKE_PROFIT_MARKET" | "LIMIT_MAKER"
"""
@type type :: String.t()

@type t :: %__MODULE__{
client_order_id: String.t(),
executed_qty: String.t(),
order_id: non_neg_integer(),
orig_qty: String.t(),
price: String.t(),
side: side(),
status: status(),
symbol: String.t(),
time_in_force: non_neg_integer(),
transact_time: non_neg_integer(),
type: type()
}
end

0 comments on commit 205bca7

Please sign in to comment.