@clarity-types/core
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Clarity types

Introduction

@clarity-types/core is a rust based library that generates typescript types from a clarity smart contract. It wraps the clarity vm and will automatically check your clarity contract for correctness before outputting types.

Installation

npm i @clarity-types/core

Usage

import { parse, parseMem } from "@clarity-types/core";

// parse contract from filesystem
const result = parse(
  contractPath, // string
  traitDir, // string | undefined | null
  contractName, // string | undefined | null
  clarityVersion // "clarity1" | "clarity2" | undefined
);
console.log(result);

// or parse contract from in-memory string
const result = parseMem(
  contractSource, // string
  traits, // Record<string, string>
  contractName, // string
  clarityVersion // "clarity1" | "clarity2" | undefined
);
console.log(result);

Authors

Readme

Keywords

none

Package Sidebar

Install

npm i @clarity-types/core

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

12.5 kB

Total Files

5

Last publish

Collaborators

  • eriicafes