Class: Bytom::Coinbase

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Coinbase

Returns a new instance of Coinbase.



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

def initialize(client)
  @client = client
end

Instance Method Details

#get_coinbase_arbitrary(params: {}) ⇒ Object

Get coinbase arbitrary.



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

def get_coinbase_arbitrary(params: {})
  client.make_request('/get-coinbase-arbitrary', 'post', params: params)
end

#set_coinbase_arbitrary(arbitrary:) ⇒ Hash

Set coinbase arbitrary.

Parameters:

  • arbitrary (String)

Returns:

  • (Hash)

    the abitrary data being appended to coinbase, in hexdecimal format. (The full coinbase data for a block will be ‘0x00`&block_height&abitrary.)



24
25
26
27
28
29
# File 'lib/bytom/api/coinbase.rb', line 24

def set_coinbase_arbitrary(arbitrary:)
  params = {
      arbitrary: arbitrary
  }
  client.make_request('/set-coinbase-arbitrary', 'post', params: params)
end