Type alias Upward<T>

Upward<T>: T | Unknown

Represents types returned by the GRPC API of a Concordium node which are possibly unknown to the SDK version. Unknown means that the type is unknown.

Example

// fail on unknown value
const upwardValue: Upward<string> = ...
if (!isKnown(upwardValue)) {
throw new Error('Uncountered unknown value')
}
// the value is known from this point

Example

// gracefully handle unknown values
const upwardValue: Upward<string> = ...
if (!isKnown(upwardValue)) {
console.warn('Uncountered unknown value')
} else {
// the value is known from this point
}

Type Parameters

  • T

    The type representing the known variants

Generated using TypeDoc