GitHub

Build Clarity apps with ease

Clarigen automatically generates TypeScript code for your Clarity contracts.Whether you're writing tests our building a web app, Clarigen makes development a breeze.
Want to see an example?
// `./clarigen-types` is generated by Clarigen automatically
import { project, accounts } from './clarigen-types';
import { projectFactory } from '@clarigen/core';
import { rov, txOk } from '@clarigen/test';
import { test, expect } from 'vitest';
 
const alice = accounts.wallet_1.address;
 
const { counter } = projectFactory(project, 'simnet');
 
test('Counter contract test', async () => {
  // Call read-only functions
  const value = rov(contracts.getCounter());
  expect(value).toEqual(1n); // `value`'s type is `bigint`
 
  // Call public functions
  const receipt = txOk(counter.increment(2), alice);
  expect(receipt.value).toEqual(3n);
 
  expect(rov(counter.getCounter())).toEqual(3n); // new value
});