Home Reference Source
public class | source

InterfaceBlockchainTransaction

Constructor Summary

Public Constructor
public

constructor(from: *, to: *, nonce: *, txId: *)

Transaction Class enables to create a new Transaction

Member Summary

Public Members
public
public get
public set
public get

fee: *

public

from: *

public

nonce: *

public
public

to: *

public

txId: *

public

version: *

Private Members
private
private

Method Summary

Public Methods
public

deserializeTransaction(buffer: *, offset: *, returnTransaction: boolean): *

public

destroyTransaction(pendingTransactionsWereIncluded: *)

public

isTransactionOK(avoidValidatingSignature: boolean, showDebug: boolean): boolean

public

processTransaction(multiplicationFactor: number, minerAddress: *, revertActions: *, showUpdate: *): boolean

public
public

serializeFromForSigning(unencodedAddress: *): *

public
public
public

setTransactionAddressFrom(address: *, currency: *)

public

setTransactionAddressesTo(addresses: *, fee: *)

public

toJSON(dontIncludeTxId: *): *

public
public
public

validateTransactionEveryTime(blockHeight: *, blockValidationType: {}): boolean

public

validateTransactionOnce(silent: *): *

Validate the Transaction

Private Methods
private
private
private
private
private

_preProcessTransaction(multiplicationFactor: number, revertActions: *, showUpdate: *): boolean

It will update the Accountant Tree

private

_processTransactionFees(): {"fees": *, "currencyTokenId": *}

private
private

_validateNonce(blockValidation: *): boolean

Public Constructors

public constructor(from: *, to: *, nonce: *, txId: *) source

Transaction Class enables to create a new Transaction

Params:

NameTypeAttributeDescription
from *

must be an Array[ object {address: object , publicKey: object } ]

to *

must be an Array [ object {address: object , amount, currency } }

nonce *

usually null

txId *

usually null

Public Members

public blockchain: * source

public get confirmed: * source

public set confirmed source

public get fee: * source

public from: * source

public nonce: * source

public timeLock: * source

public to: * source

public txId: * source

public version: * source

Private Members

private _confirmed: boolean source

private _serializated: * source

Public Methods

public deserializeTransaction(buffer: *, offset: *, returnTransaction: boolean): * source

Params:

NameTypeAttributeDescription
buffer *
offset *
returnTransaction boolean
  • optional
  • default: false

Return:

*

public destroyTransaction(pendingTransactionsWereIncluded: *) source

Params:

NameTypeAttributeDescription
pendingTransactionsWereIncluded *

public isTransactionOK(avoidValidatingSignature: boolean, showDebug: boolean): boolean source

Params:

NameTypeAttributeDescription
avoidValidatingSignature boolean
  • optional
  • default: false
showDebug boolean
  • optional
  • default: true

Return:

boolean

public processTransaction(multiplicationFactor: number, minerAddress: *, revertActions: *, showUpdate: *): boolean source

Params:

NameTypeAttributeDescription
multiplicationFactor number
  • optional
  • default: 1
minerAddress *
revertActions *
showUpdate *

Return:

boolean

public recalculateTxId() source

public serializeFromForSigning(unencodedAddress: *): * source

Params:

NameTypeAttributeDescription
unencodedAddress *

Return:

*

public serializeTransaction(rewrite: boolean): * source

Params:

NameTypeAttributeDescription
rewrite boolean
  • optional
  • default: false

Return:

*

public serializeTransactionId(): * source

Return:

*

public setTransactionAddressFrom(address: *, currency: *) source

Params:

NameTypeAttributeDescription
address *

requires .publicKey and .address

currency *

public setTransactionAddressesTo(addresses: *, fee: *) source

Params:

NameTypeAttributeDescription
addresses *
fee *

public toJSON(dontIncludeTxId: *): * source

Params:

NameTypeAttributeDescription
dontIncludeTxId *

Return:

*

public toString() source

public validateIdenticalAddresses(addresses: *): boolean source

Params:

NameTypeAttributeDescription
addresses *

Return:

boolean

public validateTransactionEveryTime(blockHeight: *, blockValidationType: {}): boolean source

Params:

NameTypeAttributeDescription
blockHeight *
blockValidationType {}
  • optional
  • default: {}

Return:

boolean

public validateTransactionOnce(silent: *): * source

Validate the Transaction

Params:

NameTypeAttributeDescription
silent *

Return:

*

Private Methods

private _computeNonce(): * source

Return:

*

private _computeTxId(): * source

Return:

*

private _createTransactionFrom(from: *): * source

Params:

NameTypeAttributeDescription
from *

Return:

*

private _createTransactionTo(to: *): * source

Params:

NameTypeAttributeDescription
to *

Return:

*

private _preProcessTransaction(multiplicationFactor: number, revertActions: *, showUpdate: *): boolean source

It will update the Accountant Tree

Params:

NameTypeAttributeDescription
multiplicationFactor number
  • optional
  • default: 1
revertActions *
showUpdate *

Return:

boolean

private _processTransactionFees(): {"fees": *, "currencyTokenId": *} source

Return:

{"fees": *, "currencyTokenId": *}

private _serializeTransaction(): * source

Return:

*

private _validateNonce(blockValidation: *): boolean source

Params:

NameTypeAttributeDescription
blockValidation *

Return:

boolean