Class: Nem::Transaction::ImportanceTransfer

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

Overview

Constant Summary collapse

TYPE =

2049 (importance transfer transaction)

0x0801
ACTIVATE =
0x0001
DEACTIVATE =
0x0002

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(remote_account, mode, timestamp: nil, deadline: nil, network: nil) ⇒ ImportanceTransfer

Returns a new instance of ImportanceTransfer.



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

def initialize(, mode, timestamp: nil, deadline: nil, network: nil)
  @remote_account = 
  @mode = mode

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

Instance Attribute Details

#modeSymbol

Returns the current value of mode.

Returns:

  • (Symbol)

    the current value of mode



6
7
8
# File 'lib/nem/transaction/importance_transfer.rb', line 6

def mode
  @mode
end

#remote_accountString

Returns the current value of remote_account.

Returns:

  • (String)

    the current value of remote_account



6
7
8
# File 'lib/nem/transaction/importance_transfer.rb', line 6

def 
  @remote_account
end

Instance Method Details

#to_hashHash

attributes must be CAMEL CASE for NIS params

Returns:

  • (Hash)


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

def to_hash
  {
    mode: parse_mode,
    remoteAccount: 
  }
end