ExOkex v0.2.0 ExOkex.Spot.Private View Source

Spot account client.

Link to this section Summary

Functions

Cancelling an unfilled order.

Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)

Get the balance, amount available/on hold of a token in spot account.

Link to this section Functions

Link to this function

cancel_order(order_id, params, config \\ nil)

View Source

Cancelling an unfilled order.

https://www.okex.com/docs/en/#spot-revocation

Example

iex> ExOkex.Spot.Private.cancel_order("1611729012263936", %{"instrument_id":"btc-usdt"})

TODO: Add response

Link to this function

create_batch_orders(params, config \\ nil)

View Source

See ExOkex.Spot.Private.create_bulk_orders/2.

Link to this function

create_bulk_orders(params, config \\ nil)

View Source

Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)

https://www.okex.com/docs/en/#spot-batch

Examples

iex> ExOkex.Spot.Private.create_bulk_orders([ { "client_oid":"20180728",

"instrument_id":"btc-usdt",
"side":"sell",
"type":"limit",
"size":"0.001",
"price":"10001",
"margin_trading ":"1"},

{ "client_oid":"20180728",

"instrument_id":"btc-usdt",
"side":"sell",
"type":"limit",
"size":"0.001",
"price":"10002",
"margin_trading ":"1"}

])

# TODO: Add response sample

Link to this function

create_order(params, config \\ nil)

View Source

Place a new order.

Refer to params listed in API docs

Examples

iex> ExOkex.Spot.Private.create_order(%{type: "limit", side: "buy", product_id: "ETH-USD", price: "0.50", size: "1.0"})
#TODO: Add response sample
Link to this function

get_balance(currency, config \\ nil)

View Source

Get the balance, amount available/on hold of a token in spot account.

Spot Trading Account of a Currency

Example

    iex(1)> ExOkex.Spot.Private.get_balance("btc")
    {:ok,
     %{
       "available" => "0.005",
       "balance" => "0.005",
       "currency" => "btc",
       "frozen" => "0",
       "hold" => "0",
       "holds" => "0",
       "id" => "2006057"
     }}
Link to this function

list_accounts(config \\ nil)

View Source

List accounts.

Examples

  iex(3)> ExOkex.Spot.Private.list_accounts()
  {:ok,
   [
     %{
       "available" => "0.005",
       "balance" => "0.005",
       "currency" => "BTC",
       "frozen" => "0",
       "hold" => "0",
       "holds" => "0",
       "id" => "2006257"
     }
   ]}