mirror of
https://github.com/fluencelabs/examples
synced 2025-06-27 16:51:33 +00:00
update aqua, versions
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user