This task will subtract 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 subtracting by a job of subtasks.

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

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

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

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

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

Implements

Constructors

  • Constructs a new SubtractTask.

    Parameters

    Returns SubtractTask

Properties

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

SubtractTask Subtraction.

aggregatorPubkey?: string

Specifies an aggregator to subtract by.

big?: string

A stringified big.js. Accepts variable expansion syntax.

job?: IOracleJob

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

scalar?: number

Specifies a scalar to subtract by.

Methods

  • Converts this SubtractTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

    • [k: string]: any
  • Creates a new SubtractTask instance using the specified properties.

    Parameters

    Returns SubtractTask

    SubtractTask instance

  • Decodes a SubtractTask 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 SubtractTask

    SubtractTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns SubtractTask

    SubtractTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • message: ISubtractTask

      SubtractTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

    • message: ISubtractTask

      SubtractTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

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

      Plain object

      • [k: string]: any

    Returns SubtractTask

    SubtractTask

  • Gets the default type url for SubtractTask

    Parameters

    • Optional typeUrlPrefix: string

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

    Returns string

    The default type url

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

    Parameters

    • message: SubtractTask

      SubtractTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a SubtractTask 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