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.0

Hierarchy

Index

Constructors

Properties

amount: number

This is the absolute amount of assets that are transferred. An amount is considered absolute when it is expressed in the smallest possible unit of the asset.

Note that depending on the divisibility of the dHealth Network Mosaic, absolute amounts have to be divided correctly to represent relative amounts, i.e. with a divisibility of 6, you should divide an absolute amount by 1000000 to get its relative representation.

Note that Number.MAX_SAFE_INTEGER takes a maximum value of: 9007199254740991 and is thereby compatible with the maximum amount that can be present in dHealth Network transfers: 8999999999999999.

This field is required and not indexed.

access

public

readonly
var

{string}

collectionName: string = "assets"

This field contains the mongo collection name for entries that are stored using AccountIntegrationDocument or the model AccountIntegrationModel.

Note that this field is not part of document properties and used only internally to perform queries that refer to an individual collection name, e.g. $unionWith.

access

public

var

{string}

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}

creationBlock: number

The document's creation block number. This field does reflect the time of creation of the assets in the end-user balance. You can use the dHealth Network API to find out exact timestamp by block height.

This field is required and indexed.

todo

Note this is not protected for number overflows (but there is a long way until block numbers do overflow..)

access

public

readonly
var

{number}

mosaicId: string

This is the dHealth Network Mosaic ID that characterizes the assets on the network and acts as an identifier for the asset. An asset can always and only be obtained using a transfer transaction on dHealth Network.

This field is required and indexed.

access

public

readonly
var

{string}

transactionHash: string

This is the transaction hash that refers to a transaction which included said asset(s) and transferred them over to the target (destination) account.

The destination address can be found in userAddress.

This field is required and indexed.

access

public

readonly
var

{string}

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}

userAddress: string

This is the user's address. The user corresponds to the owner of said assets.

This field is required and indexed.

access

public

readonly
var

{string}

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