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

#deadlineInteger



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def deadline
  @deadline
end

#feeInteger



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def fee
  @fee
end

#signatureString



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def signature
  @signature
end

#signerString



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def signer
  @signer
end

#timestampInteger



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def timestamp
  @timestamp
end

#typeInteger



9
10
11
# File 'lib/nem/transaction/base.rb', line 9

def type
  @type
end

Instance Method Details

#network(hex: false) ⇒ Object



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

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

#to_hashObject

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/nem/transaction/base.rb', line 47

def to_hash
  raise NotImplementedError, "#{self.class}##{__method__} must be implemented."
end

#versionInteger

it can be override by child class



43
44
45
# File 'lib/nem/transaction/base.rb', line 43

def version
  network(hex: true) + 1
end