Helios API/ API Reference/ Classes/

Program

Helios root object

Index

Constructors

constructor

new Program()

Accessors

config

get config(): ProgramConfig

Returns

ProgramConfig

name

get name(): string

Returns

string

parameters

get parameters(): Object

Alternative way to get the parameters as HeliosData instances

Returns

Object

set parameters(arg): void

Use proxy for setting

Parameters

NameType
argObject

Returns

void

purpose

get purpose(): ScriptPurpose

Returns

ScriptPurpose

types

get types(): UserTypes

Returns

UserTypes

Methods

compile

compile(simplify?): UplcProgram

Parameters

NameType
simplify?boolean

Returns

UplcProgram

dumpIR

dumpIR(optimized?, annotate?): string

Returns the Intermediate Representation AST of the program.

Parameters

NameTypeDescription
optimized?booleanif true, returns the IR of the optimized program
annotate?booleanadd internal type information annotations to the returned AST

Returns

string

evalParam

evalParam(name): UplcValue

Doesn't use wrapEntryPoint

Parameters

NameTypeDescription
namestringcan be namespace: "Type::ConstName" or "Module::ConstName" or "Module::Type::ConstName"

Returns

UplcValue

toString

toString(): string

Returns

string

new

Static new(mainSrc, moduleSrcs?, validatorTypes?, config?): Program

Creates a new program.

Parameters

NameTypeDescription
mainSrcstring
moduleSrcs?string[]optional sources of modules, which can be used for imports
validatorTypes?Object-
config?ProgramConfig

Returns

Program