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
#bitprim_transaction, #inputs, #total_inputs_amount
Instance Method Summary collapse
-
#build_for_creation(address, path, script, xpubs = []) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to create tokens.
-
#build_for_send_amount(address, address_dest, path, script, xpubs = []) ⇒ 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
7 8 9 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 7 def to_json @to_json end |
Instance Method Details
#build_for_creation(address, path, script, xpubs = []) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to create tokens.
18 19 20 21 22 23 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 18 def build_for_creation(address, path, script, xpubs = []) build_inputs(address) total, fee = build_fee(:create) output_amount = total - fee.to_i create(@inputs, path, address, output_amount, script, xpubs) end |
#build_for_send_amount(address, address_dest, path, script, xpubs = []) ⇒ Keoken::Backend::Trezor::Transaction
Create the transaction to broadcast in order to send amount between tokens.
35 36 37 38 39 40 41 |
# File 'lib/keoken/backend/trezor/transaction.rb', line 35 def build_for_send_amount(address, address_dest, path, script, xpubs = []) 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, xpubs) end |