update aqua, versions

This commit is contained in:
boneyard93501
2021-09-04 17:41:01 -05:00
parent 0eafaa67ec
commit e8e033de75
6 changed files with 5622 additions and 7533 deletions

View File

@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.1.9-162
* Aqua version: 0.2.2-221
*
*/
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
@ -11,6 +11,26 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
// Services
//HelloWorld
//defaultId = undefined
//hello: (from: string) => {msg:string;reply:string}
//END HelloWorld
//HelloPeer
//defaultId = "HelloPeer"
//hello: (message: string) => string
//END HelloPeer
// Functions
export async function sayHello(client: FluenceClient, targetPeerId: string, targetRelayPeerId: string, config?: {ttl?: number}): Promise<string> {
let request: RequestFlow;
@ -81,7 +101,7 @@ export async function sayHello(client: FluenceClient, targetPeerId: string, targ
h.on('getDataSrv', 'targetPeerId', () => {return targetPeerId;});
h.on('getDataSrv', 'targetRelayPeerId', () => {return targetRelayPeerId;});
h.onEvent('callbackSrv', 'response', (args) => {
const [res] = args;
const [res] = args;
resolve(res);
});
@ -95,7 +115,7 @@ h.on('getDataSrv', 'targetRelayPeerId', () => {return targetRelayPeerId;});
.handleTimeout(() => {
reject('Request timed out for sayHello');
})
if(config?.ttl) {
if(config && config.ttl) {
r.withTTL(config.ttl)
}
request = r.build();
@ -103,4 +123,4 @@ h.on('getDataSrv', 'targetRelayPeerId', () => {return targetRelayPeerId;});
await client.initiateFlow(request!);
return promise;
}