Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Compiler<TransactionContext, CompilationEnvironment, ProgramState>

A Compiler is a wrapper around a specific CompilationEnvironment which exposes a purely-functional interface and allows for stronger type checking.

Type parameters

  • TransactionContext

  • CompilationEnvironment

  • ProgramState

Hierarchy

  • Compiler

Index

Properties

environment

environment: CompilationEnvironment

generateBytecode

generateBytecode: <Debug>(scriptId: string, data: CompilationData<TransactionContext>, debug?: Debug) => Debug extends true ? CompilationResult<ProgramState> : BytecodeGenerationResult<ProgramState>

Generate the bytecode for the given script and compilation data.

param

the identifer of the script to compile

param

the compilation data required to compile this script

param

enable compilation debugging information (default: false)

Type declaration

    • <Debug>(scriptId: string, data: CompilationData<TransactionContext>, debug?: Debug): Debug extends true ? CompilationResult<ProgramState> : BytecodeGenerationResult<ProgramState>
    • Type parameters

      • Debug: boolean

      Parameters

      Returns Debug extends true ? CompilationResult<ProgramState> : BytecodeGenerationResult<ProgramState>

generateScenario

generateScenario: (__namedParameters: { scenarioId: undefined | string; unlockingScriptId: undefined | string }) => Scenario | string

Generate the compilation data for a scenario specified in this compilation environment. Returns either the full CompilationData for the selected scenario or an error message (as a string).

Note, generated compilation data always uses a transactionContext of type TransactionContextCommon.

param

the identifer of the scenario to generate

Type declaration

    • (__namedParameters: { scenarioId: undefined | string; unlockingScriptId: undefined | string }): Scenario | string
    • Parameters

      • __namedParameters: { scenarioId: undefined | string; unlockingScriptId: undefined | string }
        • scenarioId: undefined | string
        • unlockingScriptId: undefined | string

      Returns Scenario | string

Generated using TypeDoc