Aqua JS API
Aqua JS API allows you to manage all aspects of Aqua development from your JS projects.
To install the Aqua API package:
sh
sh
API
API compiles high-level Aqua code into low-level AIR instructions that can be used with Fluence JS client to make peer-to-peer calls.
API has only one function:
typescript
typescript
where input can be:
- Aqua code as a string
typescript
typescript
- Path to .aquafile or directory with.aquafiles.
- Note: paths must be absolute
typescript
typescript
- Information about a function that you want to call. It wraps aqua code to gather and print call result. Also, it checks correctness of arguments.
typescript
typescript
- importsis a path to files that is necessary for compilation but not needed to be compiled into AIR functions. More information here.
- configis the following- AquaConfigdata structure
typescript
typescript
More info about overridable constants here.
Compilation result:
typescript
typescript
Usage example
https://github.com/fluencelabs/aqua/tree/main/api/aqua-api-example/