Class: Nis::Fee::Transfer
- Inherits:
-
Object
- Object
- Nis::Fee::Transfer
- Defined in:
- lib/nis/fee/transfer.rb
Constant Summary collapse
- FEE_FACTOR =
0.05
Instance Method Summary collapse
-
#initialize(transaction) ⇒ Transfer
constructor
A new instance of Transfer.
- #testnet? ⇒ Boolean
-
#to_i ⇒ Integer
Fee in micro XEM.
-
#value ⇒ Integer
Fee in micro XEM.
Constructor Details
#initialize(transaction) ⇒ Transfer
Returns a new instance of Transfer.
5 6 7 |
# File 'lib/nis/fee/transfer.rb', line 5 def initialize(transaction) @transaction = transaction end |
Instance Method Details
#testnet? ⇒ Boolean
26 27 28 |
# File 'lib/nis/fee/transfer.rb', line 26 def testnet? @transaction.network == :testnet end |
#to_i ⇒ Integer
Returns fee in micro XEM.
21 22 23 |
# File 'lib/nis/fee/transfer.rb', line 21 def to_i value.to_i end |
#value ⇒ Integer
Returns fee in micro XEM.
10 11 12 13 14 15 16 17 18 |
# File 'lib/nis/fee/transfer.rb', line 10 def value tmp = if @transaction.has_mosaics? mosaics_fee else FEE_FACTOR * minimum_fee(@transaction.amount / 1_000_000) end tmp += if @transaction. tmp * 1_000_000 end |