Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a TurtleCoin Transaction

Hierarchy

  • Transaction

Index

Constructors

Properties

ignoredField: number = 0
m_cached: Cache = ...
m_extra: IExtraTag[] = []
m_rawExtra: Buffer = ...
m_readonly: boolean = false
m_unlockTime: BigInteger = BigInteger.zero
outputs: ITransactionOutput[] = []
signatures: string[][] = []
transactionKeys: KeyPair = ...
version: number = 1

Accessors

  • get amount(): number
  • Returns the total amount transferred in the transaction

    Returns number

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

    Returns Buffer

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

    Returns Buffer

  • get fee(): number
  • Returns the fee of the transaction

    Returns number

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

    Returns number

  • get isCoinbase(): boolean
  • Returns whether this is a coinbase transaction or not

    Returns boolean

  • get mergedMining(): undefined | ExtraMergedMining
  • Returns the merged mining tag found within the transaction

    Returns undefined | ExtraMergedMining

  • get outputAmount(): number
  • Returns the total amount of the outputs

    Returns number

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

    Returns undefined | string

  • get poolNonce(): BigInteger
  • set poolNonce(nonce: BigInteger): void
  • Returns pool nonce field within the transaction as Buffer

    Returns BigInteger

  • Sets the pool nonce field within the transaction from a Buffer

    Parameters

    • nonce: BigInteger

      the nonce data to use

    Returns void

  • get poolNonceHex(): undefined | string
  • Returns the pool nonce field as hexadecimal text

    Returns undefined | string

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

    Returns string

  • get privateKey(): undefined | string
  • Returns the transaction private key (if available)

    Returns undefined | string

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

    Returns undefined | string

  • get readonly(): boolean
  • set readonly(value: boolean): void
  • 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

  • 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

    Parameters

    • value: boolean

    Returns void

  • get recipientPublicSpendKey(): undefined | string
  • Returns the transacton recipient public spend key (if available)

    Returns undefined | string

  • get recipientPublicViewKey(): undefined | string
  • Returns the transacton recipient public view key (if available)

    Returns undefined | string

  • get size(): number
  • Returns the transaction size in bytes

    Returns number

  • get unlockTime(): number | BigInteger
  • set unlockTime(value: number | BigInteger): 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 number | BigInteger

  • 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: number | BigInteger

    Returns void

Methods

  • 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(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(paymentId: string): void
  • Adds the supplied payment ID to the transaction extra field

    Parameters

    • paymentId: string

      the payment Id to include

    Returns void

  • addPrivateKey(privateKey: string): Promise<void>
  • Adds the private key for the transaction to the transaction extra field

    Parameters

    • privateKey: string

      the private key of the transaction

    Returns Promise<void>

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

    Parameters

    • publicKey: string

      the public key of the transaction

    Returns Promise<void>

  • fingerprint(): Promise<undefined | string>
  • Calculates the transaction fingerprint if the transaction is a coinbase transaction and it contains the information necessary to do so

    Returns Promise<undefined | string>

  • hash(): Promise<string>
  • Returns the transaction hash

    Returns Promise<string>

  • incrementPoolNonce(): void
  • Increments the pool nonce by 1

    Returns void

  • prefixHash(): Promise<string>
  • Returns the transaction prefix hash

    Returns Promise<string>

  • recipient(): Promise<undefined | Address>
  • Returns the recipient address if this is a coinbase transaction and the information is available

    Returns Promise<undefined | Address>

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

    Parameters

    • headerOnly: boolean = false

    Returns Buffer

    the buffer representation

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

    Parameters

    • headerOnly: boolean = false

    Returns string

    the hexadecimal (blob) representation

  • Constructs a new transaction from an existing transaction blob

    Parameters

    • data: string | Buffer

      the transaction data blob

    Returns Promise<Transaction>

    the new transaction object

Generated using TypeDoc