ClarityValue
Usage
import { ClarityValue, Cl, ClarityType } from '@stacks/transactions';
// Create Clarity values with Cl helpers
const value: ClarityValue = Cl.uint(100);
const tupleValue: ClarityValue = Cl.tuple({ amount: Cl.uint(100), sender: Cl.principal('ST...') });
// Type narrow with ClarityType
if (value.type === ClarityType.UInt) {
console.log(value.value); // bigint
}Definition
type ClarityValue =
| BooleanCV
| IntCV
| UIntCV
| BufferCV
| OptionalCV
| ResponseCV
| StandardPrincipalCV
| ContractPrincipalCV
| ListCV
| TupleCV
| StringAsciiCV
| StringUtf8CV;Notes
Sub-types
Type
ClarityType
Payload
Last updated
Was this helpful?