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

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

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

{"tasks":[{"valueTask":{"value":100}},{"addTask":{"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}},{"addTask":{"big":"${TEN}"}}]}

Implements

Constructors

  • Constructs a new AddTask.

    Parameters

    • Optional properties: IAddTask

      Properties to set

    Returns AddTask

Properties

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

AddTask Addition.

aggregatorPubkey?: string

Specifies an aggregator to add by.

big?: string

A stringified big.js. Accepts variable expansion syntax.

job?: IOracleJob

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

scalar?: number

Specifies a scalar to add by.

Methods

  • Converts this AddTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

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

    Parameters

    • Optional properties: IAddTask

      Properties to set

    Returns AddTask

    AddTask instance

  • Decodes an AddTask 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 AddTask

    AddTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Decodes an AddTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns AddTask

    AddTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • message: IAddTask

      AddTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

    • message: IAddTask

      AddTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

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

      Plain object

      • [k: string]: any

    Returns AddTask

    AddTask

  • Gets the default type url for AddTask

    Parameters

    • Optional typeUrlPrefix: string

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

    Returns string

    The default type url

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

    Parameters

    • message: AddTask

      AddTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

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