@openpit/engine
    Preparing search index...

    Class TradeAmount

    A tagged trade amount: either a Quantity or a Volume.

    Index
    asQuantity: Quantity | undefined

    Returns the quantity, or undefined when this is a volume amount.

    asVolume: Volume | undefined

    Returns the volume, or undefined when this is a quantity amount.

    isQuantity: boolean

    Returns true when this amount is a quantity.

    isVolume: boolean

    Returns true when this amount is a volume.

    • Returns void

    • Returns a fresh TradeAmount holding the same value.

      Returns TradeAmount

    • Returns void

    • Builds a quantity-denominated trade amount.

      Accepts a Quantity value object or a DecimalInput.

      Errors

      Throws ParamError on an invalid value.

      Parameters

      • value: string | number | bigint | Quantity

      Returns TradeAmount

    • Builds a volume-denominated trade amount.

      Accepts a Volume value object or a DecimalInput.

      Errors

      Throws ParamError on an invalid value.

      Parameters

      • value: string | number | bigint | Volume

      Returns TradeAmount