iota.lib.cpp
IOTA C++ Library
Public Member Functions | List of all members
IOTA::Models::Transaction Class Reference

#include <transaction.hpp>

Public Member Functions

 Transaction ()=default
 
 ~Transaction ()=default
 
 Transaction (const Types::Trytes &trytes)
 
 Transaction (const Types::Trytes &signatureFragments, int64_t currentIndex, int64_t lastIndex, const Types::Trytes &nonce, const Types::Trytes &hash, int64_t timestamp, const Types::Trytes &trunkTransaction, const Types::Trytes &branchTransaction, const Models::Address &address, int64_t value, const Types::Trytes &bundle, const Models::Tag &tag, int64_t attachmentTimestamp, int64_t attachmentTimestampLowerBound, int64_t attachmentTimestampUpperBound)
 
 Transaction (const Models::Address &address, int64_t value, const Models::Tag &tag, int64_t timestamp, int64_t attachmentTimestamp=0, int64_t attachmentTimestampLowerBound=0, int64_t attachmentTimestampUpperBound=0)
 
bool isTailTransaction () const
 
const Types::Trytes & getHash () const
 
void setHash (const Types::Trytes &hash)
 
const Types::Trytes & getSignatureFragments () const
 
void setSignatureFragments (const Types::Trytes &signatureFragments)
 
const Models::AddressgetAddress () const
 
void setAddress (const Models::Address &address)
 
int64_t getValue () const
 
void setValue (int64_t value)
 
const Models::TaggetTag () const
 
void setTag (const Models::Tag &tag)
 
const Models::TaggetObsoleteTag () const
 
void setObsoleteTag (const Models::Tag &tag)
 
int64_t getTimestamp () const
 
void setTimestamp (int64_t timestamp)
 
int64_t getAttachmentTimestamp () const
 
void setAttachmentTimestamp (int64_t timestamp)
 
int64_t getAttachmentTimestampLowerBound () const
 
void setAttachmentTimestampLowerBound (int64_t timestamp)
 
int64_t getAttachmentTimestampUpperBound () const
 
void setAttachmentTimestampUpperBound (int64_t timestamp)
 
int64_t getCurrentIndex () const
 
void setCurrentIndex (int64_t currentIndex)
 
int64_t getLastIndex () const
 
void setLastIndex (int64_t lastIndex)
 
const Types::Trytes & getBundle () const
 
void setBundle (const Types::Trytes &bundle)
 
const Types::Trytes & getTrunkTransaction () const
 
void setTrunkTransaction (const Types::Trytes &trunkTransaction)
 
const Types::Trytes & getBranchTransaction () const
 
void setBranchTransaction (const Types::Trytes &branchTransaction)
 
const Types::Trytes & getNonce () const
 
void setNonce (const Types::Trytes &nonce)
 
bool getPersistence () const
 
void setPersistence (bool persistence)
 
bool operator== (const Transaction &rhs) const
 
bool operator!= (const Transaction &rhs) const
 
Types::Trytes toTrytes () const
 
void initFromTrytes (const Types::Trytes &trytes)
 

Detailed Description

Transaction model.

Constructor & Destructor Documentation

◆ Transaction() [1/4]

IOTA::Models::Transaction::Transaction ( )
default

Default ctor.

◆ ~Transaction()

IOTA::Models::Transaction::~Transaction ( )
default

Default dtor.

◆ Transaction() [2/4]

IOTA::Models::Transaction::Transaction ( const Types::Trytes &  trytes)
explicit

Initializes a new instance of the Transaction class from trytes.

Parameters
trytesThe trytes.

◆ Transaction() [3/4]

IOTA::Models::Transaction::Transaction ( const Types::Trytes &  signatureFragments,
int64_t  currentIndex,
int64_t  lastIndex,
const Types::Trytes &  nonce,
const Types::Trytes &  hash,
int64_t  timestamp,
const Types::Trytes &  trunkTransaction,
const Types::Trytes &  branchTransaction,
const Models::Address address,
int64_t  value,
const Types::Trytes &  bundle,
const Models::Tag tag,
int64_t  attachmentTimestamp,
int64_t  attachmentTimestampLowerBound,
int64_t  attachmentTimestampUpperBound 
)

Initializes a new instance of the Transaction class.

Parameters
signatureFragmentsSignature fragments of the transaction.
currentIndexIndex of the transaction in the bundle.
lastIndexLast transaction index of the bundle.
nonceNonce.
hashHash of the transaction.
timestampTimestamp at which transaction was issued.
trunkTransactionTrunk transaction hash.
branchTransactionBranch transaction hash.
addressAddress of the transaction.
valueValue sent.
bundleBundle hash.
tagTag of the transaction.
attachmentTimestampAttachment timestamp.
attachmentTimestampLowerBoundLower bound of the attachment timestamp.
attachmentTimestampUpperBoundIndex of the transaction in the bundle.

◆ Transaction() [4/4]

IOTA::Models::Transaction::Transaction ( const Models::Address address,
int64_t  value,
const Models::Tag tag,
int64_t  timestamp,
int64_t  attachmentTimestamp = 0,
int64_t  attachmentTimestampLowerBound = 0,
int64_t  attachmentTimestampUpperBound = 0 
)

Initializes a new instance of the Transaction class.

Parameters
addressAddress of the transaction.
valueValue sent.
tagTag of the transaction.
timestampTimestamp at which transaction was issued.
attachmentTimestampAttachment timestamp.
attachmentTimestampLowerBoundLower bound of the attachment timestamp.
attachmentTimestampUpperBoundIndex of the transaction in the bundle.

Member Function Documentation

◆ getAddress()

const Models::Address& IOTA::Models::Transaction::getAddress ( ) const

Get the address.

Returns
The address.

◆ getAttachmentTimestamp()

int64_t IOTA::Models::Transaction::getAttachmentTimestamp ( ) const

Get the attachment timestamp.

Returns
The attachment timestamp.

◆ getAttachmentTimestampLowerBound()

int64_t IOTA::Models::Transaction::getAttachmentTimestampLowerBound ( ) const

Get the attachment timestamp lower bound.

Returns
The attachment timestamp lower bound.

◆ getAttachmentTimestampUpperBound()

int64_t IOTA::Models::Transaction::getAttachmentTimestampUpperBound ( ) const

Get the attachment timestamp upper bound.

Returns
The attachment timestamp upper bound.

◆ getBranchTransaction()

const Types::Trytes& IOTA::Models::Transaction::getBranchTransaction ( ) const

Get the branch transaction.

Returns
The branch transaction.

◆ getBundle()

const Types::Trytes& IOTA::Models::Transaction::getBundle ( ) const

Get the bundle.

Returns
The bundle.

◆ getCurrentIndex()

int64_t IOTA::Models::Transaction::getCurrentIndex ( ) const

Get the current index.

Returns
The current index.

◆ getHash()

const Types::Trytes& IOTA::Models::Transaction::getHash ( ) const

Get the hash.

Returns
The hash.

◆ getLastIndex()

int64_t IOTA::Models::Transaction::getLastIndex ( ) const

Get the last index.

Returns
The last index.

◆ getNonce()

const Types::Trytes& IOTA::Models::Transaction::getNonce ( ) const

Get the nonce.

Returns
The nonce.

◆ getObsoleteTag()

const Models::Tag& IOTA::Models::Transaction::getObsoleteTag ( ) const

Get the obsolete tag.

Returns
The obsolete tag.

◆ getPersistence()

bool IOTA::Models::Transaction::getPersistence ( ) const

Get the persistence.

Returns
The persistence.

◆ getSignatureFragments()

const Types::Trytes& IOTA::Models::Transaction::getSignatureFragments ( ) const

Get the signature fragments.

Returns
The signature fragments.

◆ getTag()

const Models::Tag& IOTA::Models::Transaction::getTag ( ) const

Get the tag.

Returns
The tag.

◆ getTimestamp()

int64_t IOTA::Models::Transaction::getTimestamp ( ) const

Get the timestamp.

Returns
The timestamp.

◆ getTrunkTransaction()

const Types::Trytes& IOTA::Models::Transaction::getTrunkTransaction ( ) const

Get the trunk transaction.

Returns
The trunk transaction.

◆ getValue()

int64_t IOTA::Models::Transaction::getValue ( ) const

Get the value.

Returns
The value.

◆ initFromTrytes()

void IOTA::Models::Transaction::initFromTrytes ( const Types::Trytes &  trytes)

Initializes a new instance of the Transaction class based on tryte string.

Parameters
trytesThe trytes from which to initialize the transaction.

◆ isTailTransaction()

bool IOTA::Models::Transaction::isTailTransaction ( ) const
Returns
Whether the transaction is a tail transaction or not (getIndex == 0).

◆ operator!=()

bool IOTA::Models::Transaction::operator!= ( const Transaction rhs) const

Comparison operator.

Parameters
rhsother object to compare with.
Returns
Whether the two transactions are equal or not.

◆ operator==()

bool IOTA::Models::Transaction::operator== ( const Transaction rhs) const

Comparison operator.

Parameters
rhsother object to compare with.
Returns
Whether the two transactions are equal or not.

◆ setAddress()

void IOTA::Models::Transaction::setAddress ( const Models::Address address)

Set the address.

Parameters
addressThe address.

◆ setAttachmentTimestamp()

void IOTA::Models::Transaction::setAttachmentTimestamp ( int64_t  timestamp)

Set the attachment timestamp.

Parameters
timestampThe attachment timestamp.

◆ setAttachmentTimestampLowerBound()

void IOTA::Models::Transaction::setAttachmentTimestampLowerBound ( int64_t  timestamp)

Set the attachment timestamp lower bound.

Parameters
timestampThe attachment timestamp lower bound.

◆ setAttachmentTimestampUpperBound()

void IOTA::Models::Transaction::setAttachmentTimestampUpperBound ( int64_t  timestamp)

Set the attachment timestamp upper bound.

Parameters
timestampThe attachment timestamp upper bound.

◆ setBranchTransaction()

void IOTA::Models::Transaction::setBranchTransaction ( const Types::Trytes &  branchTransaction)

Set the branch transaction.

Parameters
branchTransactionThe branch transaction.

◆ setBundle()

void IOTA::Models::Transaction::setBundle ( const Types::Trytes &  bundle)

Set the bundle.

Parameters
bundleThe bundle.

◆ setCurrentIndex()

void IOTA::Models::Transaction::setCurrentIndex ( int64_t  currentIndex)

Set the current index.

Parameters
currentIndexThe current index.

◆ setHash()

void IOTA::Models::Transaction::setHash ( const Types::Trytes &  hash)

Set the hash.

Parameters
hashThe hash.

◆ setLastIndex()

void IOTA::Models::Transaction::setLastIndex ( int64_t  lastIndex)

Set the last index.

Parameters
lastIndexThe last index.

◆ setNonce()

void IOTA::Models::Transaction::setNonce ( const Types::Trytes &  nonce)

Set the nonce.

Parameters
nonceThe trunk nonce.

◆ setObsoleteTag()

void IOTA::Models::Transaction::setObsoleteTag ( const Models::Tag tag)

Set the obsolete tag.

Parameters
tagThe obsolete tag.

◆ setPersistence()

void IOTA::Models::Transaction::setPersistence ( bool  persistence)

Set the persistence.

Parameters
persistenceThe persistence.

◆ setSignatureFragments()

void IOTA::Models::Transaction::setSignatureFragments ( const Types::Trytes &  signatureFragments)

Set the signature fragments.

Parameters
signatureFragmentsThe signature fragments.

◆ setTag()

void IOTA::Models::Transaction::setTag ( const Models::Tag tag)

Set the tag.

Parameters
tagThe tag.

◆ setTimestamp()

void IOTA::Models::Transaction::setTimestamp ( int64_t  timestamp)

Set the timestamp.

Parameters
timestampThe timestamp.

◆ setTrunkTransaction()

void IOTA::Models::Transaction::setTrunkTransaction ( const Types::Trytes &  trunkTransaction)

Set the trunk transaction.

Parameters
trunkTransactionThe trunk transaction.

◆ setValue()

void IOTA::Models::Transaction::setValue ( int64_t  value)

Set the value.

Parameters
valueThe value.

◆ toTrytes()

Types::Trytes IOTA::Models::Transaction::toTrytes ( ) const

Converts the transaction to the corresponding trytes representation.

Returns
The trytes.

The documentation for this class was generated from the following file: