Dwarves.BinanceSpot (dwarves_binancex v0.1.11)
Link to this section Summary
Functions
Get Daily Account Snapshot.
Pings binance API. Returns {:ok, %{}}
if successful, {:error, reason}
otherwise
Link to this section Functions
Link to this function
account_snapshot(params, api_key, api_secret, is_testnet \\ false)
Get Daily Account Snapshot.
Returns {:ok, %{}}
or {:error, reason}
.
In the case of a error on binance, for example with invalid parameters, {:error, {:binance_error, %{code: code, msg: msg}}}
will be returned.
Please read https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data to understand all the parameters
Examples
account_snapshot(%{"type" => "FUTURES", "start_time" => 1642032000000, "end_time" => 1642032000000}, "api_key", "api_secret")
Result:
{:ok,
%{
code: 200,
msg: "",
snapshotVos: [...]
}
or
{:error, {:binance_error, %{
code: -3026,
msg: "request param 'type' wrong, shoud be in ('SPOT', 'MARGIN', 'FUTURES')"
}
}
}
Link to this function
get_endpoint(is_testnet)
Link to this function
ping(is_testnet \\ false)
Pings binance API. Returns {:ok, %{}}
if successful, {:error, reason}
otherwise