Class CompilerHttp

Contract Compiler over HTTP

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

Example

CompilerHttp('COMPILER_URL')

Hierarchy

Constructors

Properties

Methods

  • Compile contract by contract's path Available only in Node.js

    Parameters

    • path: string

      Path to contract source code

    Returns Promise<{
        aci: Aci;
        bytecode: `cb_${string}`;
    }>

    ACI and bytecode

  • Compile contract by contract's source code

    Parameters

    • sourceCode: string

      Contract source code as string

    • Optional fileSystem: Record<string, string>

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

    Returns Promise<{
        aci: Aci;
        bytecode: `cb_${string}`;
    }>

    ACI and bytecode

    Example

    {
    '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

    • Optional fileSystem: Record<string, string>

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

    Returns Promise<Aci>

    ACI

    Example

    {
    '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

    • Optional fileSystem: Record<string, string>

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

    Returns Promise<boolean>

    Example

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

Generated using TypeDoc