Class: Bytom::Work
- Inherits:
-
Object
- Object
- Bytom::Work
- Defined in:
- lib/bytom/api/work.rb
Instance Method Summary collapse
-
#get_work ⇒ Object
Get the proof of work.
-
#get_work_json ⇒ Object
Get the proof of work by json.
-
#initialize(client) ⇒ Work
constructor
A new instance of Work.
-
#submit_work(block_header:) ⇒ Object
Submit the proof of work.
-
#submit_work_json(block_header:) ⇒ Object
Submit the proof of work by json.
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_work ⇒ Object
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_json ⇒ Object
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.
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 |