Class: Bytom::Other

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Other

Returns a new instance of Other.



8
9
10
# File 'lib/bytom/api/other.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#compile(contract:, args: []) ⇒ Object

Compile equity contract.



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

def compile(contract:, args: [])
  params = {
      contract: contract,
      args: args
  }
  client.make_request('/compile', 'post', params: params)
end

#decode_program(program:) ⇒ Object

Decode program.

Parameters:

  • program (String)


17
18
19
# File 'lib/bytom/api/other.rb', line 17

def decode_program(program:)
  client.make_request('/decode-program', 'post', params: {program: program})
end

#list_unspent_outputs(id: nil, unconfirmed: nil, smart_contract: nil, from: nil, count: nil, account_id: nil, account_alias: nil) ⇒ Object

Returns the sub list of all available unspent outputs for all accounts in your wallet.

Parameters:

  • id (String) (defaults to: nil)
  • unconfirmed (Boolean) (defaults to: nil)
  • smart_contract (Boolean) (defaults to: nil)
  • from (Fixnum) (defaults to: nil)
  • count (Fixnum) (defaults to: nil)
  • account_id (String) (defaults to: nil)
  • account_alias (String) (defaults to: nil)


43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/bytom/api/other.rb', line 43

def list_unspent_outputs(id: nil, unconfirmed: nil, smart_contract: nil, from: nil, count: nil, account_id: nil, account_alias: nil)
  params = {
      id: id,
      unconfirmed: unconfirmed,
      smart_contract: smart_contract,
      from: from,
      count: count,
      account_id: ,
      account_alias: 
  }
  client.make_request('/list-unspent-outputs', 'post', params: params)
end