Cl. Clarity Value Namespace

The Cl namespace is provided as a convenience to build/parse Clarity Value objects.

Example

import { Cl } from '@stacks/transactions';

Cl.bool(true);
Cl.uint(100);
Cl.int(-100);

Cl.standardPrincipal('STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6');
Cl.contractPrincipal('ST000000000000000000002AMW42H', 'asset');

Cl.list([Cl.int(100), Cl.int(200)]);

Cl.stringAscii('hello world');
Cl.stringUtf8('hello world');

Cl.buffer(Uint8Array.from([0x01, 0x02, 0x03]));
Cl.bufferFromAscii('hello world');
Cl.bufferFromHex('a1b2c3');
Cl.bufferFromUtf8('hello world');

Cl.none();
Cl.some(Cl.uint(100));

Cl.ok(Cl.uint(100));
Cl.error(Cl.uint(9900));

Cl.tuple({
a: Cl.uint(100),
b: Cl.stringUtf8('hello world'),
})

Cl.serialize(Cl.uint(100));
Cl.deserialize("0c00000001016103");

Cl.prettyPrint(Cl.tuple({ id: Cl.some(Cl.uint(1)) }));

Index

Functions

Generated using TypeDoc