BinanceApi.HTTP (binance_api v0.2.6) View Source

This module constructs a request for binance using authentication information that is set in by the opts param

By default the opts will use the api_key and secret_key set in the config

Options

  • :secured? - The default value is false.

  • :secret_key - The default value is "<BINANCE_SECRET_KEY>".

  • :api_key - The default value is "<BINANCE_API_KEY>".

  • :base_futures_url - The default value is "https://fapi.binance.com".

  • :base_url - The default value is "https://api.binance.com".

  • :secure_receive_window - The default value is 5000.

  • :pool_timeout - The default value is 5000.

  • :receive_timeout - The default value is 15000.

Link to this section Summary

Link to this section Types

Specs

error() :: {:error, %{code: atom(), message: String.t()}}

Specs

opts() :: [
  secured?: boolean(),
  secret_key: String.t(),
  api_key: String.t(),
  base_futures_url: String.t(),
  base_url: String.t(),
  secure_receive_window: non_neg_integer(),
  pool_timeout: non_neg_integer(),
  receive_timeout: non_neg_integer()
]

Specs

res() :: {:ok, map() | list()} | error()

Specs

res_multi() :: {:ok, list()} | error()

Specs

res_single() :: {:ok, map()} | error()

Link to this section Functions

Specs

build_futures_url(String.t()) :: String.t()

Specs

build_v1_url(String.t()) :: String.t()

Specs

build_v3_url(String.t()) :: String.t()
Link to this function

delete(url, params \\ nil, opts)

View Source

Specs

delete(String.t(), nil | map(), Keyword.t()) :: res()
Link to this function

futures_delete(url, params \\ nil, opts)

View Source

Specs

futures_delete(String.t(), nil | map(), Keyword.t()) :: res()
Link to this function

futures_get(url, params \\ nil, opts)

View Source

Specs

futures_get(String.t(), nil | map(), Keyword.t()) :: res()
Link to this function

futures_post(url, body, opts)

View Source

Specs

futures_post(String.t(), nil | map(), Keyword.t()) :: res()
Link to this function

get(url, params \\ nil, opts)

View Source

Specs

get(String.t(), nil | map(), Keyword.t()) :: res()

Specs

opts_definitions() :: Keyword.t()

Specs

post(String.t(), nil | map(), Keyword.t()) :: res()