Class: Nem::Transaction::MosaicDefinitionCreation

Inherits:
Base
  • Object
show all
Defined in:
lib/nem/transaction/mosaic_definition_creation.rb

Overview

Constant Summary collapse

TYPE =

16385 (mosaic definition creation transaction)

0x4001

Constants inherited from Base

Base::NETWORK

Instance Attribute Summary collapse

Attributes inherited from Base

#deadline, #fee, #signature, #signer, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Base

#network, #version

Constructor Details

#initialize(mosaic_definition, timestamp: nil, deadline: nil, network: nil) ⇒ MosaicDefinitionCreation

Returns a new instance of MosaicDefinitionCreation.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/nem/transaction/mosaic_definition_creation.rb', line 12

def initialize(mosaic_definition, timestamp: nil, deadline: nil, network: nil)
  @mosaic_definition = mosaic_definition
  @creation_fee = creation[:fee]
  @creation_fee_sink = creation[:sink]

  @network = network || Nem.default_network
  @type = TYPE
  @fee = Nem::Fee::MosaicDefinitionCreation.new(self)
  @timestamp = timestamp || Time.now
  @deadline = deadline || Time.now + Nem.default_deadline
end

Instance Attribute Details

#creation_feeInteger

Returns the current value of creation_fee.

Returns:

  • (Integer)

    the current value of creation_fee



7
8
9
# File 'lib/nem/transaction/mosaic_definition_creation.rb', line 7

def creation_fee
  @creation_fee
end

#creation_fee_sinkInteger

Returns the current value of creation_fee_sink.

Returns:

  • (Integer)

    the current value of creation_fee_sink



7
8
9
# File 'lib/nem/transaction/mosaic_definition_creation.rb', line 7

def creation_fee_sink
  @creation_fee_sink
end

#mosaic_definitionNem::Model::MosaicDefinition

Returns the current value of mosaic_definition.

Returns:



7
8
9
# File 'lib/nem/transaction/mosaic_definition_creation.rb', line 7

def mosaic_definition
  @mosaic_definition
end

Instance Method Details

#to_hashHash

attributes must be CAMEL CASE for NIS params

Returns:

  • (Hash)


26
27
28
29
30
31
32
# File 'lib/nem/transaction/mosaic_definition_creation.rb', line 26

def to_hash
  {
    mosaicDefinition: mosaic_definition.to_hash,
    creationFee: creation_fee,
    creationFeeSink: creation_fee_sink,
  }
end