Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Block

Represents a TurtleCoin Block

Hierarchy

  • Block

Index

Accessors

activateParentBlockVersion

  • get activateParentBlockVersion(): number
  • set activateParentBlockVersion(activateParentBlockVersion: number): void
  • Defines what major block version activates the use of parent blocks

    Returns number

  • Defines what major block version activates the use of parent blocks

    Parameters

    • activateParentBlockVersion: number

    Returns void

baseTransactionBranch

  • get baseTransactionBranch(): string[]
  • The base transaction branch of the block

    Returns string[]

hash

  • get hash(): string
  • The block hash (id)

    Returns string

height

  • get height(): number
  • The height of the block

    Returns number

longHash

  • get longHash(): string

majorVersion

  • get majorVersion(): number
  • set majorVersion(majorVersion: number): void
  • The major block version

    Returns number

  • The major block version

    Parameters

    • majorVersion: number

    Returns void

merkleRoot

  • get merkleRoot(): string
  • The merkle root of the block

    Returns string

minerTransaction

minorVersion

  • get minorVersion(): number
  • set minorVersion(minorVersion: number): void
  • The minor block version

    Returns number

  • The minor block version

    Parameters

    • minorVersion: number

    Returns void

nonce

  • get nonce(): number
  • set nonce(value: number): void
  • The nonce of the block

    Returns number

  • The nonce of the block

    Parameters

    • value: number

    Returns void

parentBlock

previousBlockHash

  • get previousBlockHash(): string
  • set previousBlockHash(previousBlockHash: string): void
  • The previous block hash of the block

    Returns string

  • The previous block hash of the block

    Parameters

    • previousBlockHash: string

    Returns void

size

  • get size(): number
  • The size of the block in bytes

    Returns number

timestamp

  • get timestamp(): Date
  • set timestamp(timestamp: Date): void
  • The timestamp of the block

    Returns Date

  • The timestamp of the block

    Parameters

    • timestamp: Date

    Returns void

transactionTreeHash

  • get transactionTreeHash(): { count: number; hash: string }
  • The transaction tree hash of the block

    Returns { count: number; hash: string }

    • count: number
    • hash: string

transactions

  • get transactions(): string[]
  • The transactions hashes (non-coinbase) included in the block

    Returns string[]

Methods

toBuffer

  • toBuffer(): Buffer
  • Returns a Buffer representation of the block

    Returns Buffer

    the resulting Buffer

toHashingBuffer

  • toHashingBuffer(headerOnly?: boolean): Buffer
  • Returns a Buffer representation of the data for hashing (mining) the block

    Parameters

    • Default value headerOnly: boolean = false

    Returns Buffer

    the hashing buffer

toHashingString

  • toHashingString(headerOnly?: boolean): string
  • Returns a hexadecimal (blob) representation of the data for hashing (mining) the block

    Parameters

    • Default value headerOnly: boolean = false

    Returns string

    the hexadecimal (blob) representation of the hashing buffer

toString

  • toString(): string
  • Returns a hexadecimal (blob) representation of the block

    Returns string

    the hexadecimal representation of the block

Static from

  • Creates a new instance of a block from the data supplied

    Parameters

    • data: Buffer | string

      the raw block data to decode

    • Optional config: Config

    Returns Block

    the new block object

Generated using TypeDoc