Method: Hive::Broadcast.vote

Defined in:
lib/hive/broadcast.rb

.vote(options, &block) ⇒ Object

This operation is used to cast a vote on a post/comment.

options = {
  wif: wif,
  params: {
    voter: voter,
    author: author,
    permlink: permlink,
    weight: weight
  }
}

Hive::Broadcast.vote(options) do |result|
  puts result
end

Parameters:

  • options (Hash)

    options

Options Hash (options):

  • :wif (String)

    Posting wif

  • :params (Hash)
    • :voter (String)

    • :author (String)

    • :permlink (String)

    • :weight (Number)

  • :pretend (Boolean)

    Just validate, do not broadcast.

See Also:



63
64
65
66
67
68
69
70
71
# File 'lib/hive/broadcast.rb', line 63

def self.vote(options, &block)
  required_fields = %i(voter author permlink weight)
  params = options[:params]
  check_required_fields(params, *required_fields)
  
  ops = [[:vote, params]]
  
  process(options.merge(ops: ops), &block)
end