Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Price

Represents quotation of the relative value of asset against another asset. Similar to 'currency pair' used to determine value of currencies.

For example: 1 EUR / 1.25 USD where: 1 EUR is an asset specified as a base 1.25 USD us an asset specified as a qute

can determine value of EUR against USD.

Hierarchy

  • Price

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    • base: Asset

      represents a value of the price object to be expressed relatively to quote asset. Cannot have amount == 0 if you want to build valid price.

    • quote: Asset

      represents an relative asset. Cannot have amount == 0, otherwise asertion fail.

      Both base and quote shall have different symbol defined.

    Returns Price

Properties

base

base: Asset

represents a value of the price object to be expressed relatively to quote asset. Cannot have amount == 0 if you want to build valid price.

quote

quote: Asset

represents an relative asset. Cannot have amount == 0, otherwise asertion fail.

Both base and quote shall have different symbol defined.

Methods

convert

  • Return a new Asset with the price converted between the symbols in the pair. Throws if passed asset symbol is not base or quote.

    Parameters

    Returns Asset

toString

  • toString(): string
  • Return a string representation of this price pair.

    Returns string

Static from

Generated using TypeDoc