• Deserializes clarity value to clarity type

    Returns

    returns the clarity type instance

    Example

     import { intCV, serializeCV, deserializeCV } from '@stacks/transactions';

    const serialized = serializeCV(intCV(100)); // Similarly works for other clarity types as well like listCV, booleanCV ...

    // <Uint8Array 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64>

    const deserialized = deserializeCV(serialized);
    // { type: 0, value: 100n }

    See

    clarity test cases for more examples

    Type Parameters

    Parameters

    • serializedClarityValue: string | Uint8Array | BytesReader

    Returns T

Generated using TypeDoc