Class: Bytom::Other
- Inherits:
-
Object
- Object
- Bytom::Other
- Defined in:
- lib/bytom/api/other.rb
Instance Method Summary collapse
-
#compile(contract:, args: []) ⇒ Object
Compile equity contract.
-
#decode_program(program:) ⇒ Object
Decode program.
-
#initialize(client) ⇒ Other
constructor
A new instance of Other.
-
#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.
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.
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.
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_id, account_alias: account_alias } client.make_request('/list-unspent-outputs', 'post', params: params) end |