• Narrow down the type of a generic ClarityValue

    Type Parameters

    Parameters

    Returns input is ClarityTypetoValue[T]

    Example

    // some functions can return a generic `ClarityValue` type
    let value = callReadOnlyFunction();
    // ^ ClarityValue
    // use `isClarityType` to narrow down the type
    assert(isClarityType(value, ClarityType.Int))
    console.log(value)
    // ^ IntCV

Generated using TypeDoc