mirror of
https://github.com/fluencelabs/examples
synced 2025-06-14 02:21:21 +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,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
//HelloPeer
|
||||
//defaultId = "HelloPeer"
|
||||
|
||||
//hello: (from: string) => string
|
||||
//END HelloPeer
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function sayHello(client: FluenceClient, targetPeerId: string, targetRelayPeerId: string, config?: {ttl?: number}): Promise<string> {
|
||||
let request: RequestFlow;
|
||||
@ -72,7 +83,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);
|
||||
});
|
||||
|
||||
@ -86,7 +97,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();
|
||||
@ -94,4 +105,4 @@ h.on('getDataSrv', 'targetRelayPeerId', () => {return targetRelayPeerId;});
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user