Helios API/ API Reference/ Classes/
Program
Helios root object
Index
Constructors
constructor
• new Program()
Accessors
config
• get
config(): ProgramConfig
Returns
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
Name | Type |
---|---|
arg | Object |
Returns
void
purpose
• get
purpose(): ScriptPurpose
Returns
types
• get
types(): UserTypes
Returns
Methods
compile
▸ compile(simplify?
): UplcProgram
Parameters
Name | Type |
---|---|
simplify? | boolean |
Returns
dumpIR
▸ dumpIR(optimized?
, annotate?
): string
Returns the Intermediate Representation AST of the program.
Parameters
Name | Type | Description |
---|---|---|
optimized? | boolean | if true , returns the IR of the optimized program |
annotate? | boolean | add internal type information annotations to the returned AST |
Returns
string
evalParam
▸ evalParam(name
): UplcValue
Doesn't use wrapEntryPoint
Parameters
Name | Type | Description |
---|---|---|
name | string | can be namespace: "Type::ConstName" or "Module::ConstName" or "Module::Type::ConstName" |
Returns
toString
▸ toString(): string
Returns
string
new
▸ Static
new(mainSrc
, moduleSrcs?
, validatorTypes?
, config?
): Program
Creates a new program.
Parameters
Name | Type | Description |
---|---|---|
mainSrc | string | |
moduleSrcs? | string [] | optional sources of modules, which can be used for imports |
validatorTypes? | Object | - |
config? | ProgramConfig |