Contract Compiler over HTTP

This class include api call's related to contract compiler functionality.

CompilerHttp('COMPILER_URL')

Hierarchy (view full)

Constructors

Properties

Methods

  • Compile contract by contract's source code

    Parameters

    • sourceCode: string

      Contract source code as string

    • OptionalfileSystem: Record<string, string>

      A map of contract filename to the corresponding contract source code to include into the main contract

    Returns CompileResult

    ACI and bytecode

    {
    'library.aes': 'namespace TestLib =\n function sum(x: int, y: int) : int = x + y'
    }
  • Generate contract's ACI by contract's source code

    Parameters

    • sourceCode: string

      Contract source code as string

    • OptionalfileSystem: Record<string, string>

      A map of contract filename to the corresponding contract source code to include into the main contract

    Returns Promise<Aci>

    ACI

    {
    'library.aes': 'namespace TestLib =\n function sum(x: int, y: int) : int = x + y'
    }
  • Verify that a contract bytecode is the result of compiling the given source code Available only in Node.js

    Parameters

    • bytecode: `cb_${string}`

      Contract bytecode to verify

    • path: string

      Path to contract source code

    Returns Promise<boolean>

    ACI and bytecode

  • Verify that a contract bytecode is the result of compiling the given source code

    Parameters

    • bytecode: `cb_${string}`

      Contract bytecode to verify

    • sourceCode: string

      Contract source code as string

    • OptionalfileSystem: Record<string, string>

      A map of contract filename to the corresponding contract source code to include into the main contract

    Returns Promise<boolean>

    {
    'library.aes': 'namespace TestLib =\n function sum(x: int, y: int) : int = x + y'
    }