aqua/api/api-example/index.js

21 lines
374 B
JavaScript
Raw Permalink Normal View History

2023-08-09 14:32:27 +00:00
//@ts-check
2023-02-14 13:11:33 +00:00
2023-08-09 14:32:27 +00:00
import { compileAquaCallFromPath } from '@fluencelabs/aqua-api'
2023-02-14 13:11:33 +00:00
// compile call
2023-08-09 14:32:27 +00:00
const compilationResult = await compileAquaCallFromPath({
filePath: 'test.aqua',
data: { num: 3 },
funcCall: 'getNumber(num)',
})
2023-02-14 13:11:33 +00:00
2023-08-09 14:32:27 +00:00
const {
errors,
functionCall: { funcDef, script },
functions,
generatedSources,
services,
} = compilationResult
2023-02-14 13:11:33 +00:00
2023-08-09 14:32:27 +00:00
console.log(script)