Class: Nem::Transaction::Base

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

Constant Summary collapse

NETWORK =
{
  testnet: 0x98 << 24,
  mainnet: 0x68 << 24,
  mijin: 0x60 << 24
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deadlineObject (readonly)

Returns the value of attribute deadline.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def deadline
  @deadline
end

#feeObject (readonly)

Returns the value of attribute fee.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def fee
  @fee
end

#signatureObject (readonly)

Returns the value of attribute signature.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def signature
  @signature
end

#signerObject (readonly)

Returns the value of attribute signer.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def signer
  @signer
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/nem/transaction/base.rb', line 4

def type
  @type
end

Instance Method Details

#network(hex: false) ⇒ Object



31
32
33
# File 'lib/nem/transaction/base.rb', line 31

def network(hex: false)
  hex ? NETWORK[@network] : @network
end

#to_hashObject



40
41
42
# File 'lib/nem/transaction/base.rb', line 40

def to_hash
  raise 'it must be implemented by child class.'
end

#versionObject

it can be override by child class



36
37
38
# File 'lib/nem/transaction/base.rb', line 36

def version
  network(hex: true) + 1
end