This task will divide a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.

Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.

Returns: A numerical result.

Example: Returns the numerical result by dividing by a job of subtasks.

{"tasks":[{"valueTask":{"value":100}},{"divideTask":{"job":{"tasks":[{"valueTask":{"value":10}}]}}}]}

Example: Returns the numerical result by dividing by an aggregator.

{"tasks":[{"valueTask":{"value":100}},{"divideTask":{"aggregatorPubkey":"GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR"}}]}

Example: Returns the numerical result by dividing by a big.

{"tasks":[{"cacheTask":{"cacheItems":[{"variableName":"TEN","job":{"tasks":[{"valueTask":{"value":10}}]}}]}},{"valueTask":{"value":100}},{"divideTask":{"big":"${TEN}"}}]}

Implements

Constructors

  • Constructs a new DivideTask.

    Parameters

    Returns DivideTask

Properties

aggregatorPubkey?: string

Specifies another aggregator resut to divide by.

big?: string

A stringified big.js. Accepts variable expansion syntax.

Denominator?: "aggregatorPubkey" | "big" | "scalar" | "job"

DivideTask Denominator.

A job whose result is computed before dividing our numerical input by that result.

scalar?: number

Specifies a basic scalar denominator to divide by.

Methods

  • Converts this DivideTask to JSON.

    Returns { [k: string]: any }

    JSON object

  • Creates a new DivideTask instance using the specified properties.

    Parameters

    Returns DivideTask

    DivideTask instance

  • Decodes a DivideTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    • Optionallength: number

      Message length if known beforehand

    Returns DivideTask

    DivideTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Decodes a DivideTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    Returns DivideTask

    DivideTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Encodes the specified DivideTask message. Does not implicitly verify messages.

    Parameters

    • message: IDivideTask

      DivideTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified DivideTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IDivideTask

      DivideTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a DivideTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: { [k: string]: any }

      Plain object

    Returns DivideTask

    DivideTask

  • Gets the default type url for DivideTask

    Parameters

    Returns string

    The default type url

  • Creates a plain object from a DivideTask message. Also converts values to other types if specified.

    Parameters

    • message: DivideTask

      DivideTask

    • Optionaloptions: IConversionOptions

      Conversion options

    Returns { [k: string]: any }

    Plain object

  • Verifies a DivideTask message.

    Parameters

    • message: { [k: string]: any }

      Plain object to verify

    Returns string

    null if valid, otherwise the reason why it is not