ex_golos v0.11.1 Golos.SocialNetworkApi

Contains all functions to call Golos database_api methods

Link to this section Summary

Functions

Get all account votes

Get active votes on the given content. Accepts author and permlink

Get active witnesses

Get categories. Accepts wanted metric, after_category, limit. Example result:

%{
  "accounts" => ...,
  "categories" => ...,
  "category_idx" => ...,
  "discussion_idx" => ...,
  "error" => ...,
  "feed_price" => ...,
  "pow_queue" => ...,
  "props" => ...,
  "witness_schedule" => ...,
  "current_virtual_time" => ...,
  "id" => ...,
  "majority_version" => ...,
  "median_props" => ...,
  "next_shuffle_block_num" => ...,
  "witnesses" => ... }

Returns content data, accepts author and permlink

Returns a list of replies to the given content, accepts author and permlink

Gets current GBG to GOLOS conversion requests for given account. Example result:

[%{"amount" => "100.000 GBG", "conversion_date" => "2017-02-17T18:59:42",
   "id" => "2.15.696", "owner" => "ontofractal", "requestid" => 1486753166}]

Get miner queue

Returns past owner authorities that are valid for account recovery. Doesn’t seem to work at this moment.

Get state for the provided path. Example result:

%{
  "accounts" => ...,
  "categories" => ...,
  "category_idx" => ...,
  "content" => ...,
  "current_route" => ...,
  "discussion_idx" => ...,
  "error" => ...,
  "feed_price" => ...,
  "pow_queue" => ...,
  "props" => ...,
  "witness_schedule" => ...,
  "witnesses" => ... }

Get witness count

Get witnesses by ids

Get witnesses by votes. Example response is the same as get_witnesses

Link to this section Functions

Link to this function call(method, params)
Link to this function get_account_votes(name)
get_account_votes(String.t()) :: {:ok, [map()]} | {:error, any()}

Get all account votes

Example response:

[%{"authorperm" => "rusldv/programmiruem-na-php-vvedenie", "percent" => 10000,
   "rshares" => 130036223, "time" => "2017-01-26T20:06:03", "weight" => 0},
   %{...}, ...] ```
Link to this function get_active_votes(account, permlink)
get_active_votes(String.t(), String.t()) :: {:ok, [map()]} | {:error, any()}

Get active votes on the given content. Accepts author and permlink.

Example response:

[%{"percent" => 6900, "reputation" => "28759071217014",
             "rshares" => "18897453242648", "time" => "2017-01-27T09:20:21",
             "voter" => "hipster", "weight" => "51460692508758354"},
   %{...}, ...] ```
Link to this function get_active_witnesses()
get_active_witnesses() :: {:ok, [String.t()]} | {:error, any()}

Get active witnesses

Example response:

["primus", "litvintech", "yaski", "serejandmyself", "dark.sun", "phenom",
 "hipster", "gtx-1080-sc-0048", "lehard", "aleksandraz", "dr2073", "smailer",
 "on0tole", "roelandp", "arcange", "testz", "vitaly-lvov", "xtar", "anyx",
 "kuna", "creator"]
Link to this function get_categories(metric, after_category, limit)
get_categories(atom(), String.t(), integer()) ::
  {:ok, [map()]} | {:error, any()}

Get categories. Accepts wanted metric, after_category, limit. Example result:

%{
  "accounts" => ...,
  "categories" => ...,
  "category_idx" => ...,
  "discussion_idx" => ...,
  "error" => ...,
  "feed_price" => ...,
  "pow_queue" => ...,
  "props" => ...,
  "witness_schedule" => ...,
  "current_virtual_time" => ...,
  "id" => ...,
  "majority_version" => ...,
  "median_props" => ...,
  "next_shuffle_block_num" => ...,
  "witnesses" => ... }
Link to this function get_content(author, permlink)
get_content(String.t(), String.t()) :: {:ok, map()} | {:error, any()}

Returns content data, accepts author and permlink.

Example response:

  %{"max_accepted_payout" => "1000000.000 GBG",
  "title" => "[объявление] Краудсейл и Шэрдроп. Дистрибьюция",
  "category" => "ru--kraudseijl", "promoted" => "0.000 GBG",
  "last_update" => "2016-12-06T15:36:54", "created" => "2016-12-05T16:43:03",
  "parent_permlink" => "ru--kraudseijl", "total_vote_weight" => 0,
  "json_metadata" => "{"tags":["ru--kraudseijl","ru--shyerdrop","ru--golos"],"users":["golos","crowdsale","cyberdrop","misha","ether","bender","hipster","litvintech","vitaly-lvov"],"image":["https://dl.dropboxusercontent.com/u/52209381/golos/golos.png","https://dl.dropboxusercontent.com/u/52209381/golos/Screenshot%202016-12-05%2018.30.00.png","https://dl.dropboxusercontent.com/u/52209381/golos/ico_final-min.jpg","https://dl.dropboxusercontent.com/u/52209381/golos/Screenshot%202016-12-06%2002.25.05.png","https://dl.dropboxusercontent.com/u/52209381/golos/card.png"],"links":["https://docs.google.com/spreadsheets/d/1JwCAeRwsu4NzCG20UDM_CnEEsskl0wtvQ7VYjqi233A/edit?usp=sharing","https://golos.io/@litvintech"]}",
  "last_payout" => "2017-01-15T11:00:06",
  "total_payout_value" => "2412.784 GBG", "allow_replies" => true,
  "children_rshares2" => "0", "id" => "2.8.30160",
  "pending_payout_value" => "0.000 GBG", "children" => 15, "replies" => [],
  "body" => "...",
  "active" => "2016-12-06T22:23:06", "net_rshares" => 0,
  "author_rewards" => 10011558, "total_pending_payout_value" => "0.000 GBG",
  "root_comment" => "2.8.30160", "max_cashout_time" => "1969-12-31T23:59:59",
  "root_title" => "[объявление] Краудсейл и Шэрдроп. Дистрибьюция",
  "allow_votes" => true, "percent_steem_dollars" => 10000,
  "children_abs_rshares" => 0, "net_votes" => 90, "author" => "litvintech",
  "curator_payout_value" => "112.100 GBG",
  "permlink" => "obyavlenie-kraudseil-i-sherdrop-distribyuciya",
  "url" => "/ru--kraudseijl/@litvintech/obyavlenie-kraudseil-i-sherdrop-distribyuciya",
  "cashout_time" => "2017-02-14T11:00:06", "parent_author" => "",
  "allow_curation_rewards" => true, "vote_rshares" => 0,
  "reward_weight" => 10000,
  "active_votes" => [%{"percent" => 1000, "reputation" => "15928643268388",
     "rshares" => "1974529666496", "time" => "2016-12-05T17:02:39",
     "voter" => "val", "weight" => "99631990926249375"}, %{...}, ...], "depth" => 0,
  "mode" => "second_payout", "abs_rshares" => 0,
  "author_reputation" => "22784203010137"}
Link to this function get_content_replies(author, permlink)
get_content_replies(String.t(), String.t()) :: {:ok, map()} | {:error, any()}

Returns a list of replies to the given content, accepts author and permlink.

Example response:

[%{"max_accepted_payout" => "1000000.000 GBG", "title" => "",
"category" => "ru--kraudseijl", "promoted" => "0.000 GBG",
"last_update" => "2016-12-05T16:50:09",
"created" => "2016-12-05T16:50:09",
"parent_permlink" => "obyavlenie-kraudseil-i-sherdrop-distribyuciya",
"total_vote_weight" => 0,
"json_metadata" => "{"tags":["ru--kraudseijl"]}",
"last_payout" => "2017-01-15T11:00:06",
"total_payout_value" => "12.892 GBG", "allow_replies" => true,
"children_rshares2" => "0", "id" => "2.8.30165",
"pending_payout_value" => "0.000 GBG", "children" => 1,
"replies" => [],
"body" => "И он сказал поехали...",
"active" => "2016-12-06T01:57:24", "net_rshares" => 0,
"author_rewards" => 53499,
"total_pending_payout_value" => "0.000 GBG",
"root_comment" => "2.8.30160",
"max_cashout_time" => "1969-12-31T23:59:59",
"root_title" => "[объявление] Краудсейл и Шэрдроп. Дистрибьюция",
"allow_votes" => true, "percent_steem_dollars" => 10000,
"children_abs_rshares" => 0, "net_votes" => 6,
"author" => "dmilash", "curator_payout_value" => "4.296 GBG",
"permlink" => "re-litvintech-obyavlenie-kraudseil-i-sherdrop-distribyuciya-20161205t165002890z",
"url" => "/ru--kraudseijl/@litvintech/obyavlenie-kraudseil-i-sherdrop-distribyuciya#@dmilash/re-litvintech-obyavlenie-kraudseil-i-sherdrop-distribyuciya-20161205t165002890z",
"cashout_time" => "1969-12-31T23:59:59",
"parent_author" => "litvintech",
"allow_curation_rewards" => true, "vote_rshares" => 0,
"reward_weight" => 10000, "active_votes" => [], "depth" => 1,
"mode" => "second_payout", "abs_rshares" => 0,
"author_reputation" => "37110534901202"},
%{...},
...]
Link to this function get_conversion_requests()
get_conversion_requests() :: {:ok, [map()]} | {:error, any()}

Gets current GBG to GOLOS conversion requests for given account. Example result:

[%{"amount" => "100.000 GBG", "conversion_date" => "2017-02-17T18:59:42",
   "id" => "2.15.696", "owner" => "ontofractal", "requestid" => 1486753166}]
Link to this function get_miner_queue()
get_miner_queue() :: {:ok, [String.t()]} | {:error, any()}

Get miner queue

Example response:

["gtx-1080-sc-0083", "gtx-1080-sc-0016", "gtx-1080-sc-0084", "gtx-1080-sc-0017",
 "gtx-1080-sc-0085", "gtx-1080-sc-0018", "penguin-11", "gtx-1080-sc-0028",
 "gtx-1080-sc-0023", "gtx-1080-sc-0080", ...]
Link to this function get_owner_history(name)
get_owner_history(String.t()) :: {:ok, [map()]} | {:error, any()}

Returns past owner authorities that are valid for account recovery. Doesn’t seem to work at this moment.

Link to this function get_state(path)
get_state(String.t()) :: {:ok, map()} | {:error, any()}

Get state for the provided path. Example result:

%{
  "accounts" => ...,
  "categories" => ...,
  "category_idx" => ...,
  "content" => ...,
  "current_route" => ...,
  "discussion_idx" => ...,
  "error" => ...,
  "feed_price" => ...,
  "pow_queue" => ...,
  "props" => ...,
  "witness_schedule" => ...,
  "witnesses" => ... }
Link to this function get_witness_count()
get_witness_count() :: {:ok, [String.t()]} | {:error, any()}

Get witness count

Example response: 997

Link to this function get_witnesses(ids)
get_witnesses([String.t()]) :: {:ok, [map()]} | {:error, any()}

Get witnesses by ids

Example response

[%{"created" => "2016-10-18T11:21:18",
   "hardfork_time_vote" => "2016-10-18T11:00:00",
   "hardfork_version_vote" => "0.0.0", "id" => "2.3.101",
   "last_aslot" => 3323895, "last_confirmed_block_num" => 3318746,
   "last_sbd_exchange_update" => "2017-02-09T06:10:33",
   "last_work" => "0000000000000000000000000000000000000000000000000000000000000000",
   "owner" => "hipster", "pow_worker" => 0,
   "props" => %{"account_creation_fee" => "1.000 GOLOS",
     "maximum_block_size" => 65536, "sbd_interest_rate" => 1000},
   "running_version" => "0.14.2",
   "sbd_exchange_rate" => %{"base" => "1.742 GBG",
     "quote" => "1.000 GOLOS"},
   "signing_key" => "GLS6oRsauXhqxhpXbK3dJzFBGEWVoX6BjVT5z8BwNzgV38DzFat9E",
   "total_missed" => 10,
   "url" => "https://golos.io/ru--delegaty/@hipster/delegat-hipster",
   "virtual_last_update" => "2363092957490310521961963807",
   "virtual_position" => "186709431624610119071729411416709427966",
   "virtual_scheduled_time" => "2363094451567901047152350987",
   "votes" => "102787791122912956"},
%{...} ]
Link to this function get_witnesses_by_vote(from, limit)
get_witnesses_by_vote(integer(), integer()) ::
  {:ok, [map()]} | {:error, any()}

Get witnesses by votes. Example response is the same as get_witnesses.

Link to this function lookup_witness_accounts(lower_bound_name, limit)
lookup_witness_accounts(String.t(), integer()) ::
  {:ok, [String.t()]} | {:error, any()}

Lookup witness accounts

Example response:

["creator", "creatorgalaxy", "crypto", "cryptocat", "cyberfounder", "cybertech-01", "d00m", "dacom", "dance", "danet"]