Tradehub.Account (Tradehub v0.1.13) View Source
This module enable a power to help developers interacting with public endpoints that focusing on the account and profile information.
Link to this section Summary
Functions
Request information about the given account
.
Request the wallet address which is represented by a username.
Get profile from a TradeHub Wallet.
Check if the given username
has been taken.
Link to this section Functions
Specs
account(any()) :: {:error, HTTPoison.Error.t()} | {:ok, Tradehub.account()}
Request information about the given account
.
This endpoint returns numbers which are NOT human readable values. Consider base_precision
and
quote_precision
to calculate a multiplication factor = 10 ^ (base_precision
- quote_precisions
).
Examples
iex> Tradehub.Account.account("tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t")
{:ok,
%{
height: "0",
result: %{
type: "cosmos-sdk/Account",
value: %{
account_number: "0",
address: "",
coins: [],
public_key: nil,
sequence: "0"
}
}
}}
iex> Tradehub.Account.account!("tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t")
Specs
address(Tradehub.text()) :: {:error, HTTPoison.Error.t()} | {:ok, Tradehub.address()}
Request the wallet address which is represented by a username.
If no address is found an exception with status code 404 will be raised.
Examples
iex> Tradehub.Account.address("tradehub_new_ver_found")
{:ok, "\n"}
iex> Tradehub.Account.address!("tradehub_new_ver_found")
"\n"
Specs
profile(Tradehub.address()) :: {:error, HTTPoison.Error.t()} | {:ok, Tradehub.profile()}
Get profile from a TradeHub Wallet.
Examples
iex> Tradehub.Account.profile("tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t")
{:ok,
%{
address: "tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t",
last_seen_block: "0",
last_seen_time: "1970-01-01T00:00:00Z",
twitter: "",
username: ""
}}
iex> Tradehub.Account.profile!("tswth174cz08dmgluavwcz2suztvydlptp4a8f8t5h4t")
Specs
username?(Tradehub.text()) :: boolean()
Check if the given username
has been taken.
Examples
iex> Tradehub.Account.username?("tradehub_new_ver_found")
false