Class: Nem::Transaction::MosaicSupplyChange
- Defined in:
- lib/nem/transaction/mosaic_supply_change.rb
Overview
Constant Summary collapse
- TYPE =
16386 (mosaic supply change transaction)
0x4002
- INCREASE =
0x0001
- DECREASE =
0x0002
Constants inherited from Base
Instance Attribute Summary collapse
-
#delta ⇒ Integer
The current value of delta.
-
#mosaic_id ⇒ Nem::Model::MosaicId
The current value of mosaic_id.
-
#supply_type ⇒ Symbol
The current value of supply_type.
Attributes inherited from Base
#deadline, #fee, #signature, #signer, #timestamp, #type
Instance Method Summary collapse
-
#initialize(mosaic_id, type, delta, timestamp: nil, deadline: nil, network: nil) ⇒ MosaicSupplyChange
constructor
A new instance of MosaicSupplyChange.
-
#to_hash ⇒ Hash
attributes must be CAMEL CASE for NIS params.
Methods inherited from Base
Constructor Details
#initialize(mosaic_id, type, delta, timestamp: nil, deadline: nil, network: nil) ⇒ MosaicSupplyChange
Returns a new instance of MosaicSupplyChange.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nem/transaction/mosaic_supply_change.rb', line 15 def initialize(mosaic_id, type, delta, timestamp: nil, deadline: nil, network: nil) @mosaic_id = mosaic_id @supply_type = type @delta = delta @network = network || Nem.default_network @type = TYPE @fee = Nem::Fee::MosaicSupplyChangeTransfer.new(self) @timestamp = || Time.now @deadline = deadline || Time.now + Nem.default_deadline end |
Instance Attribute Details
#delta ⇒ Integer
Returns the current value of delta.
7 8 9 |
# File 'lib/nem/transaction/mosaic_supply_change.rb', line 7 def delta @delta end |
#mosaic_id ⇒ Nem::Model::MosaicId
Returns the current value of mosaic_id.
7 8 9 |
# File 'lib/nem/transaction/mosaic_supply_change.rb', line 7 def mosaic_id @mosaic_id end |
#supply_type ⇒ Symbol
Returns the current value of supply_type.
7 8 9 |
# File 'lib/nem/transaction/mosaic_supply_change.rb', line 7 def supply_type @supply_type end |
Instance Method Details
#to_hash ⇒ Hash
attributes must be CAMEL CASE for NIS params
29 30 31 32 33 34 35 |
# File 'lib/nem/transaction/mosaic_supply_change.rb', line 29 def to_hash { mosaicId: mosaic_id.to_hash, supplyType: parse_type, delta: delta, } end |