Returns a specified value.

Input: None

Returns: A numerical result.

Example: Returns the value 10

{"valueTask": {"value": 10} }

Example: Returns the currentRound result of an aggregator

{"valueTask": {"aggregatorPubkey": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR"} }

Example: Returns the value stored in a CacheTask variable

{"valueTask": {"big": "${ONE}"} }

Implements

Constructors

  • Constructs a new ValueTask.

    Parameters

    Returns ValueTask

Properties

Value?: "big" | "utf8" | "hex" | "value" | "aggregatorPubkey"

ValueTask Value.

aggregatorPubkey?: string

Specifies an aggregatorr to pull the value of.

big?: string

A stringified big.js. Accepts variable expansion syntax.

hex?: string

A stringified hex number (0x prefix is optional).

utf8?: string

A utf8 string.

value?: number

The value that will be returned from this task.

Methods

  • Converts this ValueTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

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

    Parameters

    Returns ValueTask

    ValueTask instance

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

    ValueTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns ValueTask

    ValueTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • message: IValueTask

      ValueTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

    • message: IValueTask

      ValueTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

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

      Plain object

      • [k: string]: any

    Returns ValueTask

    ValueTask

  • Gets the default type url for ValueTask

    Parameters

    • Optional typeUrlPrefix: string

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

    Returns string

    The default type url

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

    Parameters

    • message: ValueTask

      ValueTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

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