UNPKG

@aeternity/aepp-sdk

Version:

SDK for the æternity blockchain

30 lines (29 loc) 1.33 kB
import { Compiler as CompilerApi } from '../../apis/compiler/index.js'; import CompilerBase, { Aci, CompileResult } from './Base.js'; import { Encoded } from '../../utils/encoder.js'; /** * Contract Compiler over HTTP * * This class include api call's related to contract compiler functionality. * @category contract * @example CompilerHttp('COMPILER_URL') */ export default class CompilerHttp extends CompilerBase { readonly api: CompilerApi; /** * @param compilerUrl - Url for compiler API * @param options - Options * @param options.ignoreVersion - Print warning instead of throwing exception if compiler version * is not supported, use with caution */ constructor(compilerUrl: string, { ignoreVersion }?: { ignoreVersion?: boolean; }); compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): CompileResult; compile(path: string): CompileResult; generateAciBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<Aci>; generateAci(path: string): Promise<Aci>; validateBySourceCode(bytecode: Encoded.ContractBytearray, sourceCode: string, fileSystem?: Record<string, string>): Promise<boolean>; validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean>; version(): Promise<string>; }