aqua/api/api-example/index.js

21 lines
374 B
JavaScript
Raw Normal View History

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