Michelson SDK
is a framework for generating Michelson values and types from Javascript.
npm install @tezwell/michelson-sdk
import { List, Nat } from '@tezwell/michelson-sdk';
const literal = List([Nat(1), Nat(2)]);
// Micheline
console.log(literal.toMicheline()); // { 1 ; 2 }
// JSON
console.log(literal.toJSON()); // [ { int: '1' }, { int: '2' } ]
import { TList, TNat } from '@tezwell/michelson-sdk';
const list_type = TList(TNat());
// Micheline
console.log(list_type.toMicheline()); // (list nat)
// JSON
console.log(list_type.toJSON()); // { prim: 'list', args: [ { prim: 'nat' } ] }
Project was supported by Tezos Foundation.