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

Returns the current value of deadline.

Returns:

  • (Integer)

    the current value of deadline



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

def deadline
  @deadline
end

#feeInteger

Returns the current value of fee.

Returns:

  • (Integer)

    the current value of fee



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

def fee
  @fee
end

#signatureString

Returns the current value of signature.

Returns:

  • (String)

    the current value of signature



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

def signature
  @signature
end

#signerString

Returns the current value of signer.

Returns:

  • (String)

    the current value of signer



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

def signer
  @signer
end

#timestampInteger

Returns the current value of timestamp.

Returns:

  • (Integer)

    the current value of timestamp



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

def timestamp
  @timestamp
end

#typeInteger

Returns the current value of type.

Returns:

  • (Integer)

    the current value of type



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

def type
  @type
end

Instance Method Details

#network(hex: false) ⇒ Object



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

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

#to_hashObject

Raises:

  • (NotImplementedError)


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

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

#versionInteger

it can be override by child class

Returns:

  • (Integer)


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

def version
  network(hex: true) + 1
end