ex_golos v0.10.0 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 discussions by the wanted metric. Accepts a metric atom and a map with a following query params: %{tag: String.t, limit: integer} ContentResult has the same shape as a result returned by get_content. Example result:

[ContentResult, ContentResult, ...]

If start_permlink is empty then only before_date will be considered. If both are specified the earlier of the two metrics will be used. before_date format is: 2017-02-07T14:34:11 Example response:

ContentResult has the same shape as a result returned by get_content.
Example result:

[ContentResult, ContentResult, …]

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 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()) :: [map()]

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()) :: [map()]

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() :: [String.t()]

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()) :: [map()]

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()) :: map()

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()) :: map()

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() :: [map()]

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_discussions_by(metric, query)
get_discussions_by(atom(), map()) :: [map()]

Get discussions by the wanted metric. Accepts a metric atom and a map with a following query params: %{tag: String.t, limit: integer} ContentResult has the same shape as a result returned by get_content. Example result:

[ContentResult, ContentResult, ...]
Link to this function get_discussions_by_author_before_date(author, start_permlink, before_date, limit)
get_discussions_by_author_before_date(
  String.t(),
  String.t(),
  String.t(),
  integer()
) :: map()

If start_permlink is empty then only before_date will be considered. If both are specified the earlier of the two metrics will be used. before_date format is: 2017-02-07T14:34:11 Example response:

ContentResult has the same shape as a result returned by get_content.
Example result:

[ContentResult, ContentResult, …]

Link to this function get_miner_queue()
get_miner_queue() :: [String.t()]

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()) :: [map()]

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()) :: map()

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() :: [String.t()]

Get witness count

Example response: 997

Link to this function get_witnesses_by_vote(from, limit)
get_witnesses_by_vote(integer(), integer()) :: [map()]

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()) :: [String.t()]

Lookup witness accounts

Example response:

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