Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a TurtleCoin Block

Hierarchy

  • Block

Index

Constructors

Properties

m_cache: Cache = ...
m_config: ICoinRunningConfig = Config
m_majorVersion: number = 0
m_minerTransaction: Transaction = ...
m_minorVersion: number = 0
m_nonce: number = 0
m_parentBlock: ParentBlock = ...
m_previousBlockHash: string = ...
m_timestamp: Date = ...
m_transactions: string[] = []

Accessors

  • 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

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

    Returns number

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

    Returns number

  • The major block version

    Parameters

    • majorVersion: number

    Returns void

  • The miner (coinbase) transaction of the block

    Returns Transaction

  • The miner (coinbase) transaction of the block

    Parameters

    Returns void

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

    Returns number

  • The minor block version

    Parameters

    • minorVersion: number

    Returns void

  • 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

  • The parent block of the block

    Returns ParentBlock

  • The parent block of the block

    Parameters

    Returns void

  • 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

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

    Returns number

  • 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

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

    Returns string[]

Methods

  • baseTransactionBranch(): Promise<string[]>
  • The base transaction branch of the block

    Returns Promise<string[]>

  • hash(): Promise<string>
  • The block hash (id)

    Returns Promise<string>

  • longHash(): Promise<string>
  • The block PoW hash

    Returns Promise<string>

  • merkleRoot(): Promise<string>
  • The merkle root of the block

    Returns Promise<string>

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

    Returns Buffer

    the resulting Buffer

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

    Parameters

    • headerOnly: boolean = false

    Returns Promise<Buffer>

    the hashing buffer

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

    Parameters

    • headerOnly: boolean = false

    Returns Promise<string>

    the hexadecimal (blob) representation of the hashing buffer

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

    Returns string

    the hexadecimal representation of the block

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

    Returns Promise<{ count: number; hash: string }>

  • from(data: string | Buffer, config?: ICoinConfig): Promise<Block>
  • Creates a new instance of a block from the data supplied

    Parameters

    • data: string | Buffer

      the raw block data to decode

    • Optional config: ICoinConfig

    Returns Promise<Block>

    the new block object

Generated using TypeDoc