@aeternity/aepp-sdk
Version:
SDK for the æternity blockchain
29 lines (28 loc) • 1.02 kB
JavaScript
import { readFile } from 'fs/promises';
import HttpBrowser from './Http.js';
import getFileSystem from './getFileSystem.js';
/**
* Contract Compiler over HTTP for Nodejs
*
* Inherits CompilerHttp and implements `compile`, `validate` methods
* @category contract
* @example CompilerHttpNode('COMPILER_URL')
*/
export default class CompilerHttpNode extends HttpBrowser {
async compile(path) {
const fileSystem = await getFileSystem(path);
const sourceCode = await readFile(path, 'utf8');
return this.compileBySourceCode(sourceCode, fileSystem);
}
async generateAci(path) {
const fileSystem = await getFileSystem(path);
const sourceCode = await readFile(path, 'utf8');
return this.generateAciBySourceCode(sourceCode, fileSystem);
}
async validate(bytecode, path) {
const fileSystem = await getFileSystem(path);
const sourceCode = await readFile(path, 'utf8');
return this.validateBySourceCode(bytecode, sourceCode, fileSystem);
}
}
//# sourceMappingURL=HttpNode.js.map