tai v0.0.11 Tai.Exchanges.Account behaviour

Uniform interface for private exchange actions

Link to this section Summary

Link to this section Types

Link to this type

create_order_error_reason()
create_order_error_reason() ::
  :not_implemented
  | shared_error_reason()
  | Tai.Trading.InsufficientBalanceError.t()

Link to this type

credentials()
credentials() :: map()

Link to this type

insufficient_balance_error()
insufficient_balance_error() :: Tai.Trading.InsufficientBalanceError.t()

Link to this type

order_response()
order_response() :: Tai.Trading.OrderResponse.t()

Link to this type

order_status()
order_status() :: Tai.Trading.Order.status()

Link to this type

shared_error_reason()
shared_error_reason() :: :timeout | Tai.CredentialError.t()

Link to this type

t()
t() :: %Tai.Exchanges.Account{
  account_id: atom(),
  credentials: term(),
  exchange_id: atom()
}

Link to this type

time_in_force()
time_in_force() :: Tai.Trading.Order.time_in_force()

Link to this type

venue_order_id()
venue_order_id() :: Tai.Trading.Order.venue_order_id()

Link to this section Functions

Link to this function

amend_order(order, attrs)
amend_order(order(), map()) :: {:ok, order()} | {:error, reason :: term()}

Link to this function

cancel_order(venue_id, account_id, venue_order_id)
cancel_order(atom(), atom(), venue_order_id()) ::
  {:ok, venue_order_id()} | {:error, reason :: term()}

Link to this function

create_order(order)
create_order(order()) ::
  {:ok, order_response()} | {:error, create_order_error_reason()}

Link to this function

order_status(venue_id, account_id, venue_order_id)
order_status(atom(), atom(), venue_order_id()) ::
  {:ok, order_status()} | {:error, reason :: term()}

Link to this function

to_name(exchange_id, account_id)
to_name(atom(), atom()) :: atom()

Link to this section Callbacks

Link to this callback

cancel_order(venue_order_id, credentials)
cancel_order(venue_order_id(), credentials()) ::
  {:ok, venue_order_id()} | {:error, :not_implemented | reason() :: term()}

Link to this callback

create_order(order, credentials)
create_order(order(), credentials()) ::
  {:ok, order_response()} | {:error, create_order_error_reason()}

Link to this callback

order_status(venue_order_id, credentials)
order_status(venue_order_id(), credentials()) ::
  {:ok, order_status()} | {:error, :not_implemented | reason() :: term()}