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

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

DivideTask Denominator.

aggregatorPubkey?: string

Specifies another aggregator resut to divide by.

big?: string

A stringified big.js. Accepts variable expansion syntax.

job?: IOracleJob

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

    • [k: string]: any
  • 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 | Reader

      Reader or buffer to decode from

    • Optional length: number

      Message length if known beforehand

    Returns DivideTask

    DivideTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns DivideTask

    DivideTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    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

    • Optional writer: 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

    • Optional writer: 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

      • [k: string]: any

    Returns DivideTask

    DivideTask

  • Gets the default type url for DivideTask

    Parameters

    • Optional typeUrlPrefix: string

      your custom typeUrlPrefix(default "type.googleapis.com")

    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

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a DivideTask message.

    Parameters

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

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not