Class: Keoken::Backend::Trezor::Transaction
- Defined in:
- lib/keoken/backend/trezor/transaction.rb
Instance Attribute Summary collapse
-
#to_json ⇒ Object
Returns the value of attribute to_json.
Attributes inherited from Base
Instance Method Summary collapse
-
#build_for_creation(address, path, script) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to create tokens.
-
#build_for_send_amount(address, address_dest, path, script) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to send amount between tokens.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Keoken::Backend::Base
Instance Attribute Details
#to_json ⇒ Object
Returns the value of attribute to_json.
5 6 7 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 5 def to_json @to_json end |
Instance Method Details
#build_for_creation(address, path, script) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to create tokens.
15 16 17 18 19 20 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 15 def build_for_creation(address, path, script) build_inputs(address) total, fee = build_fee(:create) output_amount = total - fee.to_i create(@inputs, path, address, output_amount, script) end |
#build_for_send_amount(address, address_dest, path, script) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to send amount between tokens.
31 32 33 34 35 36 37 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 31 def build_for_send_amount(address, address_dest, path, script) build_inputs(address) total, fee = build_fee(:send) output_amount = total - (fee.to_i * 2) output_amount_to_addr2 = fee.to_i send(@inputs, path, output_amount, address, output_amount_to_addr2, address_dest, script) end |