Class: Nis::Struct::Transaction

Inherits:
Object
  • Object
show all
Includes:
Util::Assignable
Defined in:
lib/nis/struct/transaction.rb

Overview

Constant Summary collapse

TRANSFER =

257 (transfer transaction)

0x0101
IMPORTANCE_TRANSFER =

2049 (importance transfer transaction)

0x0801
MULTISIG_AGGREGATE_MODIFICATION_TRANSFER =

4097 (multisig aggregate modification transfer transaction)

0x1001
MULTISIG_SIGNATURE =

4098 (multisig signature transaction)

0x1002
MULTISIG =

4099 (multisig transaction)

0x1004
PROVISION_NAMESPACE =

8193 (provision namespace transaction)

0x2001
MOSAIC_DEFINITION_CREATION =

16385 (mosaic definition creation transaction)

0x4001
MOSAIC_SUPPLY_CHANGE =

16386 (mosaic supply change transaction)

0x4002
TESTNET =

-1744830464

0x98000000
MAINNET =

1744830464

0x68000000
VERSION_1 =

1

0x00000001
VERSION_2 =

2

0x00000002
TESTNET_VERSION_1 =

0x98000001 = -1744830463

TESTNET | VERSION_1
TESTNET_VERSION_2 =

0x98000002 = -1744830462

TESTNET | VERSION_2
MAINNET_VERSION_1 =

0x68000001 = 1744830465

MAINNET | VERSION_1
MAINNET_VERSION_2 =

0x68000002 = 1744830466

MAINNET | VERSION_2

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::Assignable

#[], #initialize, #to_hash, #to_json

Instance Attribute Details

#amountInteger


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def amount
  @amount
end

#deadlineInteger


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def deadline
  @deadline
end

#feeInteger


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def fee
  @fee
end

#messageString


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def message
  @message
end

#mosaicsArray <Nis::Struct::MosaicId>


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def mosaics
  @mosaics
end

#recipientString


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def recipient
  @recipient
end

#signerString


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def signer
  @signer
end

#timeStampObject Also known as: timestamp

Returns the value of attribute timeStamp


18
19
20
# File 'lib/nis/struct/transaction.rb', line 18

def timeStamp
  @timeStamp
end

#typeInteger


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def type
  @type
end

#versionInteger


16
17
18
# File 'lib/nis/struct/transaction.rb', line 16

def version
  @version
end

Class Method Details

.build(attrs) ⇒ Object


46
47
48
# File 'lib/nis/struct/transaction.rb', line 46

def self.build(attrs)
  new(attrs)
end

Instance Method Details

#_versionInteger


51
52
53
# File 'lib/nis/struct/transaction.rb', line 51

def _version
  (0xFFFFFFF0 & @version)
end

#mainnet?Boolean


61
62
63
# File 'lib/nis/struct/transaction.rb', line 61

def mainnet?
  (0x0000000F & @version) == MAINNET
end

#testnet?Boolean


56
57
58
# File 'lib/nis/struct/transaction.rb', line 56

def testnet?
  (0x0000000F & @version) == TESTNET
end