Class: Nem::Transaction::MultisigAggregateModification

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

Constant Summary collapse

TYPE =

4097 (multisig aggregate modification transfer transaction)

0x1001

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(modifications, relative_change, network: nil) ⇒ MultisigAggregateModification

Returns a new instance of MultisigAggregateModification.



10
11
12
13
14
15
16
17
# File 'lib/nem/transaction/multisig_aggregate_modification.rb', line 10

def initialize(modifications, relative_change, network: nil)
  @modifications = modifications
  @relative_change = relative_change

  @network = network || Nem.default_network
  @type = TYPE
  @fee = Nem::Fee::MultisigAggregateModification.new(self)
end

Instance Attribute Details

#min_cosignatoriesObject (readonly)

Returns the value of attribute min_cosignatories.



8
9
10
# File 'lib/nem/transaction/multisig_aggregate_modification.rb', line 8

def min_cosignatories
  @min_cosignatories
end

#modificationsArray <Nem::Model::MultisigCosignatoryModification>

Returns the current value of modifications.

Returns:

  • (Array <Nem::Model::MultisigCosignatoryModification>)

    the current value of modifications



5
6
7
# File 'lib/nem/transaction/multisig_aggregate_modification.rb', line 5

def modifications
  @modifications
end

#relative_changeInterger

Returns the current value of relative_change.

Returns:

  • (Interger)

    the current value of relative_change



5
6
7
# File 'lib/nem/transaction/multisig_aggregate_modification.rb', line 5

def relative_change
  @relative_change
end

Instance Method Details

#to_hashObject

attributes must be CAMEL CASE for NIS params



20
21
22
23
24
25
26
27
# File 'lib/nem/transaction/multisig_aggregate_modification.rb', line 20

def to_hash
  {
    modifications: modifications.map(&:to_hash),
    minCosignatories: {
      relativeChange: relative_change
    }
  }
end