From 9c4d6b350ff5123c36ab5ace0221c237f1cffd4f Mon Sep 17 00:00:00 2001 From: Pavel Murygin Date: Wed, 15 Feb 2023 15:55:38 +0400 Subject: [PATCH] Add example how to import aqua function --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e13bfc5..8566a7ae 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,11 @@ it might be a good idea to add these scripts to your `package.json` file For example you project structure could look like this: ``` - ┣ aqua - ┃ ┗ hello-world.aqua + ┣ _aqua + ┃ ┗ demo.aqua ┣ src ┃ ┣ _aqua - ┃ ┃ ┗ hello-world.ts + ┃ ┃ ┗ demo.ts ┃ ┗ index.ts ┣ package-lock.json ┣ package.json @@ -96,6 +96,17 @@ And your package json: } ``` +6. Now you can import and use call aqua code from your application. e.g; + +``` +import { getRelayTime } from "./_aqua/demo"; + +async function buttonClick() { + const time = await getRelayTime(); + alert("relay time: " + time); +} +``` + ## Developing To hack on the JS Client itself refer to [dev page](./DEVLOPING.md).