mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-29 14:21:50 +00:00
update aqua and fluence-js
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
/**
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
|
||||
@ -7,6 +14,7 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
@ -21,14 +29,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', 'relay', () => {
|
||||
return client.relayPeerId;
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getRelayService', 'hasReleay', () => {// Not Used
|
||||
return client.relayPeerId !== undefined;
|
||||
});
|
||||
|
||||
|
||||
h.on('errorHandlingSrv', 'error', (args) => {
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
@ -36,7 +44,7 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out');
|
||||
reject('Request timed out for id');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
|
Reference in New Issue
Block a user