ClarityType
Usage
import { ClarityType, isClarityType } from '@stacks/transactions';
// Type guard
if (isClarityType(value, ClarityType.UInt)) {
console.log(value.value); // bigint
}
// Direct comparison
if (value.type === ClarityType.BoolTrue) {
console.log('It is true');
}Definition
enum ClarityType {
Int = 'int',
UInt = 'uint',
Buffer = 'buffer',
BoolTrue = 'true',
BoolFalse = 'false',
PrincipalStandard = 'principal-standard',
PrincipalContract = 'principal-contract',
ResponseOk = 'ok',
ResponseErr = 'err',
OptionalNone = 'none',
OptionalSome = 'some',
List = 'list',
Tuple = 'tuple',
StringASCII = 'string-ascii',
StringUTF8 = 'string-utf8',
}Values
Value
String
Description
Last updated
Was this helpful?