Options
All
  • Public
  • Public/Protected
  • All
Menu
description

This class defines the exact fields that are stored in the corresponding MongoDB documents. It should be used whenever database documents are being handled or read for the assets collection.

Note that this class uses the generic Transferable trait to enable a toDTO() method on the model.

todo

Timestamp fields should be numbers to avoid timezone issues.

since

v0.3.2

Hierarchy

Index

Constructors

  • new Block(height?: number, harvester?: string, timestamp?: number, countTransactions?: number): Block
  • Constructor for Block.

    Parameters

    • Optional height: number

      The height of this block.

    • Optional harvester: string

      The harvester wallet address.

    • Optional timestamp: number

      Timestamp of the block, in standard nano seconds.

    • Optional countTransactions: number

      The number of transactions included in this block.

    Returns Block

Properties

countTransactions: number

The total number of transactions included in this block.

This field is required and not indexed.

access

public

readonly
var

{number}

createdAt: Date

The document's creation timestamp. This field does not reflect the date of update of a transaction but rather the date of creation of the cached database entry.

This field is added for consistency with the other database schema.

This field is required and indexed.

access

public

readonly
var

{Date}

harvester: string

This is the block's harvester address, corresponds to the account that has harvested this block.

This field is required and indexed.

access

public

readonly
var

{string}

height: number

This is the block height that refers to the order in which blocks were added to the network.

This field is required and indexed.

access

public

readonly
var

{number}

timestamp: number

This block's creation timestamp. This field reflects the time of the creation of the block.

This field is required and not indexed.

access

public

readonly
var

{number}

updatedAt?: Date

The document's update timestamp. This field does not reflect the date of update of a transaction but rather the date of update of the cached database entry.

This field is optional and not indexed.

access

public

readonly
var

{Date}

Accessors

  • get toQuery(): Record<string, any>
  • This method implements a specialized query format to query items individually, as documents, in the collection: operations.

    access

    public

    Returns Record<string, any>

    The individual document data that is used in a query.

Methods

Generated using TypeDoc