Class: Bytom::Work

Inherits:
Object
  • Object
show all
Defined in:
lib/bytom/api/work.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Work

Returns a new instance of Work.



6
7
8
# File 'lib/bytom/api/work.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#get_workObject

Get the proof of work.



13
14
15
# File 'lib/bytom/api/work.rb', line 13

def get_work
  client.make_request('/get-work', 'post', params: {})
end

#get_work_jsonObject

Get the proof of work by json.



29
30
31
# File 'lib/bytom/api/work.rb', line 29

def get_work_json
  client.make_request('/get-work-json', 'post', params: {})
end

#submit_work(block_header:) ⇒ Object

Submit the proof of work.

Parameters:

  • block_header (String)


22
23
24
# File 'lib/bytom/api/work.rb', line 22

def submit_work(block_header:)
  client.make_request('/submit-work', 'post', params: {block_header: block_header})
end

#submit_work_json(block_header:) ⇒ Object

Submit the proof of work by json.



36
37
38
# File 'lib/bytom/api/work.rb', line 36

def submit_work_json(block_header:)
  client.make_request('/submit-work-json', 'post', params: {block_header: block_header})
end