Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Transaction

Represents a TurtleCoin Transaction

Hierarchy

  • Transaction

Index

Properties

ignoredField

ignoredField: number = 0

inputs

inputs: ITransactionInput[] = []

outputs

outputs: ITransactionOutput[] = []

signatures

signatures: string[][] = []

transactionKeys

transactionKeys: KeyPair = new ED25519.KeyPair()

version

version: number = 1

Accessors

amount

  • get amount(): number
  • Returns the total amount of the transaction inputs

    Returns number

extra

  • get extra(): Buffer
  • Returns the transaction extra as a buffer

    Returns Buffer

extraData

  • get extraData(): Buffer
  • Returns the structured arbitrary data found in the transaction extra

    Returns Buffer

fee

  • get fee(): number

hash

  • get hash(): string

mergedMining

paymentId

  • get paymentId(): string | undefined
  • Returns the payment ID found within the transaction

    Returns string | undefined

prefix

  • get prefix(): string
  • Returns the transaction prefix in hexadecimal (blob) form

    Returns string

prefixHash

  • get prefixHash(): string

publicKey

  • get publicKey(): string | undefined
  • Returns the transaction public key

    Returns string | undefined

readonly

  • get readonly(): boolean
  • Whether the transaction data is read only This is only set if the transaction is created from a blob as it is unlikely that we will be changing data after a transaction is created and signed as it would invalidate the transaction signatures

    Returns boolean

size

  • get size(): number

unlockTime

  • get unlockTime(): BigInteger.BigInteger | number
  • set unlockTime(value: BigInteger.BigInteger | number): void
  • The unlock time (or block height) for when the funds in the transaction are made available. Returns a BigInteger only if the value exceeds MAX_SAFE_INTEGER

    Returns BigInteger.BigInteger | number

  • The unlock time (or block height) for when the funds in the transaction are made available. Returns a BigInteger only if the value exceeds MAX_SAFE_INTEGER

    Parameters

    • value: BigInteger.BigInteger | number

    Returns void

Methods

addData

  • addData(data: Buffer): void
  • Adds the arbitrary data supplied to the transaction extra field

    Parameters

    • data: Buffer

      arbitrary data to be included

    Returns void

addMergedMining

  • addMergedMining(depth: number, merkleRoot: string): void
  • Adds a merged minging tag with the supplied values to the transaction

    Parameters

    • depth: number

      the depth of the blockchain branch in the merkle root

    • merkleRoot: string

      the merkle root value

    Returns void

addPaymentId

  • addPaymentId(paymentId: string): void
  • Adds the supplied payment ID to the transaction extra field

    Parameters

    • paymentId: string

      the payment Id to include

    Returns void

addPublicKey

  • addPublicKey(publicKey: string): void
  • Adds the public key for the transaction to the transaction extra field

    Parameters

    • publicKey: string

      the public key of the transaction

    Returns void

toBuffer

  • toBuffer(headerOnly?: boolean): Buffer
  • Returns a buffer representation of the transaction object

    Parameters

    • Default value headerOnly: boolean = false

    Returns Buffer

    the buffer representation

toString

  • toString(headerOnly?: boolean): string
  • Returns the hexadecimal (blob) representation of the transaction object

    Parameters

    • Default value headerOnly: boolean = false

    Returns string

    the hexadecimal (blob) representation

Static from

  • Constructs a new transaction from an existing transaction blob

    Parameters

    • data: Buffer | string

      the transaction data blob

    Returns Transaction

    the new transaction object

Generated using TypeDoc