Bound the running result to an upper/lower bound. This is typically the last task in an OracleJob.

Input: The current running numerical result.

Returns: The running result bounded to an upper or lower bound if it exceeds a given threshold.

Example: Bound the running result to a value between 0.90 and 1.10

{ "boundTask": { "lowerBoundValue": "0.90","onExceedsLowerBoundValue": "0.90","upperBoundValue": "1.10","onExceedsUpperBoundValue": "1.10" } }

Implements

Constructors

  • Constructs a new BoundTask.

    Parameters

    Returns BoundTask

Properties

lowerBound?: IOracleJob

The OracleJob to execute for the lower bound value.

lowerBoundValue: string

The value to use for the lower bound. Can be set to a ${CACHE_KEY}.

onExceedsLowerBound?: IOracleJob

The OracleJob to execute if the lower bound is exceeded.

onExceedsLowerBoundValue: string

The value to use if the lower bound is exceeded. Can be set to a ${CACHE_KEY}.

onExceedsUpperBound?: IOracleJob

The OracleJob to execute if the upper bound is exceeded.

onExceedsUpperBoundValue: string

The value to use if the upper bound is exceeded. Can be set to a ${CACHE_KEY}.

upperBound?: IOracleJob

The OracleJob to execute for the upper bound value.

upperBoundValue: string

The value to use for the upper bound. Can be set to a ${CACHE_KEY}.

Methods

  • Converts this BoundTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

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

    Parameters

    Returns BoundTask

    BoundTask instance

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

    BoundTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns BoundTask

    BoundTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

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

    Parameters

    • message: IBoundTask

      BoundTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

    • message: IBoundTask

      BoundTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

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

    Parameters

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

      Plain object

      • [k: string]: any

    Returns BoundTask

    BoundTask

  • Gets the default type url for BoundTask

    Parameters

    • Optional typeUrlPrefix: string

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

    Returns string

    The default type url

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

    Parameters

    • message: BoundTask

      BoundTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

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

Generated using TypeDoc