Represents a Helios program containing a main function.

This is the principal API class with which users of the library interact.


The constructor isn't intended for direct use. The new static method should be used instead:
    mainSrc: string, 
    moduleSrcs: string[] = []
): helios.Program

The 1st argument here is the source of the entrypoint of the program. The 2nd argument here is optional, and is a list of the sources of modules that can be import by the entrypoint source.



Get the name of the script (contained in the header of the script). string


Returns a mapping of top-level const names to const types.

program.paramTypes: Object.<string, helios.Type>


Returns an object containing all the evaluated parameters.

program.parameters: {[paramName: string]: helios.HeliosData}

HeliosData is the abstract parent class of many Helios API types that have Helios language equivalents.


Returns an object containing Javascript contructors for the user-defined types in the main script (including those imported into the main script).

program.types: {[typeName: string]: {new(...any) => helios.HeliosData}}

Instantiating these constructors creates objects with HeliosData as a parent type.



Parameters can be set using the parameters setter. Parameters are const statements that are visible in the main Helios script. In many cases a Javascript value can be used directly (i.e. JSON-like).

program.parameters = {MY_PARAM: my_param, ...} as {[name: string]: helios.HeliosData | any}

Primitive Javascript values can also be used as a rhs when setting parameters like this. Helios will intelligently convert these in the necessary HeliosData instances.



Compiles a Helios program, with optional optimization. Returns a UplcProgram instance.

program.compile(simplify: boolean = false): helios.UplcProgram


Eval the rhs of a const statement, and return the result as a UplcValue.

program.evalParam(paramName: string): helios.UplcValue