0.4.2 • Published 6 days ago

sigmastate-js v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

CI codecov

ErgoScript compiler and ErgoTree interpreter

This repository contains implementations of ErgoScript compiler and ErgoTree Interpreter for a family of Sigma-protocol based authentication languages (or simply Sigma language).

This JS package is cross-compiled from Scala implementation using Scala.js compiler.

The modules published here can be used directly from JavaScript.

Getting Started

Add the following dependency to your package.json:

{
  "dependencies": {
    "sigmastate-js": "0.1.1"
  }
}

Then run npm install.

Examples

How to create Sigma type descriptors

Import TypeObj module, then use:

  • fields to create simple types (e.g. TypeObj.Int)
  • method TypeObj.pairType (e.g. TypeObj.pairType(TypeObj.Int, TypeObj.Long))
  • method TypeObj.collType (e.g. TypeObj.collType(TypeObj.Int))

See examples in tests Type.spec.js

How to create Sigma values

Import ValueObj module, then use its methods. See examples in tests Value.spec.js

How to work with ErgoTree

Import ErgoTreeObj module, and ErgoTree class then use its methods. See examples in tests ErgoTree.spec.js

Compile ErgoScript to ErgoTree

Import SigmaCompilerObj module and SigmaCompiler class, then use its methods. See compiler tests in SigmaCompiler.spec.js

0.4.1

6 days ago

0.4.2

6 days ago

0.4.0

5 months ago

0.3.0

8 months ago

0.1.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.2.2

9 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago